No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

5259 líneas
186 KiB

  1. // Package androiddeviceprovisioning provides access to the Android Device Provisioning Partner API.
  2. //
  3. // See https://developers.google.com/zero-touch/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/androiddeviceprovisioning/v1"
  8. // ...
  9. // androiddeviceprovisioningService, err := androiddeviceprovisioning.New(oauthHttpClient)
  10. package androiddeviceprovisioning // import "google.golang.org/api/androiddeviceprovisioning/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "androiddeviceprovisioning:v1"
  41. const apiName = "androiddeviceprovisioning"
  42. const apiVersion = "v1"
  43. const basePath = "https://androiddeviceprovisioning.googleapis.com/"
  44. func New(client *http.Client) (*Service, error) {
  45. if client == nil {
  46. return nil, errors.New("client is nil")
  47. }
  48. s := &Service{client: client, BasePath: basePath}
  49. s.Customers = NewCustomersService(s)
  50. s.Operations = NewOperationsService(s)
  51. s.Partners = NewPartnersService(s)
  52. return s, nil
  53. }
  54. type Service struct {
  55. client *http.Client
  56. BasePath string // API endpoint base URL
  57. UserAgent string // optional additional User-Agent fragment
  58. Customers *CustomersService
  59. Operations *OperationsService
  60. Partners *PartnersService
  61. }
  62. func (s *Service) userAgent() string {
  63. if s.UserAgent == "" {
  64. return googleapi.UserAgent
  65. }
  66. return googleapi.UserAgent + " " + s.UserAgent
  67. }
  68. func NewCustomersService(s *Service) *CustomersService {
  69. rs := &CustomersService{s: s}
  70. rs.Configurations = NewCustomersConfigurationsService(s)
  71. rs.Devices = NewCustomersDevicesService(s)
  72. rs.Dpcs = NewCustomersDpcsService(s)
  73. return rs
  74. }
  75. type CustomersService struct {
  76. s *Service
  77. Configurations *CustomersConfigurationsService
  78. Devices *CustomersDevicesService
  79. Dpcs *CustomersDpcsService
  80. }
  81. func NewCustomersConfigurationsService(s *Service) *CustomersConfigurationsService {
  82. rs := &CustomersConfigurationsService{s: s}
  83. return rs
  84. }
  85. type CustomersConfigurationsService struct {
  86. s *Service
  87. }
  88. func NewCustomersDevicesService(s *Service) *CustomersDevicesService {
  89. rs := &CustomersDevicesService{s: s}
  90. return rs
  91. }
  92. type CustomersDevicesService struct {
  93. s *Service
  94. }
  95. func NewCustomersDpcsService(s *Service) *CustomersDpcsService {
  96. rs := &CustomersDpcsService{s: s}
  97. return rs
  98. }
  99. type CustomersDpcsService struct {
  100. s *Service
  101. }
  102. func NewOperationsService(s *Service) *OperationsService {
  103. rs := &OperationsService{s: s}
  104. return rs
  105. }
  106. type OperationsService struct {
  107. s *Service
  108. }
  109. func NewPartnersService(s *Service) *PartnersService {
  110. rs := &PartnersService{s: s}
  111. rs.Customers = NewPartnersCustomersService(s)
  112. rs.Devices = NewPartnersDevicesService(s)
  113. return rs
  114. }
  115. type PartnersService struct {
  116. s *Service
  117. Customers *PartnersCustomersService
  118. Devices *PartnersDevicesService
  119. }
  120. func NewPartnersCustomersService(s *Service) *PartnersCustomersService {
  121. rs := &PartnersCustomersService{s: s}
  122. return rs
  123. }
  124. type PartnersCustomersService struct {
  125. s *Service
  126. }
  127. func NewPartnersDevicesService(s *Service) *PartnersDevicesService {
  128. rs := &PartnersDevicesService{s: s}
  129. return rs
  130. }
  131. type PartnersDevicesService struct {
  132. s *Service
  133. }
  134. // ClaimDeviceRequest: Request message to claim a device on behalf of a
  135. // customer.
  136. type ClaimDeviceRequest struct {
  137. // CustomerId: Required. The ID of the customer for whom the device is
  138. // being claimed.
  139. CustomerId int64 `json:"customerId,omitempty,string"`
  140. // DeviceIdentifier: Required. The device identifier of the device to
  141. // claim.
  142. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  143. // SectionType: Required. The section type of the device's provisioning
  144. // record.
  145. //
  146. // Possible values:
  147. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  148. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  149. SectionType string `json:"sectionType,omitempty"`
  150. // ForceSendFields is a list of field names (e.g. "CustomerId") to
  151. // unconditionally include in API requests. By default, fields with
  152. // empty values are omitted from API requests. However, any non-pointer,
  153. // non-interface field appearing in ForceSendFields will be sent to the
  154. // server regardless of whether the field is empty or not. This may be
  155. // used to include empty fields in Patch requests.
  156. ForceSendFields []string `json:"-"`
  157. // NullFields is a list of field names (e.g. "CustomerId") to include in
  158. // API requests with the JSON null value. By default, fields with empty
  159. // values are omitted from API requests. However, any field with an
  160. // empty value appearing in NullFields will be sent to the server as
  161. // null. It is an error if a field in this list has a non-empty value.
  162. // This may be used to include null fields in Patch requests.
  163. NullFields []string `json:"-"`
  164. }
  165. func (s *ClaimDeviceRequest) MarshalJSON() ([]byte, error) {
  166. type NoMethod ClaimDeviceRequest
  167. raw := NoMethod(*s)
  168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  169. }
  170. // ClaimDeviceResponse: Response message containing device id of the
  171. // claim.
  172. type ClaimDeviceResponse struct {
  173. // DeviceId: The device ID of the claimed device.
  174. DeviceId int64 `json:"deviceId,omitempty,string"`
  175. // DeviceName: The resource name of the device in the
  176. // format
  177. // `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
  178. DeviceName string `json:"deviceName,omitempty"`
  179. // ServerResponse contains the HTTP response code and headers from the
  180. // server.
  181. googleapi.ServerResponse `json:"-"`
  182. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  183. // unconditionally include in API requests. By default, fields with
  184. // empty values are omitted from API requests. However, any non-pointer,
  185. // non-interface field appearing in ForceSendFields will be sent to the
  186. // server regardless of whether the field is empty or not. This may be
  187. // used to include empty fields in Patch requests.
  188. ForceSendFields []string `json:"-"`
  189. // NullFields is a list of field names (e.g. "DeviceId") to include in
  190. // API requests with the JSON null value. By default, fields with empty
  191. // values are omitted from API requests. However, any field with an
  192. // empty value appearing in NullFields will be sent to the server as
  193. // null. It is an error if a field in this list has a non-empty value.
  194. // This may be used to include null fields in Patch requests.
  195. NullFields []string `json:"-"`
  196. }
  197. func (s *ClaimDeviceResponse) MarshalJSON() ([]byte, error) {
  198. type NoMethod ClaimDeviceResponse
  199. raw := NoMethod(*s)
  200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  201. }
  202. // ClaimDevicesRequest: Request to claim devices asynchronously in
  203. // batch. Claiming a device adds the
  204. // device to zero-touch enrollment and shows the device in the
  205. // customer's view
  206. // of the portal.
  207. type ClaimDevicesRequest struct {
  208. // Claims: Required. A list of device claims.
  209. Claims []*PartnerClaim `json:"claims,omitempty"`
  210. // ForceSendFields is a list of field names (e.g. "Claims") to
  211. // unconditionally include in API requests. By default, fields with
  212. // empty values are omitted from API requests. However, any non-pointer,
  213. // non-interface field appearing in ForceSendFields will be sent to the
  214. // server regardless of whether the field is empty or not. This may be
  215. // used to include empty fields in Patch requests.
  216. ForceSendFields []string `json:"-"`
  217. // NullFields is a list of field names (e.g. "Claims") to include in API
  218. // requests with the JSON null value. By default, fields with empty
  219. // values are omitted from API requests. However, any field with an
  220. // empty value appearing in NullFields will be sent to the server as
  221. // null. It is an error if a field in this list has a non-empty value.
  222. // This may be used to include null fields in Patch requests.
  223. NullFields []string `json:"-"`
  224. }
  225. func (s *ClaimDevicesRequest) MarshalJSON() ([]byte, error) {
  226. type NoMethod ClaimDevicesRequest
  227. raw := NoMethod(*s)
  228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  229. }
  230. // Company: A customer resource in the zero-touch enrollment API.
  231. type Company struct {
  232. // AdminEmails: Input only. Optional. Email address of customer's users
  233. // in the admin role.
  234. // Each email address must be associated with a Google Account.
  235. AdminEmails []string `json:"adminEmails,omitempty"`
  236. // CompanyId: Output only. The ID of the company. Assigned by the
  237. // server.
  238. CompanyId int64 `json:"companyId,omitempty,string"`
  239. // CompanyName: Required. The name of the company. For example _XYZ
  240. // Corp_. Characters
  241. // allowed are: Latin letters, numerals, hyphens, and spaces. Displayed
  242. // to the
  243. // customer's employees in the zero-touch enrollment portal.
  244. CompanyName string `json:"companyName,omitempty"`
  245. // Name: Output only. The API resource name of the company in the
  246. // format
  247. // `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the
  248. // server.
  249. Name string `json:"name,omitempty"`
  250. // OwnerEmails: Input only. Email address of customer's users in the
  251. // owner role. At least
  252. // one `owner_email` is required. Each email address must be associated
  253. // with a
  254. // Google Account. Owners share the same access as admins but can also
  255. // add,
  256. // delete, and edit your organization's portal users.
  257. OwnerEmails []string `json:"ownerEmails,omitempty"`
  258. // TermsStatus: Output only. Whether any user from the company has
  259. // accepted the latest
  260. // Terms of Service (ToS). See
  261. // TermsStatus.
  262. //
  263. // Possible values:
  264. // "TERMS_STATUS_UNSPECIFIED" - Default value. This value should never
  265. // be set if the enum is present.
  266. // "TERMS_STATUS_NOT_ACCEPTED" - None of the company's users have
  267. // accepted the ToS.
  268. // "TERMS_STATUS_ACCEPTED" - One (or more) of the company's users has
  269. // accepted the ToS.
  270. // "TERMS_STATUS_STALE" - None of the company's users has accepted the
  271. // current ToS but at least one
  272. // user accepted a previous ToS.
  273. TermsStatus string `json:"termsStatus,omitempty"`
  274. // ServerResponse contains the HTTP response code and headers from the
  275. // server.
  276. googleapi.ServerResponse `json:"-"`
  277. // ForceSendFields is a list of field names (e.g. "AdminEmails") to
  278. // unconditionally include in API requests. By default, fields with
  279. // empty values are omitted from API requests. However, any non-pointer,
  280. // non-interface field appearing in ForceSendFields will be sent to the
  281. // server regardless of whether the field is empty or not. This may be
  282. // used to include empty fields in Patch requests.
  283. ForceSendFields []string `json:"-"`
  284. // NullFields is a list of field names (e.g. "AdminEmails") to include
  285. // in API requests with the JSON null value. By default, fields with
  286. // empty values are omitted from API requests. However, any field with
  287. // an empty value appearing in NullFields will be sent to the server as
  288. // null. It is an error if a field in this list has a non-empty value.
  289. // This may be used to include null fields in Patch requests.
  290. NullFields []string `json:"-"`
  291. }
  292. func (s *Company) MarshalJSON() ([]byte, error) {
  293. type NoMethod Company
  294. raw := NoMethod(*s)
  295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  296. }
  297. // Configuration: A configuration collects the provisioning options for
  298. // Android devices. Each
  299. // configuration combines the following:
  300. //
  301. // * The EMM device policy controller (DPC) installed on the devices.
  302. // * EMM policies enforced on the devices.
  303. // * Metadata displayed on the device to help users during
  304. // setup.
  305. //
  306. // Customers can add as many configurations as they need. However,
  307. // zero-touch
  308. // enrollment works best when a customer sets a default configuration
  309. // that's
  310. // applied to any new devices the organization purchases.
  311. type Configuration struct {
  312. // CompanyName: Required. The name of the organization. Zero-touch
  313. // enrollment shows this
  314. // organization name to device users during device provisioning.
  315. CompanyName string `json:"companyName,omitempty"`
  316. // ConfigurationId: Output only. The ID of the configuration. Assigned
  317. // by the server.
  318. ConfigurationId int64 `json:"configurationId,omitempty,string"`
  319. // ConfigurationName: Required. A short name that describes the
  320. // configuration's purpose. For
  321. // example, _Sales team_ or _Temporary employees_. The zero-touch
  322. // enrollment
  323. // portal displays this name to IT admins.
  324. ConfigurationName string `json:"configurationName,omitempty"`
  325. // ContactEmail: Required. The email address that device users can
  326. // contact to get help.
  327. // Zero-touch enrollment shows this email address to device users
  328. // before
  329. // device provisioning. The value is validated on input.
  330. ContactEmail string `json:"contactEmail,omitempty"`
  331. // ContactPhone: Required. The telephone number that device users can
  332. // call, using another
  333. // device, to get help. Zero-touch enrollment shows this number to
  334. // device
  335. // users before device provisioning. Accepts numerals, spaces, the plus
  336. // sign,
  337. // hyphens, and parentheses.
  338. ContactPhone string `json:"contactPhone,omitempty"`
  339. // CustomMessage: A message, containing one or two sentences, to help
  340. // device users get help
  341. // or give them more details about what’s happening to their
  342. // device.
  343. // Zero-touch enrollment shows this message before the device is
  344. // provisioned.
  345. CustomMessage string `json:"customMessage,omitempty"`
  346. // DpcExtras: The JSON-formatted EMM provisioning extras that are passed
  347. // to the DPC.
  348. DpcExtras string `json:"dpcExtras,omitempty"`
  349. // DpcResourcePath: Required. The resource name of the selected DPC
  350. // (device policy controller)
  351. // in the format `customers/[CUSTOMER_ID]/dpcs/*`. To list the supported
  352. // DPCs,
  353. // call
  354. // `customers.dpcs.list`.
  355. DpcResourcePath string `json:"dpcResourcePath,omitempty"`
  356. // IsDefault: Required. Whether this is the default configuration that
  357. // zero-touch
  358. // enrollment applies to any new devices the organization purchases in
  359. // the
  360. // future. Only one customer configuration can be the default. Setting
  361. // this
  362. // value to `true`, changes the previous default configuration's
  363. // `isDefault`
  364. // value to `false`.
  365. IsDefault bool `json:"isDefault,omitempty"`
  366. // Name: Output only. The API resource name in the
  367. // format
  368. // `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned
  369. // by
  370. // the server.
  371. Name string `json:"name,omitempty"`
  372. // ServerResponse contains the HTTP response code and headers from the
  373. // server.
  374. googleapi.ServerResponse `json:"-"`
  375. // ForceSendFields is a list of field names (e.g. "CompanyName") to
  376. // unconditionally include in API requests. By default, fields with
  377. // empty values are omitted from API requests. However, any non-pointer,
  378. // non-interface field appearing in ForceSendFields will be sent to the
  379. // server regardless of whether the field is empty or not. This may be
  380. // used to include empty fields in Patch requests.
  381. ForceSendFields []string `json:"-"`
  382. // NullFields is a list of field names (e.g. "CompanyName") to include
  383. // in API requests with the JSON null value. By default, fields with
  384. // empty values are omitted from API requests. However, any field with
  385. // an empty value appearing in NullFields will be sent to the server as
  386. // null. It is an error if a field in this list has a non-empty value.
  387. // This may be used to include null fields in Patch requests.
  388. NullFields []string `json:"-"`
  389. }
  390. func (s *Configuration) MarshalJSON() ([]byte, error) {
  391. type NoMethod Configuration
  392. raw := NoMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  394. }
  395. // CreateCustomerRequest: Request message to create a customer.
  396. type CreateCustomerRequest struct {
  397. // Customer: Required. The company data to populate the new customer.
  398. // Must contain a
  399. // value for `companyName` and at least one `owner_email` that's
  400. // associated
  401. // with a Google Account. The values for `companyId` and `name` must be
  402. // empty.
  403. Customer *Company `json:"customer,omitempty"`
  404. // ForceSendFields is a list of field names (e.g. "Customer") to
  405. // unconditionally include in API requests. By default, fields with
  406. // empty values are omitted from API requests. However, any non-pointer,
  407. // non-interface field appearing in ForceSendFields will be sent to the
  408. // server regardless of whether the field is empty or not. This may be
  409. // used to include empty fields in Patch requests.
  410. ForceSendFields []string `json:"-"`
  411. // NullFields is a list of field names (e.g. "Customer") to include in
  412. // API requests with the JSON null value. By default, fields with empty
  413. // values are omitted from API requests. However, any field with an
  414. // empty value appearing in NullFields will be sent to the server as
  415. // null. It is an error if a field in this list has a non-empty value.
  416. // This may be used to include null fields in Patch requests.
  417. NullFields []string `json:"-"`
  418. }
  419. func (s *CreateCustomerRequest) MarshalJSON() ([]byte, error) {
  420. type NoMethod CreateCustomerRequest
  421. raw := NoMethod(*s)
  422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  423. }
  424. // CustomerApplyConfigurationRequest: Request message for customer to
  425. // assign a configuration to device.
  426. type CustomerApplyConfigurationRequest struct {
  427. // Configuration: Required. The configuration applied to the device in
  428. // the
  429. // format
  430. // `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`.
  431. Configuration string `json:"configuration,omitempty"`
  432. // Device: Required. The device the configuration is applied to.
  433. Device *DeviceReference `json:"device,omitempty"`
  434. // ForceSendFields is a list of field names (e.g. "Configuration") to
  435. // unconditionally include in API requests. By default, fields with
  436. // empty values are omitted from API requests. However, any non-pointer,
  437. // non-interface field appearing in ForceSendFields will be sent to the
  438. // server regardless of whether the field is empty or not. This may be
  439. // used to include empty fields in Patch requests.
  440. ForceSendFields []string `json:"-"`
  441. // NullFields is a list of field names (e.g. "Configuration") to include
  442. // in API requests with the JSON null value. By default, fields with
  443. // empty values are omitted from API requests. However, any field with
  444. // an empty value appearing in NullFields will be sent to the server as
  445. // null. It is an error if a field in this list has a non-empty value.
  446. // This may be used to include null fields in Patch requests.
  447. NullFields []string `json:"-"`
  448. }
  449. func (s *CustomerApplyConfigurationRequest) MarshalJSON() ([]byte, error) {
  450. type NoMethod CustomerApplyConfigurationRequest
  451. raw := NoMethod(*s)
  452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  453. }
  454. // CustomerListConfigurationsResponse: Response message of customer's
  455. // listing configuration.
  456. type CustomerListConfigurationsResponse struct {
  457. // Configurations: The configurations.
  458. Configurations []*Configuration `json:"configurations,omitempty"`
  459. // ServerResponse contains the HTTP response code and headers from the
  460. // server.
  461. googleapi.ServerResponse `json:"-"`
  462. // ForceSendFields is a list of field names (e.g. "Configurations") to
  463. // unconditionally include in API requests. By default, fields with
  464. // empty values are omitted from API requests. However, any non-pointer,
  465. // non-interface field appearing in ForceSendFields will be sent to the
  466. // server regardless of whether the field is empty or not. This may be
  467. // used to include empty fields in Patch requests.
  468. ForceSendFields []string `json:"-"`
  469. // NullFields is a list of field names (e.g. "Configurations") to
  470. // include in API requests with the JSON null value. By default, fields
  471. // with empty values are omitted from API requests. However, any field
  472. // with an empty value appearing in NullFields will be sent to the
  473. // server as null. It is an error if a field in this list has a
  474. // non-empty value. This may be used to include null fields in Patch
  475. // requests.
  476. NullFields []string `json:"-"`
  477. }
  478. func (s *CustomerListConfigurationsResponse) MarshalJSON() ([]byte, error) {
  479. type NoMethod CustomerListConfigurationsResponse
  480. raw := NoMethod(*s)
  481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  482. }
  483. // CustomerListCustomersResponse: Response message for listing my
  484. // customers.
  485. type CustomerListCustomersResponse struct {
  486. // Customers: The customer accounts the calling user is a member of.
  487. Customers []*Company `json:"customers,omitempty"`
  488. // NextPageToken: A token used to access the next page of results.
  489. // Omitted if no further
  490. // results are available.
  491. NextPageToken string `json:"nextPageToken,omitempty"`
  492. // ServerResponse contains the HTTP response code and headers from the
  493. // server.
  494. googleapi.ServerResponse `json:"-"`
  495. // ForceSendFields is a list of field names (e.g. "Customers") to
  496. // unconditionally include in API requests. By default, fields with
  497. // empty values are omitted from API requests. However, any non-pointer,
  498. // non-interface field appearing in ForceSendFields will be sent to the
  499. // server regardless of whether the field is empty or not. This may be
  500. // used to include empty fields in Patch requests.
  501. ForceSendFields []string `json:"-"`
  502. // NullFields is a list of field names (e.g. "Customers") to include in
  503. // API requests with the JSON null value. By default, fields with empty
  504. // values are omitted from API requests. However, any field with an
  505. // empty value appearing in NullFields will be sent to the server as
  506. // null. It is an error if a field in this list has a non-empty value.
  507. // This may be used to include null fields in Patch requests.
  508. NullFields []string `json:"-"`
  509. }
  510. func (s *CustomerListCustomersResponse) MarshalJSON() ([]byte, error) {
  511. type NoMethod CustomerListCustomersResponse
  512. raw := NoMethod(*s)
  513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  514. }
  515. // CustomerListDevicesResponse: Response message of customer's liting
  516. // devices.
  517. type CustomerListDevicesResponse struct {
  518. // Devices: The customer's devices.
  519. Devices []*Device `json:"devices,omitempty"`
  520. // NextPageToken: A token used to access the next page of results.
  521. // Omitted if no further
  522. // results are available.
  523. NextPageToken string `json:"nextPageToken,omitempty"`
  524. // ServerResponse contains the HTTP response code and headers from the
  525. // server.
  526. googleapi.ServerResponse `json:"-"`
  527. // ForceSendFields is a list of field names (e.g. "Devices") to
  528. // unconditionally include in API requests. By default, fields with
  529. // empty values are omitted from API requests. However, any non-pointer,
  530. // non-interface field appearing in ForceSendFields will be sent to the
  531. // server regardless of whether the field is empty or not. This may be
  532. // used to include empty fields in Patch requests.
  533. ForceSendFields []string `json:"-"`
  534. // NullFields is a list of field names (e.g. "Devices") to include in
  535. // API requests with the JSON null value. By default, fields with empty
  536. // values are omitted from API requests. However, any field with an
  537. // empty value appearing in NullFields will be sent to the server as
  538. // null. It is an error if a field in this list has a non-empty value.
  539. // This may be used to include null fields in Patch requests.
  540. NullFields []string `json:"-"`
  541. }
  542. func (s *CustomerListDevicesResponse) MarshalJSON() ([]byte, error) {
  543. type NoMethod CustomerListDevicesResponse
  544. raw := NoMethod(*s)
  545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  546. }
  547. // CustomerListDpcsResponse: Response message of customer's listing
  548. // DPCs.
  549. type CustomerListDpcsResponse struct {
  550. // Dpcs: The list of DPCs available to the customer that support
  551. // zero-touch
  552. // enrollment.
  553. Dpcs []*Dpc `json:"dpcs,omitempty"`
  554. // ServerResponse contains the HTTP response code and headers from the
  555. // server.
  556. googleapi.ServerResponse `json:"-"`
  557. // ForceSendFields is a list of field names (e.g. "Dpcs") to
  558. // unconditionally include in API requests. By default, fields with
  559. // empty values are omitted from API requests. However, any non-pointer,
  560. // non-interface field appearing in ForceSendFields will be sent to the
  561. // server regardless of whether the field is empty or not. This may be
  562. // used to include empty fields in Patch requests.
  563. ForceSendFields []string `json:"-"`
  564. // NullFields is a list of field names (e.g. "Dpcs") to include in API
  565. // requests with the JSON null value. By default, fields with empty
  566. // values are omitted from API requests. However, any field with an
  567. // empty value appearing in NullFields will be sent to the server as
  568. // null. It is an error if a field in this list has a non-empty value.
  569. // This may be used to include null fields in Patch requests.
  570. NullFields []string `json:"-"`
  571. }
  572. func (s *CustomerListDpcsResponse) MarshalJSON() ([]byte, error) {
  573. type NoMethod CustomerListDpcsResponse
  574. raw := NoMethod(*s)
  575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  576. }
  577. // CustomerRemoveConfigurationRequest: Request message for customer to
  578. // remove the configuration from device.
  579. type CustomerRemoveConfigurationRequest struct {
  580. // Device: Required. The device to remove the configuration from.
  581. Device *DeviceReference `json:"device,omitempty"`
  582. // ForceSendFields is a list of field names (e.g. "Device") to
  583. // unconditionally include in API requests. By default, fields with
  584. // empty values are omitted from API requests. However, any non-pointer,
  585. // non-interface field appearing in ForceSendFields will be sent to the
  586. // server regardless of whether the field is empty or not. This may be
  587. // used to include empty fields in Patch requests.
  588. ForceSendFields []string `json:"-"`
  589. // NullFields is a list of field names (e.g. "Device") to include in API
  590. // requests with the JSON null value. By default, fields with empty
  591. // values are omitted from API requests. However, any field with an
  592. // empty value appearing in NullFields will be sent to the server as
  593. // null. It is an error if a field in this list has a non-empty value.
  594. // This may be used to include null fields in Patch requests.
  595. NullFields []string `json:"-"`
  596. }
  597. func (s *CustomerRemoveConfigurationRequest) MarshalJSON() ([]byte, error) {
  598. type NoMethod CustomerRemoveConfigurationRequest
  599. raw := NoMethod(*s)
  600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  601. }
  602. // CustomerUnclaimDeviceRequest: Request message for customer to unclaim
  603. // a device.
  604. type CustomerUnclaimDeviceRequest struct {
  605. // Device: Required. The device to unclaim.
  606. Device *DeviceReference `json:"device,omitempty"`
  607. // ForceSendFields is a list of field names (e.g. "Device") to
  608. // unconditionally include in API requests. By default, fields with
  609. // empty values are omitted from API requests. However, any non-pointer,
  610. // non-interface field appearing in ForceSendFields will be sent to the
  611. // server regardless of whether the field is empty or not. This may be
  612. // used to include empty fields in Patch requests.
  613. ForceSendFields []string `json:"-"`
  614. // NullFields is a list of field names (e.g. "Device") to include in API
  615. // requests with the JSON null value. By default, fields with empty
  616. // values are omitted from API requests. However, any field with an
  617. // empty value appearing in NullFields will be sent to the server as
  618. // null. It is an error if a field in this list has a non-empty value.
  619. // This may be used to include null fields in Patch requests.
  620. NullFields []string `json:"-"`
  621. }
  622. func (s *CustomerUnclaimDeviceRequest) MarshalJSON() ([]byte, error) {
  623. type NoMethod CustomerUnclaimDeviceRequest
  624. raw := NoMethod(*s)
  625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  626. }
  627. // Device: An Android device registered for zero-touch enrollment.
  628. type Device struct {
  629. // Claims: Output only. The provisioning claims for a device. Devices
  630. // claimed for
  631. // zero-touch enrollment have a claim with the type
  632. // `SECTION_TYPE_ZERO_TOUCH`.
  633. // Call
  634. // `partners.devices.unclaim`
  635. // or
  636. // `partner
  637. // s.devices.unclaimAsync`
  638. // to remove the device from zero-touch enrollment.
  639. Claims []*DeviceClaim `json:"claims,omitempty"`
  640. // Configuration: Not available to resellers.
  641. Configuration string `json:"configuration,omitempty"`
  642. // DeviceId: Output only. The ID of the device. Assigned by the server.
  643. DeviceId int64 `json:"deviceId,omitempty,string"`
  644. // DeviceIdentifier: The hardware IDs that identify a manufactured
  645. // device. To learn more,
  646. // read
  647. // [Identifiers](/zero-touch/guides/identifiers).
  648. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  649. // DeviceMetadata: The metadata attached to the device. Structured as
  650. // key-value pairs. To
  651. // learn more, read [Device metadata](/zero-touch/guides/metadata).
  652. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  653. // Name: Output only. The API resource name in the
  654. // format
  655. // `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server.
  656. Name string `json:"name,omitempty"`
  657. // ServerResponse contains the HTTP response code and headers from the
  658. // server.
  659. googleapi.ServerResponse `json:"-"`
  660. // ForceSendFields is a list of field names (e.g. "Claims") to
  661. // unconditionally include in API requests. By default, fields with
  662. // empty values are omitted from API requests. However, any non-pointer,
  663. // non-interface field appearing in ForceSendFields will be sent to the
  664. // server regardless of whether the field is empty or not. This may be
  665. // used to include empty fields in Patch requests.
  666. ForceSendFields []string `json:"-"`
  667. // NullFields is a list of field names (e.g. "Claims") to include in API
  668. // requests with the JSON null value. By default, fields with empty
  669. // values are omitted from API requests. However, any field with an
  670. // empty value appearing in NullFields will be sent to the server as
  671. // null. It is an error if a field in this list has a non-empty value.
  672. // This may be used to include null fields in Patch requests.
  673. NullFields []string `json:"-"`
  674. }
  675. func (s *Device) MarshalJSON() ([]byte, error) {
  676. type NoMethod Device
  677. raw := NoMethod(*s)
  678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  679. }
  680. // DeviceClaim: A record of a device claimed by a reseller for a
  681. // customer. Devices claimed
  682. // for zero-touch enrollment have a claim with the
  683. // type
  684. // `SECTION_TYPE_ZERO_TOUCH`. To learn more, read
  685. // [Claim devices for customers](/zero-touch/guides/how-it-works#claim).
  686. type DeviceClaim struct {
  687. // OwnerCompanyId: The ID of the Customer that purchased the device.
  688. OwnerCompanyId int64 `json:"ownerCompanyId,omitempty,string"`
  689. // SectionType: Output only. The type of claim made on the device.
  690. //
  691. // Possible values:
  692. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  693. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  694. SectionType string `json:"sectionType,omitempty"`
  695. // ForceSendFields is a list of field names (e.g. "OwnerCompanyId") to
  696. // unconditionally include in API requests. By default, fields with
  697. // empty values are omitted from API requests. However, any non-pointer,
  698. // non-interface field appearing in ForceSendFields will be sent to the
  699. // server regardless of whether the field is empty or not. This may be
  700. // used to include empty fields in Patch requests.
  701. ForceSendFields []string `json:"-"`
  702. // NullFields is a list of field names (e.g. "OwnerCompanyId") to
  703. // include in API requests with the JSON null value. By default, fields
  704. // with empty values are omitted from API requests. However, any field
  705. // with an empty value appearing in NullFields will be sent to the
  706. // server as null. It is an error if a field in this list has a
  707. // non-empty value. This may be used to include null fields in Patch
  708. // requests.
  709. NullFields []string `json:"-"`
  710. }
  711. func (s *DeviceClaim) MarshalJSON() ([]byte, error) {
  712. type NoMethod DeviceClaim
  713. raw := NoMethod(*s)
  714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  715. }
  716. // DeviceIdentifier: Encapsulates hardware and product IDs to identify a
  717. // manufactured device. To
  718. // learn more, read [Identifiers](/zero-touch/guides/identifiers).
  719. type DeviceIdentifier struct {
  720. // Imei: The device’s IMEI number. Validated on input.
  721. Imei string `json:"imei,omitempty"`
  722. // Manufacturer: Required. The device manufacturer’s name. Matches the
  723. // device's built-in
  724. // value returned from `android.os.Build.MANUFACTURER`. Allowed values
  725. // are
  726. // listed in [manufacturer
  727. // names](/zero-touch/resources/manufacturer-names).
  728. Manufacturer string `json:"manufacturer,omitempty"`
  729. // Meid: The device’s MEID number.
  730. Meid string `json:"meid,omitempty"`
  731. // SerialNumber: The manufacturer's serial number for the device. This
  732. // value might not be
  733. // unique.
  734. SerialNumber string `json:"serialNumber,omitempty"`
  735. // ForceSendFields is a list of field names (e.g. "Imei") to
  736. // unconditionally include in API requests. By default, fields with
  737. // empty values are omitted from API requests. However, any non-pointer,
  738. // non-interface field appearing in ForceSendFields will be sent to the
  739. // server regardless of whether the field is empty or not. This may be
  740. // used to include empty fields in Patch requests.
  741. ForceSendFields []string `json:"-"`
  742. // NullFields is a list of field names (e.g. "Imei") to include in API
  743. // requests with the JSON null value. By default, fields with empty
  744. // values are omitted from API requests. However, any field with an
  745. // empty value appearing in NullFields will be sent to the server as
  746. // null. It is an error if a field in this list has a non-empty value.
  747. // This may be used to include null fields in Patch requests.
  748. NullFields []string `json:"-"`
  749. }
  750. func (s *DeviceIdentifier) MarshalJSON() ([]byte, error) {
  751. type NoMethod DeviceIdentifier
  752. raw := NoMethod(*s)
  753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  754. }
  755. // DeviceMetadata: Metadata entries that can be attached to a `Device`.
  756. // To learn more, read
  757. // [Device metadata](/zero-touch/guides/metadata).
  758. type DeviceMetadata struct {
  759. // Entries: Metadata entries recorded as key-value pairs.
  760. Entries map[string]string `json:"entries,omitempty"`
  761. // ServerResponse contains the HTTP response code and headers from the
  762. // server.
  763. googleapi.ServerResponse `json:"-"`
  764. // ForceSendFields is a list of field names (e.g. "Entries") to
  765. // unconditionally include in API requests. By default, fields with
  766. // empty values are omitted from API requests. However, any non-pointer,
  767. // non-interface field appearing in ForceSendFields will be sent to the
  768. // server regardless of whether the field is empty or not. This may be
  769. // used to include empty fields in Patch requests.
  770. ForceSendFields []string `json:"-"`
  771. // NullFields is a list of field names (e.g. "Entries") to include in
  772. // API requests with the JSON null value. By default, fields with empty
  773. // values are omitted from API requests. However, any field with an
  774. // empty value appearing in NullFields will be sent to the server as
  775. // null. It is an error if a field in this list has a non-empty value.
  776. // This may be used to include null fields in Patch requests.
  777. NullFields []string `json:"-"`
  778. }
  779. func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
  780. type NoMethod DeviceMetadata
  781. raw := NoMethod(*s)
  782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  783. }
  784. // DeviceReference: A `DeviceReference` is an API abstraction that lets
  785. // you supply a _device_
  786. // argument to a method using one of the following identifier types:
  787. //
  788. // * A numeric API resource ID.
  789. // * Real-world hardware IDs, such as IMEI number, belonging to the
  790. // manufactured
  791. // device.
  792. //
  793. // Methods that operate on devices take a `DeviceReference` as a
  794. // parameter type
  795. // because it's more flexible for the caller. To learn more about
  796. // device
  797. // identifiers, read [Identifiers](/zero-touch/guides/identifiers).
  798. type DeviceReference struct {
  799. // DeviceId: The ID of the device.
  800. DeviceId int64 `json:"deviceId,omitempty,string"`
  801. // DeviceIdentifier: The hardware IDs of the device.
  802. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  803. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  804. // unconditionally include in API requests. By default, fields with
  805. // empty values are omitted from API requests. However, any non-pointer,
  806. // non-interface field appearing in ForceSendFields will be sent to the
  807. // server regardless of whether the field is empty or not. This may be
  808. // used to include empty fields in Patch requests.
  809. ForceSendFields []string `json:"-"`
  810. // NullFields is a list of field names (e.g. "DeviceId") to include in
  811. // API requests with the JSON null value. By default, fields with empty
  812. // values are omitted from API requests. However, any field with an
  813. // empty value appearing in NullFields will be sent to the server as
  814. // null. It is an error if a field in this list has a non-empty value.
  815. // This may be used to include null fields in Patch requests.
  816. NullFields []string `json:"-"`
  817. }
  818. func (s *DeviceReference) MarshalJSON() ([]byte, error) {
  819. type NoMethod DeviceReference
  820. raw := NoMethod(*s)
  821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  822. }
  823. // DevicesLongRunningOperationMetadata: Tracks the status of a
  824. // long-running operation to asynchronously update a
  825. // batch of reseller metadata attached to devices. To learn more,
  826. // read
  827. // [Long‑running batch
  828. // operations](/zero-touch/guides/how-it-works#operations).
  829. type DevicesLongRunningOperationMetadata struct {
  830. // DevicesCount: The number of metadata updates in the operation. This
  831. // might be different
  832. // from the number of updates in the request if the API can't parse some
  833. // of
  834. // the updates.
  835. DevicesCount int64 `json:"devicesCount,omitempty"`
  836. // ProcessingStatus: The processing status of the operation.
  837. //
  838. // Possible values:
  839. // "BATCH_PROCESS_STATUS_UNSPECIFIED" - Invalid code. Shouldn't be
  840. // used.
  841. // "BATCH_PROCESS_PENDING" - Pending.
  842. // "BATCH_PROCESS_IN_PROGRESS" - In progress.
  843. // "BATCH_PROCESS_PROCESSED" - Processed.
  844. // This doesn't mean all items were processed sucessfully, you
  845. // should
  846. // check the `response` field for the result of every item.
  847. ProcessingStatus string `json:"processingStatus,omitempty"`
  848. // Progress: The processing progress of the operation. Measured as a
  849. // number from 0 to
  850. // 100. A value of 10O doesnt always mean the operation
  851. // completed—check for
  852. // the inclusion of a `done` field.
  853. Progress int64 `json:"progress,omitempty"`
  854. // ForceSendFields is a list of field names (e.g. "DevicesCount") to
  855. // unconditionally include in API requests. By default, fields with
  856. // empty values are omitted from API requests. However, any non-pointer,
  857. // non-interface field appearing in ForceSendFields will be sent to the
  858. // server regardless of whether the field is empty or not. This may be
  859. // used to include empty fields in Patch requests.
  860. ForceSendFields []string `json:"-"`
  861. // NullFields is a list of field names (e.g. "DevicesCount") to include
  862. // in API requests with the JSON null value. By default, fields with
  863. // empty values are omitted from API requests. However, any field with
  864. // an empty value appearing in NullFields will be sent to the server as
  865. // null. It is an error if a field in this list has a non-empty value.
  866. // This may be used to include null fields in Patch requests.
  867. NullFields []string `json:"-"`
  868. }
  869. func (s *DevicesLongRunningOperationMetadata) MarshalJSON() ([]byte, error) {
  870. type NoMethod DevicesLongRunningOperationMetadata
  871. raw := NoMethod(*s)
  872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  873. }
  874. // DevicesLongRunningOperationResponse: Tracks the status of a
  875. // long-running operation to claim, unclaim, or attach
  876. // metadata to devices. To learn more, read
  877. // [Long‑running batch
  878. // operations](/zero-touch/guides/how-it-works#operations).
  879. type DevicesLongRunningOperationResponse struct {
  880. // PerDeviceStatus: The processing status for each device in the
  881. // operation.
  882. // One `PerDeviceStatus` per device. The list order matches the items in
  883. // the
  884. // original request.
  885. PerDeviceStatus []*OperationPerDevice `json:"perDeviceStatus,omitempty"`
  886. // SuccessCount: A summary of how many items in the operation the server
  887. // processed
  888. // successfully. Updated as the operation progresses.
  889. SuccessCount int64 `json:"successCount,omitempty"`
  890. // ForceSendFields is a list of field names (e.g. "PerDeviceStatus") to
  891. // unconditionally include in API requests. By default, fields with
  892. // empty values are omitted from API requests. However, any non-pointer,
  893. // non-interface field appearing in ForceSendFields will be sent to the
  894. // server regardless of whether the field is empty or not. This may be
  895. // used to include empty fields in Patch requests.
  896. ForceSendFields []string `json:"-"`
  897. // NullFields is a list of field names (e.g. "PerDeviceStatus") to
  898. // include in API requests with the JSON null value. By default, fields
  899. // with empty values are omitted from API requests. However, any field
  900. // with an empty value appearing in NullFields will be sent to the
  901. // server as null. It is an error if a field in this list has a
  902. // non-empty value. This may be used to include null fields in Patch
  903. // requests.
  904. NullFields []string `json:"-"`
  905. }
  906. func (s *DevicesLongRunningOperationResponse) MarshalJSON() ([]byte, error) {
  907. type NoMethod DevicesLongRunningOperationResponse
  908. raw := NoMethod(*s)
  909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  910. }
  911. // Dpc: An EMM's DPC ([device
  912. // policy
  913. // controller](http://developer.android.com/work/dpc/build-dpc.htm
  914. // l)).
  915. // Zero-touch enrollment installs a DPC (listed in the `Configuration`)
  916. // on a
  917. // device to maintain the customer's mobile policies. All the DPCs
  918. // listed by the
  919. // API support zero-touch enrollment and are available in Google Play.
  920. type Dpc struct {
  921. // DpcName: Output only. The title of the DPC app in Google Play. For
  922. // example, _Google
  923. // Apps Device Policy_. Useful in an application's user interface.
  924. DpcName string `json:"dpcName,omitempty"`
  925. // Name: Output only. The API resource name in the
  926. // format
  927. // `customers/[CUSTOMER_ID]/dpcs/[DPC_ID]`. Assigned by
  928. // the server. To maintain a reference to a DPC across customer
  929. // accounts,
  930. // persist and match the last path component (`DPC_ID`).
  931. Name string `json:"name,omitempty"`
  932. // PackageName: Output only. The DPC's Android application ID that looks
  933. // like a Java
  934. // package name. Zero-touch enrollment installs the DPC app onto a
  935. // device
  936. // using this identifier.
  937. PackageName string `json:"packageName,omitempty"`
  938. // ForceSendFields is a list of field names (e.g. "DpcName") to
  939. // unconditionally include in API requests. By default, fields with
  940. // empty values are omitted from API requests. However, any non-pointer,
  941. // non-interface field appearing in ForceSendFields will be sent to the
  942. // server regardless of whether the field is empty or not. This may be
  943. // used to include empty fields in Patch requests.
  944. ForceSendFields []string `json:"-"`
  945. // NullFields is a list of field names (e.g. "DpcName") to include in
  946. // API requests with the JSON null value. By default, fields with empty
  947. // values are omitted from API requests. However, any field with an
  948. // empty value appearing in NullFields will be sent to the server as
  949. // null. It is an error if a field in this list has a non-empty value.
  950. // This may be used to include null fields in Patch requests.
  951. NullFields []string `json:"-"`
  952. }
  953. func (s *Dpc) MarshalJSON() ([]byte, error) {
  954. type NoMethod Dpc
  955. raw := NoMethod(*s)
  956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  957. }
  958. // Empty: A generic empty message that you can re-use to avoid defining
  959. // duplicated
  960. // empty messages in your APIs. A typical example is to use it as the
  961. // request
  962. // or the response type of an API method. For instance:
  963. //
  964. // service Foo {
  965. // rpc Bar(google.protobuf.Empty) returns
  966. // (google.protobuf.Empty);
  967. // }
  968. //
  969. // The JSON representation for `Empty` is empty JSON object `{}`.
  970. type Empty struct {
  971. // ServerResponse contains the HTTP response code and headers from the
  972. // server.
  973. googleapi.ServerResponse `json:"-"`
  974. }
  975. // FindDevicesByDeviceIdentifierRequest: Request to find devices.
  976. type FindDevicesByDeviceIdentifierRequest struct {
  977. // DeviceIdentifier: Required. The device identifier to search for.
  978. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  979. // Limit: Required. The maximum number of devices to show in a page of
  980. // results. Must
  981. // be between 1 and 100 inclusive.
  982. Limit int64 `json:"limit,omitempty,string"`
  983. // PageToken: A token specifying which result page to return.
  984. PageToken string `json:"pageToken,omitempty"`
  985. // ForceSendFields is a list of field names (e.g. "DeviceIdentifier") to
  986. // unconditionally include in API requests. By default, fields with
  987. // empty values are omitted from API requests. However, any non-pointer,
  988. // non-interface field appearing in ForceSendFields will be sent to the
  989. // server regardless of whether the field is empty or not. This may be
  990. // used to include empty fields in Patch requests.
  991. ForceSendFields []string `json:"-"`
  992. // NullFields is a list of field names (e.g. "DeviceIdentifier") to
  993. // include in API requests with the JSON null value. By default, fields
  994. // with empty values are omitted from API requests. However, any field
  995. // with an empty value appearing in NullFields will be sent to the
  996. // server as null. It is an error if a field in this list has a
  997. // non-empty value. This may be used to include null fields in Patch
  998. // requests.
  999. NullFields []string `json:"-"`
  1000. }
  1001. func (s *FindDevicesByDeviceIdentifierRequest) MarshalJSON() ([]byte, error) {
  1002. type NoMethod FindDevicesByDeviceIdentifierRequest
  1003. raw := NoMethod(*s)
  1004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1005. }
  1006. // FindDevicesByDeviceIdentifierResponse: Response containing found
  1007. // devices.
  1008. type FindDevicesByDeviceIdentifierResponse struct {
  1009. // Devices: Found devices.
  1010. Devices []*Device `json:"devices,omitempty"`
  1011. // NextPageToken: A token used to access the next page of results.
  1012. // Omitted if no further
  1013. // results are available.
  1014. NextPageToken string `json:"nextPageToken,omitempty"`
  1015. // ServerResponse contains the HTTP response code and headers from the
  1016. // server.
  1017. googleapi.ServerResponse `json:"-"`
  1018. // ForceSendFields is a list of field names (e.g. "Devices") to
  1019. // unconditionally include in API requests. By default, fields with
  1020. // empty values are omitted from API requests. However, any non-pointer,
  1021. // non-interface field appearing in ForceSendFields will be sent to the
  1022. // server regardless of whether the field is empty or not. This may be
  1023. // used to include empty fields in Patch requests.
  1024. ForceSendFields []string `json:"-"`
  1025. // NullFields is a list of field names (e.g. "Devices") to include in
  1026. // API requests with the JSON null value. By default, fields with empty
  1027. // values are omitted from API requests. However, any field with an
  1028. // empty value appearing in NullFields will be sent to the server as
  1029. // null. It is an error if a field in this list has a non-empty value.
  1030. // This may be used to include null fields in Patch requests.
  1031. NullFields []string `json:"-"`
  1032. }
  1033. func (s *FindDevicesByDeviceIdentifierResponse) MarshalJSON() ([]byte, error) {
  1034. type NoMethod FindDevicesByDeviceIdentifierResponse
  1035. raw := NoMethod(*s)
  1036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1037. }
  1038. // FindDevicesByOwnerRequest: Request to find devices by customers.
  1039. type FindDevicesByOwnerRequest struct {
  1040. // CustomerId: Required. The list of customer IDs to search for.
  1041. CustomerId googleapi.Int64s `json:"customerId,omitempty"`
  1042. // Limit: Required. The maximum number of devices to show in a page of
  1043. // results. Must
  1044. // be between 1 and 100 inclusive.
  1045. Limit int64 `json:"limit,omitempty,string"`
  1046. // PageToken: A token specifying which result page to return.
  1047. PageToken string `json:"pageToken,omitempty"`
  1048. // SectionType: Required. The section type of the device's provisioning
  1049. // record.
  1050. //
  1051. // Possible values:
  1052. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  1053. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  1054. SectionType string `json:"sectionType,omitempty"`
  1055. // ForceSendFields is a list of field names (e.g. "CustomerId") to
  1056. // unconditionally include in API requests. By default, fields with
  1057. // empty values are omitted from API requests. However, any non-pointer,
  1058. // non-interface field appearing in ForceSendFields will be sent to the
  1059. // server regardless of whether the field is empty or not. This may be
  1060. // used to include empty fields in Patch requests.
  1061. ForceSendFields []string `json:"-"`
  1062. // NullFields is a list of field names (e.g. "CustomerId") to include in
  1063. // API requests with the JSON null value. By default, fields with empty
  1064. // values are omitted from API requests. However, any field with an
  1065. // empty value appearing in NullFields will be sent to the server as
  1066. // null. It is an error if a field in this list has a non-empty value.
  1067. // This may be used to include null fields in Patch requests.
  1068. NullFields []string `json:"-"`
  1069. }
  1070. func (s *FindDevicesByOwnerRequest) MarshalJSON() ([]byte, error) {
  1071. type NoMethod FindDevicesByOwnerRequest
  1072. raw := NoMethod(*s)
  1073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1074. }
  1075. // FindDevicesByOwnerResponse: Response containing found devices.
  1076. type FindDevicesByOwnerResponse struct {
  1077. // Devices: The customer's devices.
  1078. Devices []*Device `json:"devices,omitempty"`
  1079. // NextPageToken: A token used to access the next page of
  1080. // results.
  1081. // Omitted if no further results are available.
  1082. NextPageToken string `json:"nextPageToken,omitempty"`
  1083. // ServerResponse contains the HTTP response code and headers from the
  1084. // server.
  1085. googleapi.ServerResponse `json:"-"`
  1086. // ForceSendFields is a list of field names (e.g. "Devices") to
  1087. // unconditionally include in API requests. By default, fields with
  1088. // empty values are omitted from API requests. However, any non-pointer,
  1089. // non-interface field appearing in ForceSendFields will be sent to the
  1090. // server regardless of whether the field is empty or not. This may be
  1091. // used to include empty fields in Patch requests.
  1092. ForceSendFields []string `json:"-"`
  1093. // NullFields is a list of field names (e.g. "Devices") to include in
  1094. // API requests with the JSON null value. By default, fields with empty
  1095. // values are omitted from API requests. However, any field with an
  1096. // empty value appearing in NullFields will be sent to the server as
  1097. // null. It is an error if a field in this list has a non-empty value.
  1098. // This may be used to include null fields in Patch requests.
  1099. NullFields []string `json:"-"`
  1100. }
  1101. func (s *FindDevicesByOwnerResponse) MarshalJSON() ([]byte, error) {
  1102. type NoMethod FindDevicesByOwnerResponse
  1103. raw := NoMethod(*s)
  1104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1105. }
  1106. // ListCustomersResponse: Response message of all customers related to
  1107. // this partner.
  1108. type ListCustomersResponse struct {
  1109. // Customers: List of customers related to this reseller partner.
  1110. Customers []*Company `json:"customers,omitempty"`
  1111. // ServerResponse contains the HTTP response code and headers from the
  1112. // server.
  1113. googleapi.ServerResponse `json:"-"`
  1114. // ForceSendFields is a list of field names (e.g. "Customers") to
  1115. // unconditionally include in API requests. By default, fields with
  1116. // empty values are omitted from API requests. However, any non-pointer,
  1117. // non-interface field appearing in ForceSendFields will be sent to the
  1118. // server regardless of whether the field is empty or not. This may be
  1119. // used to include empty fields in Patch requests.
  1120. ForceSendFields []string `json:"-"`
  1121. // NullFields is a list of field names (e.g. "Customers") to include in
  1122. // API requests with the JSON null value. By default, fields with empty
  1123. // values are omitted from API requests. However, any field with an
  1124. // empty value appearing in NullFields will be sent to the server as
  1125. // null. It is an error if a field in this list has a non-empty value.
  1126. // This may be used to include null fields in Patch requests.
  1127. NullFields []string `json:"-"`
  1128. }
  1129. func (s *ListCustomersResponse) MarshalJSON() ([]byte, error) {
  1130. type NoMethod ListCustomersResponse
  1131. raw := NoMethod(*s)
  1132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1133. }
  1134. // Operation: This resource represents a long-running operation that is
  1135. // the result of a
  1136. // network API call.
  1137. type Operation struct {
  1138. // Done: If the value is `false`, it means the operation is still in
  1139. // progress.
  1140. // If `true`, the operation is completed, and either `error` or
  1141. // `response` is
  1142. // available.
  1143. Done bool `json:"done,omitempty"`
  1144. // Error: This field will always be not set if the operation is created
  1145. // by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this
  1146. // case, error information for each device is set in
  1147. // `response.perDeviceStatus.result.status`.
  1148. Error *Status `json:"error,omitempty"`
  1149. // Metadata: This field will contain a
  1150. // `DevicesLongRunningOperationMetadata` object if the operation is
  1151. // created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`.
  1152. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1153. // Name: The server-assigned name, which is only unique within the same
  1154. // service that
  1155. // originally returns it. If you use the default HTTP mapping,
  1156. // the
  1157. // `name` should have the format of `operations/some/unique/name`.
  1158. Name string `json:"name,omitempty"`
  1159. // Response: This field will contain a
  1160. // `DevicesLongRunningOperationResponse` object if the operation is
  1161. // created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`.
  1162. Response googleapi.RawMessage `json:"response,omitempty"`
  1163. // ServerResponse contains the HTTP response code and headers from the
  1164. // server.
  1165. googleapi.ServerResponse `json:"-"`
  1166. // ForceSendFields is a list of field names (e.g. "Done") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "Done") to include in API
  1174. // requests with the JSON null value. By default, fields with empty
  1175. // values are omitted from API requests. However, any field with an
  1176. // empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *Operation) MarshalJSON() ([]byte, error) {
  1182. type NoMethod Operation
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // OperationPerDevice: A task for each device in the operation.
  1187. // Corresponds to each device
  1188. // change in the request.
  1189. type OperationPerDevice struct {
  1190. // Claim: A copy of the original device-claim request received by the
  1191. // server.
  1192. Claim *PartnerClaim `json:"claim,omitempty"`
  1193. // Result: The processing result for each device.
  1194. Result *PerDeviceStatusInBatch `json:"result,omitempty"`
  1195. // Unclaim: A copy of the original device-unclaim request received by
  1196. // the server.
  1197. Unclaim *PartnerUnclaim `json:"unclaim,omitempty"`
  1198. // UpdateMetadata: A copy of the original metadata-update request
  1199. // received by the server.
  1200. UpdateMetadata *UpdateMetadataArguments `json:"updateMetadata,omitempty"`
  1201. // ForceSendFields is a list of field names (e.g. "Claim") to
  1202. // unconditionally include in API requests. By default, fields with
  1203. // empty values are omitted from API requests. However, any non-pointer,
  1204. // non-interface field appearing in ForceSendFields will be sent to the
  1205. // server regardless of whether the field is empty or not. This may be
  1206. // used to include empty fields in Patch requests.
  1207. ForceSendFields []string `json:"-"`
  1208. // NullFields is a list of field names (e.g. "Claim") to include in API
  1209. // requests with the JSON null value. By default, fields with empty
  1210. // values are omitted from API requests. However, any field with an
  1211. // empty value appearing in NullFields will be sent to the server as
  1212. // null. It is an error if a field in this list has a non-empty value.
  1213. // This may be used to include null fields in Patch requests.
  1214. NullFields []string `json:"-"`
  1215. }
  1216. func (s *OperationPerDevice) MarshalJSON() ([]byte, error) {
  1217. type NoMethod OperationPerDevice
  1218. raw := NoMethod(*s)
  1219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1220. }
  1221. // PartnerClaim: Identifies one claim request.
  1222. type PartnerClaim struct {
  1223. // CustomerId: Required. The ID of the customer for whom the device is
  1224. // being claimed.
  1225. CustomerId int64 `json:"customerId,omitempty,string"`
  1226. // DeviceIdentifier: Required. Device identifier of the device.
  1227. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  1228. // DeviceMetadata: Required. The metadata to attach to the device at
  1229. // claim.
  1230. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1231. // SectionType: Required. The section type of the device's provisioning
  1232. // record.
  1233. //
  1234. // Possible values:
  1235. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  1236. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  1237. SectionType string `json:"sectionType,omitempty"`
  1238. // ForceSendFields is a list of field names (e.g. "CustomerId") to
  1239. // unconditionally include in API requests. By default, fields with
  1240. // empty values are omitted from API requests. However, any non-pointer,
  1241. // non-interface field appearing in ForceSendFields will be sent to the
  1242. // server regardless of whether the field is empty or not. This may be
  1243. // used to include empty fields in Patch requests.
  1244. ForceSendFields []string `json:"-"`
  1245. // NullFields is a list of field names (e.g. "CustomerId") to include in
  1246. // API requests with the JSON null value. By default, fields with empty
  1247. // values are omitted from API requests. However, any field with an
  1248. // empty value appearing in NullFields will be sent to the server as
  1249. // null. It is an error if a field in this list has a non-empty value.
  1250. // This may be used to include null fields in Patch requests.
  1251. NullFields []string `json:"-"`
  1252. }
  1253. func (s *PartnerClaim) MarshalJSON() ([]byte, error) {
  1254. type NoMethod PartnerClaim
  1255. raw := NoMethod(*s)
  1256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1257. }
  1258. // PartnerUnclaim: Identifies one unclaim request.
  1259. type PartnerUnclaim struct {
  1260. // DeviceId: Device ID of the device.
  1261. DeviceId int64 `json:"deviceId,omitempty,string"`
  1262. // DeviceIdentifier: Device identifier of the device.
  1263. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  1264. // SectionType: Required. The section type of the device's provisioning
  1265. // record.
  1266. //
  1267. // Possible values:
  1268. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  1269. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  1270. SectionType string `json:"sectionType,omitempty"`
  1271. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1272. // unconditionally include in API requests. By default, fields with
  1273. // empty values are omitted from API requests. However, any non-pointer,
  1274. // non-interface field appearing in ForceSendFields will be sent to the
  1275. // server regardless of whether the field is empty or not. This may be
  1276. // used to include empty fields in Patch requests.
  1277. ForceSendFields []string `json:"-"`
  1278. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1279. // API requests with the JSON null value. By default, fields with empty
  1280. // values are omitted from API requests. However, any field with an
  1281. // empty value appearing in NullFields will be sent to the server as
  1282. // null. It is an error if a field in this list has a non-empty value.
  1283. // This may be used to include null fields in Patch requests.
  1284. NullFields []string `json:"-"`
  1285. }
  1286. func (s *PartnerUnclaim) MarshalJSON() ([]byte, error) {
  1287. type NoMethod PartnerUnclaim
  1288. raw := NoMethod(*s)
  1289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1290. }
  1291. // PerDeviceStatusInBatch: Captures the processing status for each
  1292. // device in the operation.
  1293. type PerDeviceStatusInBatch struct {
  1294. // DeviceId: If processing succeeds, the device ID of the device.
  1295. DeviceId int64 `json:"deviceId,omitempty,string"`
  1296. // ErrorIdentifier: If processing fails, the error type.
  1297. ErrorIdentifier string `json:"errorIdentifier,omitempty"`
  1298. // ErrorMessage: If processing fails, a developer message explaining
  1299. // what went wrong.
  1300. ErrorMessage string `json:"errorMessage,omitempty"`
  1301. // Status: The result status of the device after processing.
  1302. //
  1303. // Possible values:
  1304. // "SINGLE_DEVICE_STATUS_UNSPECIFIED" - Invalid code. Shouldn't be
  1305. // used.
  1306. // "SINGLE_DEVICE_STATUS_UNKNOWN_ERROR" - Unknown error.
  1307. // We don't expect this error to occur here.
  1308. // "SINGLE_DEVICE_STATUS_OTHER_ERROR" - Other error.
  1309. // We know/expect this error, but there's no defined error code for
  1310. // the
  1311. // error.
  1312. // "SINGLE_DEVICE_STATUS_SUCCESS" - Success.
  1313. // "SINGLE_DEVICE_STATUS_PERMISSION_DENIED" - Permission denied.
  1314. // "SINGLE_DEVICE_STATUS_INVALID_DEVICE_IDENTIFIER" - Invalid device
  1315. // identifier.
  1316. // "SINGLE_DEVICE_STATUS_INVALID_SECTION_TYPE" - Invalid section type.
  1317. // "SINGLE_DEVICE_STATUS_SECTION_NOT_YOURS" - This section is claimed
  1318. // by another company.
  1319. Status string `json:"status,omitempty"`
  1320. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1321. // unconditionally include in API requests. By default, fields with
  1322. // empty values are omitted from API requests. However, any non-pointer,
  1323. // non-interface field appearing in ForceSendFields will be sent to the
  1324. // server regardless of whether the field is empty or not. This may be
  1325. // used to include empty fields in Patch requests.
  1326. ForceSendFields []string `json:"-"`
  1327. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1328. // API requests with the JSON null value. By default, fields with empty
  1329. // values are omitted from API requests. However, any field with an
  1330. // empty value appearing in NullFields will be sent to the server as
  1331. // null. It is an error if a field in this list has a non-empty value.
  1332. // This may be used to include null fields in Patch requests.
  1333. NullFields []string `json:"-"`
  1334. }
  1335. func (s *PerDeviceStatusInBatch) MarshalJSON() ([]byte, error) {
  1336. type NoMethod PerDeviceStatusInBatch
  1337. raw := NoMethod(*s)
  1338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1339. }
  1340. // Status: The `Status` type defines a logical error model that is
  1341. // suitable for different
  1342. // programming environments, including REST APIs and RPC APIs. It is
  1343. // used by
  1344. // [gRPC](https://github.com/grpc). The error model is designed to
  1345. // be:
  1346. //
  1347. // - Simple to use and understand for most users
  1348. // - Flexible enough to meet unexpected needs
  1349. //
  1350. // # Overview
  1351. //
  1352. // The `Status` message contains three pieces of data: error code, error
  1353. // message,
  1354. // and error details. The error code should be an enum value
  1355. // of
  1356. // google.rpc.Code, but it may accept additional error codes if needed.
  1357. // The
  1358. // error message should be a developer-facing English message that
  1359. // helps
  1360. // developers *understand* and *resolve* the error. If a localized
  1361. // user-facing
  1362. // error message is needed, put the localized message in the error
  1363. // details or
  1364. // localize it in the client. The optional error details may contain
  1365. // arbitrary
  1366. // information about the error. There is a predefined set of error
  1367. // detail types
  1368. // in the package `google.rpc` that can be used for common error
  1369. // conditions.
  1370. //
  1371. // # Language mapping
  1372. //
  1373. // The `Status` message is the logical representation of the error
  1374. // model, but it
  1375. // is not necessarily the actual wire format. When the `Status` message
  1376. // is
  1377. // exposed in different client libraries and different wire protocols,
  1378. // it can be
  1379. // mapped differently. For example, it will likely be mapped to some
  1380. // exceptions
  1381. // in Java, but more likely mapped to some error codes in C.
  1382. //
  1383. // # Other uses
  1384. //
  1385. // The error model and the `Status` message can be used in a variety
  1386. // of
  1387. // environments, either with or without APIs, to provide a
  1388. // consistent developer experience across different
  1389. // environments.
  1390. //
  1391. // Example uses of this error model include:
  1392. //
  1393. // - Partial errors. If a service needs to return partial errors to the
  1394. // client,
  1395. // it may embed the `Status` in the normal response to indicate the
  1396. // partial
  1397. // errors.
  1398. //
  1399. // - Workflow errors. A typical workflow has multiple steps. Each step
  1400. // may
  1401. // have a `Status` message for error reporting.
  1402. //
  1403. // - Batch operations. If a client uses batch request and batch
  1404. // response, the
  1405. // `Status` message should be used directly inside batch response,
  1406. // one for
  1407. // each error sub-response.
  1408. //
  1409. // - Asynchronous operations. If an API call embeds asynchronous
  1410. // operation
  1411. // results in its response, the status of those operations should
  1412. // be
  1413. // represented directly using the `Status` message.
  1414. //
  1415. // - Logging. If some API errors are stored in logs, the message
  1416. // `Status` could
  1417. // be used directly after any stripping needed for security/privacy
  1418. // reasons.
  1419. type Status struct {
  1420. // Code: The status code, which should be an enum value of
  1421. // google.rpc.Code.
  1422. Code int64 `json:"code,omitempty"`
  1423. // Details: A list of messages that carry the error details. There is a
  1424. // common set of
  1425. // message types for APIs to use.
  1426. Details []googleapi.RawMessage `json:"details,omitempty"`
  1427. // Message: A developer-facing error message, which should be in
  1428. // English. Any
  1429. // user-facing error message should be localized and sent in
  1430. // the
  1431. // google.rpc.Status.details field, or localized by the client.
  1432. Message string `json:"message,omitempty"`
  1433. // ForceSendFields is a list of field names (e.g. "Code") to
  1434. // unconditionally include in API requests. By default, fields with
  1435. // empty values are omitted from API requests. However, any non-pointer,
  1436. // non-interface field appearing in ForceSendFields will be sent to the
  1437. // server regardless of whether the field is empty or not. This may be
  1438. // used to include empty fields in Patch requests.
  1439. ForceSendFields []string `json:"-"`
  1440. // NullFields is a list of field names (e.g. "Code") to include in API
  1441. // requests with the JSON null value. By default, fields with empty
  1442. // values are omitted from API requests. However, any field with an
  1443. // empty value appearing in NullFields will be sent to the server as
  1444. // null. It is an error if a field in this list has a non-empty value.
  1445. // This may be used to include null fields in Patch requests.
  1446. NullFields []string `json:"-"`
  1447. }
  1448. func (s *Status) MarshalJSON() ([]byte, error) {
  1449. type NoMethod Status
  1450. raw := NoMethod(*s)
  1451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1452. }
  1453. // UnclaimDeviceRequest: Request message to unclaim a device.
  1454. type UnclaimDeviceRequest struct {
  1455. // DeviceId: The device ID returned by `ClaimDevice`.
  1456. DeviceId int64 `json:"deviceId,omitempty,string"`
  1457. // DeviceIdentifier: The device identifier you used when you claimed
  1458. // this device.
  1459. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  1460. // SectionType: Required. The section type of the device's provisioning
  1461. // record.
  1462. //
  1463. // Possible values:
  1464. // "SECTION_TYPE_UNSPECIFIED" - Unspecified section type.
  1465. // "SECTION_TYPE_ZERO_TOUCH" - Zero-touch enrollment section type.
  1466. SectionType string `json:"sectionType,omitempty"`
  1467. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1468. // unconditionally include in API requests. By default, fields with
  1469. // empty values are omitted from API requests. However, any non-pointer,
  1470. // non-interface field appearing in ForceSendFields will be sent to the
  1471. // server regardless of whether the field is empty or not. This may be
  1472. // used to include empty fields in Patch requests.
  1473. ForceSendFields []string `json:"-"`
  1474. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1475. // API requests with the JSON null value. By default, fields with empty
  1476. // values are omitted from API requests. However, any field with an
  1477. // empty value appearing in NullFields will be sent to the server as
  1478. // null. It is an error if a field in this list has a non-empty value.
  1479. // This may be used to include null fields in Patch requests.
  1480. NullFields []string `json:"-"`
  1481. }
  1482. func (s *UnclaimDeviceRequest) MarshalJSON() ([]byte, error) {
  1483. type NoMethod UnclaimDeviceRequest
  1484. raw := NoMethod(*s)
  1485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1486. }
  1487. // UnclaimDevicesRequest: Request to unclaim devices asynchronously in
  1488. // batch.
  1489. type UnclaimDevicesRequest struct {
  1490. // Unclaims: Required. The list of devices to unclaim.
  1491. Unclaims []*PartnerUnclaim `json:"unclaims,omitempty"`
  1492. // ForceSendFields is a list of field names (e.g. "Unclaims") to
  1493. // unconditionally include in API requests. By default, fields with
  1494. // empty values are omitted from API requests. However, any non-pointer,
  1495. // non-interface field appearing in ForceSendFields will be sent to the
  1496. // server regardless of whether the field is empty or not. This may be
  1497. // used to include empty fields in Patch requests.
  1498. ForceSendFields []string `json:"-"`
  1499. // NullFields is a list of field names (e.g. "Unclaims") to include in
  1500. // API requests with the JSON null value. By default, fields with empty
  1501. // values are omitted from API requests. However, any field with an
  1502. // empty value appearing in NullFields will be sent to the server as
  1503. // null. It is an error if a field in this list has a non-empty value.
  1504. // This may be used to include null fields in Patch requests.
  1505. NullFields []string `json:"-"`
  1506. }
  1507. func (s *UnclaimDevicesRequest) MarshalJSON() ([]byte, error) {
  1508. type NoMethod UnclaimDevicesRequest
  1509. raw := NoMethod(*s)
  1510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1511. }
  1512. // UpdateDeviceMetadataInBatchRequest: Request to update device metadata
  1513. // in batch.
  1514. type UpdateDeviceMetadataInBatchRequest struct {
  1515. // Updates: Required. The list of metadata updates.
  1516. Updates []*UpdateMetadataArguments `json:"updates,omitempty"`
  1517. // ForceSendFields is a list of field names (e.g. "Updates") to
  1518. // unconditionally include in API requests. By default, fields with
  1519. // empty values are omitted from API requests. However, any non-pointer,
  1520. // non-interface field appearing in ForceSendFields will be sent to the
  1521. // server regardless of whether the field is empty or not. This may be
  1522. // used to include empty fields in Patch requests.
  1523. ForceSendFields []string `json:"-"`
  1524. // NullFields is a list of field names (e.g. "Updates") to include in
  1525. // API requests with the JSON null value. By default, fields with empty
  1526. // values are omitted from API requests. However, any field with an
  1527. // empty value appearing in NullFields will be sent to the server as
  1528. // null. It is an error if a field in this list has a non-empty value.
  1529. // This may be used to include null fields in Patch requests.
  1530. NullFields []string `json:"-"`
  1531. }
  1532. func (s *UpdateDeviceMetadataInBatchRequest) MarshalJSON() ([]byte, error) {
  1533. type NoMethod UpdateDeviceMetadataInBatchRequest
  1534. raw := NoMethod(*s)
  1535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1536. }
  1537. // UpdateDeviceMetadataRequest: Request to set metadata for a device.
  1538. type UpdateDeviceMetadataRequest struct {
  1539. // DeviceMetadata: Required. The metdata to attach to the device.
  1540. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1541. // ForceSendFields is a list of field names (e.g. "DeviceMetadata") to
  1542. // unconditionally include in API requests. By default, fields with
  1543. // empty values are omitted from API requests. However, any non-pointer,
  1544. // non-interface field appearing in ForceSendFields will be sent to the
  1545. // server regardless of whether the field is empty or not. This may be
  1546. // used to include empty fields in Patch requests.
  1547. ForceSendFields []string `json:"-"`
  1548. // NullFields is a list of field names (e.g. "DeviceMetadata") to
  1549. // include in API requests with the JSON null value. By default, fields
  1550. // with empty values are omitted from API requests. However, any field
  1551. // with an empty value appearing in NullFields will be sent to the
  1552. // server as null. It is an error if a field in this list has a
  1553. // non-empty value. This may be used to include null fields in Patch
  1554. // requests.
  1555. NullFields []string `json:"-"`
  1556. }
  1557. func (s *UpdateDeviceMetadataRequest) MarshalJSON() ([]byte, error) {
  1558. type NoMethod UpdateDeviceMetadataRequest
  1559. raw := NoMethod(*s)
  1560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1561. }
  1562. // UpdateMetadataArguments: Identifies metdata updates to one device.
  1563. type UpdateMetadataArguments struct {
  1564. // DeviceId: Device ID of the device.
  1565. DeviceId int64 `json:"deviceId,omitempty,string"`
  1566. // DeviceIdentifier: Device identifier.
  1567. DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
  1568. // DeviceMetadata: Required. The metadata to update.
  1569. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1570. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1571. // unconditionally include in API requests. By default, fields with
  1572. // empty values are omitted from API requests. However, any non-pointer,
  1573. // non-interface field appearing in ForceSendFields will be sent to the
  1574. // server regardless of whether the field is empty or not. This may be
  1575. // used to include empty fields in Patch requests.
  1576. ForceSendFields []string `json:"-"`
  1577. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1578. // API requests with the JSON null value. By default, fields with empty
  1579. // values are omitted from API requests. However, any field with an
  1580. // empty value appearing in NullFields will be sent to the server as
  1581. // null. It is an error if a field in this list has a non-empty value.
  1582. // This may be used to include null fields in Patch requests.
  1583. NullFields []string `json:"-"`
  1584. }
  1585. func (s *UpdateMetadataArguments) MarshalJSON() ([]byte, error) {
  1586. type NoMethod UpdateMetadataArguments
  1587. raw := NoMethod(*s)
  1588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1589. }
  1590. // method id "androiddeviceprovisioning.customers.list":
  1591. type CustomersListCall struct {
  1592. s *Service
  1593. urlParams_ gensupport.URLParams
  1594. ifNoneMatch_ string
  1595. ctx_ context.Context
  1596. header_ http.Header
  1597. }
  1598. // List: Lists the user's customer accounts.
  1599. func (r *CustomersService) List() *CustomersListCall {
  1600. c := &CustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1601. return c
  1602. }
  1603. // PageSize sets the optional parameter "pageSize": The maximum number
  1604. // of customers to show in a page of results.
  1605. // A number between 1 and 100 (inclusive).
  1606. func (c *CustomersListCall) PageSize(pageSize int64) *CustomersListCall {
  1607. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1608. return c
  1609. }
  1610. // PageToken sets the optional parameter "pageToken": A token specifying
  1611. // which result page to return.
  1612. func (c *CustomersListCall) PageToken(pageToken string) *CustomersListCall {
  1613. c.urlParams_.Set("pageToken", pageToken)
  1614. return c
  1615. }
  1616. // Fields allows partial responses to be retrieved. See
  1617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1618. // for more information.
  1619. func (c *CustomersListCall) Fields(s ...googleapi.Field) *CustomersListCall {
  1620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1621. return c
  1622. }
  1623. // IfNoneMatch sets the optional parameter which makes the operation
  1624. // fail if the object's ETag matches the given value. This is useful for
  1625. // getting updates only after the object has changed since the last
  1626. // request. Use googleapi.IsNotModified to check whether the response
  1627. // error from Do is the result of In-None-Match.
  1628. func (c *CustomersListCall) IfNoneMatch(entityTag string) *CustomersListCall {
  1629. c.ifNoneMatch_ = entityTag
  1630. return c
  1631. }
  1632. // Context sets the context to be used in this call's Do method. Any
  1633. // pending HTTP request will be aborted if the provided context is
  1634. // canceled.
  1635. func (c *CustomersListCall) Context(ctx context.Context) *CustomersListCall {
  1636. c.ctx_ = ctx
  1637. return c
  1638. }
  1639. // Header returns an http.Header that can be modified by the caller to
  1640. // add HTTP headers to the request.
  1641. func (c *CustomersListCall) Header() http.Header {
  1642. if c.header_ == nil {
  1643. c.header_ = make(http.Header)
  1644. }
  1645. return c.header_
  1646. }
  1647. func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) {
  1648. reqHeaders := make(http.Header)
  1649. for k, v := range c.header_ {
  1650. reqHeaders[k] = v
  1651. }
  1652. reqHeaders.Set("User-Agent", c.s.userAgent())
  1653. if c.ifNoneMatch_ != "" {
  1654. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1655. }
  1656. var body io.Reader = nil
  1657. c.urlParams_.Set("alt", alt)
  1658. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/customers")
  1659. urls += "?" + c.urlParams_.Encode()
  1660. req, _ := http.NewRequest("GET", urls, body)
  1661. req.Header = reqHeaders
  1662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1663. }
  1664. // Do executes the "androiddeviceprovisioning.customers.list" call.
  1665. // Exactly one of *CustomerListCustomersResponse or error will be
  1666. // non-nil. Any non-2xx status code is an error. Response headers are in
  1667. // either *CustomerListCustomersResponse.ServerResponse.Header or (if a
  1668. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1669. // googleapi.IsNotModified to check whether the returned error was
  1670. // because http.StatusNotModified was returned.
  1671. func (c *CustomersListCall) Do(opts ...googleapi.CallOption) (*CustomerListCustomersResponse, error) {
  1672. gensupport.SetOptions(c.urlParams_, opts...)
  1673. res, err := c.doRequest("json")
  1674. if res != nil && res.StatusCode == http.StatusNotModified {
  1675. if res.Body != nil {
  1676. res.Body.Close()
  1677. }
  1678. return nil, &googleapi.Error{
  1679. Code: res.StatusCode,
  1680. Header: res.Header,
  1681. }
  1682. }
  1683. if err != nil {
  1684. return nil, err
  1685. }
  1686. defer googleapi.CloseBody(res)
  1687. if err := googleapi.CheckResponse(res); err != nil {
  1688. return nil, err
  1689. }
  1690. ret := &CustomerListCustomersResponse{
  1691. ServerResponse: googleapi.ServerResponse{
  1692. Header: res.Header,
  1693. HTTPStatusCode: res.StatusCode,
  1694. },
  1695. }
  1696. target := &ret
  1697. if err := gensupport.DecodeResponse(target, res); err != nil {
  1698. return nil, err
  1699. }
  1700. return ret, nil
  1701. // {
  1702. // "description": "Lists the user's customer accounts.",
  1703. // "flatPath": "v1/customers",
  1704. // "httpMethod": "GET",
  1705. // "id": "androiddeviceprovisioning.customers.list",
  1706. // "parameterOrder": [],
  1707. // "parameters": {
  1708. // "pageSize": {
  1709. // "description": "The maximum number of customers to show in a page of results.\nA number between 1 and 100 (inclusive).",
  1710. // "format": "int32",
  1711. // "location": "query",
  1712. // "type": "integer"
  1713. // },
  1714. // "pageToken": {
  1715. // "description": "A token specifying which result page to return.",
  1716. // "location": "query",
  1717. // "type": "string"
  1718. // }
  1719. // },
  1720. // "path": "v1/customers",
  1721. // "response": {
  1722. // "$ref": "CustomerListCustomersResponse"
  1723. // }
  1724. // }
  1725. }
  1726. // Pages invokes f for each page of results.
  1727. // A non-nil error returned from f will halt the iteration.
  1728. // The provided context supersedes any context provided to the Context method.
  1729. func (c *CustomersListCall) Pages(ctx context.Context, f func(*CustomerListCustomersResponse) error) error {
  1730. c.ctx_ = ctx
  1731. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1732. for {
  1733. x, err := c.Do()
  1734. if err != nil {
  1735. return err
  1736. }
  1737. if err := f(x); err != nil {
  1738. return err
  1739. }
  1740. if x.NextPageToken == "" {
  1741. return nil
  1742. }
  1743. c.PageToken(x.NextPageToken)
  1744. }
  1745. }
  1746. // method id "androiddeviceprovisioning.customers.configurations.create":
  1747. type CustomersConfigurationsCreateCall struct {
  1748. s *Service
  1749. parent string
  1750. configuration *Configuration
  1751. urlParams_ gensupport.URLParams
  1752. ctx_ context.Context
  1753. header_ http.Header
  1754. }
  1755. // Create: Creates a new configuration. Once created, a customer can
  1756. // apply the
  1757. // configuration to devices.
  1758. func (r *CustomersConfigurationsService) Create(parent string, configuration *Configuration) *CustomersConfigurationsCreateCall {
  1759. c := &CustomersConfigurationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1760. c.parent = parent
  1761. c.configuration = configuration
  1762. return c
  1763. }
  1764. // Fields allows partial responses to be retrieved. See
  1765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1766. // for more information.
  1767. func (c *CustomersConfigurationsCreateCall) Fields(s ...googleapi.Field) *CustomersConfigurationsCreateCall {
  1768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1769. return c
  1770. }
  1771. // Context sets the context to be used in this call's Do method. Any
  1772. // pending HTTP request will be aborted if the provided context is
  1773. // canceled.
  1774. func (c *CustomersConfigurationsCreateCall) Context(ctx context.Context) *CustomersConfigurationsCreateCall {
  1775. c.ctx_ = ctx
  1776. return c
  1777. }
  1778. // Header returns an http.Header that can be modified by the caller to
  1779. // add HTTP headers to the request.
  1780. func (c *CustomersConfigurationsCreateCall) Header() http.Header {
  1781. if c.header_ == nil {
  1782. c.header_ = make(http.Header)
  1783. }
  1784. return c.header_
  1785. }
  1786. func (c *CustomersConfigurationsCreateCall) doRequest(alt string) (*http.Response, error) {
  1787. reqHeaders := make(http.Header)
  1788. for k, v := range c.header_ {
  1789. reqHeaders[k] = v
  1790. }
  1791. reqHeaders.Set("User-Agent", c.s.userAgent())
  1792. var body io.Reader = nil
  1793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration)
  1794. if err != nil {
  1795. return nil, err
  1796. }
  1797. reqHeaders.Set("Content-Type", "application/json")
  1798. c.urlParams_.Set("alt", alt)
  1799. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations")
  1800. urls += "?" + c.urlParams_.Encode()
  1801. req, _ := http.NewRequest("POST", urls, body)
  1802. req.Header = reqHeaders
  1803. googleapi.Expand(req.URL, map[string]string{
  1804. "parent": c.parent,
  1805. })
  1806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1807. }
  1808. // Do executes the "androiddeviceprovisioning.customers.configurations.create" call.
  1809. // Exactly one of *Configuration or error will be non-nil. Any non-2xx
  1810. // status code is an error. Response headers are in either
  1811. // *Configuration.ServerResponse.Header or (if a response was returned
  1812. // at all) in error.(*googleapi.Error).Header. Use
  1813. // googleapi.IsNotModified to check whether the returned error was
  1814. // because http.StatusNotModified was returned.
  1815. func (c *CustomersConfigurationsCreateCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
  1816. gensupport.SetOptions(c.urlParams_, opts...)
  1817. res, err := c.doRequest("json")
  1818. if res != nil && res.StatusCode == http.StatusNotModified {
  1819. if res.Body != nil {
  1820. res.Body.Close()
  1821. }
  1822. return nil, &googleapi.Error{
  1823. Code: res.StatusCode,
  1824. Header: res.Header,
  1825. }
  1826. }
  1827. if err != nil {
  1828. return nil, err
  1829. }
  1830. defer googleapi.CloseBody(res)
  1831. if err := googleapi.CheckResponse(res); err != nil {
  1832. return nil, err
  1833. }
  1834. ret := &Configuration{
  1835. ServerResponse: googleapi.ServerResponse{
  1836. Header: res.Header,
  1837. HTTPStatusCode: res.StatusCode,
  1838. },
  1839. }
  1840. target := &ret
  1841. if err := gensupport.DecodeResponse(target, res); err != nil {
  1842. return nil, err
  1843. }
  1844. return ret, nil
  1845. // {
  1846. // "description": "Creates a new configuration. Once created, a customer can apply the\nconfiguration to devices.",
  1847. // "flatPath": "v1/customers/{customersId}/configurations",
  1848. // "httpMethod": "POST",
  1849. // "id": "androiddeviceprovisioning.customers.configurations.create",
  1850. // "parameterOrder": [
  1851. // "parent"
  1852. // ],
  1853. // "parameters": {
  1854. // "parent": {
  1855. // "description": "Required. The customer that manages the configuration. An API resource name\nin the format `customers/[CUSTOMER_ID]`.",
  1856. // "location": "path",
  1857. // "pattern": "^customers/[^/]+$",
  1858. // "required": true,
  1859. // "type": "string"
  1860. // }
  1861. // },
  1862. // "path": "v1/{+parent}/configurations",
  1863. // "request": {
  1864. // "$ref": "Configuration"
  1865. // },
  1866. // "response": {
  1867. // "$ref": "Configuration"
  1868. // }
  1869. // }
  1870. }
  1871. // method id "androiddeviceprovisioning.customers.configurations.delete":
  1872. type CustomersConfigurationsDeleteCall struct {
  1873. s *Service
  1874. name string
  1875. urlParams_ gensupport.URLParams
  1876. ctx_ context.Context
  1877. header_ http.Header
  1878. }
  1879. // Delete: Deletes an unused configuration. The API call fails if the
  1880. // customer has
  1881. // devices with the configuration applied.
  1882. func (r *CustomersConfigurationsService) Delete(name string) *CustomersConfigurationsDeleteCall {
  1883. c := &CustomersConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1884. c.name = name
  1885. return c
  1886. }
  1887. // Fields allows partial responses to be retrieved. See
  1888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1889. // for more information.
  1890. func (c *CustomersConfigurationsDeleteCall) Fields(s ...googleapi.Field) *CustomersConfigurationsDeleteCall {
  1891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1892. return c
  1893. }
  1894. // Context sets the context to be used in this call's Do method. Any
  1895. // pending HTTP request will be aborted if the provided context is
  1896. // canceled.
  1897. func (c *CustomersConfigurationsDeleteCall) Context(ctx context.Context) *CustomersConfigurationsDeleteCall {
  1898. c.ctx_ = ctx
  1899. return c
  1900. }
  1901. // Header returns an http.Header that can be modified by the caller to
  1902. // add HTTP headers to the request.
  1903. func (c *CustomersConfigurationsDeleteCall) Header() http.Header {
  1904. if c.header_ == nil {
  1905. c.header_ = make(http.Header)
  1906. }
  1907. return c.header_
  1908. }
  1909. func (c *CustomersConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1910. reqHeaders := make(http.Header)
  1911. for k, v := range c.header_ {
  1912. reqHeaders[k] = v
  1913. }
  1914. reqHeaders.Set("User-Agent", c.s.userAgent())
  1915. var body io.Reader = nil
  1916. c.urlParams_.Set("alt", alt)
  1917. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1918. urls += "?" + c.urlParams_.Encode()
  1919. req, _ := http.NewRequest("DELETE", urls, body)
  1920. req.Header = reqHeaders
  1921. googleapi.Expand(req.URL, map[string]string{
  1922. "name": c.name,
  1923. })
  1924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1925. }
  1926. // Do executes the "androiddeviceprovisioning.customers.configurations.delete" call.
  1927. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1928. // code is an error. Response headers are in either
  1929. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1930. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1931. // check whether the returned error was because http.StatusNotModified
  1932. // was returned.
  1933. func (c *CustomersConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1934. gensupport.SetOptions(c.urlParams_, opts...)
  1935. res, err := c.doRequest("json")
  1936. if res != nil && res.StatusCode == http.StatusNotModified {
  1937. if res.Body != nil {
  1938. res.Body.Close()
  1939. }
  1940. return nil, &googleapi.Error{
  1941. Code: res.StatusCode,
  1942. Header: res.Header,
  1943. }
  1944. }
  1945. if err != nil {
  1946. return nil, err
  1947. }
  1948. defer googleapi.CloseBody(res)
  1949. if err := googleapi.CheckResponse(res); err != nil {
  1950. return nil, err
  1951. }
  1952. ret := &Empty{
  1953. ServerResponse: googleapi.ServerResponse{
  1954. Header: res.Header,
  1955. HTTPStatusCode: res.StatusCode,
  1956. },
  1957. }
  1958. target := &ret
  1959. if err := gensupport.DecodeResponse(target, res); err != nil {
  1960. return nil, err
  1961. }
  1962. return ret, nil
  1963. // {
  1964. // "description": "Deletes an unused configuration. The API call fails if the customer has\ndevices with the configuration applied.",
  1965. // "flatPath": "v1/customers/{customersId}/configurations/{configurationsId}",
  1966. // "httpMethod": "DELETE",
  1967. // "id": "androiddeviceprovisioning.customers.configurations.delete",
  1968. // "parameterOrder": [
  1969. // "name"
  1970. // ],
  1971. // "parameters": {
  1972. // "name": {
  1973. // "description": "Required. The configuration to delete. An API resource name in the format\n`customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. If the\nconfiguration is applied to any devices, the API call fails.",
  1974. // "location": "path",
  1975. // "pattern": "^customers/[^/]+/configurations/[^/]+$",
  1976. // "required": true,
  1977. // "type": "string"
  1978. // }
  1979. // },
  1980. // "path": "v1/{+name}",
  1981. // "response": {
  1982. // "$ref": "Empty"
  1983. // }
  1984. // }
  1985. }
  1986. // method id "androiddeviceprovisioning.customers.configurations.get":
  1987. type CustomersConfigurationsGetCall struct {
  1988. s *Service
  1989. name string
  1990. urlParams_ gensupport.URLParams
  1991. ifNoneMatch_ string
  1992. ctx_ context.Context
  1993. header_ http.Header
  1994. }
  1995. // Get: Gets the details of a configuration.
  1996. func (r *CustomersConfigurationsService) Get(name string) *CustomersConfigurationsGetCall {
  1997. c := &CustomersConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1998. c.name = name
  1999. return c
  2000. }
  2001. // Fields allows partial responses to be retrieved. See
  2002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2003. // for more information.
  2004. func (c *CustomersConfigurationsGetCall) Fields(s ...googleapi.Field) *CustomersConfigurationsGetCall {
  2005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2006. return c
  2007. }
  2008. // IfNoneMatch sets the optional parameter which makes the operation
  2009. // fail if the object's ETag matches the given value. This is useful for
  2010. // getting updates only after the object has changed since the last
  2011. // request. Use googleapi.IsNotModified to check whether the response
  2012. // error from Do is the result of In-None-Match.
  2013. func (c *CustomersConfigurationsGetCall) IfNoneMatch(entityTag string) *CustomersConfigurationsGetCall {
  2014. c.ifNoneMatch_ = entityTag
  2015. return c
  2016. }
  2017. // Context sets the context to be used in this call's Do method. Any
  2018. // pending HTTP request will be aborted if the provided context is
  2019. // canceled.
  2020. func (c *CustomersConfigurationsGetCall) Context(ctx context.Context) *CustomersConfigurationsGetCall {
  2021. c.ctx_ = ctx
  2022. return c
  2023. }
  2024. // Header returns an http.Header that can be modified by the caller to
  2025. // add HTTP headers to the request.
  2026. func (c *CustomersConfigurationsGetCall) Header() http.Header {
  2027. if c.header_ == nil {
  2028. c.header_ = make(http.Header)
  2029. }
  2030. return c.header_
  2031. }
  2032. func (c *CustomersConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  2033. reqHeaders := make(http.Header)
  2034. for k, v := range c.header_ {
  2035. reqHeaders[k] = v
  2036. }
  2037. reqHeaders.Set("User-Agent", c.s.userAgent())
  2038. if c.ifNoneMatch_ != "" {
  2039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2040. }
  2041. var body io.Reader = nil
  2042. c.urlParams_.Set("alt", alt)
  2043. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2044. urls += "?" + c.urlParams_.Encode()
  2045. req, _ := http.NewRequest("GET", urls, body)
  2046. req.Header = reqHeaders
  2047. googleapi.Expand(req.URL, map[string]string{
  2048. "name": c.name,
  2049. })
  2050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2051. }
  2052. // Do executes the "androiddeviceprovisioning.customers.configurations.get" call.
  2053. // Exactly one of *Configuration or error will be non-nil. Any non-2xx
  2054. // status code is an error. Response headers are in either
  2055. // *Configuration.ServerResponse.Header or (if a response was returned
  2056. // at all) in error.(*googleapi.Error).Header. Use
  2057. // googleapi.IsNotModified to check whether the returned error was
  2058. // because http.StatusNotModified was returned.
  2059. func (c *CustomersConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
  2060. gensupport.SetOptions(c.urlParams_, opts...)
  2061. res, err := c.doRequest("json")
  2062. if res != nil && res.StatusCode == http.StatusNotModified {
  2063. if res.Body != nil {
  2064. res.Body.Close()
  2065. }
  2066. return nil, &googleapi.Error{
  2067. Code: res.StatusCode,
  2068. Header: res.Header,
  2069. }
  2070. }
  2071. if err != nil {
  2072. return nil, err
  2073. }
  2074. defer googleapi.CloseBody(res)
  2075. if err := googleapi.CheckResponse(res); err != nil {
  2076. return nil, err
  2077. }
  2078. ret := &Configuration{
  2079. ServerResponse: googleapi.ServerResponse{
  2080. Header: res.Header,
  2081. HTTPStatusCode: res.StatusCode,
  2082. },
  2083. }
  2084. target := &ret
  2085. if err := gensupport.DecodeResponse(target, res); err != nil {
  2086. return nil, err
  2087. }
  2088. return ret, nil
  2089. // {
  2090. // "description": "Gets the details of a configuration.",
  2091. // "flatPath": "v1/customers/{customersId}/configurations/{configurationsId}",
  2092. // "httpMethod": "GET",
  2093. // "id": "androiddeviceprovisioning.customers.configurations.get",
  2094. // "parameterOrder": [
  2095. // "name"
  2096. // ],
  2097. // "parameters": {
  2098. // "name": {
  2099. // "description": "Required. The configuration to get. An API resource name in the format\n`customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`.",
  2100. // "location": "path",
  2101. // "pattern": "^customers/[^/]+/configurations/[^/]+$",
  2102. // "required": true,
  2103. // "type": "string"
  2104. // }
  2105. // },
  2106. // "path": "v1/{+name}",
  2107. // "response": {
  2108. // "$ref": "Configuration"
  2109. // }
  2110. // }
  2111. }
  2112. // method id "androiddeviceprovisioning.customers.configurations.list":
  2113. type CustomersConfigurationsListCall struct {
  2114. s *Service
  2115. parent string
  2116. urlParams_ gensupport.URLParams
  2117. ifNoneMatch_ string
  2118. ctx_ context.Context
  2119. header_ http.Header
  2120. }
  2121. // List: Lists a customer's configurations.
  2122. func (r *CustomersConfigurationsService) List(parent string) *CustomersConfigurationsListCall {
  2123. c := &CustomersConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2124. c.parent = parent
  2125. return c
  2126. }
  2127. // Fields allows partial responses to be retrieved. See
  2128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2129. // for more information.
  2130. func (c *CustomersConfigurationsListCall) Fields(s ...googleapi.Field) *CustomersConfigurationsListCall {
  2131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2132. return c
  2133. }
  2134. // IfNoneMatch sets the optional parameter which makes the operation
  2135. // fail if the object's ETag matches the given value. This is useful for
  2136. // getting updates only after the object has changed since the last
  2137. // request. Use googleapi.IsNotModified to check whether the response
  2138. // error from Do is the result of In-None-Match.
  2139. func (c *CustomersConfigurationsListCall) IfNoneMatch(entityTag string) *CustomersConfigurationsListCall {
  2140. c.ifNoneMatch_ = entityTag
  2141. return c
  2142. }
  2143. // Context sets the context to be used in this call's Do method. Any
  2144. // pending HTTP request will be aborted if the provided context is
  2145. // canceled.
  2146. func (c *CustomersConfigurationsListCall) Context(ctx context.Context) *CustomersConfigurationsListCall {
  2147. c.ctx_ = ctx
  2148. return c
  2149. }
  2150. // Header returns an http.Header that can be modified by the caller to
  2151. // add HTTP headers to the request.
  2152. func (c *CustomersConfigurationsListCall) Header() http.Header {
  2153. if c.header_ == nil {
  2154. c.header_ = make(http.Header)
  2155. }
  2156. return c.header_
  2157. }
  2158. func (c *CustomersConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  2159. reqHeaders := make(http.Header)
  2160. for k, v := range c.header_ {
  2161. reqHeaders[k] = v
  2162. }
  2163. reqHeaders.Set("User-Agent", c.s.userAgent())
  2164. if c.ifNoneMatch_ != "" {
  2165. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2166. }
  2167. var body io.Reader = nil
  2168. c.urlParams_.Set("alt", alt)
  2169. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations")
  2170. urls += "?" + c.urlParams_.Encode()
  2171. req, _ := http.NewRequest("GET", urls, body)
  2172. req.Header = reqHeaders
  2173. googleapi.Expand(req.URL, map[string]string{
  2174. "parent": c.parent,
  2175. })
  2176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2177. }
  2178. // Do executes the "androiddeviceprovisioning.customers.configurations.list" call.
  2179. // Exactly one of *CustomerListConfigurationsResponse or error will be
  2180. // non-nil. Any non-2xx status code is an error. Response headers are in
  2181. // either *CustomerListConfigurationsResponse.ServerResponse.Header or
  2182. // (if a response was returned at all) in
  2183. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2184. // whether the returned error was because http.StatusNotModified was
  2185. // returned.
  2186. func (c *CustomersConfigurationsListCall) Do(opts ...googleapi.CallOption) (*CustomerListConfigurationsResponse, error) {
  2187. gensupport.SetOptions(c.urlParams_, opts...)
  2188. res, err := c.doRequest("json")
  2189. if res != nil && res.StatusCode == http.StatusNotModified {
  2190. if res.Body != nil {
  2191. res.Body.Close()
  2192. }
  2193. return nil, &googleapi.Error{
  2194. Code: res.StatusCode,
  2195. Header: res.Header,
  2196. }
  2197. }
  2198. if err != nil {
  2199. return nil, err
  2200. }
  2201. defer googleapi.CloseBody(res)
  2202. if err := googleapi.CheckResponse(res); err != nil {
  2203. return nil, err
  2204. }
  2205. ret := &CustomerListConfigurationsResponse{
  2206. ServerResponse: googleapi.ServerResponse{
  2207. Header: res.Header,
  2208. HTTPStatusCode: res.StatusCode,
  2209. },
  2210. }
  2211. target := &ret
  2212. if err := gensupport.DecodeResponse(target, res); err != nil {
  2213. return nil, err
  2214. }
  2215. return ret, nil
  2216. // {
  2217. // "description": "Lists a customer's configurations.",
  2218. // "flatPath": "v1/customers/{customersId}/configurations",
  2219. // "httpMethod": "GET",
  2220. // "id": "androiddeviceprovisioning.customers.configurations.list",
  2221. // "parameterOrder": [
  2222. // "parent"
  2223. // ],
  2224. // "parameters": {
  2225. // "parent": {
  2226. // "description": "Required. The customer that manages the listed configurations. An API\nresource name in the format `customers/[CUSTOMER_ID]`.",
  2227. // "location": "path",
  2228. // "pattern": "^customers/[^/]+$",
  2229. // "required": true,
  2230. // "type": "string"
  2231. // }
  2232. // },
  2233. // "path": "v1/{+parent}/configurations",
  2234. // "response": {
  2235. // "$ref": "CustomerListConfigurationsResponse"
  2236. // }
  2237. // }
  2238. }
  2239. // method id "androiddeviceprovisioning.customers.configurations.patch":
  2240. type CustomersConfigurationsPatchCall struct {
  2241. s *Service
  2242. name string
  2243. configuration *Configuration
  2244. urlParams_ gensupport.URLParams
  2245. ctx_ context.Context
  2246. header_ http.Header
  2247. }
  2248. // Patch: Updates a configuration's field values.
  2249. func (r *CustomersConfigurationsService) Patch(name string, configuration *Configuration) *CustomersConfigurationsPatchCall {
  2250. c := &CustomersConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2251. c.name = name
  2252. c.configuration = configuration
  2253. return c
  2254. }
  2255. // UpdateMask sets the optional parameter "updateMask": Required. The
  2256. // field mask applied to the target `Configuration` before
  2257. // updating the fields. To learn more about using field masks,
  2258. // read
  2259. // [FieldMask](/protocol-buffers/docs/reference/google.protobuf#fiel
  2260. // dmask) in
  2261. // the Protocol Buffers documentation.
  2262. func (c *CustomersConfigurationsPatchCall) UpdateMask(updateMask string) *CustomersConfigurationsPatchCall {
  2263. c.urlParams_.Set("updateMask", updateMask)
  2264. return c
  2265. }
  2266. // Fields allows partial responses to be retrieved. See
  2267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2268. // for more information.
  2269. func (c *CustomersConfigurationsPatchCall) Fields(s ...googleapi.Field) *CustomersConfigurationsPatchCall {
  2270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2271. return c
  2272. }
  2273. // Context sets the context to be used in this call's Do method. Any
  2274. // pending HTTP request will be aborted if the provided context is
  2275. // canceled.
  2276. func (c *CustomersConfigurationsPatchCall) Context(ctx context.Context) *CustomersConfigurationsPatchCall {
  2277. c.ctx_ = ctx
  2278. return c
  2279. }
  2280. // Header returns an http.Header that can be modified by the caller to
  2281. // add HTTP headers to the request.
  2282. func (c *CustomersConfigurationsPatchCall) Header() http.Header {
  2283. if c.header_ == nil {
  2284. c.header_ = make(http.Header)
  2285. }
  2286. return c.header_
  2287. }
  2288. func (c *CustomersConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  2289. reqHeaders := make(http.Header)
  2290. for k, v := range c.header_ {
  2291. reqHeaders[k] = v
  2292. }
  2293. reqHeaders.Set("User-Agent", c.s.userAgent())
  2294. var body io.Reader = nil
  2295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration)
  2296. if err != nil {
  2297. return nil, err
  2298. }
  2299. reqHeaders.Set("Content-Type", "application/json")
  2300. c.urlParams_.Set("alt", alt)
  2301. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2302. urls += "?" + c.urlParams_.Encode()
  2303. req, _ := http.NewRequest("PATCH", urls, body)
  2304. req.Header = reqHeaders
  2305. googleapi.Expand(req.URL, map[string]string{
  2306. "name": c.name,
  2307. })
  2308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2309. }
  2310. // Do executes the "androiddeviceprovisioning.customers.configurations.patch" call.
  2311. // Exactly one of *Configuration or error will be non-nil. Any non-2xx
  2312. // status code is an error. Response headers are in either
  2313. // *Configuration.ServerResponse.Header or (if a response was returned
  2314. // at all) in error.(*googleapi.Error).Header. Use
  2315. // googleapi.IsNotModified to check whether the returned error was
  2316. // because http.StatusNotModified was returned.
  2317. func (c *CustomersConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
  2318. gensupport.SetOptions(c.urlParams_, opts...)
  2319. res, err := c.doRequest("json")
  2320. if res != nil && res.StatusCode == http.StatusNotModified {
  2321. if res.Body != nil {
  2322. res.Body.Close()
  2323. }
  2324. return nil, &googleapi.Error{
  2325. Code: res.StatusCode,
  2326. Header: res.Header,
  2327. }
  2328. }
  2329. if err != nil {
  2330. return nil, err
  2331. }
  2332. defer googleapi.CloseBody(res)
  2333. if err := googleapi.CheckResponse(res); err != nil {
  2334. return nil, err
  2335. }
  2336. ret := &Configuration{
  2337. ServerResponse: googleapi.ServerResponse{
  2338. Header: res.Header,
  2339. HTTPStatusCode: res.StatusCode,
  2340. },
  2341. }
  2342. target := &ret
  2343. if err := gensupport.DecodeResponse(target, res); err != nil {
  2344. return nil, err
  2345. }
  2346. return ret, nil
  2347. // {
  2348. // "description": "Updates a configuration's field values.",
  2349. // "flatPath": "v1/customers/{customersId}/configurations/{configurationsId}",
  2350. // "httpMethod": "PATCH",
  2351. // "id": "androiddeviceprovisioning.customers.configurations.patch",
  2352. // "parameterOrder": [
  2353. // "name"
  2354. // ],
  2355. // "parameters": {
  2356. // "name": {
  2357. // "description": "Output only. The API resource name in the format\n`customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by\nthe server.",
  2358. // "location": "path",
  2359. // "pattern": "^customers/[^/]+/configurations/[^/]+$",
  2360. // "required": true,
  2361. // "type": "string"
  2362. // },
  2363. // "updateMask": {
  2364. // "description": "Required. The field mask applied to the target `Configuration` before\nupdating the fields. To learn more about using field masks, read\n[FieldMask](/protocol-buffers/docs/reference/google.protobuf#fieldmask) in\nthe Protocol Buffers documentation.",
  2365. // "format": "google-fieldmask",
  2366. // "location": "query",
  2367. // "type": "string"
  2368. // }
  2369. // },
  2370. // "path": "v1/{+name}",
  2371. // "request": {
  2372. // "$ref": "Configuration"
  2373. // },
  2374. // "response": {
  2375. // "$ref": "Configuration"
  2376. // }
  2377. // }
  2378. }
  2379. // method id "androiddeviceprovisioning.customers.devices.applyConfiguration":
  2380. type CustomersDevicesApplyConfigurationCall struct {
  2381. s *Service
  2382. parent string
  2383. customerapplyconfigurationrequest *CustomerApplyConfigurationRequest
  2384. urlParams_ gensupport.URLParams
  2385. ctx_ context.Context
  2386. header_ http.Header
  2387. }
  2388. // ApplyConfiguration: Applies a Configuration to the device to register
  2389. // the device for zero-touch
  2390. // enrollment. After applying a configuration to a device, the
  2391. // device
  2392. // automatically provisions itself on first boot, or next factory reset.
  2393. func (r *CustomersDevicesService) ApplyConfiguration(parent string, customerapplyconfigurationrequest *CustomerApplyConfigurationRequest) *CustomersDevicesApplyConfigurationCall {
  2394. c := &CustomersDevicesApplyConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2395. c.parent = parent
  2396. c.customerapplyconfigurationrequest = customerapplyconfigurationrequest
  2397. return c
  2398. }
  2399. // Fields allows partial responses to be retrieved. See
  2400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2401. // for more information.
  2402. func (c *CustomersDevicesApplyConfigurationCall) Fields(s ...googleapi.Field) *CustomersDevicesApplyConfigurationCall {
  2403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2404. return c
  2405. }
  2406. // Context sets the context to be used in this call's Do method. Any
  2407. // pending HTTP request will be aborted if the provided context is
  2408. // canceled.
  2409. func (c *CustomersDevicesApplyConfigurationCall) Context(ctx context.Context) *CustomersDevicesApplyConfigurationCall {
  2410. c.ctx_ = ctx
  2411. return c
  2412. }
  2413. // Header returns an http.Header that can be modified by the caller to
  2414. // add HTTP headers to the request.
  2415. func (c *CustomersDevicesApplyConfigurationCall) Header() http.Header {
  2416. if c.header_ == nil {
  2417. c.header_ = make(http.Header)
  2418. }
  2419. return c.header_
  2420. }
  2421. func (c *CustomersDevicesApplyConfigurationCall) doRequest(alt string) (*http.Response, error) {
  2422. reqHeaders := make(http.Header)
  2423. for k, v := range c.header_ {
  2424. reqHeaders[k] = v
  2425. }
  2426. reqHeaders.Set("User-Agent", c.s.userAgent())
  2427. var body io.Reader = nil
  2428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerapplyconfigurationrequest)
  2429. if err != nil {
  2430. return nil, err
  2431. }
  2432. reqHeaders.Set("Content-Type", "application/json")
  2433. c.urlParams_.Set("alt", alt)
  2434. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:applyConfiguration")
  2435. urls += "?" + c.urlParams_.Encode()
  2436. req, _ := http.NewRequest("POST", urls, body)
  2437. req.Header = reqHeaders
  2438. googleapi.Expand(req.URL, map[string]string{
  2439. "parent": c.parent,
  2440. })
  2441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2442. }
  2443. // Do executes the "androiddeviceprovisioning.customers.devices.applyConfiguration" call.
  2444. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2445. // code is an error. Response headers are in either
  2446. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2447. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2448. // check whether the returned error was because http.StatusNotModified
  2449. // was returned.
  2450. func (c *CustomersDevicesApplyConfigurationCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2451. gensupport.SetOptions(c.urlParams_, opts...)
  2452. res, err := c.doRequest("json")
  2453. if res != nil && res.StatusCode == http.StatusNotModified {
  2454. if res.Body != nil {
  2455. res.Body.Close()
  2456. }
  2457. return nil, &googleapi.Error{
  2458. Code: res.StatusCode,
  2459. Header: res.Header,
  2460. }
  2461. }
  2462. if err != nil {
  2463. return nil, err
  2464. }
  2465. defer googleapi.CloseBody(res)
  2466. if err := googleapi.CheckResponse(res); err != nil {
  2467. return nil, err
  2468. }
  2469. ret := &Empty{
  2470. ServerResponse: googleapi.ServerResponse{
  2471. Header: res.Header,
  2472. HTTPStatusCode: res.StatusCode,
  2473. },
  2474. }
  2475. target := &ret
  2476. if err := gensupport.DecodeResponse(target, res); err != nil {
  2477. return nil, err
  2478. }
  2479. return ret, nil
  2480. // {
  2481. // "description": "Applies a Configuration to the device to register the device for zero-touch\nenrollment. After applying a configuration to a device, the device\nautomatically provisions itself on first boot, or next factory reset.",
  2482. // "flatPath": "v1/customers/{customersId}/devices:applyConfiguration",
  2483. // "httpMethod": "POST",
  2484. // "id": "androiddeviceprovisioning.customers.devices.applyConfiguration",
  2485. // "parameterOrder": [
  2486. // "parent"
  2487. // ],
  2488. // "parameters": {
  2489. // "parent": {
  2490. // "description": "Required. The customer managing the device. An API resource name in the\nformat `customers/[CUSTOMER_ID]`.",
  2491. // "location": "path",
  2492. // "pattern": "^customers/[^/]+$",
  2493. // "required": true,
  2494. // "type": "string"
  2495. // }
  2496. // },
  2497. // "path": "v1/{+parent}/devices:applyConfiguration",
  2498. // "request": {
  2499. // "$ref": "CustomerApplyConfigurationRequest"
  2500. // },
  2501. // "response": {
  2502. // "$ref": "Empty"
  2503. // }
  2504. // }
  2505. }
  2506. // method id "androiddeviceprovisioning.customers.devices.get":
  2507. type CustomersDevicesGetCall struct {
  2508. s *Service
  2509. name string
  2510. urlParams_ gensupport.URLParams
  2511. ifNoneMatch_ string
  2512. ctx_ context.Context
  2513. header_ http.Header
  2514. }
  2515. // Get: Gets the details of a device.
  2516. func (r *CustomersDevicesService) Get(name string) *CustomersDevicesGetCall {
  2517. c := &CustomersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2518. c.name = name
  2519. return c
  2520. }
  2521. // Fields allows partial responses to be retrieved. See
  2522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2523. // for more information.
  2524. func (c *CustomersDevicesGetCall) Fields(s ...googleapi.Field) *CustomersDevicesGetCall {
  2525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2526. return c
  2527. }
  2528. // IfNoneMatch sets the optional parameter which makes the operation
  2529. // fail if the object's ETag matches the given value. This is useful for
  2530. // getting updates only after the object has changed since the last
  2531. // request. Use googleapi.IsNotModified to check whether the response
  2532. // error from Do is the result of In-None-Match.
  2533. func (c *CustomersDevicesGetCall) IfNoneMatch(entityTag string) *CustomersDevicesGetCall {
  2534. c.ifNoneMatch_ = entityTag
  2535. return c
  2536. }
  2537. // Context sets the context to be used in this call's Do method. Any
  2538. // pending HTTP request will be aborted if the provided context is
  2539. // canceled.
  2540. func (c *CustomersDevicesGetCall) Context(ctx context.Context) *CustomersDevicesGetCall {
  2541. c.ctx_ = ctx
  2542. return c
  2543. }
  2544. // Header returns an http.Header that can be modified by the caller to
  2545. // add HTTP headers to the request.
  2546. func (c *CustomersDevicesGetCall) Header() http.Header {
  2547. if c.header_ == nil {
  2548. c.header_ = make(http.Header)
  2549. }
  2550. return c.header_
  2551. }
  2552. func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
  2553. reqHeaders := make(http.Header)
  2554. for k, v := range c.header_ {
  2555. reqHeaders[k] = v
  2556. }
  2557. reqHeaders.Set("User-Agent", c.s.userAgent())
  2558. if c.ifNoneMatch_ != "" {
  2559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2560. }
  2561. var body io.Reader = nil
  2562. c.urlParams_.Set("alt", alt)
  2563. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2564. urls += "?" + c.urlParams_.Encode()
  2565. req, _ := http.NewRequest("GET", urls, body)
  2566. req.Header = reqHeaders
  2567. googleapi.Expand(req.URL, map[string]string{
  2568. "name": c.name,
  2569. })
  2570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2571. }
  2572. // Do executes the "androiddeviceprovisioning.customers.devices.get" call.
  2573. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  2574. // code is an error. Response headers are in either
  2575. // *Device.ServerResponse.Header or (if a response was returned at all)
  2576. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2577. // check whether the returned error was because http.StatusNotModified
  2578. // was returned.
  2579. func (c *CustomersDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  2580. gensupport.SetOptions(c.urlParams_, opts...)
  2581. res, err := c.doRequest("json")
  2582. if res != nil && res.StatusCode == http.StatusNotModified {
  2583. if res.Body != nil {
  2584. res.Body.Close()
  2585. }
  2586. return nil, &googleapi.Error{
  2587. Code: res.StatusCode,
  2588. Header: res.Header,
  2589. }
  2590. }
  2591. if err != nil {
  2592. return nil, err
  2593. }
  2594. defer googleapi.CloseBody(res)
  2595. if err := googleapi.CheckResponse(res); err != nil {
  2596. return nil, err
  2597. }
  2598. ret := &Device{
  2599. ServerResponse: googleapi.ServerResponse{
  2600. Header: res.Header,
  2601. HTTPStatusCode: res.StatusCode,
  2602. },
  2603. }
  2604. target := &ret
  2605. if err := gensupport.DecodeResponse(target, res); err != nil {
  2606. return nil, err
  2607. }
  2608. return ret, nil
  2609. // {
  2610. // "description": "Gets the details of a device.",
  2611. // "flatPath": "v1/customers/{customersId}/devices/{devicesId}",
  2612. // "httpMethod": "GET",
  2613. // "id": "androiddeviceprovisioning.customers.devices.get",
  2614. // "parameterOrder": [
  2615. // "name"
  2616. // ],
  2617. // "parameters": {
  2618. // "name": {
  2619. // "description": "Required. The device to get. An API resource name in the format\n`customers/[CUSTOMER_ID]/devices/[DEVICE_ID]`.",
  2620. // "location": "path",
  2621. // "pattern": "^customers/[^/]+/devices/[^/]+$",
  2622. // "required": true,
  2623. // "type": "string"
  2624. // }
  2625. // },
  2626. // "path": "v1/{+name}",
  2627. // "response": {
  2628. // "$ref": "Device"
  2629. // }
  2630. // }
  2631. }
  2632. // method id "androiddeviceprovisioning.customers.devices.list":
  2633. type CustomersDevicesListCall struct {
  2634. s *Service
  2635. parent string
  2636. urlParams_ gensupport.URLParams
  2637. ifNoneMatch_ string
  2638. ctx_ context.Context
  2639. header_ http.Header
  2640. }
  2641. // List: Lists a customer's devices.
  2642. func (r *CustomersDevicesService) List(parent string) *CustomersDevicesListCall {
  2643. c := &CustomersDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2644. c.parent = parent
  2645. return c
  2646. }
  2647. // PageSize sets the optional parameter "pageSize": The maximum number
  2648. // of devices to show in a page of results.
  2649. // Must be between 1 and 100 inclusive.
  2650. func (c *CustomersDevicesListCall) PageSize(pageSize int64) *CustomersDevicesListCall {
  2651. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2652. return c
  2653. }
  2654. // PageToken sets the optional parameter "pageToken": A token specifying
  2655. // which result page to return.
  2656. func (c *CustomersDevicesListCall) PageToken(pageToken string) *CustomersDevicesListCall {
  2657. c.urlParams_.Set("pageToken", pageToken)
  2658. return c
  2659. }
  2660. // Fields allows partial responses to be retrieved. See
  2661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2662. // for more information.
  2663. func (c *CustomersDevicesListCall) Fields(s ...googleapi.Field) *CustomersDevicesListCall {
  2664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2665. return c
  2666. }
  2667. // IfNoneMatch sets the optional parameter which makes the operation
  2668. // fail if the object's ETag matches the given value. This is useful for
  2669. // getting updates only after the object has changed since the last
  2670. // request. Use googleapi.IsNotModified to check whether the response
  2671. // error from Do is the result of In-None-Match.
  2672. func (c *CustomersDevicesListCall) IfNoneMatch(entityTag string) *CustomersDevicesListCall {
  2673. c.ifNoneMatch_ = entityTag
  2674. return c
  2675. }
  2676. // Context sets the context to be used in this call's Do method. Any
  2677. // pending HTTP request will be aborted if the provided context is
  2678. // canceled.
  2679. func (c *CustomersDevicesListCall) Context(ctx context.Context) *CustomersDevicesListCall {
  2680. c.ctx_ = ctx
  2681. return c
  2682. }
  2683. // Header returns an http.Header that can be modified by the caller to
  2684. // add HTTP headers to the request.
  2685. func (c *CustomersDevicesListCall) Header() http.Header {
  2686. if c.header_ == nil {
  2687. c.header_ = make(http.Header)
  2688. }
  2689. return c.header_
  2690. }
  2691. func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) {
  2692. reqHeaders := make(http.Header)
  2693. for k, v := range c.header_ {
  2694. reqHeaders[k] = v
  2695. }
  2696. reqHeaders.Set("User-Agent", c.s.userAgent())
  2697. if c.ifNoneMatch_ != "" {
  2698. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2699. }
  2700. var body io.Reader = nil
  2701. c.urlParams_.Set("alt", alt)
  2702. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices")
  2703. urls += "?" + c.urlParams_.Encode()
  2704. req, _ := http.NewRequest("GET", urls, body)
  2705. req.Header = reqHeaders
  2706. googleapi.Expand(req.URL, map[string]string{
  2707. "parent": c.parent,
  2708. })
  2709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2710. }
  2711. // Do executes the "androiddeviceprovisioning.customers.devices.list" call.
  2712. // Exactly one of *CustomerListDevicesResponse or error will be non-nil.
  2713. // Any non-2xx status code is an error. Response headers are in either
  2714. // *CustomerListDevicesResponse.ServerResponse.Header or (if a response
  2715. // was returned at all) in error.(*googleapi.Error).Header. Use
  2716. // googleapi.IsNotModified to check whether the returned error was
  2717. // because http.StatusNotModified was returned.
  2718. func (c *CustomersDevicesListCall) Do(opts ...googleapi.CallOption) (*CustomerListDevicesResponse, error) {
  2719. gensupport.SetOptions(c.urlParams_, opts...)
  2720. res, err := c.doRequest("json")
  2721. if res != nil && res.StatusCode == http.StatusNotModified {
  2722. if res.Body != nil {
  2723. res.Body.Close()
  2724. }
  2725. return nil, &googleapi.Error{
  2726. Code: res.StatusCode,
  2727. Header: res.Header,
  2728. }
  2729. }
  2730. if err != nil {
  2731. return nil, err
  2732. }
  2733. defer googleapi.CloseBody(res)
  2734. if err := googleapi.CheckResponse(res); err != nil {
  2735. return nil, err
  2736. }
  2737. ret := &CustomerListDevicesResponse{
  2738. ServerResponse: googleapi.ServerResponse{
  2739. Header: res.Header,
  2740. HTTPStatusCode: res.StatusCode,
  2741. },
  2742. }
  2743. target := &ret
  2744. if err := gensupport.DecodeResponse(target, res); err != nil {
  2745. return nil, err
  2746. }
  2747. return ret, nil
  2748. // {
  2749. // "description": "Lists a customer's devices.",
  2750. // "flatPath": "v1/customers/{customersId}/devices",
  2751. // "httpMethod": "GET",
  2752. // "id": "androiddeviceprovisioning.customers.devices.list",
  2753. // "parameterOrder": [
  2754. // "parent"
  2755. // ],
  2756. // "parameters": {
  2757. // "pageSize": {
  2758. // "description": "The maximum number of devices to show in a page of results.\nMust be between 1 and 100 inclusive.",
  2759. // "format": "int64",
  2760. // "location": "query",
  2761. // "type": "string"
  2762. // },
  2763. // "pageToken": {
  2764. // "description": "A token specifying which result page to return.",
  2765. // "location": "query",
  2766. // "type": "string"
  2767. // },
  2768. // "parent": {
  2769. // "description": "Required. The customer managing the devices. An API resource name in the\nformat `customers/[CUSTOMER_ID]`.",
  2770. // "location": "path",
  2771. // "pattern": "^customers/[^/]+$",
  2772. // "required": true,
  2773. // "type": "string"
  2774. // }
  2775. // },
  2776. // "path": "v1/{+parent}/devices",
  2777. // "response": {
  2778. // "$ref": "CustomerListDevicesResponse"
  2779. // }
  2780. // }
  2781. }
  2782. // Pages invokes f for each page of results.
  2783. // A non-nil error returned from f will halt the iteration.
  2784. // The provided context supersedes any context provided to the Context method.
  2785. func (c *CustomersDevicesListCall) Pages(ctx context.Context, f func(*CustomerListDevicesResponse) error) error {
  2786. c.ctx_ = ctx
  2787. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2788. for {
  2789. x, err := c.Do()
  2790. if err != nil {
  2791. return err
  2792. }
  2793. if err := f(x); err != nil {
  2794. return err
  2795. }
  2796. if x.NextPageToken == "" {
  2797. return nil
  2798. }
  2799. c.PageToken(x.NextPageToken)
  2800. }
  2801. }
  2802. // method id "androiddeviceprovisioning.customers.devices.removeConfiguration":
  2803. type CustomersDevicesRemoveConfigurationCall struct {
  2804. s *Service
  2805. parent string
  2806. customerremoveconfigurationrequest *CustomerRemoveConfigurationRequest
  2807. urlParams_ gensupport.URLParams
  2808. ctx_ context.Context
  2809. header_ http.Header
  2810. }
  2811. // RemoveConfiguration: Removes a configuration from device.
  2812. func (r *CustomersDevicesService) RemoveConfiguration(parent string, customerremoveconfigurationrequest *CustomerRemoveConfigurationRequest) *CustomersDevicesRemoveConfigurationCall {
  2813. c := &CustomersDevicesRemoveConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2814. c.parent = parent
  2815. c.customerremoveconfigurationrequest = customerremoveconfigurationrequest
  2816. return c
  2817. }
  2818. // Fields allows partial responses to be retrieved. See
  2819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2820. // for more information.
  2821. func (c *CustomersDevicesRemoveConfigurationCall) Fields(s ...googleapi.Field) *CustomersDevicesRemoveConfigurationCall {
  2822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2823. return c
  2824. }
  2825. // Context sets the context to be used in this call's Do method. Any
  2826. // pending HTTP request will be aborted if the provided context is
  2827. // canceled.
  2828. func (c *CustomersDevicesRemoveConfigurationCall) Context(ctx context.Context) *CustomersDevicesRemoveConfigurationCall {
  2829. c.ctx_ = ctx
  2830. return c
  2831. }
  2832. // Header returns an http.Header that can be modified by the caller to
  2833. // add HTTP headers to the request.
  2834. func (c *CustomersDevicesRemoveConfigurationCall) Header() http.Header {
  2835. if c.header_ == nil {
  2836. c.header_ = make(http.Header)
  2837. }
  2838. return c.header_
  2839. }
  2840. func (c *CustomersDevicesRemoveConfigurationCall) doRequest(alt string) (*http.Response, error) {
  2841. reqHeaders := make(http.Header)
  2842. for k, v := range c.header_ {
  2843. reqHeaders[k] = v
  2844. }
  2845. reqHeaders.Set("User-Agent", c.s.userAgent())
  2846. var body io.Reader = nil
  2847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerremoveconfigurationrequest)
  2848. if err != nil {
  2849. return nil, err
  2850. }
  2851. reqHeaders.Set("Content-Type", "application/json")
  2852. c.urlParams_.Set("alt", alt)
  2853. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:removeConfiguration")
  2854. urls += "?" + c.urlParams_.Encode()
  2855. req, _ := http.NewRequest("POST", urls, body)
  2856. req.Header = reqHeaders
  2857. googleapi.Expand(req.URL, map[string]string{
  2858. "parent": c.parent,
  2859. })
  2860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2861. }
  2862. // Do executes the "androiddeviceprovisioning.customers.devices.removeConfiguration" call.
  2863. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2864. // code is an error. Response headers are in either
  2865. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2866. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2867. // check whether the returned error was because http.StatusNotModified
  2868. // was returned.
  2869. func (c *CustomersDevicesRemoveConfigurationCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2870. gensupport.SetOptions(c.urlParams_, opts...)
  2871. res, err := c.doRequest("json")
  2872. if res != nil && res.StatusCode == http.StatusNotModified {
  2873. if res.Body != nil {
  2874. res.Body.Close()
  2875. }
  2876. return nil, &googleapi.Error{
  2877. Code: res.StatusCode,
  2878. Header: res.Header,
  2879. }
  2880. }
  2881. if err != nil {
  2882. return nil, err
  2883. }
  2884. defer googleapi.CloseBody(res)
  2885. if err := googleapi.CheckResponse(res); err != nil {
  2886. return nil, err
  2887. }
  2888. ret := &Empty{
  2889. ServerResponse: googleapi.ServerResponse{
  2890. Header: res.Header,
  2891. HTTPStatusCode: res.StatusCode,
  2892. },
  2893. }
  2894. target := &ret
  2895. if err := gensupport.DecodeResponse(target, res); err != nil {
  2896. return nil, err
  2897. }
  2898. return ret, nil
  2899. // {
  2900. // "description": "Removes a configuration from device.",
  2901. // "flatPath": "v1/customers/{customersId}/devices:removeConfiguration",
  2902. // "httpMethod": "POST",
  2903. // "id": "androiddeviceprovisioning.customers.devices.removeConfiguration",
  2904. // "parameterOrder": [
  2905. // "parent"
  2906. // ],
  2907. // "parameters": {
  2908. // "parent": {
  2909. // "description": "Required. The customer managing the device in the format\n`customers/[CUSTOMER_ID]`.",
  2910. // "location": "path",
  2911. // "pattern": "^customers/[^/]+$",
  2912. // "required": true,
  2913. // "type": "string"
  2914. // }
  2915. // },
  2916. // "path": "v1/{+parent}/devices:removeConfiguration",
  2917. // "request": {
  2918. // "$ref": "CustomerRemoveConfigurationRequest"
  2919. // },
  2920. // "response": {
  2921. // "$ref": "Empty"
  2922. // }
  2923. // }
  2924. }
  2925. // method id "androiddeviceprovisioning.customers.devices.unclaim":
  2926. type CustomersDevicesUnclaimCall struct {
  2927. s *Service
  2928. parent string
  2929. customerunclaimdevicerequest *CustomerUnclaimDeviceRequest
  2930. urlParams_ gensupport.URLParams
  2931. ctx_ context.Context
  2932. header_ http.Header
  2933. }
  2934. // Unclaim: Unclaims a device from a customer and removes it from
  2935. // zero-touch
  2936. // enrollment.
  2937. //
  2938. // After removing a device, a customer must contact their reseller to
  2939. // register
  2940. // the device into zero-touch enrollment again.
  2941. func (r *CustomersDevicesService) Unclaim(parent string, customerunclaimdevicerequest *CustomerUnclaimDeviceRequest) *CustomersDevicesUnclaimCall {
  2942. c := &CustomersDevicesUnclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2943. c.parent = parent
  2944. c.customerunclaimdevicerequest = customerunclaimdevicerequest
  2945. return c
  2946. }
  2947. // Fields allows partial responses to be retrieved. See
  2948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2949. // for more information.
  2950. func (c *CustomersDevicesUnclaimCall) Fields(s ...googleapi.Field) *CustomersDevicesUnclaimCall {
  2951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2952. return c
  2953. }
  2954. // Context sets the context to be used in this call's Do method. Any
  2955. // pending HTTP request will be aborted if the provided context is
  2956. // canceled.
  2957. func (c *CustomersDevicesUnclaimCall) Context(ctx context.Context) *CustomersDevicesUnclaimCall {
  2958. c.ctx_ = ctx
  2959. return c
  2960. }
  2961. // Header returns an http.Header that can be modified by the caller to
  2962. // add HTTP headers to the request.
  2963. func (c *CustomersDevicesUnclaimCall) Header() http.Header {
  2964. if c.header_ == nil {
  2965. c.header_ = make(http.Header)
  2966. }
  2967. return c.header_
  2968. }
  2969. func (c *CustomersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) {
  2970. reqHeaders := make(http.Header)
  2971. for k, v := range c.header_ {
  2972. reqHeaders[k] = v
  2973. }
  2974. reqHeaders.Set("User-Agent", c.s.userAgent())
  2975. var body io.Reader = nil
  2976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerunclaimdevicerequest)
  2977. if err != nil {
  2978. return nil, err
  2979. }
  2980. reqHeaders.Set("Content-Type", "application/json")
  2981. c.urlParams_.Set("alt", alt)
  2982. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:unclaim")
  2983. urls += "?" + c.urlParams_.Encode()
  2984. req, _ := http.NewRequest("POST", urls, body)
  2985. req.Header = reqHeaders
  2986. googleapi.Expand(req.URL, map[string]string{
  2987. "parent": c.parent,
  2988. })
  2989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2990. }
  2991. // Do executes the "androiddeviceprovisioning.customers.devices.unclaim" call.
  2992. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2993. // code is an error. Response headers are in either
  2994. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2995. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2996. // check whether the returned error was because http.StatusNotModified
  2997. // was returned.
  2998. func (c *CustomersDevicesUnclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2999. gensupport.SetOptions(c.urlParams_, opts...)
  3000. res, err := c.doRequest("json")
  3001. if res != nil && res.StatusCode == http.StatusNotModified {
  3002. if res.Body != nil {
  3003. res.Body.Close()
  3004. }
  3005. return nil, &googleapi.Error{
  3006. Code: res.StatusCode,
  3007. Header: res.Header,
  3008. }
  3009. }
  3010. if err != nil {
  3011. return nil, err
  3012. }
  3013. defer googleapi.CloseBody(res)
  3014. if err := googleapi.CheckResponse(res); err != nil {
  3015. return nil, err
  3016. }
  3017. ret := &Empty{
  3018. ServerResponse: googleapi.ServerResponse{
  3019. Header: res.Header,
  3020. HTTPStatusCode: res.StatusCode,
  3021. },
  3022. }
  3023. target := &ret
  3024. if err := gensupport.DecodeResponse(target, res); err != nil {
  3025. return nil, err
  3026. }
  3027. return ret, nil
  3028. // {
  3029. // "description": "Unclaims a device from a customer and removes it from zero-touch\nenrollment.\n\nAfter removing a device, a customer must contact their reseller to register\nthe device into zero-touch enrollment again.",
  3030. // "flatPath": "v1/customers/{customersId}/devices:unclaim",
  3031. // "httpMethod": "POST",
  3032. // "id": "androiddeviceprovisioning.customers.devices.unclaim",
  3033. // "parameterOrder": [
  3034. // "parent"
  3035. // ],
  3036. // "parameters": {
  3037. // "parent": {
  3038. // "description": "Required. The customer managing the device. An API resource name in the\nformat `customers/[CUSTOMER_ID]`.",
  3039. // "location": "path",
  3040. // "pattern": "^customers/[^/]+$",
  3041. // "required": true,
  3042. // "type": "string"
  3043. // }
  3044. // },
  3045. // "path": "v1/{+parent}/devices:unclaim",
  3046. // "request": {
  3047. // "$ref": "CustomerUnclaimDeviceRequest"
  3048. // },
  3049. // "response": {
  3050. // "$ref": "Empty"
  3051. // }
  3052. // }
  3053. }
  3054. // method id "androiddeviceprovisioning.customers.dpcs.list":
  3055. type CustomersDpcsListCall struct {
  3056. s *Service
  3057. parent string
  3058. urlParams_ gensupport.URLParams
  3059. ifNoneMatch_ string
  3060. ctx_ context.Context
  3061. header_ http.Header
  3062. }
  3063. // List: Lists the DPCs (device policy controllers) that support
  3064. // zero-touch
  3065. // enrollment.
  3066. func (r *CustomersDpcsService) List(parent string) *CustomersDpcsListCall {
  3067. c := &CustomersDpcsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3068. c.parent = parent
  3069. return c
  3070. }
  3071. // Fields allows partial responses to be retrieved. See
  3072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3073. // for more information.
  3074. func (c *CustomersDpcsListCall) Fields(s ...googleapi.Field) *CustomersDpcsListCall {
  3075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3076. return c
  3077. }
  3078. // IfNoneMatch sets the optional parameter which makes the operation
  3079. // fail if the object's ETag matches the given value. This is useful for
  3080. // getting updates only after the object has changed since the last
  3081. // request. Use googleapi.IsNotModified to check whether the response
  3082. // error from Do is the result of In-None-Match.
  3083. func (c *CustomersDpcsListCall) IfNoneMatch(entityTag string) *CustomersDpcsListCall {
  3084. c.ifNoneMatch_ = entityTag
  3085. return c
  3086. }
  3087. // Context sets the context to be used in this call's Do method. Any
  3088. // pending HTTP request will be aborted if the provided context is
  3089. // canceled.
  3090. func (c *CustomersDpcsListCall) Context(ctx context.Context) *CustomersDpcsListCall {
  3091. c.ctx_ = ctx
  3092. return c
  3093. }
  3094. // Header returns an http.Header that can be modified by the caller to
  3095. // add HTTP headers to the request.
  3096. func (c *CustomersDpcsListCall) Header() http.Header {
  3097. if c.header_ == nil {
  3098. c.header_ = make(http.Header)
  3099. }
  3100. return c.header_
  3101. }
  3102. func (c *CustomersDpcsListCall) doRequest(alt string) (*http.Response, error) {
  3103. reqHeaders := make(http.Header)
  3104. for k, v := range c.header_ {
  3105. reqHeaders[k] = v
  3106. }
  3107. reqHeaders.Set("User-Agent", c.s.userAgent())
  3108. if c.ifNoneMatch_ != "" {
  3109. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3110. }
  3111. var body io.Reader = nil
  3112. c.urlParams_.Set("alt", alt)
  3113. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dpcs")
  3114. urls += "?" + c.urlParams_.Encode()
  3115. req, _ := http.NewRequest("GET", urls, body)
  3116. req.Header = reqHeaders
  3117. googleapi.Expand(req.URL, map[string]string{
  3118. "parent": c.parent,
  3119. })
  3120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3121. }
  3122. // Do executes the "androiddeviceprovisioning.customers.dpcs.list" call.
  3123. // Exactly one of *CustomerListDpcsResponse or error will be non-nil.
  3124. // Any non-2xx status code is an error. Response headers are in either
  3125. // *CustomerListDpcsResponse.ServerResponse.Header or (if a response was
  3126. // returned at all) in error.(*googleapi.Error).Header. Use
  3127. // googleapi.IsNotModified to check whether the returned error was
  3128. // because http.StatusNotModified was returned.
  3129. func (c *CustomersDpcsListCall) Do(opts ...googleapi.CallOption) (*CustomerListDpcsResponse, error) {
  3130. gensupport.SetOptions(c.urlParams_, opts...)
  3131. res, err := c.doRequest("json")
  3132. if res != nil && res.StatusCode == http.StatusNotModified {
  3133. if res.Body != nil {
  3134. res.Body.Close()
  3135. }
  3136. return nil, &googleapi.Error{
  3137. Code: res.StatusCode,
  3138. Header: res.Header,
  3139. }
  3140. }
  3141. if err != nil {
  3142. return nil, err
  3143. }
  3144. defer googleapi.CloseBody(res)
  3145. if err := googleapi.CheckResponse(res); err != nil {
  3146. return nil, err
  3147. }
  3148. ret := &CustomerListDpcsResponse{
  3149. ServerResponse: googleapi.ServerResponse{
  3150. Header: res.Header,
  3151. HTTPStatusCode: res.StatusCode,
  3152. },
  3153. }
  3154. target := &ret
  3155. if err := gensupport.DecodeResponse(target, res); err != nil {
  3156. return nil, err
  3157. }
  3158. return ret, nil
  3159. // {
  3160. // "description": "Lists the DPCs (device policy controllers) that support zero-touch\nenrollment.",
  3161. // "flatPath": "v1/customers/{customersId}/dpcs",
  3162. // "httpMethod": "GET",
  3163. // "id": "androiddeviceprovisioning.customers.dpcs.list",
  3164. // "parameterOrder": [
  3165. // "parent"
  3166. // ],
  3167. // "parameters": {
  3168. // "parent": {
  3169. // "description": "Required. The customer that can use the DPCs in configurations. An API\nresource name in the format `customers/[CUSTOMER_ID]`.",
  3170. // "location": "path",
  3171. // "pattern": "^customers/[^/]+$",
  3172. // "required": true,
  3173. // "type": "string"
  3174. // }
  3175. // },
  3176. // "path": "v1/{+parent}/dpcs",
  3177. // "response": {
  3178. // "$ref": "CustomerListDpcsResponse"
  3179. // }
  3180. // }
  3181. }
  3182. // method id "androiddeviceprovisioning.operations.get":
  3183. type OperationsGetCall struct {
  3184. s *Service
  3185. name string
  3186. urlParams_ gensupport.URLParams
  3187. ifNoneMatch_ string
  3188. ctx_ context.Context
  3189. header_ http.Header
  3190. }
  3191. // Get: Gets the latest state of a long-running operation. Clients can
  3192. // use this
  3193. // method to poll the operation result at intervals as recommended by
  3194. // the API
  3195. // service.
  3196. func (r *OperationsService) Get(name string) *OperationsGetCall {
  3197. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3198. c.name = name
  3199. return c
  3200. }
  3201. // Fields allows partial responses to be retrieved. See
  3202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3203. // for more information.
  3204. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  3205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3206. return c
  3207. }
  3208. // IfNoneMatch sets the optional parameter which makes the operation
  3209. // fail if the object's ETag matches the given value. This is useful for
  3210. // getting updates only after the object has changed since the last
  3211. // request. Use googleapi.IsNotModified to check whether the response
  3212. // error from Do is the result of In-None-Match.
  3213. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  3214. c.ifNoneMatch_ = entityTag
  3215. return c
  3216. }
  3217. // Context sets the context to be used in this call's Do method. Any
  3218. // pending HTTP request will be aborted if the provided context is
  3219. // canceled.
  3220. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  3221. c.ctx_ = ctx
  3222. return c
  3223. }
  3224. // Header returns an http.Header that can be modified by the caller to
  3225. // add HTTP headers to the request.
  3226. func (c *OperationsGetCall) Header() http.Header {
  3227. if c.header_ == nil {
  3228. c.header_ = make(http.Header)
  3229. }
  3230. return c.header_
  3231. }
  3232. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  3233. reqHeaders := make(http.Header)
  3234. for k, v := range c.header_ {
  3235. reqHeaders[k] = v
  3236. }
  3237. reqHeaders.Set("User-Agent", c.s.userAgent())
  3238. if c.ifNoneMatch_ != "" {
  3239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3240. }
  3241. var body io.Reader = nil
  3242. c.urlParams_.Set("alt", alt)
  3243. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3244. urls += "?" + c.urlParams_.Encode()
  3245. req, _ := http.NewRequest("GET", urls, body)
  3246. req.Header = reqHeaders
  3247. googleapi.Expand(req.URL, map[string]string{
  3248. "name": c.name,
  3249. })
  3250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3251. }
  3252. // Do executes the "androiddeviceprovisioning.operations.get" call.
  3253. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3254. // status code is an error. Response headers are in either
  3255. // *Operation.ServerResponse.Header or (if a response was returned at
  3256. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3257. // to check whether the returned error was because
  3258. // http.StatusNotModified was returned.
  3259. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3260. gensupport.SetOptions(c.urlParams_, opts...)
  3261. res, err := c.doRequest("json")
  3262. if res != nil && res.StatusCode == http.StatusNotModified {
  3263. if res.Body != nil {
  3264. res.Body.Close()
  3265. }
  3266. return nil, &googleapi.Error{
  3267. Code: res.StatusCode,
  3268. Header: res.Header,
  3269. }
  3270. }
  3271. if err != nil {
  3272. return nil, err
  3273. }
  3274. defer googleapi.CloseBody(res)
  3275. if err := googleapi.CheckResponse(res); err != nil {
  3276. return nil, err
  3277. }
  3278. ret := &Operation{
  3279. ServerResponse: googleapi.ServerResponse{
  3280. Header: res.Header,
  3281. HTTPStatusCode: res.StatusCode,
  3282. },
  3283. }
  3284. target := &ret
  3285. if err := gensupport.DecodeResponse(target, res); err != nil {
  3286. return nil, err
  3287. }
  3288. return ret, nil
  3289. // {
  3290. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  3291. // "flatPath": "v1/operations/{operationsId}",
  3292. // "httpMethod": "GET",
  3293. // "id": "androiddeviceprovisioning.operations.get",
  3294. // "parameterOrder": [
  3295. // "name"
  3296. // ],
  3297. // "parameters": {
  3298. // "name": {
  3299. // "description": "The name of the operation resource.",
  3300. // "location": "path",
  3301. // "pattern": "^operations/.+$",
  3302. // "required": true,
  3303. // "type": "string"
  3304. // }
  3305. // },
  3306. // "path": "v1/{+name}",
  3307. // "response": {
  3308. // "$ref": "Operation"
  3309. // }
  3310. // }
  3311. }
  3312. // method id "androiddeviceprovisioning.partners.customers.create":
  3313. type PartnersCustomersCreateCall struct {
  3314. s *Service
  3315. parent string
  3316. createcustomerrequest *CreateCustomerRequest
  3317. urlParams_ gensupport.URLParams
  3318. ctx_ context.Context
  3319. header_ http.Header
  3320. }
  3321. // Create: Creates a customer for zero-touch enrollment. After the
  3322. // method returns
  3323. // successfully, admin and owner roles can manage devices and EMM
  3324. // configs
  3325. // by calling API methods or using their zero-touch enrollment portal.
  3326. // The API
  3327. // doesn't notify the customer that they have access.
  3328. func (r *PartnersCustomersService) Create(parent string, createcustomerrequest *CreateCustomerRequest) *PartnersCustomersCreateCall {
  3329. c := &PartnersCustomersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3330. c.parent = parent
  3331. c.createcustomerrequest = createcustomerrequest
  3332. return c
  3333. }
  3334. // Fields allows partial responses to be retrieved. See
  3335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3336. // for more information.
  3337. func (c *PartnersCustomersCreateCall) Fields(s ...googleapi.Field) *PartnersCustomersCreateCall {
  3338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3339. return c
  3340. }
  3341. // Context sets the context to be used in this call's Do method. Any
  3342. // pending HTTP request will be aborted if the provided context is
  3343. // canceled.
  3344. func (c *PartnersCustomersCreateCall) Context(ctx context.Context) *PartnersCustomersCreateCall {
  3345. c.ctx_ = ctx
  3346. return c
  3347. }
  3348. // Header returns an http.Header that can be modified by the caller to
  3349. // add HTTP headers to the request.
  3350. func (c *PartnersCustomersCreateCall) Header() http.Header {
  3351. if c.header_ == nil {
  3352. c.header_ = make(http.Header)
  3353. }
  3354. return c.header_
  3355. }
  3356. func (c *PartnersCustomersCreateCall) doRequest(alt string) (*http.Response, error) {
  3357. reqHeaders := make(http.Header)
  3358. for k, v := range c.header_ {
  3359. reqHeaders[k] = v
  3360. }
  3361. reqHeaders.Set("User-Agent", c.s.userAgent())
  3362. var body io.Reader = nil
  3363. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcustomerrequest)
  3364. if err != nil {
  3365. return nil, err
  3366. }
  3367. reqHeaders.Set("Content-Type", "application/json")
  3368. c.urlParams_.Set("alt", alt)
  3369. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers")
  3370. urls += "?" + c.urlParams_.Encode()
  3371. req, _ := http.NewRequest("POST", urls, body)
  3372. req.Header = reqHeaders
  3373. googleapi.Expand(req.URL, map[string]string{
  3374. "parent": c.parent,
  3375. })
  3376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3377. }
  3378. // Do executes the "androiddeviceprovisioning.partners.customers.create" call.
  3379. // Exactly one of *Company or error will be non-nil. Any non-2xx status
  3380. // code is an error. Response headers are in either
  3381. // *Company.ServerResponse.Header or (if a response was returned at all)
  3382. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3383. // check whether the returned error was because http.StatusNotModified
  3384. // was returned.
  3385. func (c *PartnersCustomersCreateCall) Do(opts ...googleapi.CallOption) (*Company, error) {
  3386. gensupport.SetOptions(c.urlParams_, opts...)
  3387. res, err := c.doRequest("json")
  3388. if res != nil && res.StatusCode == http.StatusNotModified {
  3389. if res.Body != nil {
  3390. res.Body.Close()
  3391. }
  3392. return nil, &googleapi.Error{
  3393. Code: res.StatusCode,
  3394. Header: res.Header,
  3395. }
  3396. }
  3397. if err != nil {
  3398. return nil, err
  3399. }
  3400. defer googleapi.CloseBody(res)
  3401. if err := googleapi.CheckResponse(res); err != nil {
  3402. return nil, err
  3403. }
  3404. ret := &Company{
  3405. ServerResponse: googleapi.ServerResponse{
  3406. Header: res.Header,
  3407. HTTPStatusCode: res.StatusCode,
  3408. },
  3409. }
  3410. target := &ret
  3411. if err := gensupport.DecodeResponse(target, res); err != nil {
  3412. return nil, err
  3413. }
  3414. return ret, nil
  3415. // {
  3416. // "description": "Creates a customer for zero-touch enrollment. After the method returns\nsuccessfully, admin and owner roles can manage devices and EMM configs\nby calling API methods or using their zero-touch enrollment portal. The API\ndoesn't notify the customer that they have access.",
  3417. // "flatPath": "v1/partners/{partnersId}/customers",
  3418. // "httpMethod": "POST",
  3419. // "id": "androiddeviceprovisioning.partners.customers.create",
  3420. // "parameterOrder": [
  3421. // "parent"
  3422. // ],
  3423. // "parameters": {
  3424. // "parent": {
  3425. // "description": "Required. The parent resource ID in the format `partners/[PARTNER_ID]` that\nidentifies the reseller.",
  3426. // "location": "path",
  3427. // "pattern": "^partners/[^/]+$",
  3428. // "required": true,
  3429. // "type": "string"
  3430. // }
  3431. // },
  3432. // "path": "v1/{+parent}/customers",
  3433. // "request": {
  3434. // "$ref": "CreateCustomerRequest"
  3435. // },
  3436. // "response": {
  3437. // "$ref": "Company"
  3438. // }
  3439. // }
  3440. }
  3441. // method id "androiddeviceprovisioning.partners.customers.list":
  3442. type PartnersCustomersListCall struct {
  3443. s *Service
  3444. partnerId int64
  3445. urlParams_ gensupport.URLParams
  3446. ifNoneMatch_ string
  3447. ctx_ context.Context
  3448. header_ http.Header
  3449. }
  3450. // List: Lists the customers that are enrolled to the reseller
  3451. // identified by the
  3452. // `partnerId` argument. This list includes customers that the
  3453. // reseller
  3454. // created and customers that enrolled themselves using the portal.
  3455. func (r *PartnersCustomersService) List(partnerId int64) *PartnersCustomersListCall {
  3456. c := &PartnersCustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3457. c.partnerId = partnerId
  3458. return c
  3459. }
  3460. // Fields allows partial responses to be retrieved. See
  3461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3462. // for more information.
  3463. func (c *PartnersCustomersListCall) Fields(s ...googleapi.Field) *PartnersCustomersListCall {
  3464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3465. return c
  3466. }
  3467. // IfNoneMatch sets the optional parameter which makes the operation
  3468. // fail if the object's ETag matches the given value. This is useful for
  3469. // getting updates only after the object has changed since the last
  3470. // request. Use googleapi.IsNotModified to check whether the response
  3471. // error from Do is the result of In-None-Match.
  3472. func (c *PartnersCustomersListCall) IfNoneMatch(entityTag string) *PartnersCustomersListCall {
  3473. c.ifNoneMatch_ = entityTag
  3474. return c
  3475. }
  3476. // Context sets the context to be used in this call's Do method. Any
  3477. // pending HTTP request will be aborted if the provided context is
  3478. // canceled.
  3479. func (c *PartnersCustomersListCall) Context(ctx context.Context) *PartnersCustomersListCall {
  3480. c.ctx_ = ctx
  3481. return c
  3482. }
  3483. // Header returns an http.Header that can be modified by the caller to
  3484. // add HTTP headers to the request.
  3485. func (c *PartnersCustomersListCall) Header() http.Header {
  3486. if c.header_ == nil {
  3487. c.header_ = make(http.Header)
  3488. }
  3489. return c.header_
  3490. }
  3491. func (c *PartnersCustomersListCall) doRequest(alt string) (*http.Response, error) {
  3492. reqHeaders := make(http.Header)
  3493. for k, v := range c.header_ {
  3494. reqHeaders[k] = v
  3495. }
  3496. reqHeaders.Set("User-Agent", c.s.userAgent())
  3497. if c.ifNoneMatch_ != "" {
  3498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3499. }
  3500. var body io.Reader = nil
  3501. c.urlParams_.Set("alt", alt)
  3502. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/customers")
  3503. urls += "?" + c.urlParams_.Encode()
  3504. req, _ := http.NewRequest("GET", urls, body)
  3505. req.Header = reqHeaders
  3506. googleapi.Expand(req.URL, map[string]string{
  3507. "partnerId": strconv.FormatInt(c.partnerId, 10),
  3508. })
  3509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3510. }
  3511. // Do executes the "androiddeviceprovisioning.partners.customers.list" call.
  3512. // Exactly one of *ListCustomersResponse or error will be non-nil. Any
  3513. // non-2xx status code is an error. Response headers are in either
  3514. // *ListCustomersResponse.ServerResponse.Header or (if a response was
  3515. // returned at all) in error.(*googleapi.Error).Header. Use
  3516. // googleapi.IsNotModified to check whether the returned error was
  3517. // because http.StatusNotModified was returned.
  3518. func (c *PartnersCustomersListCall) Do(opts ...googleapi.CallOption) (*ListCustomersResponse, error) {
  3519. gensupport.SetOptions(c.urlParams_, opts...)
  3520. res, err := c.doRequest("json")
  3521. if res != nil && res.StatusCode == http.StatusNotModified {
  3522. if res.Body != nil {
  3523. res.Body.Close()
  3524. }
  3525. return nil, &googleapi.Error{
  3526. Code: res.StatusCode,
  3527. Header: res.Header,
  3528. }
  3529. }
  3530. if err != nil {
  3531. return nil, err
  3532. }
  3533. defer googleapi.CloseBody(res)
  3534. if err := googleapi.CheckResponse(res); err != nil {
  3535. return nil, err
  3536. }
  3537. ret := &ListCustomersResponse{
  3538. ServerResponse: googleapi.ServerResponse{
  3539. Header: res.Header,
  3540. HTTPStatusCode: res.StatusCode,
  3541. },
  3542. }
  3543. target := &ret
  3544. if err := gensupport.DecodeResponse(target, res); err != nil {
  3545. return nil, err
  3546. }
  3547. return ret, nil
  3548. // {
  3549. // "description": "Lists the customers that are enrolled to the reseller identified by the\n`partnerId` argument. This list includes customers that the reseller\ncreated and customers that enrolled themselves using the portal.",
  3550. // "flatPath": "v1/partners/{partnersId}/customers",
  3551. // "httpMethod": "GET",
  3552. // "id": "androiddeviceprovisioning.partners.customers.list",
  3553. // "parameterOrder": [
  3554. // "partnerId"
  3555. // ],
  3556. // "parameters": {
  3557. // "partnerId": {
  3558. // "description": "Required. The ID of the reseller partner.",
  3559. // "format": "int64",
  3560. // "location": "path",
  3561. // "pattern": "^[^/]+$",
  3562. // "required": true,
  3563. // "type": "string"
  3564. // }
  3565. // },
  3566. // "path": "v1/partners/{+partnerId}/customers",
  3567. // "response": {
  3568. // "$ref": "ListCustomersResponse"
  3569. // }
  3570. // }
  3571. }
  3572. // method id "androiddeviceprovisioning.partners.devices.claim":
  3573. type PartnersDevicesClaimCall struct {
  3574. s *Service
  3575. partnerId int64
  3576. claimdevicerequest *ClaimDeviceRequest
  3577. urlParams_ gensupport.URLParams
  3578. ctx_ context.Context
  3579. header_ http.Header
  3580. }
  3581. // Claim: Claims a device for a customer and adds it to zero-touch
  3582. // enrollment. If the
  3583. // device is already claimed by another customer, the call returns an
  3584. // error.
  3585. func (r *PartnersDevicesService) Claim(partnerId int64, claimdevicerequest *ClaimDeviceRequest) *PartnersDevicesClaimCall {
  3586. c := &PartnersDevicesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3587. c.partnerId = partnerId
  3588. c.claimdevicerequest = claimdevicerequest
  3589. return c
  3590. }
  3591. // Fields allows partial responses to be retrieved. See
  3592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3593. // for more information.
  3594. func (c *PartnersDevicesClaimCall) Fields(s ...googleapi.Field) *PartnersDevicesClaimCall {
  3595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3596. return c
  3597. }
  3598. // Context sets the context to be used in this call's Do method. Any
  3599. // pending HTTP request will be aborted if the provided context is
  3600. // canceled.
  3601. func (c *PartnersDevicesClaimCall) Context(ctx context.Context) *PartnersDevicesClaimCall {
  3602. c.ctx_ = ctx
  3603. return c
  3604. }
  3605. // Header returns an http.Header that can be modified by the caller to
  3606. // add HTTP headers to the request.
  3607. func (c *PartnersDevicesClaimCall) Header() http.Header {
  3608. if c.header_ == nil {
  3609. c.header_ = make(http.Header)
  3610. }
  3611. return c.header_
  3612. }
  3613. func (c *PartnersDevicesClaimCall) doRequest(alt string) (*http.Response, error) {
  3614. reqHeaders := make(http.Header)
  3615. for k, v := range c.header_ {
  3616. reqHeaders[k] = v
  3617. }
  3618. reqHeaders.Set("User-Agent", c.s.userAgent())
  3619. var body io.Reader = nil
  3620. body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicerequest)
  3621. if err != nil {
  3622. return nil, err
  3623. }
  3624. reqHeaders.Set("Content-Type", "application/json")
  3625. c.urlParams_.Set("alt", alt)
  3626. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:claim")
  3627. urls += "?" + c.urlParams_.Encode()
  3628. req, _ := http.NewRequest("POST", urls, body)
  3629. req.Header = reqHeaders
  3630. googleapi.Expand(req.URL, map[string]string{
  3631. "partnerId": strconv.FormatInt(c.partnerId, 10),
  3632. })
  3633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3634. }
  3635. // Do executes the "androiddeviceprovisioning.partners.devices.claim" call.
  3636. // Exactly one of *ClaimDeviceResponse or error will be non-nil. Any
  3637. // non-2xx status code is an error. Response headers are in either
  3638. // *ClaimDeviceResponse.ServerResponse.Header or (if a response was
  3639. // returned at all) in error.(*googleapi.Error).Header. Use
  3640. // googleapi.IsNotModified to check whether the returned error was
  3641. // because http.StatusNotModified was returned.
  3642. func (c *PartnersDevicesClaimCall) Do(opts ...googleapi.CallOption) (*ClaimDeviceResponse, error) {
  3643. gensupport.SetOptions(c.urlParams_, opts...)
  3644. res, err := c.doRequest("json")
  3645. if res != nil && res.StatusCode == http.StatusNotModified {
  3646. if res.Body != nil {
  3647. res.Body.Close()
  3648. }
  3649. return nil, &googleapi.Error{
  3650. Code: res.StatusCode,
  3651. Header: res.Header,
  3652. }
  3653. }
  3654. if err != nil {
  3655. return nil, err
  3656. }
  3657. defer googleapi.CloseBody(res)
  3658. if err := googleapi.CheckResponse(res); err != nil {
  3659. return nil, err
  3660. }
  3661. ret := &ClaimDeviceResponse{
  3662. ServerResponse: googleapi.ServerResponse{
  3663. Header: res.Header,
  3664. HTTPStatusCode: res.StatusCode,
  3665. },
  3666. }
  3667. target := &ret
  3668. if err := gensupport.DecodeResponse(target, res); err != nil {
  3669. return nil, err
  3670. }
  3671. return ret, nil
  3672. // {
  3673. // "description": "Claims a device for a customer and adds it to zero-touch enrollment. If the\ndevice is already claimed by another customer, the call returns an error.",
  3674. // "flatPath": "v1/partners/{partnersId}/devices:claim",
  3675. // "httpMethod": "POST",
  3676. // "id": "androiddeviceprovisioning.partners.devices.claim",
  3677. // "parameterOrder": [
  3678. // "partnerId"
  3679. // ],
  3680. // "parameters": {
  3681. // "partnerId": {
  3682. // "description": "Required. The ID of the reseller partner.",
  3683. // "format": "int64",
  3684. // "location": "path",
  3685. // "pattern": "^[^/]+$",
  3686. // "required": true,
  3687. // "type": "string"
  3688. // }
  3689. // },
  3690. // "path": "v1/partners/{+partnerId}/devices:claim",
  3691. // "request": {
  3692. // "$ref": "ClaimDeviceRequest"
  3693. // },
  3694. // "response": {
  3695. // "$ref": "ClaimDeviceResponse"
  3696. // }
  3697. // }
  3698. }
  3699. // method id "androiddeviceprovisioning.partners.devices.claimAsync":
  3700. type PartnersDevicesClaimAsyncCall struct {
  3701. s *Service
  3702. partnerId int64
  3703. claimdevicesrequest *ClaimDevicesRequest
  3704. urlParams_ gensupport.URLParams
  3705. ctx_ context.Context
  3706. header_ http.Header
  3707. }
  3708. // ClaimAsync: Claims a batch of devices for a customer asynchronously.
  3709. // Adds the devices
  3710. // to zero-touch enrollment. To learn more, read [Long‑running
  3711. // batch
  3712. // operations](/zero-touch/guides/how-it-works#operations).
  3713. func (r *PartnersDevicesService) ClaimAsync(partnerId int64, claimdevicesrequest *ClaimDevicesRequest) *PartnersDevicesClaimAsyncCall {
  3714. c := &PartnersDevicesClaimAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3715. c.partnerId = partnerId
  3716. c.claimdevicesrequest = claimdevicesrequest
  3717. return c
  3718. }
  3719. // Fields allows partial responses to be retrieved. See
  3720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3721. // for more information.
  3722. func (c *PartnersDevicesClaimAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesClaimAsyncCall {
  3723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3724. return c
  3725. }
  3726. // Context sets the context to be used in this call's Do method. Any
  3727. // pending HTTP request will be aborted if the provided context is
  3728. // canceled.
  3729. func (c *PartnersDevicesClaimAsyncCall) Context(ctx context.Context) *PartnersDevicesClaimAsyncCall {
  3730. c.ctx_ = ctx
  3731. return c
  3732. }
  3733. // Header returns an http.Header that can be modified by the caller to
  3734. // add HTTP headers to the request.
  3735. func (c *PartnersDevicesClaimAsyncCall) Header() http.Header {
  3736. if c.header_ == nil {
  3737. c.header_ = make(http.Header)
  3738. }
  3739. return c.header_
  3740. }
  3741. func (c *PartnersDevicesClaimAsyncCall) doRequest(alt string) (*http.Response, error) {
  3742. reqHeaders := make(http.Header)
  3743. for k, v := range c.header_ {
  3744. reqHeaders[k] = v
  3745. }
  3746. reqHeaders.Set("User-Agent", c.s.userAgent())
  3747. var body io.Reader = nil
  3748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicesrequest)
  3749. if err != nil {
  3750. return nil, err
  3751. }
  3752. reqHeaders.Set("Content-Type", "application/json")
  3753. c.urlParams_.Set("alt", alt)
  3754. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:claimAsync")
  3755. urls += "?" + c.urlParams_.Encode()
  3756. req, _ := http.NewRequest("POST", urls, body)
  3757. req.Header = reqHeaders
  3758. googleapi.Expand(req.URL, map[string]string{
  3759. "partnerId": strconv.FormatInt(c.partnerId, 10),
  3760. })
  3761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3762. }
  3763. // Do executes the "androiddeviceprovisioning.partners.devices.claimAsync" call.
  3764. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3765. // status code is an error. Response headers are in either
  3766. // *Operation.ServerResponse.Header or (if a response was returned at
  3767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3768. // to check whether the returned error was because
  3769. // http.StatusNotModified was returned.
  3770. func (c *PartnersDevicesClaimAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3771. gensupport.SetOptions(c.urlParams_, opts...)
  3772. res, err := c.doRequest("json")
  3773. if res != nil && res.StatusCode == http.StatusNotModified {
  3774. if res.Body != nil {
  3775. res.Body.Close()
  3776. }
  3777. return nil, &googleapi.Error{
  3778. Code: res.StatusCode,
  3779. Header: res.Header,
  3780. }
  3781. }
  3782. if err != nil {
  3783. return nil, err
  3784. }
  3785. defer googleapi.CloseBody(res)
  3786. if err := googleapi.CheckResponse(res); err != nil {
  3787. return nil, err
  3788. }
  3789. ret := &Operation{
  3790. ServerResponse: googleapi.ServerResponse{
  3791. Header: res.Header,
  3792. HTTPStatusCode: res.StatusCode,
  3793. },
  3794. }
  3795. target := &ret
  3796. if err := gensupport.DecodeResponse(target, res); err != nil {
  3797. return nil, err
  3798. }
  3799. return ret, nil
  3800. // {
  3801. // "description": "Claims a batch of devices for a customer asynchronously. Adds the devices\nto zero-touch enrollment. To learn more, read [Long‑running batch\noperations](/zero-touch/guides/how-it-works#operations).",
  3802. // "flatPath": "v1/partners/{partnersId}/devices:claimAsync",
  3803. // "httpMethod": "POST",
  3804. // "id": "androiddeviceprovisioning.partners.devices.claimAsync",
  3805. // "parameterOrder": [
  3806. // "partnerId"
  3807. // ],
  3808. // "parameters": {
  3809. // "partnerId": {
  3810. // "description": "Required. The ID of the reseller partner.",
  3811. // "format": "int64",
  3812. // "location": "path",
  3813. // "pattern": "^[^/]+$",
  3814. // "required": true,
  3815. // "type": "string"
  3816. // }
  3817. // },
  3818. // "path": "v1/partners/{+partnerId}/devices:claimAsync",
  3819. // "request": {
  3820. // "$ref": "ClaimDevicesRequest"
  3821. // },
  3822. // "response": {
  3823. // "$ref": "Operation"
  3824. // }
  3825. // }
  3826. }
  3827. // method id "androiddeviceprovisioning.partners.devices.findByIdentifier":
  3828. type PartnersDevicesFindByIdentifierCall struct {
  3829. s *Service
  3830. partnerId int64
  3831. finddevicesbydeviceidentifierrequest *FindDevicesByDeviceIdentifierRequest
  3832. urlParams_ gensupport.URLParams
  3833. ctx_ context.Context
  3834. header_ http.Header
  3835. }
  3836. // FindByIdentifier: Finds devices by hardware identifiers, such as
  3837. // IMEI.
  3838. func (r *PartnersDevicesService) FindByIdentifier(partnerId int64, finddevicesbydeviceidentifierrequest *FindDevicesByDeviceIdentifierRequest) *PartnersDevicesFindByIdentifierCall {
  3839. c := &PartnersDevicesFindByIdentifierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3840. c.partnerId = partnerId
  3841. c.finddevicesbydeviceidentifierrequest = finddevicesbydeviceidentifierrequest
  3842. return c
  3843. }
  3844. // Fields allows partial responses to be retrieved. See
  3845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3846. // for more information.
  3847. func (c *PartnersDevicesFindByIdentifierCall) Fields(s ...googleapi.Field) *PartnersDevicesFindByIdentifierCall {
  3848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3849. return c
  3850. }
  3851. // Context sets the context to be used in this call's Do method. Any
  3852. // pending HTTP request will be aborted if the provided context is
  3853. // canceled.
  3854. func (c *PartnersDevicesFindByIdentifierCall) Context(ctx context.Context) *PartnersDevicesFindByIdentifierCall {
  3855. c.ctx_ = ctx
  3856. return c
  3857. }
  3858. // Header returns an http.Header that can be modified by the caller to
  3859. // add HTTP headers to the request.
  3860. func (c *PartnersDevicesFindByIdentifierCall) Header() http.Header {
  3861. if c.header_ == nil {
  3862. c.header_ = make(http.Header)
  3863. }
  3864. return c.header_
  3865. }
  3866. func (c *PartnersDevicesFindByIdentifierCall) doRequest(alt string) (*http.Response, error) {
  3867. reqHeaders := make(http.Header)
  3868. for k, v := range c.header_ {
  3869. reqHeaders[k] = v
  3870. }
  3871. reqHeaders.Set("User-Agent", c.s.userAgent())
  3872. var body io.Reader = nil
  3873. body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbydeviceidentifierrequest)
  3874. if err != nil {
  3875. return nil, err
  3876. }
  3877. reqHeaders.Set("Content-Type", "application/json")
  3878. c.urlParams_.Set("alt", alt)
  3879. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:findByIdentifier")
  3880. urls += "?" + c.urlParams_.Encode()
  3881. req, _ := http.NewRequest("POST", urls, body)
  3882. req.Header = reqHeaders
  3883. googleapi.Expand(req.URL, map[string]string{
  3884. "partnerId": strconv.FormatInt(c.partnerId, 10),
  3885. })
  3886. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3887. }
  3888. // Do executes the "androiddeviceprovisioning.partners.devices.findByIdentifier" call.
  3889. // Exactly one of *FindDevicesByDeviceIdentifierResponse or error will
  3890. // be non-nil. Any non-2xx status code is an error. Response headers are
  3891. // in either
  3892. // *FindDevicesByDeviceIdentifierResponse.ServerResponse.Header or (if a
  3893. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3894. // googleapi.IsNotModified to check whether the returned error was
  3895. // because http.StatusNotModified was returned.
  3896. func (c *PartnersDevicesFindByIdentifierCall) Do(opts ...googleapi.CallOption) (*FindDevicesByDeviceIdentifierResponse, error) {
  3897. gensupport.SetOptions(c.urlParams_, opts...)
  3898. res, err := c.doRequest("json")
  3899. if res != nil && res.StatusCode == http.StatusNotModified {
  3900. if res.Body != nil {
  3901. res.Body.Close()
  3902. }
  3903. return nil, &googleapi.Error{
  3904. Code: res.StatusCode,
  3905. Header: res.Header,
  3906. }
  3907. }
  3908. if err != nil {
  3909. return nil, err
  3910. }
  3911. defer googleapi.CloseBody(res)
  3912. if err := googleapi.CheckResponse(res); err != nil {
  3913. return nil, err
  3914. }
  3915. ret := &FindDevicesByDeviceIdentifierResponse{
  3916. ServerResponse: googleapi.ServerResponse{
  3917. Header: res.Header,
  3918. HTTPStatusCode: res.StatusCode,
  3919. },
  3920. }
  3921. target := &ret
  3922. if err := gensupport.DecodeResponse(target, res); err != nil {
  3923. return nil, err
  3924. }
  3925. return ret, nil
  3926. // {
  3927. // "description": "Finds devices by hardware identifiers, such as IMEI.",
  3928. // "flatPath": "v1/partners/{partnersId}/devices:findByIdentifier",
  3929. // "httpMethod": "POST",
  3930. // "id": "androiddeviceprovisioning.partners.devices.findByIdentifier",
  3931. // "parameterOrder": [
  3932. // "partnerId"
  3933. // ],
  3934. // "parameters": {
  3935. // "partnerId": {
  3936. // "description": "Required. The ID of the reseller partner.",
  3937. // "format": "int64",
  3938. // "location": "path",
  3939. // "pattern": "^[^/]+$",
  3940. // "required": true,
  3941. // "type": "string"
  3942. // }
  3943. // },
  3944. // "path": "v1/partners/{+partnerId}/devices:findByIdentifier",
  3945. // "request": {
  3946. // "$ref": "FindDevicesByDeviceIdentifierRequest"
  3947. // },
  3948. // "response": {
  3949. // "$ref": "FindDevicesByDeviceIdentifierResponse"
  3950. // }
  3951. // }
  3952. }
  3953. // Pages invokes f for each page of results.
  3954. // A non-nil error returned from f will halt the iteration.
  3955. // The provided context supersedes any context provided to the Context method.
  3956. func (c *PartnersDevicesFindByIdentifierCall) Pages(ctx context.Context, f func(*FindDevicesByDeviceIdentifierResponse) error) error {
  3957. c.ctx_ = ctx
  3958. defer func(pt string) { c.finddevicesbydeviceidentifierrequest.PageToken = pt }(c.finddevicesbydeviceidentifierrequest.PageToken) // reset paging to original point
  3959. for {
  3960. x, err := c.Do()
  3961. if err != nil {
  3962. return err
  3963. }
  3964. if err := f(x); err != nil {
  3965. return err
  3966. }
  3967. if x.NextPageToken == "" {
  3968. return nil
  3969. }
  3970. c.finddevicesbydeviceidentifierrequest.PageToken = x.NextPageToken
  3971. }
  3972. }
  3973. // method id "androiddeviceprovisioning.partners.devices.findByOwner":
  3974. type PartnersDevicesFindByOwnerCall struct {
  3975. s *Service
  3976. partnerId int64
  3977. finddevicesbyownerrequest *FindDevicesByOwnerRequest
  3978. urlParams_ gensupport.URLParams
  3979. ctx_ context.Context
  3980. header_ http.Header
  3981. }
  3982. // FindByOwner: Finds devices claimed for customers. The results only
  3983. // contain devices
  3984. // registered to the reseller that's identified by the `partnerId`
  3985. // argument.
  3986. // The customer's devices purchased from other resellers don't appear in
  3987. // the
  3988. // results.
  3989. func (r *PartnersDevicesService) FindByOwner(partnerId int64, finddevicesbyownerrequest *FindDevicesByOwnerRequest) *PartnersDevicesFindByOwnerCall {
  3990. c := &PartnersDevicesFindByOwnerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3991. c.partnerId = partnerId
  3992. c.finddevicesbyownerrequest = finddevicesbyownerrequest
  3993. return c
  3994. }
  3995. // Fields allows partial responses to be retrieved. See
  3996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3997. // for more information.
  3998. func (c *PartnersDevicesFindByOwnerCall) Fields(s ...googleapi.Field) *PartnersDevicesFindByOwnerCall {
  3999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4000. return c
  4001. }
  4002. // Context sets the context to be used in this call's Do method. Any
  4003. // pending HTTP request will be aborted if the provided context is
  4004. // canceled.
  4005. func (c *PartnersDevicesFindByOwnerCall) Context(ctx context.Context) *PartnersDevicesFindByOwnerCall {
  4006. c.ctx_ = ctx
  4007. return c
  4008. }
  4009. // Header returns an http.Header that can be modified by the caller to
  4010. // add HTTP headers to the request.
  4011. func (c *PartnersDevicesFindByOwnerCall) Header() http.Header {
  4012. if c.header_ == nil {
  4013. c.header_ = make(http.Header)
  4014. }
  4015. return c.header_
  4016. }
  4017. func (c *PartnersDevicesFindByOwnerCall) doRequest(alt string) (*http.Response, error) {
  4018. reqHeaders := make(http.Header)
  4019. for k, v := range c.header_ {
  4020. reqHeaders[k] = v
  4021. }
  4022. reqHeaders.Set("User-Agent", c.s.userAgent())
  4023. var body io.Reader = nil
  4024. body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbyownerrequest)
  4025. if err != nil {
  4026. return nil, err
  4027. }
  4028. reqHeaders.Set("Content-Type", "application/json")
  4029. c.urlParams_.Set("alt", alt)
  4030. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:findByOwner")
  4031. urls += "?" + c.urlParams_.Encode()
  4032. req, _ := http.NewRequest("POST", urls, body)
  4033. req.Header = reqHeaders
  4034. googleapi.Expand(req.URL, map[string]string{
  4035. "partnerId": strconv.FormatInt(c.partnerId, 10),
  4036. })
  4037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4038. }
  4039. // Do executes the "androiddeviceprovisioning.partners.devices.findByOwner" call.
  4040. // Exactly one of *FindDevicesByOwnerResponse or error will be non-nil.
  4041. // Any non-2xx status code is an error. Response headers are in either
  4042. // *FindDevicesByOwnerResponse.ServerResponse.Header or (if a response
  4043. // was returned at all) in error.(*googleapi.Error).Header. Use
  4044. // googleapi.IsNotModified to check whether the returned error was
  4045. // because http.StatusNotModified was returned.
  4046. func (c *PartnersDevicesFindByOwnerCall) Do(opts ...googleapi.CallOption) (*FindDevicesByOwnerResponse, error) {
  4047. gensupport.SetOptions(c.urlParams_, opts...)
  4048. res, err := c.doRequest("json")
  4049. if res != nil && res.StatusCode == http.StatusNotModified {
  4050. if res.Body != nil {
  4051. res.Body.Close()
  4052. }
  4053. return nil, &googleapi.Error{
  4054. Code: res.StatusCode,
  4055. Header: res.Header,
  4056. }
  4057. }
  4058. if err != nil {
  4059. return nil, err
  4060. }
  4061. defer googleapi.CloseBody(res)
  4062. if err := googleapi.CheckResponse(res); err != nil {
  4063. return nil, err
  4064. }
  4065. ret := &FindDevicesByOwnerResponse{
  4066. ServerResponse: googleapi.ServerResponse{
  4067. Header: res.Header,
  4068. HTTPStatusCode: res.StatusCode,
  4069. },
  4070. }
  4071. target := &ret
  4072. if err := gensupport.DecodeResponse(target, res); err != nil {
  4073. return nil, err
  4074. }
  4075. return ret, nil
  4076. // {
  4077. // "description": "Finds devices claimed for customers. The results only contain devices\nregistered to the reseller that's identified by the `partnerId` argument.\nThe customer's devices purchased from other resellers don't appear in the\nresults.",
  4078. // "flatPath": "v1/partners/{partnersId}/devices:findByOwner",
  4079. // "httpMethod": "POST",
  4080. // "id": "androiddeviceprovisioning.partners.devices.findByOwner",
  4081. // "parameterOrder": [
  4082. // "partnerId"
  4083. // ],
  4084. // "parameters": {
  4085. // "partnerId": {
  4086. // "description": "Required. The ID of the reseller partner.",
  4087. // "format": "int64",
  4088. // "location": "path",
  4089. // "pattern": "^[^/]+$",
  4090. // "required": true,
  4091. // "type": "string"
  4092. // }
  4093. // },
  4094. // "path": "v1/partners/{+partnerId}/devices:findByOwner",
  4095. // "request": {
  4096. // "$ref": "FindDevicesByOwnerRequest"
  4097. // },
  4098. // "response": {
  4099. // "$ref": "FindDevicesByOwnerResponse"
  4100. // }
  4101. // }
  4102. }
  4103. // Pages invokes f for each page of results.
  4104. // A non-nil error returned from f will halt the iteration.
  4105. // The provided context supersedes any context provided to the Context method.
  4106. func (c *PartnersDevicesFindByOwnerCall) Pages(ctx context.Context, f func(*FindDevicesByOwnerResponse) error) error {
  4107. c.ctx_ = ctx
  4108. defer func(pt string) { c.finddevicesbyownerrequest.PageToken = pt }(c.finddevicesbyownerrequest.PageToken) // reset paging to original point
  4109. for {
  4110. x, err := c.Do()
  4111. if err != nil {
  4112. return err
  4113. }
  4114. if err := f(x); err != nil {
  4115. return err
  4116. }
  4117. if x.NextPageToken == "" {
  4118. return nil
  4119. }
  4120. c.finddevicesbyownerrequest.PageToken = x.NextPageToken
  4121. }
  4122. }
  4123. // method id "androiddeviceprovisioning.partners.devices.get":
  4124. type PartnersDevicesGetCall struct {
  4125. s *Service
  4126. name string
  4127. urlParams_ gensupport.URLParams
  4128. ifNoneMatch_ string
  4129. ctx_ context.Context
  4130. header_ http.Header
  4131. }
  4132. // Get: Gets a device.
  4133. func (r *PartnersDevicesService) Get(name string) *PartnersDevicesGetCall {
  4134. c := &PartnersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4135. c.name = name
  4136. return c
  4137. }
  4138. // Fields allows partial responses to be retrieved. See
  4139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4140. // for more information.
  4141. func (c *PartnersDevicesGetCall) Fields(s ...googleapi.Field) *PartnersDevicesGetCall {
  4142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4143. return c
  4144. }
  4145. // IfNoneMatch sets the optional parameter which makes the operation
  4146. // fail if the object's ETag matches the given value. This is useful for
  4147. // getting updates only after the object has changed since the last
  4148. // request. Use googleapi.IsNotModified to check whether the response
  4149. // error from Do is the result of In-None-Match.
  4150. func (c *PartnersDevicesGetCall) IfNoneMatch(entityTag string) *PartnersDevicesGetCall {
  4151. c.ifNoneMatch_ = entityTag
  4152. return c
  4153. }
  4154. // Context sets the context to be used in this call's Do method. Any
  4155. // pending HTTP request will be aborted if the provided context is
  4156. // canceled.
  4157. func (c *PartnersDevicesGetCall) Context(ctx context.Context) *PartnersDevicesGetCall {
  4158. c.ctx_ = ctx
  4159. return c
  4160. }
  4161. // Header returns an http.Header that can be modified by the caller to
  4162. // add HTTP headers to the request.
  4163. func (c *PartnersDevicesGetCall) Header() http.Header {
  4164. if c.header_ == nil {
  4165. c.header_ = make(http.Header)
  4166. }
  4167. return c.header_
  4168. }
  4169. func (c *PartnersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
  4170. reqHeaders := make(http.Header)
  4171. for k, v := range c.header_ {
  4172. reqHeaders[k] = v
  4173. }
  4174. reqHeaders.Set("User-Agent", c.s.userAgent())
  4175. if c.ifNoneMatch_ != "" {
  4176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4177. }
  4178. var body io.Reader = nil
  4179. c.urlParams_.Set("alt", alt)
  4180. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4181. urls += "?" + c.urlParams_.Encode()
  4182. req, _ := http.NewRequest("GET", urls, body)
  4183. req.Header = reqHeaders
  4184. googleapi.Expand(req.URL, map[string]string{
  4185. "name": c.name,
  4186. })
  4187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4188. }
  4189. // Do executes the "androiddeviceprovisioning.partners.devices.get" call.
  4190. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  4191. // code is an error. Response headers are in either
  4192. // *Device.ServerResponse.Header or (if a response was returned at all)
  4193. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4194. // check whether the returned error was because http.StatusNotModified
  4195. // was returned.
  4196. func (c *PartnersDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  4197. gensupport.SetOptions(c.urlParams_, opts...)
  4198. res, err := c.doRequest("json")
  4199. if res != nil && res.StatusCode == http.StatusNotModified {
  4200. if res.Body != nil {
  4201. res.Body.Close()
  4202. }
  4203. return nil, &googleapi.Error{
  4204. Code: res.StatusCode,
  4205. Header: res.Header,
  4206. }
  4207. }
  4208. if err != nil {
  4209. return nil, err
  4210. }
  4211. defer googleapi.CloseBody(res)
  4212. if err := googleapi.CheckResponse(res); err != nil {
  4213. return nil, err
  4214. }
  4215. ret := &Device{
  4216. ServerResponse: googleapi.ServerResponse{
  4217. Header: res.Header,
  4218. HTTPStatusCode: res.StatusCode,
  4219. },
  4220. }
  4221. target := &ret
  4222. if err := gensupport.DecodeResponse(target, res); err != nil {
  4223. return nil, err
  4224. }
  4225. return ret, nil
  4226. // {
  4227. // "description": "Gets a device.",
  4228. // "flatPath": "v1/partners/{partnersId}/devices/{devicesId}",
  4229. // "httpMethod": "GET",
  4230. // "id": "androiddeviceprovisioning.partners.devices.get",
  4231. // "parameterOrder": [
  4232. // "name"
  4233. // ],
  4234. // "parameters": {
  4235. // "name": {
  4236. // "description": "Required. The device API resource name in the format\n`partners/[PARTNER_ID]/devices/[DEVICE_ID]`.",
  4237. // "location": "path",
  4238. // "pattern": "^partners/[^/]+/devices/[^/]+$",
  4239. // "required": true,
  4240. // "type": "string"
  4241. // }
  4242. // },
  4243. // "path": "v1/{+name}",
  4244. // "response": {
  4245. // "$ref": "Device"
  4246. // }
  4247. // }
  4248. }
  4249. // method id "androiddeviceprovisioning.partners.devices.metadata":
  4250. type PartnersDevicesMetadataCall struct {
  4251. s *Service
  4252. metadataOwnerId int64
  4253. deviceId int64
  4254. updatedevicemetadatarequest *UpdateDeviceMetadataRequest
  4255. urlParams_ gensupport.URLParams
  4256. ctx_ context.Context
  4257. header_ http.Header
  4258. }
  4259. // Metadata: Updates reseller metadata associated with the device.
  4260. func (r *PartnersDevicesService) Metadata(metadataOwnerId int64, deviceId int64, updatedevicemetadatarequest *UpdateDeviceMetadataRequest) *PartnersDevicesMetadataCall {
  4261. c := &PartnersDevicesMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4262. c.metadataOwnerId = metadataOwnerId
  4263. c.deviceId = deviceId
  4264. c.updatedevicemetadatarequest = updatedevicemetadatarequest
  4265. return c
  4266. }
  4267. // Fields allows partial responses to be retrieved. See
  4268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4269. // for more information.
  4270. func (c *PartnersDevicesMetadataCall) Fields(s ...googleapi.Field) *PartnersDevicesMetadataCall {
  4271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4272. return c
  4273. }
  4274. // Context sets the context to be used in this call's Do method. Any
  4275. // pending HTTP request will be aborted if the provided context is
  4276. // canceled.
  4277. func (c *PartnersDevicesMetadataCall) Context(ctx context.Context) *PartnersDevicesMetadataCall {
  4278. c.ctx_ = ctx
  4279. return c
  4280. }
  4281. // Header returns an http.Header that can be modified by the caller to
  4282. // add HTTP headers to the request.
  4283. func (c *PartnersDevicesMetadataCall) Header() http.Header {
  4284. if c.header_ == nil {
  4285. c.header_ = make(http.Header)
  4286. }
  4287. return c.header_
  4288. }
  4289. func (c *PartnersDevicesMetadataCall) doRequest(alt string) (*http.Response, error) {
  4290. reqHeaders := make(http.Header)
  4291. for k, v := range c.header_ {
  4292. reqHeaders[k] = v
  4293. }
  4294. reqHeaders.Set("User-Agent", c.s.userAgent())
  4295. var body io.Reader = nil
  4296. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatarequest)
  4297. if err != nil {
  4298. return nil, err
  4299. }
  4300. reqHeaders.Set("Content-Type", "application/json")
  4301. c.urlParams_.Set("alt", alt)
  4302. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata")
  4303. urls += "?" + c.urlParams_.Encode()
  4304. req, _ := http.NewRequest("POST", urls, body)
  4305. req.Header = reqHeaders
  4306. googleapi.Expand(req.URL, map[string]string{
  4307. "metadataOwnerId": strconv.FormatInt(c.metadataOwnerId, 10),
  4308. "deviceId": strconv.FormatInt(c.deviceId, 10),
  4309. })
  4310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4311. }
  4312. // Do executes the "androiddeviceprovisioning.partners.devices.metadata" call.
  4313. // Exactly one of *DeviceMetadata or error will be non-nil. Any non-2xx
  4314. // status code is an error. Response headers are in either
  4315. // *DeviceMetadata.ServerResponse.Header or (if a response was returned
  4316. // at all) in error.(*googleapi.Error).Header. Use
  4317. // googleapi.IsNotModified to check whether the returned error was
  4318. // because http.StatusNotModified was returned.
  4319. func (c *PartnersDevicesMetadataCall) Do(opts ...googleapi.CallOption) (*DeviceMetadata, error) {
  4320. gensupport.SetOptions(c.urlParams_, opts...)
  4321. res, err := c.doRequest("json")
  4322. if res != nil && res.StatusCode == http.StatusNotModified {
  4323. if res.Body != nil {
  4324. res.Body.Close()
  4325. }
  4326. return nil, &googleapi.Error{
  4327. Code: res.StatusCode,
  4328. Header: res.Header,
  4329. }
  4330. }
  4331. if err != nil {
  4332. return nil, err
  4333. }
  4334. defer googleapi.CloseBody(res)
  4335. if err := googleapi.CheckResponse(res); err != nil {
  4336. return nil, err
  4337. }
  4338. ret := &DeviceMetadata{
  4339. ServerResponse: googleapi.ServerResponse{
  4340. Header: res.Header,
  4341. HTTPStatusCode: res.StatusCode,
  4342. },
  4343. }
  4344. target := &ret
  4345. if err := gensupport.DecodeResponse(target, res); err != nil {
  4346. return nil, err
  4347. }
  4348. return ret, nil
  4349. // {
  4350. // "description": "Updates reseller metadata associated with the device.",
  4351. // "flatPath": "v1/partners/{partnersId}/devices/{devicesId}/metadata",
  4352. // "httpMethod": "POST",
  4353. // "id": "androiddeviceprovisioning.partners.devices.metadata",
  4354. // "parameterOrder": [
  4355. // "metadataOwnerId",
  4356. // "deviceId"
  4357. // ],
  4358. // "parameters": {
  4359. // "deviceId": {
  4360. // "description": "Required. The ID of the reseller partner.",
  4361. // "format": "int64",
  4362. // "location": "path",
  4363. // "pattern": "^[^/]+$",
  4364. // "required": true,
  4365. // "type": "string"
  4366. // },
  4367. // "metadataOwnerId": {
  4368. // "description": "Required. The owner of the newly set metadata. Set this to the partner ID.",
  4369. // "format": "int64",
  4370. // "location": "path",
  4371. // "pattern": "^[^/]+$",
  4372. // "required": true,
  4373. // "type": "string"
  4374. // }
  4375. // },
  4376. // "path": "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata",
  4377. // "request": {
  4378. // "$ref": "UpdateDeviceMetadataRequest"
  4379. // },
  4380. // "response": {
  4381. // "$ref": "DeviceMetadata"
  4382. // }
  4383. // }
  4384. }
  4385. // method id "androiddeviceprovisioning.partners.devices.unclaim":
  4386. type PartnersDevicesUnclaimCall struct {
  4387. s *Service
  4388. partnerId int64
  4389. unclaimdevicerequest *UnclaimDeviceRequest
  4390. urlParams_ gensupport.URLParams
  4391. ctx_ context.Context
  4392. header_ http.Header
  4393. }
  4394. // Unclaim: Unclaims a device from a customer and removes it from
  4395. // zero-touch
  4396. // enrollment.
  4397. func (r *PartnersDevicesService) Unclaim(partnerId int64, unclaimdevicerequest *UnclaimDeviceRequest) *PartnersDevicesUnclaimCall {
  4398. c := &PartnersDevicesUnclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4399. c.partnerId = partnerId
  4400. c.unclaimdevicerequest = unclaimdevicerequest
  4401. return c
  4402. }
  4403. // Fields allows partial responses to be retrieved. See
  4404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4405. // for more information.
  4406. func (c *PartnersDevicesUnclaimCall) Fields(s ...googleapi.Field) *PartnersDevicesUnclaimCall {
  4407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4408. return c
  4409. }
  4410. // Context sets the context to be used in this call's Do method. Any
  4411. // pending HTTP request will be aborted if the provided context is
  4412. // canceled.
  4413. func (c *PartnersDevicesUnclaimCall) Context(ctx context.Context) *PartnersDevicesUnclaimCall {
  4414. c.ctx_ = ctx
  4415. return c
  4416. }
  4417. // Header returns an http.Header that can be modified by the caller to
  4418. // add HTTP headers to the request.
  4419. func (c *PartnersDevicesUnclaimCall) Header() http.Header {
  4420. if c.header_ == nil {
  4421. c.header_ = make(http.Header)
  4422. }
  4423. return c.header_
  4424. }
  4425. func (c *PartnersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) {
  4426. reqHeaders := make(http.Header)
  4427. for k, v := range c.header_ {
  4428. reqHeaders[k] = v
  4429. }
  4430. reqHeaders.Set("User-Agent", c.s.userAgent())
  4431. var body io.Reader = nil
  4432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicerequest)
  4433. if err != nil {
  4434. return nil, err
  4435. }
  4436. reqHeaders.Set("Content-Type", "application/json")
  4437. c.urlParams_.Set("alt", alt)
  4438. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:unclaim")
  4439. urls += "?" + c.urlParams_.Encode()
  4440. req, _ := http.NewRequest("POST", urls, body)
  4441. req.Header = reqHeaders
  4442. googleapi.Expand(req.URL, map[string]string{
  4443. "partnerId": strconv.FormatInt(c.partnerId, 10),
  4444. })
  4445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4446. }
  4447. // Do executes the "androiddeviceprovisioning.partners.devices.unclaim" call.
  4448. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4449. // code is an error. Response headers are in either
  4450. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4451. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4452. // check whether the returned error was because http.StatusNotModified
  4453. // was returned.
  4454. func (c *PartnersDevicesUnclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4455. gensupport.SetOptions(c.urlParams_, opts...)
  4456. res, err := c.doRequest("json")
  4457. if res != nil && res.StatusCode == http.StatusNotModified {
  4458. if res.Body != nil {
  4459. res.Body.Close()
  4460. }
  4461. return nil, &googleapi.Error{
  4462. Code: res.StatusCode,
  4463. Header: res.Header,
  4464. }
  4465. }
  4466. if err != nil {
  4467. return nil, err
  4468. }
  4469. defer googleapi.CloseBody(res)
  4470. if err := googleapi.CheckResponse(res); err != nil {
  4471. return nil, err
  4472. }
  4473. ret := &Empty{
  4474. ServerResponse: googleapi.ServerResponse{
  4475. Header: res.Header,
  4476. HTTPStatusCode: res.StatusCode,
  4477. },
  4478. }
  4479. target := &ret
  4480. if err := gensupport.DecodeResponse(target, res); err != nil {
  4481. return nil, err
  4482. }
  4483. return ret, nil
  4484. // {
  4485. // "description": "Unclaims a device from a customer and removes it from zero-touch\nenrollment.",
  4486. // "flatPath": "v1/partners/{partnersId}/devices:unclaim",
  4487. // "httpMethod": "POST",
  4488. // "id": "androiddeviceprovisioning.partners.devices.unclaim",
  4489. // "parameterOrder": [
  4490. // "partnerId"
  4491. // ],
  4492. // "parameters": {
  4493. // "partnerId": {
  4494. // "description": "Required. The ID of the reseller partner.",
  4495. // "format": "int64",
  4496. // "location": "path",
  4497. // "pattern": "^[^/]+$",
  4498. // "required": true,
  4499. // "type": "string"
  4500. // }
  4501. // },
  4502. // "path": "v1/partners/{+partnerId}/devices:unclaim",
  4503. // "request": {
  4504. // "$ref": "UnclaimDeviceRequest"
  4505. // },
  4506. // "response": {
  4507. // "$ref": "Empty"
  4508. // }
  4509. // }
  4510. }
  4511. // method id "androiddeviceprovisioning.partners.devices.unclaimAsync":
  4512. type PartnersDevicesUnclaimAsyncCall struct {
  4513. s *Service
  4514. partnerId int64
  4515. unclaimdevicesrequest *UnclaimDevicesRequest
  4516. urlParams_ gensupport.URLParams
  4517. ctx_ context.Context
  4518. header_ http.Header
  4519. }
  4520. // UnclaimAsync: Unclaims a batch of devices for a customer
  4521. // asynchronously. Removes the
  4522. // devices from zero-touch enrollment. To learn more, read
  4523. // [Long‑running
  4524. // batch
  4525. // operations](/zero-touch/guides/how-it-works#operations).
  4526. func (r *PartnersDevicesService) UnclaimAsync(partnerId int64, unclaimdevicesrequest *UnclaimDevicesRequest) *PartnersDevicesUnclaimAsyncCall {
  4527. c := &PartnersDevicesUnclaimAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4528. c.partnerId = partnerId
  4529. c.unclaimdevicesrequest = unclaimdevicesrequest
  4530. return c
  4531. }
  4532. // Fields allows partial responses to be retrieved. See
  4533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4534. // for more information.
  4535. func (c *PartnersDevicesUnclaimAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesUnclaimAsyncCall {
  4536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4537. return c
  4538. }
  4539. // Context sets the context to be used in this call's Do method. Any
  4540. // pending HTTP request will be aborted if the provided context is
  4541. // canceled.
  4542. func (c *PartnersDevicesUnclaimAsyncCall) Context(ctx context.Context) *PartnersDevicesUnclaimAsyncCall {
  4543. c.ctx_ = ctx
  4544. return c
  4545. }
  4546. // Header returns an http.Header that can be modified by the caller to
  4547. // add HTTP headers to the request.
  4548. func (c *PartnersDevicesUnclaimAsyncCall) Header() http.Header {
  4549. if c.header_ == nil {
  4550. c.header_ = make(http.Header)
  4551. }
  4552. return c.header_
  4553. }
  4554. func (c *PartnersDevicesUnclaimAsyncCall) doRequest(alt string) (*http.Response, error) {
  4555. reqHeaders := make(http.Header)
  4556. for k, v := range c.header_ {
  4557. reqHeaders[k] = v
  4558. }
  4559. reqHeaders.Set("User-Agent", c.s.userAgent())
  4560. var body io.Reader = nil
  4561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicesrequest)
  4562. if err != nil {
  4563. return nil, err
  4564. }
  4565. reqHeaders.Set("Content-Type", "application/json")
  4566. c.urlParams_.Set("alt", alt)
  4567. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:unclaimAsync")
  4568. urls += "?" + c.urlParams_.Encode()
  4569. req, _ := http.NewRequest("POST", urls, body)
  4570. req.Header = reqHeaders
  4571. googleapi.Expand(req.URL, map[string]string{
  4572. "partnerId": strconv.FormatInt(c.partnerId, 10),
  4573. })
  4574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4575. }
  4576. // Do executes the "androiddeviceprovisioning.partners.devices.unclaimAsync" call.
  4577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4578. // status code is an error. Response headers are in either
  4579. // *Operation.ServerResponse.Header or (if a response was returned at
  4580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4581. // to check whether the returned error was because
  4582. // http.StatusNotModified was returned.
  4583. func (c *PartnersDevicesUnclaimAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4584. gensupport.SetOptions(c.urlParams_, opts...)
  4585. res, err := c.doRequest("json")
  4586. if res != nil && res.StatusCode == http.StatusNotModified {
  4587. if res.Body != nil {
  4588. res.Body.Close()
  4589. }
  4590. return nil, &googleapi.Error{
  4591. Code: res.StatusCode,
  4592. Header: res.Header,
  4593. }
  4594. }
  4595. if err != nil {
  4596. return nil, err
  4597. }
  4598. defer googleapi.CloseBody(res)
  4599. if err := googleapi.CheckResponse(res); err != nil {
  4600. return nil, err
  4601. }
  4602. ret := &Operation{
  4603. ServerResponse: googleapi.ServerResponse{
  4604. Header: res.Header,
  4605. HTTPStatusCode: res.StatusCode,
  4606. },
  4607. }
  4608. target := &ret
  4609. if err := gensupport.DecodeResponse(target, res); err != nil {
  4610. return nil, err
  4611. }
  4612. return ret, nil
  4613. // {
  4614. // "description": "Unclaims a batch of devices for a customer asynchronously. Removes the\ndevices from zero-touch enrollment. To learn more, read [Long‑running batch\noperations](/zero-touch/guides/how-it-works#operations).",
  4615. // "flatPath": "v1/partners/{partnersId}/devices:unclaimAsync",
  4616. // "httpMethod": "POST",
  4617. // "id": "androiddeviceprovisioning.partners.devices.unclaimAsync",
  4618. // "parameterOrder": [
  4619. // "partnerId"
  4620. // ],
  4621. // "parameters": {
  4622. // "partnerId": {
  4623. // "description": "Required. The reseller partner ID.",
  4624. // "format": "int64",
  4625. // "location": "path",
  4626. // "pattern": "^[^/]+$",
  4627. // "required": true,
  4628. // "type": "string"
  4629. // }
  4630. // },
  4631. // "path": "v1/partners/{+partnerId}/devices:unclaimAsync",
  4632. // "request": {
  4633. // "$ref": "UnclaimDevicesRequest"
  4634. // },
  4635. // "response": {
  4636. // "$ref": "Operation"
  4637. // }
  4638. // }
  4639. }
  4640. // method id "androiddeviceprovisioning.partners.devices.updateMetadataAsync":
  4641. type PartnersDevicesUpdateMetadataAsyncCall struct {
  4642. s *Service
  4643. partnerId int64
  4644. updatedevicemetadatainbatchrequest *UpdateDeviceMetadataInBatchRequest
  4645. urlParams_ gensupport.URLParams
  4646. ctx_ context.Context
  4647. header_ http.Header
  4648. }
  4649. // UpdateMetadataAsync: Updates the reseller metadata attached to a
  4650. // batch of devices. This method
  4651. // updates devices asynchronously and returns an `Operation` that can be
  4652. // used
  4653. // to track progress. Read [Long‑running
  4654. // batch
  4655. // operations](/zero-touch/guides/how-it-works#operations).
  4656. func (r *PartnersDevicesService) UpdateMetadataAsync(partnerId int64, updatedevicemetadatainbatchrequest *UpdateDeviceMetadataInBatchRequest) *PartnersDevicesUpdateMetadataAsyncCall {
  4657. c := &PartnersDevicesUpdateMetadataAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4658. c.partnerId = partnerId
  4659. c.updatedevicemetadatainbatchrequest = updatedevicemetadatainbatchrequest
  4660. return c
  4661. }
  4662. // Fields allows partial responses to be retrieved. See
  4663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4664. // for more information.
  4665. func (c *PartnersDevicesUpdateMetadataAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesUpdateMetadataAsyncCall {
  4666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4667. return c
  4668. }
  4669. // Context sets the context to be used in this call's Do method. Any
  4670. // pending HTTP request will be aborted if the provided context is
  4671. // canceled.
  4672. func (c *PartnersDevicesUpdateMetadataAsyncCall) Context(ctx context.Context) *PartnersDevicesUpdateMetadataAsyncCall {
  4673. c.ctx_ = ctx
  4674. return c
  4675. }
  4676. // Header returns an http.Header that can be modified by the caller to
  4677. // add HTTP headers to the request.
  4678. func (c *PartnersDevicesUpdateMetadataAsyncCall) Header() http.Header {
  4679. if c.header_ == nil {
  4680. c.header_ = make(http.Header)
  4681. }
  4682. return c.header_
  4683. }
  4684. func (c *PartnersDevicesUpdateMetadataAsyncCall) doRequest(alt string) (*http.Response, error) {
  4685. reqHeaders := make(http.Header)
  4686. for k, v := range c.header_ {
  4687. reqHeaders[k] = v
  4688. }
  4689. reqHeaders.Set("User-Agent", c.s.userAgent())
  4690. var body io.Reader = nil
  4691. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatainbatchrequest)
  4692. if err != nil {
  4693. return nil, err
  4694. }
  4695. reqHeaders.Set("Content-Type", "application/json")
  4696. c.urlParams_.Set("alt", alt)
  4697. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:updateMetadataAsync")
  4698. urls += "?" + c.urlParams_.Encode()
  4699. req, _ := http.NewRequest("POST", urls, body)
  4700. req.Header = reqHeaders
  4701. googleapi.Expand(req.URL, map[string]string{
  4702. "partnerId": strconv.FormatInt(c.partnerId, 10),
  4703. })
  4704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4705. }
  4706. // Do executes the "androiddeviceprovisioning.partners.devices.updateMetadataAsync" call.
  4707. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4708. // status code is an error. Response headers are in either
  4709. // *Operation.ServerResponse.Header or (if a response was returned at
  4710. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4711. // to check whether the returned error was because
  4712. // http.StatusNotModified was returned.
  4713. func (c *PartnersDevicesUpdateMetadataAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4714. gensupport.SetOptions(c.urlParams_, opts...)
  4715. res, err := c.doRequest("json")
  4716. if res != nil && res.StatusCode == http.StatusNotModified {
  4717. if res.Body != nil {
  4718. res.Body.Close()
  4719. }
  4720. return nil, &googleapi.Error{
  4721. Code: res.StatusCode,
  4722. Header: res.Header,
  4723. }
  4724. }
  4725. if err != nil {
  4726. return nil, err
  4727. }
  4728. defer googleapi.CloseBody(res)
  4729. if err := googleapi.CheckResponse(res); err != nil {
  4730. return nil, err
  4731. }
  4732. ret := &Operation{
  4733. ServerResponse: googleapi.ServerResponse{
  4734. Header: res.Header,
  4735. HTTPStatusCode: res.StatusCode,
  4736. },
  4737. }
  4738. target := &ret
  4739. if err := gensupport.DecodeResponse(target, res); err != nil {
  4740. return nil, err
  4741. }
  4742. return ret, nil
  4743. // {
  4744. // "description": "Updates the reseller metadata attached to a batch of devices. This method\nupdates devices asynchronously and returns an `Operation` that can be used\nto track progress. Read [Long‑running batch\noperations](/zero-touch/guides/how-it-works#operations).",
  4745. // "flatPath": "v1/partners/{partnersId}/devices:updateMetadataAsync",
  4746. // "httpMethod": "POST",
  4747. // "id": "androiddeviceprovisioning.partners.devices.updateMetadataAsync",
  4748. // "parameterOrder": [
  4749. // "partnerId"
  4750. // ],
  4751. // "parameters": {
  4752. // "partnerId": {
  4753. // "description": "Required. The reseller partner ID.",
  4754. // "format": "int64",
  4755. // "location": "path",
  4756. // "pattern": "^[^/]+$",
  4757. // "required": true,
  4758. // "type": "string"
  4759. // }
  4760. // },
  4761. // "path": "v1/partners/{+partnerId}/devices:updateMetadataAsync",
  4762. // "request": {
  4763. // "$ref": "UpdateDeviceMetadataInBatchRequest"
  4764. // },
  4765. // "response": {
  4766. // "$ref": "Operation"
  4767. // }
  4768. // }
  4769. }