1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package androidenterprise provides access to the Google Play EMM API. 8// 9// For product documentation, see: https://developers.google.com/android/work/play/emm-api 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/androidenterprise/v1" 16// ... 17// ctx := context.Background() 18// androidenterpriseService, err := androidenterprise.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// androidenterpriseService, err := androidenterprise.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// androidenterpriseService, err := androidenterprise.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package androidenterprise // import "google.golang.org/api/androidenterprise/v1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "androidenterprise:v1" 75const apiName = "androidenterprise" 76const apiVersion = "v1" 77const basePath = "https://androidenterprise.googleapis.com/" 78const mtlsBasePath = "https://androidenterprise.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // Manage corporate Android devices 83 AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/androidenterprise", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Devices = NewDevicesService(s) 120 s.Enterprises = NewEnterprisesService(s) 121 s.Entitlements = NewEntitlementsService(s) 122 s.Grouplicenses = NewGrouplicensesService(s) 123 s.Grouplicenseusers = NewGrouplicenseusersService(s) 124 s.Installs = NewInstallsService(s) 125 s.Managedconfigurationsfordevice = NewManagedconfigurationsfordeviceService(s) 126 s.Managedconfigurationsforuser = NewManagedconfigurationsforuserService(s) 127 s.Managedconfigurationssettings = NewManagedconfigurationssettingsService(s) 128 s.Permissions = NewPermissionsService(s) 129 s.Products = NewProductsService(s) 130 s.Serviceaccountkeys = NewServiceaccountkeysService(s) 131 s.Storelayoutclusters = NewStorelayoutclustersService(s) 132 s.Storelayoutpages = NewStorelayoutpagesService(s) 133 s.Users = NewUsersService(s) 134 s.Webapps = NewWebappsService(s) 135 return s, nil 136} 137 138type Service struct { 139 client *http.Client 140 BasePath string // API endpoint base URL 141 UserAgent string // optional additional User-Agent fragment 142 143 Devices *DevicesService 144 145 Enterprises *EnterprisesService 146 147 Entitlements *EntitlementsService 148 149 Grouplicenses *GrouplicensesService 150 151 Grouplicenseusers *GrouplicenseusersService 152 153 Installs *InstallsService 154 155 Managedconfigurationsfordevice *ManagedconfigurationsfordeviceService 156 157 Managedconfigurationsforuser *ManagedconfigurationsforuserService 158 159 Managedconfigurationssettings *ManagedconfigurationssettingsService 160 161 Permissions *PermissionsService 162 163 Products *ProductsService 164 165 Serviceaccountkeys *ServiceaccountkeysService 166 167 Storelayoutclusters *StorelayoutclustersService 168 169 Storelayoutpages *StorelayoutpagesService 170 171 Users *UsersService 172 173 Webapps *WebappsService 174} 175 176func (s *Service) userAgent() string { 177 if s.UserAgent == "" { 178 return googleapi.UserAgent 179 } 180 return googleapi.UserAgent + " " + s.UserAgent 181} 182 183func NewDevicesService(s *Service) *DevicesService { 184 rs := &DevicesService{s: s} 185 return rs 186} 187 188type DevicesService struct { 189 s *Service 190} 191 192func NewEnterprisesService(s *Service) *EnterprisesService { 193 rs := &EnterprisesService{s: s} 194 return rs 195} 196 197type EnterprisesService struct { 198 s *Service 199} 200 201func NewEntitlementsService(s *Service) *EntitlementsService { 202 rs := &EntitlementsService{s: s} 203 return rs 204} 205 206type EntitlementsService struct { 207 s *Service 208} 209 210func NewGrouplicensesService(s *Service) *GrouplicensesService { 211 rs := &GrouplicensesService{s: s} 212 return rs 213} 214 215type GrouplicensesService struct { 216 s *Service 217} 218 219func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService { 220 rs := &GrouplicenseusersService{s: s} 221 return rs 222} 223 224type GrouplicenseusersService struct { 225 s *Service 226} 227 228func NewInstallsService(s *Service) *InstallsService { 229 rs := &InstallsService{s: s} 230 return rs 231} 232 233type InstallsService struct { 234 s *Service 235} 236 237func NewManagedconfigurationsfordeviceService(s *Service) *ManagedconfigurationsfordeviceService { 238 rs := &ManagedconfigurationsfordeviceService{s: s} 239 return rs 240} 241 242type ManagedconfigurationsfordeviceService struct { 243 s *Service 244} 245 246func NewManagedconfigurationsforuserService(s *Service) *ManagedconfigurationsforuserService { 247 rs := &ManagedconfigurationsforuserService{s: s} 248 return rs 249} 250 251type ManagedconfigurationsforuserService struct { 252 s *Service 253} 254 255func NewManagedconfigurationssettingsService(s *Service) *ManagedconfigurationssettingsService { 256 rs := &ManagedconfigurationssettingsService{s: s} 257 return rs 258} 259 260type ManagedconfigurationssettingsService struct { 261 s *Service 262} 263 264func NewPermissionsService(s *Service) *PermissionsService { 265 rs := &PermissionsService{s: s} 266 return rs 267} 268 269type PermissionsService struct { 270 s *Service 271} 272 273func NewProductsService(s *Service) *ProductsService { 274 rs := &ProductsService{s: s} 275 return rs 276} 277 278type ProductsService struct { 279 s *Service 280} 281 282func NewServiceaccountkeysService(s *Service) *ServiceaccountkeysService { 283 rs := &ServiceaccountkeysService{s: s} 284 return rs 285} 286 287type ServiceaccountkeysService struct { 288 s *Service 289} 290 291func NewStorelayoutclustersService(s *Service) *StorelayoutclustersService { 292 rs := &StorelayoutclustersService{s: s} 293 return rs 294} 295 296type StorelayoutclustersService struct { 297 s *Service 298} 299 300func NewStorelayoutpagesService(s *Service) *StorelayoutpagesService { 301 rs := &StorelayoutpagesService{s: s} 302 return rs 303} 304 305type StorelayoutpagesService struct { 306 s *Service 307} 308 309func NewUsersService(s *Service) *UsersService { 310 rs := &UsersService{s: s} 311 return rs 312} 313 314type UsersService struct { 315 s *Service 316} 317 318func NewWebappsService(s *Service) *WebappsService { 319 rs := &WebappsService{s: s} 320 return rs 321} 322 323type WebappsService struct { 324 s *Service 325} 326 327// Administrator: This represents an enterprise admin who can manage the 328// enterprise in the managed Google Play store. 329type Administrator struct { 330 // Email: The admin's email address. 331 Email string `json:"email,omitempty"` 332 333 // ForceSendFields is a list of field names (e.g. "Email") to 334 // unconditionally include in API requests. By default, fields with 335 // empty or default values are omitted from API requests. However, any 336 // non-pointer, non-interface field appearing in ForceSendFields will be 337 // sent to the server regardless of whether the field is empty or not. 338 // This may be used to include empty fields in Patch requests. 339 ForceSendFields []string `json:"-"` 340 341 // NullFields is a list of field names (e.g. "Email") to include in API 342 // requests with the JSON null value. By default, fields with empty 343 // values are omitted from API requests. However, any field with an 344 // empty value appearing in NullFields will be sent to the server as 345 // null. It is an error if a field in this list has a non-empty value. 346 // This may be used to include null fields in Patch requests. 347 NullFields []string `json:"-"` 348} 349 350func (s *Administrator) MarshalJSON() ([]byte, error) { 351 type NoMethod Administrator 352 raw := NoMethod(*s) 353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 354} 355 356// AdministratorWebToken: A token authorizing an admin to access an 357// iframe. 358type AdministratorWebToken struct { 359 // Token: An opaque token to be passed to the Play front-end to generate 360 // an iframe. 361 Token string `json:"token,omitempty"` 362 363 // ServerResponse contains the HTTP response code and headers from the 364 // server. 365 googleapi.ServerResponse `json:"-"` 366 367 // ForceSendFields is a list of field names (e.g. "Token") to 368 // unconditionally include in API requests. By default, fields with 369 // empty or default values are omitted from API requests. However, any 370 // non-pointer, non-interface field appearing in ForceSendFields will be 371 // sent to the server regardless of whether the field is empty or not. 372 // This may be used to include empty fields in Patch requests. 373 ForceSendFields []string `json:"-"` 374 375 // NullFields is a list of field names (e.g. "Token") to include in API 376 // requests with the JSON null value. By default, fields with empty 377 // values are omitted from API requests. However, any field with an 378 // empty value appearing in NullFields will be sent to the server as 379 // null. It is an error if a field in this list has a non-empty value. 380 // This may be used to include null fields in Patch requests. 381 NullFields []string `json:"-"` 382} 383 384func (s *AdministratorWebToken) MarshalJSON() ([]byte, error) { 385 type NoMethod AdministratorWebToken 386 raw := NoMethod(*s) 387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 388} 389 390// AdministratorWebTokenSpec: Specification for a token used to generate 391// iframes. The token specifies what data the admin is allowed to modify 392// and the URI the iframe is allowed to communiate with. 393type AdministratorWebTokenSpec struct { 394 // ManagedConfigurations: Options for displaying the Managed 395 // Configuration page. 396 ManagedConfigurations *AdministratorWebTokenSpecManagedConfigurations `json:"managedConfigurations,omitempty"` 397 398 // Parent: The URI of the parent frame hosting the iframe. To prevent 399 // XSS, the iframe may not be hosted at other URIs. This URI must be 400 // https. Use whitespaces to separate multiple parent URIs. 401 Parent string `json:"parent,omitempty"` 402 403 // Permission: Deprecated. Use PlaySearch.approveApps. 404 // 405 // Possible values: 406 // "unknown" - Unknown permission. 407 // "approveApps" - Permission to approve and unapprove apps. 408 // "manageMcm" - Permission to manage app restrictions. 409 Permission []string `json:"permission,omitempty"` 410 411 // PlaySearch: Options for displaying the managed Play Search apps page. 412 PlaySearch *AdministratorWebTokenSpecPlaySearch `json:"playSearch,omitempty"` 413 414 // PrivateApps: Options for displaying the Private Apps page. 415 PrivateApps *AdministratorWebTokenSpecPrivateApps `json:"privateApps,omitempty"` 416 417 // StoreBuilder: Options for displaying the Organize apps page. 418 StoreBuilder *AdministratorWebTokenSpecStoreBuilder `json:"storeBuilder,omitempty"` 419 420 // WebApps: Options for displaying the Web Apps page. 421 WebApps *AdministratorWebTokenSpecWebApps `json:"webApps,omitempty"` 422 423 // ZeroTouch: Options for displaying the Zero Touch page. 424 ZeroTouch *AdministratorWebTokenSpecZeroTouch `json:"zeroTouch,omitempty"` 425 426 // ForceSendFields is a list of field names (e.g. 427 // "ManagedConfigurations") to unconditionally include in API requests. 428 // By default, fields with empty or default values are omitted from API 429 // requests. However, any non-pointer, non-interface field appearing in 430 // ForceSendFields will be sent to the server regardless of whether the 431 // field is empty or not. This may be used to include empty fields in 432 // Patch requests. 433 ForceSendFields []string `json:"-"` 434 435 // NullFields is a list of field names (e.g. "ManagedConfigurations") to 436 // include in API requests with the JSON null value. By default, fields 437 // with empty values are omitted from API requests. However, any field 438 // with an empty value appearing in NullFields will be sent to the 439 // server as null. It is an error if a field in this list has a 440 // non-empty value. This may be used to include null fields in Patch 441 // requests. 442 NullFields []string `json:"-"` 443} 444 445func (s *AdministratorWebTokenSpec) MarshalJSON() ([]byte, error) { 446 type NoMethod AdministratorWebTokenSpec 447 raw := NoMethod(*s) 448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 449} 450 451type AdministratorWebTokenSpecManagedConfigurations struct { 452 // Enabled: Whether the Managed Configuration page is displayed. Default 453 // is true. 454 Enabled bool `json:"enabled,omitempty"` 455 456 // ForceSendFields is a list of field names (e.g. "Enabled") to 457 // unconditionally include in API requests. By default, fields with 458 // empty or default values are omitted from API requests. However, any 459 // non-pointer, non-interface field appearing in ForceSendFields will be 460 // sent to the server regardless of whether the field is empty or not. 461 // This may be used to include empty fields in Patch requests. 462 ForceSendFields []string `json:"-"` 463 464 // NullFields is a list of field names (e.g. "Enabled") to include in 465 // API requests with the JSON null value. By default, fields with empty 466 // values are omitted from API requests. However, any field with an 467 // empty value appearing in NullFields will be sent to the server as 468 // null. It is an error if a field in this list has a non-empty value. 469 // This may be used to include null fields in Patch requests. 470 NullFields []string `json:"-"` 471} 472 473func (s *AdministratorWebTokenSpecManagedConfigurations) MarshalJSON() ([]byte, error) { 474 type NoMethod AdministratorWebTokenSpecManagedConfigurations 475 raw := NoMethod(*s) 476 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 477} 478 479type AdministratorWebTokenSpecPlaySearch struct { 480 // ApproveApps: Allow access to the iframe in approve mode. Default is 481 // false. 482 ApproveApps bool `json:"approveApps,omitempty"` 483 484 // Enabled: Whether the managed Play Search apps page is displayed. 485 // Default is true. 486 Enabled bool `json:"enabled,omitempty"` 487 488 // ForceSendFields is a list of field names (e.g. "ApproveApps") to 489 // unconditionally include in API requests. By default, fields with 490 // empty or default values are omitted from API requests. However, any 491 // non-pointer, non-interface field appearing in ForceSendFields will be 492 // sent to the server regardless of whether the field is empty or not. 493 // This may be used to include empty fields in Patch requests. 494 ForceSendFields []string `json:"-"` 495 496 // NullFields is a list of field names (e.g. "ApproveApps") to include 497 // in API requests with the JSON null value. By default, fields with 498 // empty values are omitted from API requests. However, any field with 499 // an empty value appearing in NullFields will be sent to the server as 500 // null. It is an error if a field in this list has a non-empty value. 501 // This may be used to include null fields in Patch requests. 502 NullFields []string `json:"-"` 503} 504 505func (s *AdministratorWebTokenSpecPlaySearch) MarshalJSON() ([]byte, error) { 506 type NoMethod AdministratorWebTokenSpecPlaySearch 507 raw := NoMethod(*s) 508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 509} 510 511type AdministratorWebTokenSpecPrivateApps struct { 512 // Enabled: Whether the Private Apps page is displayed. Default is true. 513 Enabled bool `json:"enabled,omitempty"` 514 515 // ForceSendFields is a list of field names (e.g. "Enabled") to 516 // unconditionally include in API requests. By default, fields with 517 // empty or default values are omitted from API requests. However, any 518 // non-pointer, non-interface field appearing in ForceSendFields will be 519 // sent to the server regardless of whether the field is empty or not. 520 // This may be used to include empty fields in Patch requests. 521 ForceSendFields []string `json:"-"` 522 523 // NullFields is a list of field names (e.g. "Enabled") to include in 524 // API requests with the JSON null value. By default, fields with empty 525 // values are omitted from API requests. However, any field with an 526 // empty value appearing in NullFields will be sent to the server as 527 // null. It is an error if a field in this list has a non-empty value. 528 // This may be used to include null fields in Patch requests. 529 NullFields []string `json:"-"` 530} 531 532func (s *AdministratorWebTokenSpecPrivateApps) MarshalJSON() ([]byte, error) { 533 type NoMethod AdministratorWebTokenSpecPrivateApps 534 raw := NoMethod(*s) 535 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 536} 537 538type AdministratorWebTokenSpecStoreBuilder struct { 539 // Enabled: Whether the Organize apps page is displayed. Default is 540 // true. 541 Enabled bool `json:"enabled,omitempty"` 542 543 // ForceSendFields is a list of field names (e.g. "Enabled") to 544 // unconditionally include in API requests. By default, fields with 545 // empty or default values are omitted from API requests. However, any 546 // non-pointer, non-interface field appearing in ForceSendFields will be 547 // sent to the server regardless of whether the field is empty or not. 548 // This may be used to include empty fields in Patch requests. 549 ForceSendFields []string `json:"-"` 550 551 // NullFields is a list of field names (e.g. "Enabled") to include in 552 // API requests with the JSON null value. By default, fields with empty 553 // values are omitted from API requests. However, any field with an 554 // empty value appearing in NullFields will be sent to the server as 555 // null. It is an error if a field in this list has a non-empty value. 556 // This may be used to include null fields in Patch requests. 557 NullFields []string `json:"-"` 558} 559 560func (s *AdministratorWebTokenSpecStoreBuilder) MarshalJSON() ([]byte, error) { 561 type NoMethod AdministratorWebTokenSpecStoreBuilder 562 raw := NoMethod(*s) 563 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 564} 565 566type AdministratorWebTokenSpecWebApps struct { 567 // Enabled: Whether the Web Apps page is displayed. Default is true. 568 Enabled bool `json:"enabled,omitempty"` 569 570 // ForceSendFields is a list of field names (e.g. "Enabled") to 571 // unconditionally include in API requests. By default, fields with 572 // empty or default values are omitted from API requests. However, any 573 // non-pointer, non-interface field appearing in ForceSendFields will be 574 // sent to the server regardless of whether the field is empty or not. 575 // This may be used to include empty fields in Patch requests. 576 ForceSendFields []string `json:"-"` 577 578 // NullFields is a list of field names (e.g. "Enabled") to include in 579 // API requests with the JSON null value. By default, fields with empty 580 // values are omitted from API requests. However, any field with an 581 // empty value appearing in NullFields will be sent to the server as 582 // null. It is an error if a field in this list has a non-empty value. 583 // This may be used to include null fields in Patch requests. 584 NullFields []string `json:"-"` 585} 586 587func (s *AdministratorWebTokenSpecWebApps) MarshalJSON() ([]byte, error) { 588 type NoMethod AdministratorWebTokenSpecWebApps 589 raw := NoMethod(*s) 590 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 591} 592 593type AdministratorWebTokenSpecZeroTouch struct { 594 // Enabled: Whether zero-touch embedded UI is usable with this token. If 595 // enabled, the admin can link zero-touch customers to this enterprise. 596 Enabled bool `json:"enabled,omitempty"` 597 598 // ForceSendFields is a list of field names (e.g. "Enabled") to 599 // unconditionally include in API requests. By default, fields with 600 // empty or default values are omitted from API requests. However, any 601 // non-pointer, non-interface field appearing in ForceSendFields will be 602 // sent to the server regardless of whether the field is empty or not. 603 // This may be used to include empty fields in Patch requests. 604 ForceSendFields []string `json:"-"` 605 606 // NullFields is a list of field names (e.g. "Enabled") to include in 607 // API requests with the JSON null value. By default, fields with empty 608 // values are omitted from API requests. However, any field with an 609 // empty value appearing in NullFields will be sent to the server as 610 // null. It is an error if a field in this list has a non-empty value. 611 // This may be used to include null fields in Patch requests. 612 NullFields []string `json:"-"` 613} 614 615func (s *AdministratorWebTokenSpecZeroTouch) MarshalJSON() ([]byte, error) { 616 type NoMethod AdministratorWebTokenSpecZeroTouch 617 raw := NoMethod(*s) 618 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 619} 620 621// AppRestrictionsSchema: Represents the list of app restrictions 622// available to be pre-configured for the product. 623type AppRestrictionsSchema struct { 624 // Kind: Deprecated. 625 Kind string `json:"kind,omitempty"` 626 627 // Restrictions: The set of restrictions that make up this schema. 628 Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"` 629 630 // ServerResponse contains the HTTP response code and headers from the 631 // server. 632 googleapi.ServerResponse `json:"-"` 633 634 // ForceSendFields is a list of field names (e.g. "Kind") to 635 // unconditionally include in API requests. By default, fields with 636 // empty or default values are omitted from API requests. However, any 637 // non-pointer, non-interface field appearing in ForceSendFields will be 638 // sent to the server regardless of whether the field is empty or not. 639 // This may be used to include empty fields in Patch requests. 640 ForceSendFields []string `json:"-"` 641 642 // NullFields is a list of field names (e.g. "Kind") to include in API 643 // requests with the JSON null value. By default, fields with empty 644 // values are omitted from API requests. However, any field with an 645 // empty value appearing in NullFields will be sent to the server as 646 // null. It is an error if a field in this list has a non-empty value. 647 // This may be used to include null fields in Patch requests. 648 NullFields []string `json:"-"` 649} 650 651func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) { 652 type NoMethod AppRestrictionsSchema 653 raw := NoMethod(*s) 654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 655} 656 657// AppRestrictionsSchemaChangeEvent: An event generated when a new app 658// version is uploaded to Google Play and its app restrictions schema 659// changed. To fetch the app restrictions schema for an app, use 660// Products.getAppRestrictionsSchema on the EMM API. 661type AppRestrictionsSchemaChangeEvent struct { 662 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 663 // for which the app restriction schema changed. This field will always 664 // be present. 665 ProductId string `json:"productId,omitempty"` 666 667 // ForceSendFields is a list of field names (e.g. "ProductId") to 668 // unconditionally include in API requests. By default, fields with 669 // empty or default values are omitted from API requests. However, any 670 // non-pointer, non-interface field appearing in ForceSendFields will be 671 // sent to the server regardless of whether the field is empty or not. 672 // This may be used to include empty fields in Patch requests. 673 ForceSendFields []string `json:"-"` 674 675 // NullFields is a list of field names (e.g. "ProductId") to include in 676 // API requests with the JSON null value. By default, fields with empty 677 // values are omitted from API requests. However, any field with an 678 // empty value appearing in NullFields will be sent to the server as 679 // null. It is an error if a field in this list has a non-empty value. 680 // This may be used to include null fields in Patch requests. 681 NullFields []string `json:"-"` 682} 683 684func (s *AppRestrictionsSchemaChangeEvent) MarshalJSON() ([]byte, error) { 685 type NoMethod AppRestrictionsSchemaChangeEvent 686 raw := NoMethod(*s) 687 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 688} 689 690// AppRestrictionsSchemaRestriction: A restriction in the App 691// Restriction Schema represents a piece of configuration that may be 692// pre-applied. 693type AppRestrictionsSchemaRestriction struct { 694 // DefaultValue: The default value of the restriction. bundle and 695 // bundleArray restrictions never have a default value. 696 DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"` 697 698 // Description: A longer description of the restriction, giving more 699 // detail of what it affects. 700 Description string `json:"description,omitempty"` 701 702 // Entry: For choice or multiselect restrictions, the list of possible 703 // entries' human-readable names. 704 Entry []string `json:"entry,omitempty"` 705 706 // EntryValue: For choice or multiselect restrictions, the list of 707 // possible entries' machine-readable values. These values should be 708 // used in the configuration, either as a single string value for a 709 // choice restriction or in a stringArray for a multiselect restriction. 710 EntryValue []string `json:"entryValue,omitempty"` 711 712 // Key: The unique key that the product uses to identify the 713 // restriction, e.g. "com.google.android.gm.fieldname". 714 Key string `json:"key,omitempty"` 715 716 // NestedRestriction: For bundle or bundleArray restrictions, the list 717 // of nested restrictions. A bundle restriction is always nested within 718 // a bundleArray restriction, and a bundleArray restriction is at most 719 // two levels deep. 720 NestedRestriction []*AppRestrictionsSchemaRestriction `json:"nestedRestriction,omitempty"` 721 722 // RestrictionType: The type of the restriction. 723 // 724 // Possible values: 725 // "bool" - A restriction of boolean type. 726 // "string" - A restriction of string type. 727 // "integer" - A restriction of integer type. 728 // "choice" - A choice of one item from a set. 729 // "multiselect" - A choice of multiple items from a set. 730 // "hidden" - A hidden restriction of string type (the default value 731 // can be used to pass along information that cannot be modified, such 732 // as a version code). 733 // "bundle" - [M+ devices only] A bundle of restrictions 734 // "bundleArray" - [M+ devices only] An array of restriction bundles 735 RestrictionType string `json:"restrictionType,omitempty"` 736 737 // Title: The name of the restriction. 738 Title string `json:"title,omitempty"` 739 740 // ForceSendFields is a list of field names (e.g. "DefaultValue") to 741 // unconditionally include in API requests. By default, fields with 742 // empty or default values are omitted from API requests. However, any 743 // non-pointer, non-interface field appearing in ForceSendFields will be 744 // sent to the server regardless of whether the field is empty or not. 745 // This may be used to include empty fields in Patch requests. 746 ForceSendFields []string `json:"-"` 747 748 // NullFields is a list of field names (e.g. "DefaultValue") to include 749 // in API requests with the JSON null value. By default, fields with 750 // empty values are omitted from API requests. However, any field with 751 // an empty value appearing in NullFields will be sent to the server as 752 // null. It is an error if a field in this list has a non-empty value. 753 // This may be used to include null fields in Patch requests. 754 NullFields []string `json:"-"` 755} 756 757func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) { 758 type NoMethod AppRestrictionsSchemaRestriction 759 raw := NoMethod(*s) 760 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 761} 762 763// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for 764// the restriction. 765type AppRestrictionsSchemaRestrictionRestrictionValue struct { 766 // Type: The type of the value being provided. 767 // 768 // Possible values: 769 // "bool" - A restriction of boolean type. 770 // "string" - A restriction of string type. 771 // "integer" - A restriction of integer type. 772 // "choice" - A choice of one item from a set. 773 // "multiselect" - A choice of multiple items from a set. 774 // "hidden" - A hidden restriction of string type (the default value 775 // can be used to pass along information that cannot be modified, such 776 // as a version code). 777 // "bundle" - [M+ devices only] A bundle of restrictions 778 // "bundleArray" - [M+ devices only] An array of restriction bundles 779 Type string `json:"type,omitempty"` 780 781 // ValueBool: The boolean value - this will only be present if type is 782 // bool. 783 ValueBool bool `json:"valueBool,omitempty"` 784 785 // ValueInteger: The integer value - this will only be present if type 786 // is integer. 787 ValueInteger int64 `json:"valueInteger,omitempty"` 788 789 // ValueMultiselect: The list of string values - this will only be 790 // present if type is multiselect. 791 ValueMultiselect []string `json:"valueMultiselect,omitempty"` 792 793 // ValueString: The string value - this will be present for types 794 // string, choice and hidden. 795 ValueString string `json:"valueString,omitempty"` 796 797 // ForceSendFields is a list of field names (e.g. "Type") to 798 // unconditionally include in API requests. By default, fields with 799 // empty or default values are omitted from API requests. However, any 800 // non-pointer, non-interface field appearing in ForceSendFields will be 801 // sent to the server regardless of whether the field is empty or not. 802 // This may be used to include empty fields in Patch requests. 803 ForceSendFields []string `json:"-"` 804 805 // NullFields is a list of field names (e.g. "Type") to include in API 806 // requests with the JSON null value. By default, fields with empty 807 // values are omitted from API requests. However, any field with an 808 // empty value appearing in NullFields will be sent to the server as 809 // null. It is an error if a field in this list has a non-empty value. 810 // This may be used to include null fields in Patch requests. 811 NullFields []string `json:"-"` 812} 813 814func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) { 815 type NoMethod AppRestrictionsSchemaRestrictionRestrictionValue 816 raw := NoMethod(*s) 817 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 818} 819 820// AppState: List of states set by the app. 821type AppState struct { 822 // KeyedAppState: List of keyed app states. This field will always be 823 // present. 824 KeyedAppState []*KeyedAppState `json:"keyedAppState,omitempty"` 825 826 // PackageName: The package name of the app. This field will always be 827 // present. 828 PackageName string `json:"packageName,omitempty"` 829 830 // ForceSendFields is a list of field names (e.g. "KeyedAppState") to 831 // unconditionally include in API requests. By default, fields with 832 // empty or default values are omitted from API requests. However, any 833 // non-pointer, non-interface field appearing in ForceSendFields will be 834 // sent to the server regardless of whether the field is empty or not. 835 // This may be used to include empty fields in Patch requests. 836 ForceSendFields []string `json:"-"` 837 838 // NullFields is a list of field names (e.g. "KeyedAppState") to include 839 // in API requests with the JSON null value. By default, fields with 840 // empty values are omitted from API requests. However, any field with 841 // an empty value appearing in NullFields will be sent to the server as 842 // null. It is an error if a field in this list has a non-empty value. 843 // This may be used to include null fields in Patch requests. 844 NullFields []string `json:"-"` 845} 846 847func (s *AppState) MarshalJSON() ([]byte, error) { 848 type NoMethod AppState 849 raw := NoMethod(*s) 850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 851} 852 853// AppUpdateEvent: An event generated when a new version of an app is 854// uploaded to Google Play. Notifications are sent for new public 855// versions only: alpha, beta, or canary versions do not generate this 856// event. To fetch up-to-date version history for an app, use 857// Products.Get on the EMM API. 858type AppUpdateEvent struct { 859 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 860 // that was updated. This field will always be present. 861 ProductId string `json:"productId,omitempty"` 862 863 // ForceSendFields is a list of field names (e.g. "ProductId") to 864 // unconditionally include in API requests. By default, fields with 865 // empty or default values are omitted from API requests. However, any 866 // non-pointer, non-interface field appearing in ForceSendFields will be 867 // sent to the server regardless of whether the field is empty or not. 868 // This may be used to include empty fields in Patch requests. 869 ForceSendFields []string `json:"-"` 870 871 // NullFields is a list of field names (e.g. "ProductId") to include in 872 // API requests with the JSON null value. By default, fields with empty 873 // values are omitted from API requests. However, any field with an 874 // empty value appearing in NullFields will be sent to the server as 875 // null. It is an error if a field in this list has a non-empty value. 876 // This may be used to include null fields in Patch requests. 877 NullFields []string `json:"-"` 878} 879 880func (s *AppUpdateEvent) MarshalJSON() ([]byte, error) { 881 type NoMethod AppUpdateEvent 882 raw := NoMethod(*s) 883 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 884} 885 886// AppVersion: This represents a single version of the app. 887type AppVersion struct { 888 // IsProduction: True if this version is a production APK. 889 IsProduction bool `json:"isProduction,omitempty"` 890 891 // Track: Deprecated, use trackId instead. 892 // 893 // Possible values: 894 // "appTrackUnspecified" 895 // "production" 896 // "beta" 897 // "alpha" 898 Track string `json:"track,omitempty"` 899 900 // TrackId: Track ids that the app version is published in. Replaces the 901 // track field (deprecated), but doesn't include the production track 902 // (see isProduction instead). 903 TrackId []string `json:"trackId,omitempty"` 904 905 // VersionCode: Unique increasing identifier for the app version. 906 VersionCode int64 `json:"versionCode,omitempty"` 907 908 // VersionString: The string used in the Play store by the app developer 909 // to identify the version. The string is not necessarily unique or 910 // localized (for example, the string could be "1.4"). 911 VersionString string `json:"versionString,omitempty"` 912 913 // ForceSendFields is a list of field names (e.g. "IsProduction") to 914 // unconditionally include in API requests. By default, fields with 915 // empty or default values are omitted from API requests. However, any 916 // non-pointer, non-interface field appearing in ForceSendFields will be 917 // sent to the server regardless of whether the field is empty or not. 918 // This may be used to include empty fields in Patch requests. 919 ForceSendFields []string `json:"-"` 920 921 // NullFields is a list of field names (e.g. "IsProduction") to include 922 // in API requests with the JSON null value. By default, fields with 923 // empty values are omitted from API requests. However, any field with 924 // an empty value appearing in NullFields will be sent to the server as 925 // null. It is an error if a field in this list has a non-empty value. 926 // This may be used to include null fields in Patch requests. 927 NullFields []string `json:"-"` 928} 929 930func (s *AppVersion) MarshalJSON() ([]byte, error) { 931 type NoMethod AppVersion 932 raw := NoMethod(*s) 933 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 934} 935 936// ApprovalUrlInfo: Information on an approval URL. 937type ApprovalUrlInfo struct { 938 // ApprovalUrl: A URL that displays a product's permissions and that can 939 // also be used to approve the product with the Products.approve call. 940 ApprovalUrl string `json:"approvalUrl,omitempty"` 941 942 // ForceSendFields is a list of field names (e.g. "ApprovalUrl") to 943 // unconditionally include in API requests. By default, fields with 944 // empty or default values are omitted from API requests. However, any 945 // non-pointer, non-interface field appearing in ForceSendFields will be 946 // sent to the server regardless of whether the field is empty or not. 947 // This may be used to include empty fields in Patch requests. 948 ForceSendFields []string `json:"-"` 949 950 // NullFields is a list of field names (e.g. "ApprovalUrl") to include 951 // in API requests with the JSON null value. By default, fields with 952 // empty values are omitted from API requests. However, any field with 953 // an empty value appearing in NullFields will be sent to the server as 954 // null. It is an error if a field in this list has a non-empty value. 955 // This may be used to include null fields in Patch requests. 956 NullFields []string `json:"-"` 957} 958 959func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) { 960 type NoMethod ApprovalUrlInfo 961 raw := NoMethod(*s) 962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 963} 964 965// AuthenticationToken: An AuthenticationToken is used by the EMM's 966// device policy client on a device to provision the given EMM-managed 967// user on that device. 968type AuthenticationToken struct { 969 // Token: The authentication token to be passed to the device policy 970 // client on the device where it can be used to provision the account 971 // for which this token was generated. 972 Token string `json:"token,omitempty"` 973 974 // ServerResponse contains the HTTP response code and headers from the 975 // server. 976 googleapi.ServerResponse `json:"-"` 977 978 // ForceSendFields is a list of field names (e.g. "Token") to 979 // unconditionally include in API requests. By default, fields with 980 // empty or default values are omitted from API requests. However, any 981 // non-pointer, non-interface field appearing in ForceSendFields will be 982 // sent to the server regardless of whether the field is empty or not. 983 // This may be used to include empty fields in Patch requests. 984 ForceSendFields []string `json:"-"` 985 986 // NullFields is a list of field names (e.g. "Token") to include in API 987 // requests with the JSON null value. By default, fields with empty 988 // values are omitted from API requests. However, any field with an 989 // empty value appearing in NullFields will be sent to the server as 990 // null. It is an error if a field in this list has a non-empty value. 991 // This may be used to include null fields in Patch requests. 992 NullFields []string `json:"-"` 993} 994 995func (s *AuthenticationToken) MarshalJSON() ([]byte, error) { 996 type NoMethod AuthenticationToken 997 raw := NoMethod(*s) 998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 999} 1000 1001// AutoInstallConstraint: The auto-install constraint. Defines a set of 1002// restrictions for installation. At least one of the fields must be 1003// set. 1004type AutoInstallConstraint struct { 1005 // ChargingStateConstraint: Charging state constraint. 1006 // 1007 // Possible values: 1008 // "chargingStateConstraintUnspecified" 1009 // "chargingNotRequired" - Device doesn't have to be charging. 1010 // "chargingRequired" - Device has to be charging. 1011 ChargingStateConstraint string `json:"chargingStateConstraint,omitempty"` 1012 1013 // DeviceIdleStateConstraint: Device idle state constraint. 1014 // 1015 // Possible values: 1016 // "deviceIdleStateConstraintUnspecified" 1017 // "deviceIdleNotRequired" - Device doesn't have to be idle, app can 1018 // be installed while the user is interacting with the device. 1019 // "deviceIdleRequired" - Device has to be idle. 1020 DeviceIdleStateConstraint string `json:"deviceIdleStateConstraint,omitempty"` 1021 1022 // NetworkTypeConstraint: Network type constraint. 1023 // 1024 // Possible values: 1025 // "networkTypeConstraintUnspecified" 1026 // "anyNetwork" - Any active networks (Wi-Fi, cellular, etc.). 1027 // "unmeteredNetwork" - Any unmetered network (e.g. Wi-FI). 1028 NetworkTypeConstraint string `json:"networkTypeConstraint,omitempty"` 1029 1030 // ForceSendFields is a list of field names (e.g. 1031 // "ChargingStateConstraint") to unconditionally include in API 1032 // requests. By default, fields with empty or default values are omitted 1033 // from API requests. However, any non-pointer, non-interface field 1034 // appearing in ForceSendFields will be sent to the server regardless of 1035 // whether the field is empty or not. This may be used to include empty 1036 // fields in Patch requests. 1037 ForceSendFields []string `json:"-"` 1038 1039 // NullFields is a list of field names (e.g. "ChargingStateConstraint") 1040 // to include in API requests with the JSON null value. By default, 1041 // fields with empty values are omitted from API requests. However, any 1042 // field with an empty value appearing in NullFields will be sent to the 1043 // server as null. It is an error if a field in this list has a 1044 // non-empty value. This may be used to include null fields in Patch 1045 // requests. 1046 NullFields []string `json:"-"` 1047} 1048 1049func (s *AutoInstallConstraint) MarshalJSON() ([]byte, error) { 1050 type NoMethod AutoInstallConstraint 1051 raw := NoMethod(*s) 1052 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1053} 1054 1055type AutoInstallPolicy struct { 1056 // AutoInstallConstraint: The constraints for auto-installing the app. 1057 // You can specify a maximum of one constraint. 1058 AutoInstallConstraint []*AutoInstallConstraint `json:"autoInstallConstraint,omitempty"` 1059 1060 // AutoInstallMode: The auto-install mode. If unset defaults to 1061 // "doNotAutoInstall". 1062 // 1063 // Possible values: 1064 // "autoInstallModeUnspecified" 1065 // "doNotAutoInstall" - The product is not installed automatically, 1066 // the user needs to install it from the Play Store. 1067 // "autoInstallOnce" - The product is automatically installed once, if 1068 // the user uninstalls the product it will not be installed again. 1069 // "forceAutoInstall" - The product is automatically installed, if the 1070 // user uninstalls the product it will be installed again. On managed 1071 // devices the DPC should block uninstall. 1072 AutoInstallMode string `json:"autoInstallMode,omitempty"` 1073 1074 // AutoInstallPriority: The priority of the install, as an unsigned 1075 // integer. A lower number means higher priority. 1076 AutoInstallPriority int64 `json:"autoInstallPriority,omitempty"` 1077 1078 // MinimumVersionCode: The minimum version of the app. If a lower 1079 // version of the app is installed, then the app will be auto-updated 1080 // according to the auto-install constraints, instead of waiting for the 1081 // regular auto-update. You can set a minimum version code for at most 1082 // 20 apps per device. 1083 MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"` 1084 1085 // ForceSendFields is a list of field names (e.g. 1086 // "AutoInstallConstraint") to unconditionally include in API requests. 1087 // By default, fields with empty or default values are omitted from API 1088 // requests. However, any non-pointer, non-interface field appearing in 1089 // ForceSendFields will be sent to the server regardless of whether the 1090 // field is empty or not. This may be used to include empty fields in 1091 // Patch requests. 1092 ForceSendFields []string `json:"-"` 1093 1094 // NullFields is a list of field names (e.g. "AutoInstallConstraint") to 1095 // include in API requests with the JSON null value. By default, fields 1096 // with empty values are omitted from API requests. However, any field 1097 // with an empty value appearing in NullFields will be sent to the 1098 // server as null. It is an error if a field in this list has a 1099 // non-empty value. This may be used to include null fields in Patch 1100 // requests. 1101 NullFields []string `json:"-"` 1102} 1103 1104func (s *AutoInstallPolicy) MarshalJSON() ([]byte, error) { 1105 type NoMethod AutoInstallPolicy 1106 raw := NoMethod(*s) 1107 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1108} 1109 1110// ConfigurationVariables: A configuration variables resource contains 1111// the managed configuration settings ID to be applied to a single user, 1112// as well as the variable set that is attributed to the user. The 1113// variable set will be used to replace placeholders in the managed 1114// configuration settings. 1115type ConfigurationVariables struct { 1116 // McmId: The ID of the managed configurations settings. 1117 McmId string `json:"mcmId,omitempty"` 1118 1119 // VariableSet: The variable set that is attributed to the user. 1120 VariableSet []*VariableSet `json:"variableSet,omitempty"` 1121 1122 // ForceSendFields is a list of field names (e.g. "McmId") to 1123 // unconditionally include in API requests. By default, fields with 1124 // empty or default values are omitted from API requests. However, any 1125 // non-pointer, non-interface field appearing in ForceSendFields will be 1126 // sent to the server regardless of whether the field is empty or not. 1127 // This may be used to include empty fields in Patch requests. 1128 ForceSendFields []string `json:"-"` 1129 1130 // NullFields is a list of field names (e.g. "McmId") to include in API 1131 // requests with the JSON null value. By default, fields with empty 1132 // values are omitted from API requests. However, any field with an 1133 // empty value appearing in NullFields will be sent to the server as 1134 // null. It is an error if a field in this list has a non-empty value. 1135 // This may be used to include null fields in Patch requests. 1136 NullFields []string `json:"-"` 1137} 1138 1139func (s *ConfigurationVariables) MarshalJSON() ([]byte, error) { 1140 type NoMethod ConfigurationVariables 1141 raw := NoMethod(*s) 1142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1143} 1144 1145// Device: A Devices resource represents a mobile device managed by the 1146// EMM and belonging to a specific enterprise user. 1147type Device struct { 1148 // AndroidId: The Google Play Services Android ID for the device encoded 1149 // as a lowercase hex string. For example, "123456789abcdef0". 1150 AndroidId string `json:"androidId,omitempty"` 1151 1152 // ManagementType: Identifies the extent to which the device is 1153 // controlled by a managed Google Play EMM in various deployment 1154 // configurations. Possible values include: - "managedDevice", a device 1155 // that has the EMM's device policy controller (DPC) as the device 1156 // owner. - "managedProfile", a device that has a profile managed by the 1157 // DPC (DPC is profile owner) in addition to a separate, personal 1158 // profile that is unavailable to the DPC. - "containerApp", no longer 1159 // used (deprecated). - "unmanagedProfile", a device that has been 1160 // allowed (by the domain's admin, using the Admin Console to enable the 1161 // privilege) to use managed Google Play, but the profile is itself not 1162 // owned by a DPC. 1163 // 1164 // Possible values: 1165 // "managedDevice" 1166 // "managedProfile" 1167 // "containerApp" 1168 // "unmanagedProfile" 1169 ManagementType string `json:"managementType,omitempty"` 1170 1171 // Policy: The policy enforced on the device. 1172 Policy *Policy `json:"policy,omitempty"` 1173 1174 // Report: The device report updated with the latest app states. 1175 Report *DeviceReport `json:"report,omitempty"` 1176 1177 // ServerResponse contains the HTTP response code and headers from the 1178 // server. 1179 googleapi.ServerResponse `json:"-"` 1180 1181 // ForceSendFields is a list of field names (e.g. "AndroidId") to 1182 // unconditionally include in API requests. By default, fields with 1183 // empty or default values are omitted from API requests. However, any 1184 // non-pointer, non-interface field appearing in ForceSendFields will be 1185 // sent to the server regardless of whether the field is empty or not. 1186 // This may be used to include empty fields in Patch requests. 1187 ForceSendFields []string `json:"-"` 1188 1189 // NullFields is a list of field names (e.g. "AndroidId") to include in 1190 // API requests with the JSON null value. By default, fields with empty 1191 // values are omitted from API requests. However, any field with an 1192 // empty value appearing in NullFields will be sent to the server as 1193 // null. It is an error if a field in this list has a non-empty value. 1194 // This may be used to include null fields in Patch requests. 1195 NullFields []string `json:"-"` 1196} 1197 1198func (s *Device) MarshalJSON() ([]byte, error) { 1199 type NoMethod Device 1200 raw := NoMethod(*s) 1201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1202} 1203 1204// DeviceReport: Device report updated with the latest app states for 1205// managed apps on the device. 1206type DeviceReport struct { 1207 // AppState: List of app states set by managed apps on the device. App 1208 // states are defined by the app's developers. This field will always be 1209 // present. 1210 AppState []*AppState `json:"appState,omitempty"` 1211 1212 // LastUpdatedTimestampMillis: The timestamp of the last report update 1213 // in milliseconds since epoch. This field will always be present. 1214 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 1215 1216 // ForceSendFields is a list of field names (e.g. "AppState") to 1217 // unconditionally include in API requests. By default, fields with 1218 // empty or default values are omitted from API requests. However, any 1219 // non-pointer, non-interface field appearing in ForceSendFields will be 1220 // sent to the server regardless of whether the field is empty or not. 1221 // This may be used to include empty fields in Patch requests. 1222 ForceSendFields []string `json:"-"` 1223 1224 // NullFields is a list of field names (e.g. "AppState") to include in 1225 // API requests with the JSON null value. By default, fields with empty 1226 // values are omitted from API requests. However, any field with an 1227 // empty value appearing in NullFields will be sent to the server as 1228 // null. It is an error if a field in this list has a non-empty value. 1229 // This may be used to include null fields in Patch requests. 1230 NullFields []string `json:"-"` 1231} 1232 1233func (s *DeviceReport) MarshalJSON() ([]byte, error) { 1234 type NoMethod DeviceReport 1235 raw := NoMethod(*s) 1236 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1237} 1238 1239// DeviceReportUpdateEvent: An event generated when an updated device 1240// report is available. 1241type DeviceReportUpdateEvent struct { 1242 // DeviceId: The Android ID of the device. This field will always be 1243 // present. 1244 DeviceId string `json:"deviceId,omitempty"` 1245 1246 // Report: The device report updated with the latest app states. This 1247 // field will always be present. 1248 Report *DeviceReport `json:"report,omitempty"` 1249 1250 // UserId: The ID of the user. This field will always be present. 1251 UserId string `json:"userId,omitempty"` 1252 1253 // ForceSendFields is a list of field names (e.g. "DeviceId") to 1254 // unconditionally include in API requests. By default, fields with 1255 // empty or default values are omitted from API requests. However, any 1256 // non-pointer, non-interface field appearing in ForceSendFields will be 1257 // sent to the server regardless of whether the field is empty or not. 1258 // This may be used to include empty fields in Patch requests. 1259 ForceSendFields []string `json:"-"` 1260 1261 // NullFields is a list of field names (e.g. "DeviceId") to include in 1262 // API requests with the JSON null value. By default, fields with empty 1263 // values are omitted from API requests. However, any field with an 1264 // empty value appearing in NullFields will be sent to the server as 1265 // null. It is an error if a field in this list has a non-empty value. 1266 // This may be used to include null fields in Patch requests. 1267 NullFields []string `json:"-"` 1268} 1269 1270func (s *DeviceReportUpdateEvent) MarshalJSON() ([]byte, error) { 1271 type NoMethod DeviceReportUpdateEvent 1272 raw := NoMethod(*s) 1273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1274} 1275 1276// DeviceState: The state of a user's device, as accessed by the 1277// getState and setState methods on device resources. 1278type DeviceState struct { 1279 // AccountState: The state of the Google account on the device. 1280 // "enabled" indicates that the Google account on the device can be used 1281 // to access Google services (including Google Play), while "disabled" 1282 // means that it cannot. A new device is initially in the "disabled" 1283 // state. 1284 // 1285 // Possible values: 1286 // "enabled" 1287 // "disabled" 1288 AccountState string `json:"accountState,omitempty"` 1289 1290 // ServerResponse contains the HTTP response code and headers from the 1291 // server. 1292 googleapi.ServerResponse `json:"-"` 1293 1294 // ForceSendFields is a list of field names (e.g. "AccountState") to 1295 // unconditionally include in API requests. By default, fields with 1296 // empty or default values are omitted from API requests. However, any 1297 // non-pointer, non-interface field appearing in ForceSendFields will be 1298 // sent to the server regardless of whether the field is empty or not. 1299 // This may be used to include empty fields in Patch requests. 1300 ForceSendFields []string `json:"-"` 1301 1302 // NullFields is a list of field names (e.g. "AccountState") to include 1303 // in API requests with the JSON null value. By default, fields with 1304 // empty values are omitted from API requests. However, any field with 1305 // an empty value appearing in NullFields will be sent to the server as 1306 // null. It is an error if a field in this list has a non-empty value. 1307 // This may be used to include null fields in Patch requests. 1308 NullFields []string `json:"-"` 1309} 1310 1311func (s *DeviceState) MarshalJSON() ([]byte, error) { 1312 type NoMethod DeviceState 1313 raw := NoMethod(*s) 1314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1315} 1316 1317type DevicesListResponse struct { 1318 // Device: A managed device. 1319 Device []*Device `json:"device,omitempty"` 1320 1321 // ServerResponse contains the HTTP response code and headers from the 1322 // server. 1323 googleapi.ServerResponse `json:"-"` 1324 1325 // ForceSendFields is a list of field names (e.g. "Device") to 1326 // unconditionally include in API requests. By default, fields with 1327 // empty or default values are omitted from API requests. However, any 1328 // non-pointer, non-interface field appearing in ForceSendFields will be 1329 // sent to the server regardless of whether the field is empty or not. 1330 // This may be used to include empty fields in Patch requests. 1331 ForceSendFields []string `json:"-"` 1332 1333 // NullFields is a list of field names (e.g. "Device") to include in API 1334 // requests with the JSON null value. By default, fields with empty 1335 // values are omitted from API requests. However, any field with an 1336 // empty value appearing in NullFields will be sent to the server as 1337 // null. It is an error if a field in this list has a non-empty value. 1338 // This may be used to include null fields in Patch requests. 1339 NullFields []string `json:"-"` 1340} 1341 1342func (s *DevicesListResponse) MarshalJSON() ([]byte, error) { 1343 type NoMethod DevicesListResponse 1344 raw := NoMethod(*s) 1345 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1346} 1347 1348// Enterprise: An Enterprises resource represents the binding between an 1349// EMM and a specific organization. That binding can be instantiated in 1350// one of two different ways using this API as follows: - For Google 1351// managed domain customers, the process involves using 1352// Enterprises.enroll and Enterprises.setAccount (in conjunction with 1353// artifacts obtained from the Admin console and the Google API Console) 1354// and submitted to the EMM through a more-or-less manual process. - For 1355// managed Google Play Accounts customers, the process involves using 1356// Enterprises.generateSignupUrl and Enterprises.completeSignup in 1357// conjunction with the managed Google Play sign-up UI (Google-provided 1358// mechanism) to create the binding without manual steps. As an EMM, you 1359// can support either or both approaches in your EMM console. See Create 1360// an Enterprise for details. 1361type Enterprise struct { 1362 // Administrator: Admins of the enterprise. This is only supported for 1363 // enterprises created via the EMM-initiated flow. 1364 Administrator []*Administrator `json:"administrator,omitempty"` 1365 1366 // Id: The unique ID for the enterprise. 1367 Id string `json:"id,omitempty"` 1368 1369 // Name: The name of the enterprise, for example, "Example, Inc". 1370 Name string `json:"name,omitempty"` 1371 1372 // PrimaryDomain: The enterprise's primary domain, such as 1373 // "example.com". 1374 PrimaryDomain string `json:"primaryDomain,omitempty"` 1375 1376 // ServerResponse contains the HTTP response code and headers from the 1377 // server. 1378 googleapi.ServerResponse `json:"-"` 1379 1380 // ForceSendFields is a list of field names (e.g. "Administrator") to 1381 // unconditionally include in API requests. By default, fields with 1382 // empty or default values are omitted from API requests. However, any 1383 // non-pointer, non-interface field appearing in ForceSendFields will be 1384 // sent to the server regardless of whether the field is empty or not. 1385 // This may be used to include empty fields in Patch requests. 1386 ForceSendFields []string `json:"-"` 1387 1388 // NullFields is a list of field names (e.g. "Administrator") to include 1389 // in API requests with the JSON null value. By default, fields with 1390 // empty values are omitted from API requests. However, any field with 1391 // an empty value appearing in NullFields will be sent to the server as 1392 // null. It is an error if a field in this list has a non-empty value. 1393 // This may be used to include null fields in Patch requests. 1394 NullFields []string `json:"-"` 1395} 1396 1397func (s *Enterprise) MarshalJSON() ([]byte, error) { 1398 type NoMethod Enterprise 1399 raw := NoMethod(*s) 1400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1401} 1402 1403// EnterpriseAccount: A service account that can be used to authenticate 1404// as the enterprise to API calls that require such authentication. 1405type EnterpriseAccount struct { 1406 // AccountEmail: The email address of the service account. 1407 AccountEmail string `json:"accountEmail,omitempty"` 1408 1409 // ServerResponse contains the HTTP response code and headers from the 1410 // server. 1411 googleapi.ServerResponse `json:"-"` 1412 1413 // ForceSendFields is a list of field names (e.g. "AccountEmail") to 1414 // unconditionally include in API requests. By default, fields with 1415 // empty or default values are omitted from API requests. However, any 1416 // non-pointer, non-interface field appearing in ForceSendFields will be 1417 // sent to the server regardless of whether the field is empty or not. 1418 // This may be used to include empty fields in Patch requests. 1419 ForceSendFields []string `json:"-"` 1420 1421 // NullFields is a list of field names (e.g. "AccountEmail") to include 1422 // in API requests with the JSON null value. By default, fields with 1423 // empty values are omitted from API requests. However, any field with 1424 // an empty value appearing in NullFields will be sent to the server as 1425 // null. It is an error if a field in this list has a non-empty value. 1426 // This may be used to include null fields in Patch requests. 1427 NullFields []string `json:"-"` 1428} 1429 1430func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) { 1431 type NoMethod EnterpriseAccount 1432 raw := NoMethod(*s) 1433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1434} 1435 1436type EnterprisesListResponse struct { 1437 // Enterprise: An enterprise. 1438 Enterprise []*Enterprise `json:"enterprise,omitempty"` 1439 1440 // ServerResponse contains the HTTP response code and headers from the 1441 // server. 1442 googleapi.ServerResponse `json:"-"` 1443 1444 // ForceSendFields is a list of field names (e.g. "Enterprise") to 1445 // unconditionally include in API requests. By default, fields with 1446 // empty or default values are omitted from API requests. However, any 1447 // non-pointer, non-interface field appearing in ForceSendFields will be 1448 // sent to the server regardless of whether the field is empty or not. 1449 // This may be used to include empty fields in Patch requests. 1450 ForceSendFields []string `json:"-"` 1451 1452 // NullFields is a list of field names (e.g. "Enterprise") to include in 1453 // API requests with the JSON null value. By default, fields with empty 1454 // values are omitted from API requests. However, any field with an 1455 // empty value appearing in NullFields will be sent to the server as 1456 // null. It is an error if a field in this list has a non-empty value. 1457 // This may be used to include null fields in Patch requests. 1458 NullFields []string `json:"-"` 1459} 1460 1461func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) { 1462 type NoMethod EnterprisesListResponse 1463 raw := NoMethod(*s) 1464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1465} 1466 1467type EnterprisesSendTestPushNotificationResponse struct { 1468 // MessageId: The message ID of the test push notification that was 1469 // sent. 1470 MessageId string `json:"messageId,omitempty"` 1471 1472 // TopicName: The name of the Cloud Pub/Sub topic to which notifications 1473 // for this enterprise's enrolled account will be sent. 1474 TopicName string `json:"topicName,omitempty"` 1475 1476 // ServerResponse contains the HTTP response code and headers from the 1477 // server. 1478 googleapi.ServerResponse `json:"-"` 1479 1480 // ForceSendFields is a list of field names (e.g. "MessageId") to 1481 // unconditionally include in API requests. By default, fields with 1482 // empty or default values are omitted from API requests. However, any 1483 // non-pointer, non-interface field appearing in ForceSendFields will be 1484 // sent to the server regardless of whether the field is empty or not. 1485 // This may be used to include empty fields in Patch requests. 1486 ForceSendFields []string `json:"-"` 1487 1488 // NullFields is a list of field names (e.g. "MessageId") to include in 1489 // API requests with the JSON null value. By default, fields with empty 1490 // values are omitted from API requests. However, any field with an 1491 // empty value appearing in NullFields will be sent to the server as 1492 // null. It is an error if a field in this list has a non-empty value. 1493 // This may be used to include null fields in Patch requests. 1494 NullFields []string `json:"-"` 1495} 1496 1497func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) { 1498 type NoMethod EnterprisesSendTestPushNotificationResponse 1499 raw := NoMethod(*s) 1500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1501} 1502 1503// Entitlement: The presence of an Entitlements resource indicates that 1504// a user has the right to use a particular app. Entitlements are user 1505// specific, not device specific. This allows a user with an entitlement 1506// to an app to install the app on all their devices. It's also possible 1507// for a user to hold an entitlement to an app without installing the 1508// app on any device. The API can be used to create an entitlement. As 1509// an option, you can also use the API to trigger the installation of an 1510// app on all a user's managed devices at the same time the entitlement 1511// is created. If the app is free, creating the entitlement also creates 1512// a group license for that app. For paid apps, creating the entitlement 1513// consumes one license, and that license remains consumed until the 1514// entitlement is removed. If the enterprise hasn't purchased enough 1515// licenses, then no entitlement is created and the installation fails. 1516// An entitlement is also not created for an app if the app requires 1517// permissions that the enterprise hasn't accepted. If an entitlement is 1518// deleted, the app may be uninstalled from a user's device. As a best 1519// practice, uninstall the app by calling Installs.delete() before 1520// deleting the entitlement. Entitlements for apps that a user pays for 1521// on an unmanaged profile have "userPurchase" as the entitlement 1522// reason. These entitlements cannot be removed via the API. 1523type Entitlement struct { 1524 // ProductId: The ID of the product that the entitlement is for. For 1525 // example, "app:com.google.android.gm". 1526 ProductId string `json:"productId,omitempty"` 1527 1528 // Reason: The reason for the entitlement. For example, "free" for free 1529 // apps. This property is temporary: it will be replaced by the 1530 // acquisition kind field of group licenses. 1531 // 1532 // Possible values: 1533 // "free" 1534 // "groupLicense" 1535 // "userPurchase" 1536 Reason string `json:"reason,omitempty"` 1537 1538 // ServerResponse contains the HTTP response code and headers from the 1539 // server. 1540 googleapi.ServerResponse `json:"-"` 1541 1542 // ForceSendFields is a list of field names (e.g. "ProductId") to 1543 // unconditionally include in API requests. By default, fields with 1544 // empty or default values are omitted from API requests. However, any 1545 // non-pointer, non-interface field appearing in ForceSendFields will be 1546 // sent to the server regardless of whether the field is empty or not. 1547 // This may be used to include empty fields in Patch requests. 1548 ForceSendFields []string `json:"-"` 1549 1550 // NullFields is a list of field names (e.g. "ProductId") to include in 1551 // API requests with the JSON null value. By default, fields with empty 1552 // values are omitted from API requests. However, any field with an 1553 // empty value appearing in NullFields will be sent to the server as 1554 // null. It is an error if a field in this list has a non-empty value. 1555 // This may be used to include null fields in Patch requests. 1556 NullFields []string `json:"-"` 1557} 1558 1559func (s *Entitlement) MarshalJSON() ([]byte, error) { 1560 type NoMethod Entitlement 1561 raw := NoMethod(*s) 1562 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1563} 1564 1565type EntitlementsListResponse struct { 1566 // Entitlement: An entitlement of a user to a product (e.g. an app). For 1567 // example, a free app that they have installed, or a paid app that they 1568 // have been allocated a license to. 1569 Entitlement []*Entitlement `json:"entitlement,omitempty"` 1570 1571 // ServerResponse contains the HTTP response code and headers from the 1572 // server. 1573 googleapi.ServerResponse `json:"-"` 1574 1575 // ForceSendFields is a list of field names (e.g. "Entitlement") to 1576 // unconditionally include in API requests. By default, fields with 1577 // empty or default values are omitted from API requests. However, any 1578 // non-pointer, non-interface field appearing in ForceSendFields will be 1579 // sent to the server regardless of whether the field is empty or not. 1580 // This may be used to include empty fields in Patch requests. 1581 ForceSendFields []string `json:"-"` 1582 1583 // NullFields is a list of field names (e.g. "Entitlement") to include 1584 // in API requests with the JSON null value. By default, fields with 1585 // empty values are omitted from API requests. However, any field with 1586 // an empty value appearing in NullFields will be sent to the server as 1587 // null. It is an error if a field in this list has a non-empty value. 1588 // This may be used to include null fields in Patch requests. 1589 NullFields []string `json:"-"` 1590} 1591 1592func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) { 1593 type NoMethod EntitlementsListResponse 1594 raw := NoMethod(*s) 1595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1596} 1597 1598// GroupLicense: Group license objects allow you to keep track of 1599// licenses (called entitlements) for both free and paid apps. For a 1600// free app, a group license is created when an enterprise admin first 1601// approves the product in Google Play or when the first entitlement for 1602// the product is created for a user via the API. For a paid app, a 1603// group license object is only created when an enterprise admin 1604// purchases the product in Google Play for the first time. Use the API 1605// to query group licenses. A Grouplicenses resource includes the total 1606// number of licenses purchased (paid apps only) and the total number of 1607// licenses currently in use. In other words, the total number of 1608// Entitlements that exist for the product. Only one group license 1609// object is created per product and group license objects are never 1610// deleted. If a product is unapproved, its group license remains. This 1611// allows enterprise admins to keep track of any remaining entitlements 1612// for the product. 1613type GroupLicense struct { 1614 // AcquisitionKind: How this group license was acquired. "bulkPurchase" 1615 // means that this Grouplicenses resource was created because the 1616 // enterprise purchased licenses for this product; otherwise, the value 1617 // is "free" (for free products). 1618 // 1619 // Possible values: 1620 // "free" 1621 // "bulkPurchase" 1622 AcquisitionKind string `json:"acquisitionKind,omitempty"` 1623 1624 // Approval: Whether the product to which this group license relates is 1625 // currently approved by the enterprise. Products are approved when a 1626 // group license is first created, but this approval may be revoked by 1627 // an enterprise admin via Google Play. Unapproved products will not be 1628 // visible to end users in collections, and new entitlements to them 1629 // should not normally be created. 1630 // 1631 // Possible values: 1632 // "approved" 1633 // "unapproved" 1634 Approval string `json:"approval,omitempty"` 1635 1636 // NumProvisioned: The total number of provisioned licenses for this 1637 // product. Returned by read operations, but ignored in write 1638 // operations. 1639 NumProvisioned int64 `json:"numProvisioned,omitempty"` 1640 1641 // NumPurchased: The number of purchased licenses (possibly in multiple 1642 // purchases). If this field is omitted, then there is no limit on the 1643 // number of licenses that can be provisioned (for example, if the 1644 // acquisition kind is "free"). 1645 NumPurchased int64 `json:"numPurchased,omitempty"` 1646 1647 // Permissions: The permission approval status of the product. This 1648 // field is only set if the product is approved. Possible states are: - 1649 // "currentApproved", the current set of permissions is approved, but 1650 // additional permissions will require the administrator to reapprove 1651 // the product (If the product was approved without specifying the 1652 // approved permissions setting, then this is the default behavior.), - 1653 // "needsReapproval", the product has unapproved permissions. No 1654 // additional product licenses can be assigned until the product is 1655 // reapproved, - "allCurrentAndFutureApproved", the current permissions 1656 // are approved and any future permission updates will be automatically 1657 // approved without administrator review. 1658 // 1659 // Possible values: 1660 // "currentApproved" 1661 // "needsReapproval" 1662 // "allCurrentAndFutureApproved" 1663 Permissions string `json:"permissions,omitempty"` 1664 1665 // ProductId: The ID of the product that the license is for. For 1666 // example, "app:com.google.android.gm". 1667 ProductId string `json:"productId,omitempty"` 1668 1669 // ServerResponse contains the HTTP response code and headers from the 1670 // server. 1671 googleapi.ServerResponse `json:"-"` 1672 1673 // ForceSendFields is a list of field names (e.g. "AcquisitionKind") to 1674 // unconditionally include in API requests. By default, fields with 1675 // empty or default values are omitted from API requests. However, any 1676 // non-pointer, non-interface field appearing in ForceSendFields will be 1677 // sent to the server regardless of whether the field is empty or not. 1678 // This may be used to include empty fields in Patch requests. 1679 ForceSendFields []string `json:"-"` 1680 1681 // NullFields is a list of field names (e.g. "AcquisitionKind") to 1682 // include in API requests with the JSON null value. By default, fields 1683 // with empty values are omitted from API requests. However, any field 1684 // with an empty value appearing in NullFields will be sent to the 1685 // server as null. It is an error if a field in this list has a 1686 // non-empty value. This may be used to include null fields in Patch 1687 // requests. 1688 NullFields []string `json:"-"` 1689} 1690 1691func (s *GroupLicense) MarshalJSON() ([]byte, error) { 1692 type NoMethod GroupLicense 1693 raw := NoMethod(*s) 1694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1695} 1696 1697type GroupLicenseUsersListResponse struct { 1698 // User: A user of an enterprise. 1699 User []*User `json:"user,omitempty"` 1700 1701 // ServerResponse contains the HTTP response code and headers from the 1702 // server. 1703 googleapi.ServerResponse `json:"-"` 1704 1705 // ForceSendFields is a list of field names (e.g. "User") to 1706 // unconditionally include in API requests. By default, fields with 1707 // empty or default values are omitted from API requests. However, any 1708 // non-pointer, non-interface field appearing in ForceSendFields will be 1709 // sent to the server regardless of whether the field is empty or not. 1710 // This may be used to include empty fields in Patch requests. 1711 ForceSendFields []string `json:"-"` 1712 1713 // NullFields is a list of field names (e.g. "User") to include in API 1714 // requests with the JSON null value. By default, fields with empty 1715 // values are omitted from API requests. However, any field with an 1716 // empty value appearing in NullFields will be sent to the server as 1717 // null. It is an error if a field in this list has a non-empty value. 1718 // This may be used to include null fields in Patch requests. 1719 NullFields []string `json:"-"` 1720} 1721 1722func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) { 1723 type NoMethod GroupLicenseUsersListResponse 1724 raw := NoMethod(*s) 1725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1726} 1727 1728type GroupLicensesListResponse struct { 1729 // GroupLicense: A group license for a product approved for use in the 1730 // enterprise. 1731 GroupLicense []*GroupLicense `json:"groupLicense,omitempty"` 1732 1733 // ServerResponse contains the HTTP response code and headers from the 1734 // server. 1735 googleapi.ServerResponse `json:"-"` 1736 1737 // ForceSendFields is a list of field names (e.g. "GroupLicense") to 1738 // unconditionally include in API requests. By default, fields with 1739 // empty or default values are omitted from API requests. However, any 1740 // non-pointer, non-interface field appearing in ForceSendFields will be 1741 // sent to the server regardless of whether the field is empty or not. 1742 // This may be used to include empty fields in Patch requests. 1743 ForceSendFields []string `json:"-"` 1744 1745 // NullFields is a list of field names (e.g. "GroupLicense") to include 1746 // in API requests with the JSON null value. By default, fields with 1747 // empty values are omitted from API requests. However, any field with 1748 // an empty value appearing in NullFields will be sent to the server as 1749 // null. It is an error if a field in this list has a non-empty value. 1750 // This may be used to include null fields in Patch requests. 1751 NullFields []string `json:"-"` 1752} 1753 1754func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) { 1755 type NoMethod GroupLicensesListResponse 1756 raw := NoMethod(*s) 1757 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1758} 1759 1760// Install: The existence of an Installs resource indicates that an app 1761// is installed on a particular device (or that an install is pending). 1762// The API can be used to create an install resource using the update 1763// method. This triggers the actual install of the app on the device. If 1764// the user does not already have an entitlement for the app, then an 1765// attempt is made to create one. If this fails (for example, because 1766// the app is not free and there is no available license), then the 1767// creation of the install fails. The API can also be used to update an 1768// installed app. If the update method is used on an existing install, 1769// then the app will be updated to the latest available version. Note 1770// that it is not possible to force the installation of a specific 1771// version of an app: the version code is read-only. If a user installs 1772// an app themselves (as permitted by the enterprise), then again an 1773// install resource and possibly an entitlement resource are 1774// automatically created. The API can also be used to delete an install 1775// resource, which triggers the removal of the app from the device. Note 1776// that deleting an install does not automatically remove the 1777// corresponding entitlement, even if there are no remaining installs. 1778// The install resource will also be deleted if the user uninstalls the 1779// app themselves. 1780type Install struct { 1781 // InstallState: Install state. The state "installPending" means that an 1782 // install request has recently been made and download to the device is 1783 // in progress. The state "installed" means that the app has been 1784 // installed. This field is read-only. 1785 // 1786 // Possible values: 1787 // "installed" 1788 // "installPending" 1789 InstallState string `json:"installState,omitempty"` 1790 1791 // ProductId: The ID of the product that the install is for. For 1792 // example, "app:com.google.android.gm". 1793 ProductId string `json:"productId,omitempty"` 1794 1795 // VersionCode: The version of the installed product. Guaranteed to be 1796 // set only if the install state is "installed". 1797 VersionCode int64 `json:"versionCode,omitempty"` 1798 1799 // ServerResponse contains the HTTP response code and headers from the 1800 // server. 1801 googleapi.ServerResponse `json:"-"` 1802 1803 // ForceSendFields is a list of field names (e.g. "InstallState") to 1804 // unconditionally include in API requests. By default, fields with 1805 // empty or default values are omitted from API requests. However, any 1806 // non-pointer, non-interface field appearing in ForceSendFields will be 1807 // sent to the server regardless of whether the field is empty or not. 1808 // This may be used to include empty fields in Patch requests. 1809 ForceSendFields []string `json:"-"` 1810 1811 // NullFields is a list of field names (e.g. "InstallState") to include 1812 // in API requests with the JSON null value. By default, fields with 1813 // empty values are omitted from API requests. However, any field with 1814 // an empty value appearing in NullFields will be sent to the server as 1815 // null. It is an error if a field in this list has a non-empty value. 1816 // This may be used to include null fields in Patch requests. 1817 NullFields []string `json:"-"` 1818} 1819 1820func (s *Install) MarshalJSON() ([]byte, error) { 1821 type NoMethod Install 1822 raw := NoMethod(*s) 1823 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1824} 1825 1826// InstallFailureEvent: An event generated when an app installation 1827// failed on a device 1828type InstallFailureEvent struct { 1829 // DeviceId: The Android ID of the device. This field will always be 1830 // present. 1831 DeviceId string `json:"deviceId,omitempty"` 1832 1833 // FailureDetails: Additional details on the failure if applicable. 1834 FailureDetails string `json:"failureDetails,omitempty"` 1835 1836 // FailureReason: The reason for the installation failure. This field 1837 // will always be present. 1838 // 1839 // Possible values: 1840 // "unknown" - Used whenever no better reason for failure can be 1841 // provided. 1842 // "timeout" - Used when the installation timed out. This can cover a 1843 // number of situations, for example when the device did not have 1844 // connectivity at any point during the retry period, or if the device 1845 // is OOM. 1846 FailureReason string `json:"failureReason,omitempty"` 1847 1848 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 1849 // for which the install failure event occured. This field will always 1850 // be present. 1851 ProductId string `json:"productId,omitempty"` 1852 1853 // UserId: The ID of the user. This field will always be present. 1854 UserId string `json:"userId,omitempty"` 1855 1856 // ForceSendFields is a list of field names (e.g. "DeviceId") to 1857 // unconditionally include in API requests. By default, fields with 1858 // empty or default values are omitted from API requests. However, any 1859 // non-pointer, non-interface field appearing in ForceSendFields will be 1860 // sent to the server regardless of whether the field is empty or not. 1861 // This may be used to include empty fields in Patch requests. 1862 ForceSendFields []string `json:"-"` 1863 1864 // NullFields is a list of field names (e.g. "DeviceId") to include in 1865 // API requests with the JSON null value. By default, fields with empty 1866 // values are omitted from API requests. However, any field with an 1867 // empty value appearing in NullFields will be sent to the server as 1868 // null. It is an error if a field in this list has a non-empty value. 1869 // This may be used to include null fields in Patch requests. 1870 NullFields []string `json:"-"` 1871} 1872 1873func (s *InstallFailureEvent) MarshalJSON() ([]byte, error) { 1874 type NoMethod InstallFailureEvent 1875 raw := NoMethod(*s) 1876 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1877} 1878 1879type InstallsListResponse struct { 1880 // Install: An installation of an app for a user on a specific device. 1881 // The existence of an install implies that the user must have an 1882 // entitlement to the app. 1883 Install []*Install `json:"install,omitempty"` 1884 1885 // ServerResponse contains the HTTP response code and headers from the 1886 // server. 1887 googleapi.ServerResponse `json:"-"` 1888 1889 // ForceSendFields is a list of field names (e.g. "Install") to 1890 // unconditionally include in API requests. By default, fields with 1891 // empty or default values are omitted from API requests. However, any 1892 // non-pointer, non-interface field appearing in ForceSendFields will be 1893 // sent to the server regardless of whether the field is empty or not. 1894 // This may be used to include empty fields in Patch requests. 1895 ForceSendFields []string `json:"-"` 1896 1897 // NullFields is a list of field names (e.g. "Install") to include in 1898 // API requests with the JSON null value. By default, fields with empty 1899 // values are omitted from API requests. However, any field with an 1900 // empty value appearing in NullFields will be sent to the server as 1901 // null. It is an error if a field in this list has a non-empty value. 1902 // This may be used to include null fields in Patch requests. 1903 NullFields []string `json:"-"` 1904} 1905 1906func (s *InstallsListResponse) MarshalJSON() ([]byte, error) { 1907 type NoMethod InstallsListResponse 1908 raw := NoMethod(*s) 1909 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1910} 1911 1912// KeyedAppState: Represents a keyed app state containing a key, 1913// timestamp, severity level, optional description, and optional data. 1914type KeyedAppState struct { 1915 // Data: Additional field intended for machine-readable data. For 1916 // example, a number or JSON object. To prevent XSS, we recommend 1917 // removing any HTML from the data before displaying it. 1918 Data string `json:"data,omitempty"` 1919 1920 // Key: Key indicating what the app is providing a state for. The 1921 // content of the key is set by the app's developer. To prevent XSS, we 1922 // recommend removing any HTML from the key before displaying it. This 1923 // field will always be present. 1924 Key string `json:"key,omitempty"` 1925 1926 // Message: Free-form, human-readable message describing the app state. 1927 // For example, an error message. To prevent XSS, we recommend removing 1928 // any HTML from the message before displaying it. 1929 Message string `json:"message,omitempty"` 1930 1931 // Severity: Severity of the app state. This field will always be 1932 // present. 1933 // 1934 // Possible values: 1935 // "severityUnknown" 1936 // "severityInfo" 1937 // "severityError" 1938 Severity string `json:"severity,omitempty"` 1939 1940 // StateTimestampMillis: Timestamp of when the app set the state in 1941 // milliseconds since epoch. This field will always be present. 1942 StateTimestampMillis int64 `json:"stateTimestampMillis,omitempty,string"` 1943 1944 // ForceSendFields is a list of field names (e.g. "Data") to 1945 // unconditionally include in API requests. By default, fields with 1946 // empty or default values are omitted from API requests. However, any 1947 // non-pointer, non-interface field appearing in ForceSendFields will be 1948 // sent to the server regardless of whether the field is empty or not. 1949 // This may be used to include empty fields in Patch requests. 1950 ForceSendFields []string `json:"-"` 1951 1952 // NullFields is a list of field names (e.g. "Data") to include in API 1953 // requests with the JSON null value. By default, fields with empty 1954 // values are omitted from API requests. However, any field with an 1955 // empty value appearing in NullFields will be sent to the server as 1956 // null. It is an error if a field in this list has a non-empty value. 1957 // This may be used to include null fields in Patch requests. 1958 NullFields []string `json:"-"` 1959} 1960 1961func (s *KeyedAppState) MarshalJSON() ([]byte, error) { 1962 type NoMethod KeyedAppState 1963 raw := NoMethod(*s) 1964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1965} 1966 1967// LocalizedText: A localized string with its locale. 1968type LocalizedText struct { 1969 // Locale: The BCP47 tag for a locale. (e.g. "en-US", "de"). 1970 Locale string `json:"locale,omitempty"` 1971 1972 // Text: The text localized in the associated locale. 1973 Text string `json:"text,omitempty"` 1974 1975 // ForceSendFields is a list of field names (e.g. "Locale") to 1976 // unconditionally include in API requests. By default, fields with 1977 // empty or default values are omitted from API requests. However, any 1978 // non-pointer, non-interface field appearing in ForceSendFields will be 1979 // sent to the server regardless of whether the field is empty or not. 1980 // This may be used to include empty fields in Patch requests. 1981 ForceSendFields []string `json:"-"` 1982 1983 // NullFields is a list of field names (e.g. "Locale") to include in API 1984 // requests with the JSON null value. By default, fields with empty 1985 // values are omitted from API requests. However, any field with an 1986 // empty value appearing in NullFields will be sent to the server as 1987 // null. It is an error if a field in this list has a non-empty value. 1988 // This may be used to include null fields in Patch requests. 1989 NullFields []string `json:"-"` 1990} 1991 1992func (s *LocalizedText) MarshalJSON() ([]byte, error) { 1993 type NoMethod LocalizedText 1994 raw := NoMethod(*s) 1995 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1996} 1997 1998// MaintenanceWindow: Maintenance window for managed Google Play 1999// Accounts. This allows Play store to update the apps on the foreground 2000// in the designated window. 2001type MaintenanceWindow struct { 2002 // DurationMs: Duration of the maintenance window, in milliseconds. The 2003 // duration must be between 30 minutes and 24 hours (inclusive). 2004 DurationMs int64 `json:"durationMs,omitempty,string"` 2005 2006 // StartTimeAfterMidnightMs: Start time of the maintenance window, in 2007 // milliseconds after midnight on the device. Windows can span midnight. 2008 StartTimeAfterMidnightMs int64 `json:"startTimeAfterMidnightMs,omitempty,string"` 2009 2010 // ForceSendFields is a list of field names (e.g. "DurationMs") to 2011 // unconditionally include in API requests. By default, fields with 2012 // empty or default values are omitted from API requests. However, any 2013 // non-pointer, non-interface field appearing in ForceSendFields will be 2014 // sent to the server regardless of whether the field is empty or not. 2015 // This may be used to include empty fields in Patch requests. 2016 ForceSendFields []string `json:"-"` 2017 2018 // NullFields is a list of field names (e.g. "DurationMs") to include in 2019 // API requests with the JSON null value. By default, fields with empty 2020 // values are omitted from API requests. However, any field with an 2021 // empty value appearing in NullFields will be sent to the server as 2022 // null. It is an error if a field in this list has a non-empty value. 2023 // This may be used to include null fields in Patch requests. 2024 NullFields []string `json:"-"` 2025} 2026 2027func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 2028 type NoMethod MaintenanceWindow 2029 raw := NoMethod(*s) 2030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2031} 2032 2033// ManagedConfiguration: A managed configuration resource contains the 2034// set of managed properties defined by the app developer in the app's 2035// managed configurations schema, as well as any configuration variables 2036// defined for the user. 2037type ManagedConfiguration struct { 2038 // ConfigurationVariables: Contains the ID of the managed configuration 2039 // profile and the set of configuration variables (if any) defined for 2040 // the user. 2041 ConfigurationVariables *ConfigurationVariables `json:"configurationVariables,omitempty"` 2042 2043 // Kind: Deprecated. 2044 Kind string `json:"kind,omitempty"` 2045 2046 // ManagedProperty: The set of managed properties for this 2047 // configuration. 2048 ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"` 2049 2050 // ProductId: The ID of the product that the managed configuration is 2051 // for, e.g. "app:com.google.android.gm". 2052 ProductId string `json:"productId,omitempty"` 2053 2054 // ServerResponse contains the HTTP response code and headers from the 2055 // server. 2056 googleapi.ServerResponse `json:"-"` 2057 2058 // ForceSendFields is a list of field names (e.g. 2059 // "ConfigurationVariables") to unconditionally include in API requests. 2060 // By default, fields with empty or default values are omitted from API 2061 // requests. However, any non-pointer, non-interface field appearing in 2062 // ForceSendFields will be sent to the server regardless of whether the 2063 // field is empty or not. This may be used to include empty fields in 2064 // Patch requests. 2065 ForceSendFields []string `json:"-"` 2066 2067 // NullFields is a list of field names (e.g. "ConfigurationVariables") 2068 // to include in API requests with the JSON null value. By default, 2069 // fields with empty values are omitted from API requests. However, any 2070 // field with an empty value appearing in NullFields will be sent to the 2071 // server as null. It is an error if a field in this list has a 2072 // non-empty value. This may be used to include null fields in Patch 2073 // requests. 2074 NullFields []string `json:"-"` 2075} 2076 2077func (s *ManagedConfiguration) MarshalJSON() ([]byte, error) { 2078 type NoMethod ManagedConfiguration 2079 raw := NoMethod(*s) 2080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2081} 2082 2083type ManagedConfigurationsForDeviceListResponse struct { 2084 // ManagedConfigurationForDevice: A managed configuration for an app on 2085 // a specific device. 2086 ManagedConfigurationForDevice []*ManagedConfiguration `json:"managedConfigurationForDevice,omitempty"` 2087 2088 // ServerResponse contains the HTTP response code and headers from the 2089 // server. 2090 googleapi.ServerResponse `json:"-"` 2091 2092 // ForceSendFields is a list of field names (e.g. 2093 // "ManagedConfigurationForDevice") to unconditionally include in API 2094 // requests. By default, fields with empty or default values are omitted 2095 // from API requests. However, any non-pointer, non-interface field 2096 // appearing in ForceSendFields will be sent to the server regardless of 2097 // whether the field is empty or not. This may be used to include empty 2098 // fields in Patch requests. 2099 ForceSendFields []string `json:"-"` 2100 2101 // NullFields is a list of field names (e.g. 2102 // "ManagedConfigurationForDevice") to include in API requests with the 2103 // JSON null value. By default, fields with empty values are omitted 2104 // from API requests. However, any field with an empty value appearing 2105 // in NullFields will be sent to the server as null. It is an error if a 2106 // field in this list has a non-empty value. This may be used to include 2107 // null fields in Patch requests. 2108 NullFields []string `json:"-"` 2109} 2110 2111func (s *ManagedConfigurationsForDeviceListResponse) MarshalJSON() ([]byte, error) { 2112 type NoMethod ManagedConfigurationsForDeviceListResponse 2113 raw := NoMethod(*s) 2114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2115} 2116 2117type ManagedConfigurationsForUserListResponse struct { 2118 // ManagedConfigurationForUser: A managed configuration for an app for a 2119 // specific user. 2120 ManagedConfigurationForUser []*ManagedConfiguration `json:"managedConfigurationForUser,omitempty"` 2121 2122 // ServerResponse contains the HTTP response code and headers from the 2123 // server. 2124 googleapi.ServerResponse `json:"-"` 2125 2126 // ForceSendFields is a list of field names (e.g. 2127 // "ManagedConfigurationForUser") to unconditionally include in API 2128 // requests. By default, fields with empty or default values are omitted 2129 // from API requests. However, any non-pointer, non-interface field 2130 // appearing in ForceSendFields will be sent to the server regardless of 2131 // whether the field is empty or not. This may be used to include empty 2132 // fields in Patch requests. 2133 ForceSendFields []string `json:"-"` 2134 2135 // NullFields is a list of field names (e.g. 2136 // "ManagedConfigurationForUser") to include in API requests with the 2137 // JSON null value. By default, fields with empty values are omitted 2138 // from API requests. However, any field with an empty value appearing 2139 // in NullFields will be sent to the server as null. It is an error if a 2140 // field in this list has a non-empty value. This may be used to include 2141 // null fields in Patch requests. 2142 NullFields []string `json:"-"` 2143} 2144 2145func (s *ManagedConfigurationsForUserListResponse) MarshalJSON() ([]byte, error) { 2146 type NoMethod ManagedConfigurationsForUserListResponse 2147 raw := NoMethod(*s) 2148 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2149} 2150 2151// ManagedConfigurationsSettings: A managed configurations settings 2152// resource contains the set of managed properties that have been 2153// configured for an Android app to be applied to a set of users. The 2154// app's developer would have defined configurable properties in the 2155// managed configurations schema. 2156type ManagedConfigurationsSettings struct { 2157 // LastUpdatedTimestampMillis: The last updated time of the managed 2158 // configuration settings in milliseconds since 1970-01-01T00:00:00Z. 2159 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 2160 2161 // McmId: The ID of the managed configurations settings. 2162 McmId string `json:"mcmId,omitempty"` 2163 2164 // Name: The name of the managed configurations settings. 2165 Name string `json:"name,omitempty"` 2166 2167 // ForceSendFields is a list of field names (e.g. 2168 // "LastUpdatedTimestampMillis") to unconditionally include in API 2169 // requests. By default, fields with empty or default values are omitted 2170 // from API requests. However, any non-pointer, non-interface field 2171 // appearing in ForceSendFields will be sent to the server regardless of 2172 // whether the field is empty or not. This may be used to include empty 2173 // fields in Patch requests. 2174 ForceSendFields []string `json:"-"` 2175 2176 // NullFields is a list of field names (e.g. 2177 // "LastUpdatedTimestampMillis") to include in API requests with the 2178 // JSON null value. By default, fields with empty values are omitted 2179 // from API requests. However, any field with an empty value appearing 2180 // in NullFields will be sent to the server as null. It is an error if a 2181 // field in this list has a non-empty value. This may be used to include 2182 // null fields in Patch requests. 2183 NullFields []string `json:"-"` 2184} 2185 2186func (s *ManagedConfigurationsSettings) MarshalJSON() ([]byte, error) { 2187 type NoMethod ManagedConfigurationsSettings 2188 raw := NoMethod(*s) 2189 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2190} 2191 2192type ManagedConfigurationsSettingsListResponse struct { 2193 // ManagedConfigurationsSettings: A managed configurations settings for 2194 // an app that may be assigned to a group of users in an enterprise. 2195 ManagedConfigurationsSettings []*ManagedConfigurationsSettings `json:"managedConfigurationsSettings,omitempty"` 2196 2197 // ServerResponse contains the HTTP response code and headers from the 2198 // server. 2199 googleapi.ServerResponse `json:"-"` 2200 2201 // ForceSendFields is a list of field names (e.g. 2202 // "ManagedConfigurationsSettings") to unconditionally include in API 2203 // requests. By default, fields with empty or default values are omitted 2204 // from API requests. However, any non-pointer, non-interface field 2205 // appearing in ForceSendFields will be sent to the server regardless of 2206 // whether the field is empty or not. This may be used to include empty 2207 // fields in Patch requests. 2208 ForceSendFields []string `json:"-"` 2209 2210 // NullFields is a list of field names (e.g. 2211 // "ManagedConfigurationsSettings") to include in API requests with the 2212 // JSON null value. By default, fields with empty values are omitted 2213 // from API requests. However, any field with an empty value appearing 2214 // in NullFields will be sent to the server as null. It is an error if a 2215 // field in this list has a non-empty value. This may be used to include 2216 // null fields in Patch requests. 2217 NullFields []string `json:"-"` 2218} 2219 2220func (s *ManagedConfigurationsSettingsListResponse) MarshalJSON() ([]byte, error) { 2221 type NoMethod ManagedConfigurationsSettingsListResponse 2222 raw := NoMethod(*s) 2223 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2224} 2225 2226// ManagedProperty: A managed property of a managed configuration. The 2227// property must match one of the properties in the app restrictions 2228// schema of the product. Exactly one of the value fields must be 2229// populated, and it must match the property's type in the app 2230// restrictions schema. 2231type ManagedProperty struct { 2232 // Key: The unique key that identifies the property. 2233 Key string `json:"key,omitempty"` 2234 2235 // ValueBool: The boolean value - this will only be present if type of 2236 // the property is bool. 2237 ValueBool bool `json:"valueBool,omitempty"` 2238 2239 // ValueBundle: The bundle of managed properties - this will only be 2240 // present if type of the property is bundle. 2241 ValueBundle *ManagedPropertyBundle `json:"valueBundle,omitempty"` 2242 2243 // ValueBundleArray: The list of bundles of properties - this will only 2244 // be present if type of the property is bundle_array. 2245 ValueBundleArray []*ManagedPropertyBundle `json:"valueBundleArray,omitempty"` 2246 2247 // ValueInteger: The integer value - this will only be present if type 2248 // of the property is integer. 2249 ValueInteger int64 `json:"valueInteger,omitempty"` 2250 2251 // ValueString: The string value - this will only be present if type of 2252 // the property is string, choice or hidden. 2253 ValueString string `json:"valueString,omitempty"` 2254 2255 // ValueStringArray: The list of string values - this will only be 2256 // present if type of the property is multiselect. 2257 ValueStringArray []string `json:"valueStringArray,omitempty"` 2258 2259 // ForceSendFields is a list of field names (e.g. "Key") to 2260 // unconditionally include in API requests. By default, fields with 2261 // empty or default values are omitted from API requests. However, any 2262 // non-pointer, non-interface field appearing in ForceSendFields will be 2263 // sent to the server regardless of whether the field is empty or not. 2264 // This may be used to include empty fields in Patch requests. 2265 ForceSendFields []string `json:"-"` 2266 2267 // NullFields is a list of field names (e.g. "Key") to include in API 2268 // requests with the JSON null value. By default, fields with empty 2269 // values are omitted from API requests. However, any field with an 2270 // empty value appearing in NullFields will be sent to the server as 2271 // null. It is an error if a field in this list has a non-empty value. 2272 // This may be used to include null fields in Patch requests. 2273 NullFields []string `json:"-"` 2274} 2275 2276func (s *ManagedProperty) MarshalJSON() ([]byte, error) { 2277 type NoMethod ManagedProperty 2278 raw := NoMethod(*s) 2279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2280} 2281 2282// ManagedPropertyBundle: A bundle of managed properties. 2283type ManagedPropertyBundle struct { 2284 // ManagedProperty: The list of managed properties. 2285 ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"` 2286 2287 // ForceSendFields is a list of field names (e.g. "ManagedProperty") to 2288 // unconditionally include in API requests. By default, fields with 2289 // empty or default values are omitted from API requests. However, any 2290 // non-pointer, non-interface field appearing in ForceSendFields will be 2291 // sent to the server regardless of whether the field is empty or not. 2292 // This may be used to include empty fields in Patch requests. 2293 ForceSendFields []string `json:"-"` 2294 2295 // NullFields is a list of field names (e.g. "ManagedProperty") to 2296 // include in API requests with the JSON null value. By default, fields 2297 // with empty values are omitted from API requests. However, any field 2298 // with an empty value appearing in NullFields will be sent to the 2299 // server as null. It is an error if a field in this list has a 2300 // non-empty value. This may be used to include null fields in Patch 2301 // requests. 2302 NullFields []string `json:"-"` 2303} 2304 2305func (s *ManagedPropertyBundle) MarshalJSON() ([]byte, error) { 2306 type NoMethod ManagedPropertyBundle 2307 raw := NoMethod(*s) 2308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2309} 2310 2311// NewDeviceEvent: An event generated when a new device is ready to be 2312// managed. 2313type NewDeviceEvent struct { 2314 // DeviceId: The Android ID of the device. This field will always be 2315 // present. 2316 DeviceId string `json:"deviceId,omitempty"` 2317 2318 // DpcPackageName: Policy app on the device. 2319 DpcPackageName string `json:"dpcPackageName,omitempty"` 2320 2321 // ManagementType: Identifies the extent to which the device is 2322 // controlled by an Android EMM in various deployment configurations. 2323 // Possible values include: - "managedDevice", a device where the DPC is 2324 // set as device owner, - "managedProfile", a device where the DPC is 2325 // set as profile owner. 2326 // 2327 // Possible values: 2328 // "managedDevice" 2329 // "managedProfile" 2330 ManagementType string `json:"managementType,omitempty"` 2331 2332 // UserId: The ID of the user. This field will always be present. 2333 UserId string `json:"userId,omitempty"` 2334 2335 // ForceSendFields is a list of field names (e.g. "DeviceId") to 2336 // unconditionally include in API requests. By default, fields with 2337 // empty or default values are omitted from API requests. However, any 2338 // non-pointer, non-interface field appearing in ForceSendFields will be 2339 // sent to the server regardless of whether the field is empty or not. 2340 // This may be used to include empty fields in Patch requests. 2341 ForceSendFields []string `json:"-"` 2342 2343 // NullFields is a list of field names (e.g. "DeviceId") to include in 2344 // API requests with the JSON null value. By default, fields with empty 2345 // values are omitted from API requests. However, any field with an 2346 // empty value appearing in NullFields will be sent to the server as 2347 // null. It is an error if a field in this list has a non-empty value. 2348 // This may be used to include null fields in Patch requests. 2349 NullFields []string `json:"-"` 2350} 2351 2352func (s *NewDeviceEvent) MarshalJSON() ([]byte, error) { 2353 type NoMethod NewDeviceEvent 2354 raw := NoMethod(*s) 2355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2356} 2357 2358// NewPermissionsEvent: An event generated when new permissions are 2359// added to an app. 2360type NewPermissionsEvent struct { 2361 // ApprovedPermissions: The set of permissions that the enterprise admin 2362 // has already approved for this application. Use Permissions.Get on the 2363 // EMM API to retrieve details about these permissions. 2364 ApprovedPermissions []string `json:"approvedPermissions,omitempty"` 2365 2366 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2367 // for which new permissions were added. This field will always be 2368 // present. 2369 ProductId string `json:"productId,omitempty"` 2370 2371 // RequestedPermissions: The set of permissions that the app is 2372 // currently requesting. Use Permissions.Get on the EMM API to retrieve 2373 // details about these permissions. 2374 RequestedPermissions []string `json:"requestedPermissions,omitempty"` 2375 2376 // ForceSendFields is a list of field names (e.g. "ApprovedPermissions") 2377 // to unconditionally include in API requests. By default, fields with 2378 // empty or default values are omitted from API requests. However, any 2379 // non-pointer, non-interface field appearing in ForceSendFields will be 2380 // sent to the server regardless of whether the field is empty or not. 2381 // This may be used to include empty fields in Patch requests. 2382 ForceSendFields []string `json:"-"` 2383 2384 // NullFields is a list of field names (e.g. "ApprovedPermissions") to 2385 // include in API requests with the JSON null value. By default, fields 2386 // with empty values are omitted from API requests. However, any field 2387 // with an empty value appearing in NullFields will be sent to the 2388 // server as null. It is an error if a field in this list has a 2389 // non-empty value. This may be used to include null fields in Patch 2390 // requests. 2391 NullFields []string `json:"-"` 2392} 2393 2394func (s *NewPermissionsEvent) MarshalJSON() ([]byte, error) { 2395 type NoMethod NewPermissionsEvent 2396 raw := NoMethod(*s) 2397 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2398} 2399 2400// Notification: A notification of one event relating to an enterprise. 2401type Notification struct { 2402 // AppRestrictionsSchemaChangeEvent: Notifications about new app 2403 // restrictions schema changes. 2404 AppRestrictionsSchemaChangeEvent *AppRestrictionsSchemaChangeEvent `json:"appRestrictionsSchemaChangeEvent,omitempty"` 2405 2406 // AppUpdateEvent: Notifications about app updates. 2407 AppUpdateEvent *AppUpdateEvent `json:"appUpdateEvent,omitempty"` 2408 2409 // DeviceReportUpdateEvent: Notifications about device report updates. 2410 DeviceReportUpdateEvent *DeviceReportUpdateEvent `json:"deviceReportUpdateEvent,omitempty"` 2411 2412 // EnterpriseId: The ID of the enterprise for which the notification is 2413 // sent. This will always be present. 2414 EnterpriseId string `json:"enterpriseId,omitempty"` 2415 2416 // InstallFailureEvent: Notifications about an app installation failure. 2417 InstallFailureEvent *InstallFailureEvent `json:"installFailureEvent,omitempty"` 2418 2419 // NewDeviceEvent: Notifications about new devices. 2420 NewDeviceEvent *NewDeviceEvent `json:"newDeviceEvent,omitempty"` 2421 2422 // NewPermissionsEvent: Notifications about new app permissions. 2423 NewPermissionsEvent *NewPermissionsEvent `json:"newPermissionsEvent,omitempty"` 2424 2425 // NotificationType: Type of the notification. 2426 // 2427 // Possible values: 2428 // "unknown" 2429 // "testNotification" - A test push notification. 2430 // "productApproval" - Notification about change to a product's 2431 // approval status. 2432 // "installFailure" - Notification about an app installation failure. 2433 // "appUpdate" - Notification about app update. 2434 // "newPermissions" - Notification about new app permissions. 2435 // "appRestricionsSchemaChange" - Notification about new app 2436 // restrictions schema change. 2437 // "productAvailabilityChange" - Notification about product 2438 // availability change. 2439 // "newDevice" - Notification about a new device. 2440 // "deviceReportUpdate" - Notification about an updated device report. 2441 NotificationType string `json:"notificationType,omitempty"` 2442 2443 // ProductApprovalEvent: Notifications about changes to a product's 2444 // approval status. 2445 ProductApprovalEvent *ProductApprovalEvent `json:"productApprovalEvent,omitempty"` 2446 2447 // ProductAvailabilityChangeEvent: Notifications about product 2448 // availability changes. 2449 ProductAvailabilityChangeEvent *ProductAvailabilityChangeEvent `json:"productAvailabilityChangeEvent,omitempty"` 2450 2451 // TimestampMillis: The time when the notification was published in 2452 // milliseconds since 1970-01-01T00:00:00Z. This will always be present. 2453 TimestampMillis int64 `json:"timestampMillis,omitempty,string"` 2454 2455 // ForceSendFields is a list of field names (e.g. 2456 // "AppRestrictionsSchemaChangeEvent") to unconditionally include in API 2457 // requests. By default, fields with empty or default values are omitted 2458 // from API requests. However, any non-pointer, non-interface field 2459 // appearing in ForceSendFields will be sent to the server regardless of 2460 // whether the field is empty or not. This may be used to include empty 2461 // fields in Patch requests. 2462 ForceSendFields []string `json:"-"` 2463 2464 // NullFields is a list of field names (e.g. 2465 // "AppRestrictionsSchemaChangeEvent") to include in API requests with 2466 // the JSON null value. By default, fields with empty values are omitted 2467 // from API requests. However, any field with an empty value appearing 2468 // in NullFields will be sent to the server as null. It is an error if a 2469 // field in this list has a non-empty value. This may be used to include 2470 // null fields in Patch requests. 2471 NullFields []string `json:"-"` 2472} 2473 2474func (s *Notification) MarshalJSON() ([]byte, error) { 2475 type NoMethod Notification 2476 raw := NoMethod(*s) 2477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2478} 2479 2480// NotificationSet: A resource returned by the PullNotificationSet API, 2481// which contains a collection of notifications for enterprises 2482// associated with the service account authenticated for the request. 2483type NotificationSet struct { 2484 // Notification: The notifications received, or empty if no 2485 // notifications are present. 2486 Notification []*Notification `json:"notification,omitempty"` 2487 2488 // NotificationSetId: The notification set ID, required to mark the 2489 // notification as received with the Enterprises.AcknowledgeNotification 2490 // API. This will be omitted if no notifications are present. 2491 NotificationSetId string `json:"notificationSetId,omitempty"` 2492 2493 // ServerResponse contains the HTTP response code and headers from the 2494 // server. 2495 googleapi.ServerResponse `json:"-"` 2496 2497 // ForceSendFields is a list of field names (e.g. "Notification") to 2498 // unconditionally include in API requests. By default, fields with 2499 // empty or default values are omitted from API requests. However, any 2500 // non-pointer, non-interface field appearing in ForceSendFields will be 2501 // sent to the server regardless of whether the field is empty or not. 2502 // This may be used to include empty fields in Patch requests. 2503 ForceSendFields []string `json:"-"` 2504 2505 // NullFields is a list of field names (e.g. "Notification") to include 2506 // in API requests with the JSON null value. By default, fields with 2507 // empty values are omitted from API requests. However, any field with 2508 // an empty value appearing in NullFields will be sent to the server as 2509 // null. It is an error if a field in this list has a non-empty value. 2510 // This may be used to include null fields in Patch requests. 2511 NullFields []string `json:"-"` 2512} 2513 2514func (s *NotificationSet) MarshalJSON() ([]byte, error) { 2515 type NoMethod NotificationSet 2516 raw := NoMethod(*s) 2517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2518} 2519 2520// PageInfo: Information about the current page. List operations that 2521// supports paging return only one "page" of results. This protocol 2522// buffer message describes the page that has been returned. 2523type PageInfo struct { 2524 // ResultPerPage: Maximum number of results returned in one page. ! The 2525 // number of results included in the API response. 2526 ResultPerPage int64 `json:"resultPerPage,omitempty"` 2527 2528 // StartIndex: Index of the first result returned in the current page. 2529 StartIndex int64 `json:"startIndex,omitempty"` 2530 2531 // TotalResults: Total number of results available on the backend ! The 2532 // total number of results in the result set. 2533 TotalResults int64 `json:"totalResults,omitempty"` 2534 2535 // ForceSendFields is a list of field names (e.g. "ResultPerPage") to 2536 // unconditionally include in API requests. By default, fields with 2537 // empty or default values are omitted from API requests. However, any 2538 // non-pointer, non-interface field appearing in ForceSendFields will be 2539 // sent to the server regardless of whether the field is empty or not. 2540 // This may be used to include empty fields in Patch requests. 2541 ForceSendFields []string `json:"-"` 2542 2543 // NullFields is a list of field names (e.g. "ResultPerPage") to include 2544 // in API requests with the JSON null value. By default, fields with 2545 // empty values are omitted from API requests. However, any field with 2546 // an empty value appearing in NullFields will be sent to the server as 2547 // null. It is an error if a field in this list has a non-empty value. 2548 // This may be used to include null fields in Patch requests. 2549 NullFields []string `json:"-"` 2550} 2551 2552func (s *PageInfo) MarshalJSON() ([]byte, error) { 2553 type NoMethod PageInfo 2554 raw := NoMethod(*s) 2555 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2556} 2557 2558// Permission: A Permissions resource represents some extra capability, 2559// to be granted to an Android app, which requires explicit consent. An 2560// enterprise admin must consent to these permissions on behalf of their 2561// users before an entitlement for the app can be created. The 2562// permissions collection is read-only. The information provided for 2563// each permission (localized name and description) is intended to be 2564// used in the MDM user interface when obtaining consent from the 2565// enterprise. 2566type Permission struct { 2567 // Description: A longer description of the Permissions resource, giving 2568 // more details of what it affects. 2569 Description string `json:"description,omitempty"` 2570 2571 // Name: The name of the permission. 2572 Name string `json:"name,omitempty"` 2573 2574 // PermissionId: An opaque string uniquely identifying the permission. 2575 PermissionId string `json:"permissionId,omitempty"` 2576 2577 // ServerResponse contains the HTTP response code and headers from the 2578 // server. 2579 googleapi.ServerResponse `json:"-"` 2580 2581 // ForceSendFields is a list of field names (e.g. "Description") to 2582 // unconditionally include in API requests. By default, fields with 2583 // empty or default values are omitted from API requests. However, any 2584 // non-pointer, non-interface field appearing in ForceSendFields will be 2585 // sent to the server regardless of whether the field is empty or not. 2586 // This may be used to include empty fields in Patch requests. 2587 ForceSendFields []string `json:"-"` 2588 2589 // NullFields is a list of field names (e.g. "Description") to include 2590 // in API requests with the JSON null value. By default, fields with 2591 // empty values are omitted from API requests. However, any field with 2592 // an empty value appearing in NullFields will be sent to the server as 2593 // null. It is an error if a field in this list has a non-empty value. 2594 // This may be used to include null fields in Patch requests. 2595 NullFields []string `json:"-"` 2596} 2597 2598func (s *Permission) MarshalJSON() ([]byte, error) { 2599 type NoMethod Permission 2600 raw := NoMethod(*s) 2601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2602} 2603 2604// Policy: The device policy for a given managed device. 2605type Policy struct { 2606 // AutoUpdatePolicy: Deprecated. Use autoUpdateMode instead. When 2607 // autoUpdateMode is set to AUTO_UPDATE_POSTPONED or 2608 // AUTO_UPDATE_HIGH_PRIORITY, this field has no effect. 2609 // "choiceToTheUser" allows the device's user to configure the app 2610 // update policy. "always" enables auto updates. "never" disables auto 2611 // updates. "wifiOnly" enables auto updates only when the device is 2612 // connected to wifi. 2613 // 2614 // Possible values: 2615 // "autoUpdatePolicyUnspecified" - The auto update policy is not set. 2616 // "choiceToTheUser" - The user can control auto-updates. 2617 // "never" - Apps are never auto-updated. 2618 // "wifiOnly" - Apps are auto-updated over WiFi only. 2619 // "always" - Apps are auto-updated at any time. Data charges may 2620 // apply. 2621 AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"` 2622 2623 // DeviceReportPolicy: Whether the device reports app states to the EMM. 2624 // The default value is "deviceReportDisabled". 2625 // 2626 // Possible values: 2627 // "deviceReportPolicyUnspecified" - The device report policy is not 2628 // set. 2629 // "deviceReportDisabled" - Device reports are disabled. 2630 // "deviceReportEnabled" - Device reports are enabled. 2631 DeviceReportPolicy string `json:"deviceReportPolicy,omitempty"` 2632 2633 // MaintenanceWindow: The maintenance window defining when apps running 2634 // in the foreground should be updated. 2635 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 2636 2637 // ProductAvailabilityPolicy: The availability granted to the device for 2638 // the specified products. "all" gives the device access to all 2639 // products, regardless of approval status. "all" does not enable 2640 // automatic visibility of "alpha" or "beta" tracks. "whitelist" grants 2641 // the device access the products specified in productPolicy[]. Only 2642 // products that are approved or products that were previously approved 2643 // (products with revoked approval) by the enterprise can be 2644 // whitelisted. If no value is provided, the availability set at the 2645 // user level is applied by default. 2646 // 2647 // Possible values: 2648 // "productAvailabilityPolicyUnspecified" - Unspecified, applies the 2649 // user available product set by default. 2650 // "whitelist" - The approved products with product availability set 2651 // to AVAILABLE in the product policy are available. 2652 // "all" - All products are available except those explicitly marked 2653 // as unavailable in the product availability policy. 2654 ProductAvailabilityPolicy string `json:"productAvailabilityPolicy,omitempty"` 2655 2656 // ProductPolicy: The list of product policies. The 2657 // productAvailabilityPolicy needs to be set to WHITELIST or ALL for the 2658 // product policies to be applied. 2659 ProductPolicy []*ProductPolicy `json:"productPolicy,omitempty"` 2660 2661 // ForceSendFields is a list of field names (e.g. "AutoUpdatePolicy") to 2662 // unconditionally include in API requests. By default, fields with 2663 // empty or default values are omitted from API requests. However, any 2664 // non-pointer, non-interface field appearing in ForceSendFields will be 2665 // sent to the server regardless of whether the field is empty or not. 2666 // This may be used to include empty fields in Patch requests. 2667 ForceSendFields []string `json:"-"` 2668 2669 // NullFields is a list of field names (e.g. "AutoUpdatePolicy") to 2670 // include in API requests with the JSON null value. By default, fields 2671 // with empty values are omitted from API requests. However, any field 2672 // with an empty value appearing in NullFields will be sent to the 2673 // server as null. It is an error if a field in this list has a 2674 // non-empty value. This may be used to include null fields in Patch 2675 // requests. 2676 NullFields []string `json:"-"` 2677} 2678 2679func (s *Policy) MarshalJSON() ([]byte, error) { 2680 type NoMethod Policy 2681 raw := NoMethod(*s) 2682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2683} 2684 2685// Product: A Products resource represents an app in the Google Play 2686// store that is available to at least some users in the enterprise. 2687// (Some apps are restricted to a single enterprise, and no information 2688// about them is made available outside that enterprise.) The 2689// information provided for each product (localized name, icon, link to 2690// the full Google Play details page) is intended to allow a basic 2691// representation of the product within an EMM user interface. 2692type Product struct { 2693 // AppTracks: The tracks visible to the enterprise. 2694 AppTracks []*TrackInfo `json:"appTracks,omitempty"` 2695 2696 // AppVersion: App versions currently available for this product. 2697 AppVersion []*AppVersion `json:"appVersion,omitempty"` 2698 2699 // AuthorName: The name of the author of the product (for example, the 2700 // app developer). 2701 AuthorName string `json:"authorName,omitempty"` 2702 2703 // AvailableCountries: The countries which this app is available in. 2704 AvailableCountries []string `json:"availableCountries,omitempty"` 2705 2706 // AvailableTracks: Deprecated, use appTracks instead. 2707 // 2708 // Possible values: 2709 // "appTrackUnspecified" 2710 // "production" 2711 // "beta" 2712 // "alpha" 2713 AvailableTracks []string `json:"availableTracks,omitempty"` 2714 2715 // Category: The app category (e.g. RACING, SOCIAL, etc.) 2716 Category string `json:"category,omitempty"` 2717 2718 // ContentRating: The content rating for this app. 2719 // 2720 // Possible values: 2721 // "ratingUnknown" 2722 // "all" 2723 // "preTeen" 2724 // "teen" 2725 // "mature" 2726 ContentRating string `json:"contentRating,omitempty"` 2727 2728 // Description: The localized promotional description, if available. 2729 Description string `json:"description,omitempty"` 2730 2731 // DetailsUrl: A link to the (consumer) Google Play details page for the 2732 // product. 2733 DetailsUrl string `json:"detailsUrl,omitempty"` 2734 2735 // DistributionChannel: How and to whom the package is made available. 2736 // The value publicGoogleHosted means that the package is available 2737 // through the Play store and not restricted to a specific enterprise. 2738 // The value privateGoogleHosted means that the package is a private app 2739 // (restricted to an enterprise) but hosted by Google. The value 2740 // privateSelfHosted means that the package is a private app (restricted 2741 // to an enterprise) and is privately hosted. 2742 // 2743 // Possible values: 2744 // "publicGoogleHosted" 2745 // "privateGoogleHosted" 2746 // "privateSelfHosted" 2747 DistributionChannel string `json:"distributionChannel,omitempty"` 2748 2749 // Features: Noteworthy features (if any) of this product. 2750 // 2751 // Possible values: 2752 // "featureUnknown" 2753 // "vpnApp" - The app is a VPN. 2754 Features []string `json:"features,omitempty"` 2755 2756 // IconUrl: A link to an image that can be used as an icon for the 2757 // product. This image is suitable for use at up to 512px x 512px. 2758 IconUrl string `json:"iconUrl,omitempty"` 2759 2760 // LastUpdatedTimestampMillis: The approximate time (within 7 days) the 2761 // app was last published, expressed in milliseconds since epoch. 2762 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 2763 2764 // MinAndroidSdkVersion: The minimum Android SDK necessary to run the 2765 // app. 2766 MinAndroidSdkVersion int64 `json:"minAndroidSdkVersion,omitempty"` 2767 2768 // Permissions: A list of permissions required by the app. 2769 Permissions []*ProductPermission `json:"permissions,omitempty"` 2770 2771 // ProductId: A string of the form *app:<package name>*. For example, 2772 // app:com.google.android.gm represents the Gmail app. 2773 ProductId string `json:"productId,omitempty"` 2774 2775 // ProductPricing: Whether this product is free, free with in-app 2776 // purchases, or paid. If the pricing is unknown, this means the product 2777 // is not generally available anymore (even though it might still be 2778 // available to people who own it). 2779 // 2780 // Possible values: 2781 // "unknown" - Unknown pricing, used to denote an approved product 2782 // that is not generally available. 2783 // "free" - The product is free. 2784 // "freeWithInAppPurchase" - The product is free, but offers in-app 2785 // purchases. 2786 // "paid" - The product is paid. 2787 ProductPricing string `json:"productPricing,omitempty"` 2788 2789 // RecentChanges: A description of the recent changes made to the app. 2790 RecentChanges string `json:"recentChanges,omitempty"` 2791 2792 // RequiresContainerApp: Deprecated. 2793 RequiresContainerApp bool `json:"requiresContainerApp,omitempty"` 2794 2795 // ScreenshotUrls: A list of screenshot links representing the app. 2796 ScreenshotUrls []string `json:"screenshotUrls,omitempty"` 2797 2798 // SigningCertificate: The certificate used to sign this product. 2799 SigningCertificate *ProductSigningCertificate `json:"signingCertificate,omitempty"` 2800 2801 // SmallIconUrl: A link to a smaller image that can be used as an icon 2802 // for the product. This image is suitable for use at up to 128px x 2803 // 128px. 2804 SmallIconUrl string `json:"smallIconUrl,omitempty"` 2805 2806 // Title: The name of the product. 2807 Title string `json:"title,omitempty"` 2808 2809 // WorkDetailsUrl: A link to the managed Google Play details page for 2810 // the product, for use by an Enterprise admin. 2811 WorkDetailsUrl string `json:"workDetailsUrl,omitempty"` 2812 2813 // ServerResponse contains the HTTP response code and headers from the 2814 // server. 2815 googleapi.ServerResponse `json:"-"` 2816 2817 // ForceSendFields is a list of field names (e.g. "AppTracks") to 2818 // unconditionally include in API requests. By default, fields with 2819 // empty or default values are omitted from API requests. However, any 2820 // non-pointer, non-interface field appearing in ForceSendFields will be 2821 // sent to the server regardless of whether the field is empty or not. 2822 // This may be used to include empty fields in Patch requests. 2823 ForceSendFields []string `json:"-"` 2824 2825 // NullFields is a list of field names (e.g. "AppTracks") to include in 2826 // API requests with the JSON null value. By default, fields with empty 2827 // values are omitted from API requests. However, any field with an 2828 // empty value appearing in NullFields will be sent to the server as 2829 // null. It is an error if a field in this list has a non-empty value. 2830 // This may be used to include null fields in Patch requests. 2831 NullFields []string `json:"-"` 2832} 2833 2834func (s *Product) MarshalJSON() ([]byte, error) { 2835 type NoMethod Product 2836 raw := NoMethod(*s) 2837 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2838} 2839 2840// ProductApprovalEvent: An event generated when a product's approval 2841// status is changed. 2842type ProductApprovalEvent struct { 2843 // Approved: Whether the product was approved or unapproved. This field 2844 // will always be present. 2845 // 2846 // Possible values: 2847 // "unknown" - Conveys no information. 2848 // "approved" - The product was approved. 2849 // "unapproved" - The product was unapproved. 2850 Approved string `json:"approved,omitempty"` 2851 2852 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2853 // for which the approval status has changed. This field will always be 2854 // present. 2855 ProductId string `json:"productId,omitempty"` 2856 2857 // ForceSendFields is a list of field names (e.g. "Approved") to 2858 // unconditionally include in API requests. By default, fields with 2859 // empty or default values are omitted from API requests. However, any 2860 // non-pointer, non-interface field appearing in ForceSendFields will be 2861 // sent to the server regardless of whether the field is empty or not. 2862 // This may be used to include empty fields in Patch requests. 2863 ForceSendFields []string `json:"-"` 2864 2865 // NullFields is a list of field names (e.g. "Approved") to include in 2866 // API requests with the JSON null value. By default, fields with empty 2867 // values are omitted from API requests. However, any field with an 2868 // empty value appearing in NullFields will be sent to the server as 2869 // null. It is an error if a field in this list has a non-empty value. 2870 // This may be used to include null fields in Patch requests. 2871 NullFields []string `json:"-"` 2872} 2873 2874func (s *ProductApprovalEvent) MarshalJSON() ([]byte, error) { 2875 type NoMethod ProductApprovalEvent 2876 raw := NoMethod(*s) 2877 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2878} 2879 2880// ProductAvailabilityChangeEvent: An event generated whenever a 2881// product's availability changes. 2882type ProductAvailabilityChangeEvent struct { 2883 // AvailabilityStatus: The new state of the product. This field will 2884 // always be present. 2885 // 2886 // Possible values: 2887 // "unknown" - Conveys no information. 2888 // "available" - The previously unavailable product is again available 2889 // on Google Play. 2890 // "removed" - The product was removed from Google Play. 2891 // "unpublished" - The product was unpublished by the developer. 2892 AvailabilityStatus string `json:"availabilityStatus,omitempty"` 2893 2894 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2895 // for which the product availability changed. This field will always be 2896 // present. 2897 ProductId string `json:"productId,omitempty"` 2898 2899 // ForceSendFields is a list of field names (e.g. "AvailabilityStatus") 2900 // to unconditionally include in API requests. By default, fields with 2901 // empty or default values are omitted from API requests. However, any 2902 // non-pointer, non-interface field appearing in ForceSendFields will be 2903 // sent to the server regardless of whether the field is empty or not. 2904 // This may be used to include empty fields in Patch requests. 2905 ForceSendFields []string `json:"-"` 2906 2907 // NullFields is a list of field names (e.g. "AvailabilityStatus") to 2908 // include in API requests with the JSON null value. By default, fields 2909 // with empty values are omitted from API requests. However, any field 2910 // with an empty value appearing in NullFields will be sent to the 2911 // server as null. It is an error if a field in this list has a 2912 // non-empty value. This may be used to include null fields in Patch 2913 // requests. 2914 NullFields []string `json:"-"` 2915} 2916 2917func (s *ProductAvailabilityChangeEvent) MarshalJSON() ([]byte, error) { 2918 type NoMethod ProductAvailabilityChangeEvent 2919 raw := NoMethod(*s) 2920 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2921} 2922 2923// ProductPermission: A product permissions resource represents the set 2924// of permissions required by a specific app and whether or not they 2925// have been accepted by an enterprise admin. The API can be used to 2926// read the set of permissions, and also to update the set to indicate 2927// that permissions have been accepted. 2928type ProductPermission struct { 2929 // PermissionId: An opaque string uniquely identifying the permission. 2930 PermissionId string `json:"permissionId,omitempty"` 2931 2932 // State: Whether the permission has been accepted or not. 2933 // 2934 // Possible values: 2935 // "required" - The permission is required by the app but has not yet 2936 // been accepted by the enterprise. 2937 // "accepted" - The permission has been accepted by the enterprise. 2938 State string `json:"state,omitempty"` 2939 2940 // ForceSendFields is a list of field names (e.g. "PermissionId") to 2941 // unconditionally include in API requests. By default, fields with 2942 // empty or default values are omitted from API requests. However, any 2943 // non-pointer, non-interface field appearing in ForceSendFields will be 2944 // sent to the server regardless of whether the field is empty or not. 2945 // This may be used to include empty fields in Patch requests. 2946 ForceSendFields []string `json:"-"` 2947 2948 // NullFields is a list of field names (e.g. "PermissionId") to include 2949 // in API requests with the JSON null value. By default, fields with 2950 // empty values are omitted from API requests. However, any field with 2951 // an empty value appearing in NullFields will be sent to the server as 2952 // null. It is an error if a field in this list has a non-empty value. 2953 // This may be used to include null fields in Patch requests. 2954 NullFields []string `json:"-"` 2955} 2956 2957func (s *ProductPermission) MarshalJSON() ([]byte, error) { 2958 type NoMethod ProductPermission 2959 raw := NoMethod(*s) 2960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2961} 2962 2963// ProductPermissions: Information about the permissions required by a 2964// specific app and whether they have been accepted by the enterprise. 2965type ProductPermissions struct { 2966 // Permission: The permissions required by the app. 2967 Permission []*ProductPermission `json:"permission,omitempty"` 2968 2969 // ProductId: The ID of the app that the permissions relate to, e.g. 2970 // "app:com.google.android.gm". 2971 ProductId string `json:"productId,omitempty"` 2972 2973 // ServerResponse contains the HTTP response code and headers from the 2974 // server. 2975 googleapi.ServerResponse `json:"-"` 2976 2977 // ForceSendFields is a list of field names (e.g. "Permission") to 2978 // unconditionally include in API requests. By default, fields with 2979 // empty or default values are omitted from API requests. However, any 2980 // non-pointer, non-interface field appearing in ForceSendFields will be 2981 // sent to the server regardless of whether the field is empty or not. 2982 // This may be used to include empty fields in Patch requests. 2983 ForceSendFields []string `json:"-"` 2984 2985 // NullFields is a list of field names (e.g. "Permission") to include in 2986 // API requests with the JSON null value. By default, fields with empty 2987 // values are omitted from API requests. However, any field with an 2988 // empty value appearing in NullFields will be sent to the server as 2989 // null. It is an error if a field in this list has a non-empty value. 2990 // This may be used to include null fields in Patch requests. 2991 NullFields []string `json:"-"` 2992} 2993 2994func (s *ProductPermissions) MarshalJSON() ([]byte, error) { 2995 type NoMethod ProductPermissions 2996 raw := NoMethod(*s) 2997 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2998} 2999 3000// ProductPolicy: The policy for a product. 3001type ProductPolicy struct { 3002 // AutoInstallPolicy: The auto-install policy for the product. 3003 AutoInstallPolicy *AutoInstallPolicy `json:"autoInstallPolicy,omitempty"` 3004 3005 // AutoUpdateMode: The auto-update mode for the product. 3006 // 3007 // Possible values: 3008 // "autoUpdateModeUnspecified" - Unspecified. Defaults to 3009 // AUTO_UPDATE_DEFAULT. 3010 // "autoUpdateDefault" - The app is automatically updated with low 3011 // priority to minimize the impact on the user. The app is updated when 3012 // the following constraints are met: * The device is not actively used 3013 // * The device is connected to an unmetered network * The device is 3014 // charging The device is notified about a new update within 24 hours 3015 // after it is published by the developer, after which the app is 3016 // updated the next time the constraints above are met. 3017 // "autoUpdatePostponed" - The app is not automatically updated for a 3018 // maximum of 90 days after the app becomes out of date. 90 days after 3019 // the app becomes out of date, the latest available version is 3020 // installed automatically with low priority (see AUTO_UPDATE_DEFAULT). 3021 // After the app is updated it is not automatically updated again until 3022 // 90 days after it becomes out of date again. The user can still 3023 // manually update the app from the Play Store at any time. 3024 // "autoUpdateHighPriority" - The app is updated as soon as possible. 3025 // No constraints are applied. The device is notified immediately about 3026 // a new app update after it is published by the developer. 3027 AutoUpdateMode string `json:"autoUpdateMode,omitempty"` 3028 3029 // ManagedConfiguration: The managed configuration for the product. 3030 ManagedConfiguration *ManagedConfiguration `json:"managedConfiguration,omitempty"` 3031 3032 // ProductId: The ID of the product. For example, 3033 // "app:com.google.android.gm". 3034 ProductId string `json:"productId,omitempty"` 3035 3036 // TrackIds: Grants the device visibility to the specified product 3037 // release track(s), identified by trackIds. The list of release tracks 3038 // of a product can be obtained by calling Products.Get. 3039 TrackIds []string `json:"trackIds,omitempty"` 3040 3041 // Tracks: Deprecated. Use trackIds instead. 3042 // 3043 // Possible values: 3044 // "appTrackUnspecified" 3045 // "production" 3046 // "beta" 3047 // "alpha" 3048 Tracks []string `json:"tracks,omitempty"` 3049 3050 // ForceSendFields is a list of field names (e.g. "AutoInstallPolicy") 3051 // to unconditionally include in API requests. By default, fields with 3052 // empty or default values are omitted from API requests. However, any 3053 // non-pointer, non-interface field appearing in ForceSendFields will be 3054 // sent to the server regardless of whether the field is empty or not. 3055 // This may be used to include empty fields in Patch requests. 3056 ForceSendFields []string `json:"-"` 3057 3058 // NullFields is a list of field names (e.g. "AutoInstallPolicy") to 3059 // include in API requests with the JSON null value. By default, fields 3060 // with empty values are omitted from API requests. However, any field 3061 // with an empty value appearing in NullFields will be sent to the 3062 // server as null. It is an error if a field in this list has a 3063 // non-empty value. This may be used to include null fields in Patch 3064 // requests. 3065 NullFields []string `json:"-"` 3066} 3067 3068func (s *ProductPolicy) MarshalJSON() ([]byte, error) { 3069 type NoMethod ProductPolicy 3070 raw := NoMethod(*s) 3071 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3072} 3073 3074// ProductSet: A set of products. 3075type ProductSet struct { 3076 // ProductId: The list of product IDs making up the set of products. 3077 ProductId []string `json:"productId,omitempty"` 3078 3079 // ProductSetBehavior: The interpretation of this product set. "unknown" 3080 // should never be sent and is ignored if received. "whitelist" means 3081 // that the user is entitled to access the product set. "includeAll" 3082 // means that all products are accessible, including products that are 3083 // approved, products with revoked approval, and products that have 3084 // never been approved. "allApproved" means that the user is entitled to 3085 // access all products that are approved for the enterprise. If the 3086 // value is "allApproved" or "includeAll", the productId field is 3087 // ignored. If no value is provided, it is interpreted as "whitelist" 3088 // for backwards compatibility. Further "allApproved" or "includeAll" 3089 // does not enable automatic visibility of "alpha" or "beta" tracks for 3090 // Android app. Use ProductVisibility to enable "alpha" or "beta" tracks 3091 // per user. 3092 // 3093 // Possible values: 3094 // "unknown" - This value should never be sent and ignored if 3095 // received. 3096 // "whitelist" - This product set constitutes a whitelist. 3097 // "includeAll" - This product set represents all products. For 3098 // Android app it represents only "production" track. (The value of the 3099 // productId field is therefore ignored). 3100 // "allApproved" - This product set represents all approved products. 3101 // For Android app it represents only "production" track. (The value of 3102 // the product_id field is therefore ignored). 3103 ProductSetBehavior string `json:"productSetBehavior,omitempty"` 3104 3105 // ProductVisibility: Additional list of product IDs making up the 3106 // product set. Unlike the productID array, in this list It's possible 3107 // to specify which tracks (alpha, beta, production) of a product are 3108 // visible to the user. See ProductVisibility and its fields for more 3109 // information. Specifying the same product ID both here and in the 3110 // productId array is not allowed and it will result in an error. 3111 ProductVisibility []*ProductVisibility `json:"productVisibility,omitempty"` 3112 3113 // ServerResponse contains the HTTP response code and headers from the 3114 // server. 3115 googleapi.ServerResponse `json:"-"` 3116 3117 // ForceSendFields is a list of field names (e.g. "ProductId") to 3118 // unconditionally include in API requests. By default, fields with 3119 // empty or default values are omitted from API requests. However, any 3120 // non-pointer, non-interface field appearing in ForceSendFields will be 3121 // sent to the server regardless of whether the field is empty or not. 3122 // This may be used to include empty fields in Patch requests. 3123 ForceSendFields []string `json:"-"` 3124 3125 // NullFields is a list of field names (e.g. "ProductId") to include in 3126 // API requests with the JSON null value. By default, fields with empty 3127 // values are omitted from API requests. However, any field with an 3128 // empty value appearing in NullFields will be sent to the server as 3129 // null. It is an error if a field in this list has a non-empty value. 3130 // This may be used to include null fields in Patch requests. 3131 NullFields []string `json:"-"` 3132} 3133 3134func (s *ProductSet) MarshalJSON() ([]byte, error) { 3135 type NoMethod ProductSet 3136 raw := NoMethod(*s) 3137 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3138} 3139 3140type ProductSigningCertificate struct { 3141 // CertificateHashSha1: The base64 urlsafe encoded SHA1 hash of the 3142 // certificate. (This field is deprecated in favor of SHA2-256. It 3143 // should not be used and may be removed at any time.) 3144 CertificateHashSha1 string `json:"certificateHashSha1,omitempty"` 3145 3146 // CertificateHashSha256: The base64 urlsafe encoded SHA2-256 hash of 3147 // the certificate. 3148 CertificateHashSha256 string `json:"certificateHashSha256,omitempty"` 3149 3150 // ForceSendFields is a list of field names (e.g. "CertificateHashSha1") 3151 // to unconditionally include in API requests. By default, fields with 3152 // empty or default values are omitted from API requests. However, any 3153 // non-pointer, non-interface field appearing in ForceSendFields will be 3154 // sent to the server regardless of whether the field is empty or not. 3155 // This may be used to include empty fields in Patch requests. 3156 ForceSendFields []string `json:"-"` 3157 3158 // NullFields is a list of field names (e.g. "CertificateHashSha1") to 3159 // include in API requests with the JSON null value. By default, fields 3160 // with empty values are omitted from API requests. However, any field 3161 // with an empty value appearing in NullFields will be sent to the 3162 // server as null. It is an error if a field in this list has a 3163 // non-empty value. This may be used to include null fields in Patch 3164 // requests. 3165 NullFields []string `json:"-"` 3166} 3167 3168func (s *ProductSigningCertificate) MarshalJSON() ([]byte, error) { 3169 type NoMethod ProductSigningCertificate 3170 raw := NoMethod(*s) 3171 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3172} 3173 3174// ProductVisibility: A product to be made visible to a user. 3175type ProductVisibility struct { 3176 // ProductId: The product ID to make visible to the user. Required for 3177 // each item in the productVisibility list. 3178 ProductId string `json:"productId,omitempty"` 3179 3180 // TrackIds: Grants the user visibility to the specified product 3181 // track(s), identified by trackIds. 3182 TrackIds []string `json:"trackIds,omitempty"` 3183 3184 // Tracks: Deprecated. Use trackIds instead. 3185 // 3186 // Possible values: 3187 // "appTrackUnspecified" 3188 // "production" 3189 // "beta" 3190 // "alpha" 3191 Tracks []string `json:"tracks,omitempty"` 3192 3193 // ForceSendFields is a list of field names (e.g. "ProductId") to 3194 // unconditionally include in API requests. By default, fields with 3195 // empty or default values are omitted from API requests. However, any 3196 // non-pointer, non-interface field appearing in ForceSendFields will be 3197 // sent to the server regardless of whether the field is empty or not. 3198 // This may be used to include empty fields in Patch requests. 3199 ForceSendFields []string `json:"-"` 3200 3201 // NullFields is a list of field names (e.g. "ProductId") to include in 3202 // API requests with the JSON null value. By default, fields with empty 3203 // values are omitted from API requests. However, any field with an 3204 // empty value appearing in NullFields will be sent to the server as 3205 // null. It is an error if a field in this list has a non-empty value. 3206 // This may be used to include null fields in Patch requests. 3207 NullFields []string `json:"-"` 3208} 3209 3210func (s *ProductVisibility) MarshalJSON() ([]byte, error) { 3211 type NoMethod ProductVisibility 3212 raw := NoMethod(*s) 3213 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3214} 3215 3216type ProductsApproveRequest struct { 3217 // ApprovalUrlInfo: The approval URL that was shown to the user. Only 3218 // the permissions shown to the user with that URL will be accepted, 3219 // which may not be the product's entire set of permissions. For 3220 // example, the URL may only display new permissions from an update 3221 // after the product was approved, or not include new permissions if the 3222 // product was updated since the URL was generated. 3223 ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"` 3224 3225 // ApprovedPermissions: Sets how new permission requests for the product 3226 // are handled. "allPermissions" automatically approves all current and 3227 // future permissions for the product. "currentPermissionsOnly" approves 3228 // the current set of permissions for the product, but any future 3229 // permissions added through updates will require manual reapproval. If 3230 // not specified, only the current set of permissions will be approved. 3231 // 3232 // Possible values: 3233 // "currentPermissionsOnly" - Approve only the permissions the product 3234 // requires at approval time. If an update requires additional 3235 // permissions, the app will not be updated on devices associated with 3236 // enterprise users until the additional permissions are approved. 3237 // "allPermissions" - All current and future permissions the app 3238 // requires are automatically approved. 3239 ApprovedPermissions string `json:"approvedPermissions,omitempty"` 3240 3241 // ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to 3242 // unconditionally include in API requests. By default, fields with 3243 // empty or default values are omitted from API requests. However, any 3244 // non-pointer, non-interface field appearing in ForceSendFields will be 3245 // sent to the server regardless of whether the field is empty or not. 3246 // This may be used to include empty fields in Patch requests. 3247 ForceSendFields []string `json:"-"` 3248 3249 // NullFields is a list of field names (e.g. "ApprovalUrlInfo") to 3250 // include in API requests with the JSON null value. By default, fields 3251 // with empty values are omitted from API requests. However, any field 3252 // with an empty value appearing in NullFields will be sent to the 3253 // server as null. It is an error if a field in this list has a 3254 // non-empty value. This may be used to include null fields in Patch 3255 // requests. 3256 NullFields []string `json:"-"` 3257} 3258 3259func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) { 3260 type NoMethod ProductsApproveRequest 3261 raw := NoMethod(*s) 3262 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3263} 3264 3265type ProductsGenerateApprovalUrlResponse struct { 3266 // Url: A URL that can be rendered in an iframe to display the 3267 // permissions (if any) of a product. This URL can be used to approve 3268 // the product only once and only within 24 hours of being generated, 3269 // using the Products.approve call. If the product is currently 3270 // unapproved and has no permissions, this URL will point to an empty 3271 // page. If the product is currently approved, a URL will only be 3272 // generated if that product has added permissions since it was last 3273 // approved, and the URL will only display those new permissions that 3274 // have not yet been accepted. 3275 Url string `json:"url,omitempty"` 3276 3277 // ServerResponse contains the HTTP response code and headers from the 3278 // server. 3279 googleapi.ServerResponse `json:"-"` 3280 3281 // ForceSendFields is a list of field names (e.g. "Url") to 3282 // unconditionally include in API requests. By default, fields with 3283 // empty or default values are omitted from API requests. However, any 3284 // non-pointer, non-interface field appearing in ForceSendFields will be 3285 // sent to the server regardless of whether the field is empty or not. 3286 // This may be used to include empty fields in Patch requests. 3287 ForceSendFields []string `json:"-"` 3288 3289 // NullFields is a list of field names (e.g. "Url") to include in API 3290 // requests with the JSON null value. By default, fields with empty 3291 // values are omitted from API requests. However, any field with an 3292 // empty value appearing in NullFields will be sent to the server as 3293 // null. It is an error if a field in this list has a non-empty value. 3294 // This may be used to include null fields in Patch requests. 3295 NullFields []string `json:"-"` 3296} 3297 3298func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) { 3299 type NoMethod ProductsGenerateApprovalUrlResponse 3300 raw := NoMethod(*s) 3301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3302} 3303 3304type ProductsListResponse struct { 3305 // PageInfo: General pagination information. 3306 PageInfo *PageInfo `json:"pageInfo,omitempty"` 3307 3308 // Product: Information about a product (e.g. an app) in the Google Play 3309 // store, for display to an enterprise admin. 3310 Product []*Product `json:"product,omitempty"` 3311 3312 // TokenPagination: Pagination information for token pagination. 3313 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` 3314 3315 // ServerResponse contains the HTTP response code and headers from the 3316 // server. 3317 googleapi.ServerResponse `json:"-"` 3318 3319 // ForceSendFields is a list of field names (e.g. "PageInfo") to 3320 // unconditionally include in API requests. By default, fields with 3321 // empty or default values are omitted from API requests. However, any 3322 // non-pointer, non-interface field appearing in ForceSendFields will be 3323 // sent to the server regardless of whether the field is empty or not. 3324 // This may be used to include empty fields in Patch requests. 3325 ForceSendFields []string `json:"-"` 3326 3327 // NullFields is a list of field names (e.g. "PageInfo") to include in 3328 // API requests with the JSON null value. By default, fields with empty 3329 // values are omitted from API requests. However, any field with an 3330 // empty value appearing in NullFields will be sent to the server as 3331 // null. It is an error if a field in this list has a non-empty value. 3332 // This may be used to include null fields in Patch requests. 3333 NullFields []string `json:"-"` 3334} 3335 3336func (s *ProductsListResponse) MarshalJSON() ([]byte, error) { 3337 type NoMethod ProductsListResponse 3338 raw := NoMethod(*s) 3339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3340} 3341 3342// ServiceAccount: A service account identity, including the name and 3343// credentials that can be used to authenticate as the service account. 3344type ServiceAccount struct { 3345 // Key: Credentials that can be used to authenticate as this 3346 // ServiceAccount. 3347 Key *ServiceAccountKey `json:"key,omitempty"` 3348 3349 // Name: The account name of the service account, in the form of an 3350 // email address. Assigned by the server. 3351 Name string `json:"name,omitempty"` 3352 3353 // ServerResponse contains the HTTP response code and headers from the 3354 // server. 3355 googleapi.ServerResponse `json:"-"` 3356 3357 // ForceSendFields is a list of field names (e.g. "Key") to 3358 // unconditionally include in API requests. By default, fields with 3359 // empty or default values are omitted from API requests. However, any 3360 // non-pointer, non-interface field appearing in ForceSendFields will be 3361 // sent to the server regardless of whether the field is empty or not. 3362 // This may be used to include empty fields in Patch requests. 3363 ForceSendFields []string `json:"-"` 3364 3365 // NullFields is a list of field names (e.g. "Key") to include in API 3366 // requests with the JSON null value. By default, fields with empty 3367 // values are omitted from API requests. However, any field with an 3368 // empty value appearing in NullFields will be sent to the server as 3369 // null. It is an error if a field in this list has a non-empty value. 3370 // This may be used to include null fields in Patch requests. 3371 NullFields []string `json:"-"` 3372} 3373 3374func (s *ServiceAccount) MarshalJSON() ([]byte, error) { 3375 type NoMethod ServiceAccount 3376 raw := NoMethod(*s) 3377 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3378} 3379 3380// ServiceAccountKey: Credentials that can be used to authenticate as a 3381// service account. 3382type ServiceAccountKey struct { 3383 // Data: The body of the private key credentials file, in string format. 3384 // This is only populated when the ServiceAccountKey is created, and is 3385 // not stored by Google. 3386 Data string `json:"data,omitempty"` 3387 3388 // Id: An opaque, unique identifier for this ServiceAccountKey. Assigned 3389 // by the server. 3390 Id string `json:"id,omitempty"` 3391 3392 // PublicData: Public key data for the credentials file. This is an 3393 // X.509 cert. If you are using the googleCredentials key type, this is 3394 // identical to the cert that can be retrieved by using the X.509 cert 3395 // url inside of the credentials file. 3396 PublicData string `json:"publicData,omitempty"` 3397 3398 // Type: The file format of the generated key data. 3399 // 3400 // Possible values: 3401 // "googleCredentials" - Google Credentials File format. 3402 // "pkcs12" - PKCS12 format. The password for the PKCS12 file is 3403 // 'notasecret'. For more information, see 3404 // https://tools.ietf.org/html/rfc7292. The data for keys of this type 3405 // are base64 encoded according to RFC 4648 Section 4. See 3406 // http://tools.ietf.org/html/rfc4648#section-4. 3407 Type string `json:"type,omitempty"` 3408 3409 // ServerResponse contains the HTTP response code and headers from the 3410 // server. 3411 googleapi.ServerResponse `json:"-"` 3412 3413 // ForceSendFields is a list of field names (e.g. "Data") to 3414 // unconditionally include in API requests. By default, fields with 3415 // empty or default values are omitted from API requests. However, any 3416 // non-pointer, non-interface field appearing in ForceSendFields will be 3417 // sent to the server regardless of whether the field is empty or not. 3418 // This may be used to include empty fields in Patch requests. 3419 ForceSendFields []string `json:"-"` 3420 3421 // NullFields is a list of field names (e.g. "Data") to include in API 3422 // requests with the JSON null value. By default, fields with empty 3423 // values are omitted from API requests. However, any field with an 3424 // empty value appearing in NullFields will be sent to the server as 3425 // null. It is an error if a field in this list has a non-empty value. 3426 // This may be used to include null fields in Patch requests. 3427 NullFields []string `json:"-"` 3428} 3429 3430func (s *ServiceAccountKey) MarshalJSON() ([]byte, error) { 3431 type NoMethod ServiceAccountKey 3432 raw := NoMethod(*s) 3433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3434} 3435 3436type ServiceAccountKeysListResponse struct { 3437 // ServiceAccountKey: The service account credentials. 3438 ServiceAccountKey []*ServiceAccountKey `json:"serviceAccountKey,omitempty"` 3439 3440 // ServerResponse contains the HTTP response code and headers from the 3441 // server. 3442 googleapi.ServerResponse `json:"-"` 3443 3444 // ForceSendFields is a list of field names (e.g. "ServiceAccountKey") 3445 // to unconditionally include in API requests. By default, fields with 3446 // empty or default values are omitted from API requests. However, any 3447 // non-pointer, non-interface field appearing in ForceSendFields will be 3448 // sent to the server regardless of whether the field is empty or not. 3449 // This may be used to include empty fields in Patch requests. 3450 ForceSendFields []string `json:"-"` 3451 3452 // NullFields is a list of field names (e.g. "ServiceAccountKey") to 3453 // include in API requests with the JSON null value. By default, fields 3454 // with empty values are omitted from API requests. However, any field 3455 // with an empty value appearing in NullFields will be sent to the 3456 // server as null. It is an error if a field in this list has a 3457 // non-empty value. This may be used to include null fields in Patch 3458 // requests. 3459 NullFields []string `json:"-"` 3460} 3461 3462func (s *ServiceAccountKeysListResponse) MarshalJSON() ([]byte, error) { 3463 type NoMethod ServiceAccountKeysListResponse 3464 raw := NoMethod(*s) 3465 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3466} 3467 3468// SignupInfo: A resource returned by the GenerateSignupUrl API, which 3469// contains the Signup URL and Completion Token. 3470type SignupInfo struct { 3471 // CompletionToken: An opaque token that will be required, along with 3472 // the Enterprise Token, for obtaining the enterprise resource from 3473 // CompleteSignup. 3474 CompletionToken string `json:"completionToken,omitempty"` 3475 3476 // Kind: Deprecated. 3477 Kind string `json:"kind,omitempty"` 3478 3479 // Url: A URL under which the Admin can sign up for an enterprise. The 3480 // page pointed to cannot be rendered in an iframe. 3481 Url string `json:"url,omitempty"` 3482 3483 // ServerResponse contains the HTTP response code and headers from the 3484 // server. 3485 googleapi.ServerResponse `json:"-"` 3486 3487 // ForceSendFields is a list of field names (e.g. "CompletionToken") to 3488 // unconditionally include in API requests. By default, fields with 3489 // empty or default values are omitted from API requests. However, any 3490 // non-pointer, non-interface field appearing in ForceSendFields will be 3491 // sent to the server regardless of whether the field is empty or not. 3492 // This may be used to include empty fields in Patch requests. 3493 ForceSendFields []string `json:"-"` 3494 3495 // NullFields is a list of field names (e.g. "CompletionToken") to 3496 // include in API requests with the JSON null value. By default, fields 3497 // with empty values are omitted from API requests. However, any field 3498 // with an empty value appearing in NullFields will be sent to the 3499 // server as null. It is an error if a field in this list has a 3500 // non-empty value. This may be used to include null fields in Patch 3501 // requests. 3502 NullFields []string `json:"-"` 3503} 3504 3505func (s *SignupInfo) MarshalJSON() ([]byte, error) { 3506 type NoMethod SignupInfo 3507 raw := NoMethod(*s) 3508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3509} 3510 3511// StoreCluster: Definition of a managed Google Play store cluster, a 3512// list of products displayed as part of a store page. 3513type StoreCluster struct { 3514 // Id: Unique ID of this cluster. Assigned by the server. Immutable once 3515 // assigned. 3516 Id string `json:"id,omitempty"` 3517 3518 // Name: Ordered list of localized strings giving the name of this page. 3519 // The text displayed is the one that best matches the user locale, or 3520 // the first entry if there is no good match. There needs to be at least 3521 // one entry. 3522 Name []*LocalizedText `json:"name,omitempty"` 3523 3524 // OrderInPage: String (US-ASCII only) used to determine order of this 3525 // cluster within the parent page's elements. Page elements are sorted 3526 // in lexicographic order of this field. Duplicated values are allowed, 3527 // but ordering between elements with duplicate order is undefined. The 3528 // value of this field is never visible to a user, it is used solely for 3529 // the purpose of defining an ordering. Maximum length is 256 3530 // characters. 3531 OrderInPage string `json:"orderInPage,omitempty"` 3532 3533 // ProductId: List of products in the order they are displayed in the 3534 // cluster. There should not be duplicates within a cluster. 3535 ProductId []string `json:"productId,omitempty"` 3536 3537 // ServerResponse contains the HTTP response code and headers from the 3538 // server. 3539 googleapi.ServerResponse `json:"-"` 3540 3541 // ForceSendFields is a list of field names (e.g. "Id") to 3542 // unconditionally include in API requests. By default, fields with 3543 // empty or default values are omitted from API requests. However, any 3544 // non-pointer, non-interface field appearing in ForceSendFields will be 3545 // sent to the server regardless of whether the field is empty or not. 3546 // This may be used to include empty fields in Patch requests. 3547 ForceSendFields []string `json:"-"` 3548 3549 // NullFields is a list of field names (e.g. "Id") to include in API 3550 // requests with the JSON null value. By default, fields with empty 3551 // values are omitted from API requests. However, any field with an 3552 // empty value appearing in NullFields will be sent to the server as 3553 // null. It is an error if a field in this list has a non-empty value. 3554 // This may be used to include null fields in Patch requests. 3555 NullFields []string `json:"-"` 3556} 3557 3558func (s *StoreCluster) MarshalJSON() ([]byte, error) { 3559 type NoMethod StoreCluster 3560 raw := NoMethod(*s) 3561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3562} 3563 3564// StoreLayout: General setting for the managed Google Play store 3565// layout, currently only specifying the page to display the first time 3566// the store is opened. 3567type StoreLayout struct { 3568 // HomepageId: The ID of the store page to be used as the homepage. The 3569 // homepage is the first page shown in the managed Google Play Store. 3570 // Not specifying a homepage is equivalent to setting the store layout 3571 // type to "basic". 3572 HomepageId string `json:"homepageId,omitempty"` 3573 3574 // StoreLayoutType: The store layout type. By default, this value is set 3575 // to "basic" if the homepageId field is not set, and to "custom" 3576 // otherwise. If set to "basic", the layout will consist of all approved 3577 // apps that have been whitelisted for the user. 3578 // 3579 // Possible values: 3580 // "unknown" 3581 // "basic" 3582 // "custom" 3583 StoreLayoutType string `json:"storeLayoutType,omitempty"` 3584 3585 // ServerResponse contains the HTTP response code and headers from the 3586 // server. 3587 googleapi.ServerResponse `json:"-"` 3588 3589 // ForceSendFields is a list of field names (e.g. "HomepageId") to 3590 // unconditionally include in API requests. By default, fields with 3591 // empty or default values are omitted from API requests. However, any 3592 // non-pointer, non-interface field appearing in ForceSendFields will be 3593 // sent to the server regardless of whether the field is empty or not. 3594 // This may be used to include empty fields in Patch requests. 3595 ForceSendFields []string `json:"-"` 3596 3597 // NullFields is a list of field names (e.g. "HomepageId") to include in 3598 // API requests with the JSON null value. By default, fields with empty 3599 // values are omitted from API requests. However, any field with an 3600 // empty value appearing in NullFields will be sent to the server as 3601 // null. It is an error if a field in this list has a non-empty value. 3602 // This may be used to include null fields in Patch requests. 3603 NullFields []string `json:"-"` 3604} 3605 3606func (s *StoreLayout) MarshalJSON() ([]byte, error) { 3607 type NoMethod StoreLayout 3608 raw := NoMethod(*s) 3609 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3610} 3611 3612type StoreLayoutClustersListResponse struct { 3613 // Cluster: A store cluster of an enterprise. 3614 Cluster []*StoreCluster `json:"cluster,omitempty"` 3615 3616 // ServerResponse contains the HTTP response code and headers from the 3617 // server. 3618 googleapi.ServerResponse `json:"-"` 3619 3620 // ForceSendFields is a list of field names (e.g. "Cluster") to 3621 // unconditionally include in API requests. By default, fields with 3622 // empty or default values are omitted from API requests. However, any 3623 // non-pointer, non-interface field appearing in ForceSendFields will be 3624 // sent to the server regardless of whether the field is empty or not. 3625 // This may be used to include empty fields in Patch requests. 3626 ForceSendFields []string `json:"-"` 3627 3628 // NullFields is a list of field names (e.g. "Cluster") to include in 3629 // API requests with the JSON null value. By default, fields with empty 3630 // values are omitted from API requests. However, any field with an 3631 // empty value appearing in NullFields will be sent to the server as 3632 // null. It is an error if a field in this list has a non-empty value. 3633 // This may be used to include null fields in Patch requests. 3634 NullFields []string `json:"-"` 3635} 3636 3637func (s *StoreLayoutClustersListResponse) MarshalJSON() ([]byte, error) { 3638 type NoMethod StoreLayoutClustersListResponse 3639 raw := NoMethod(*s) 3640 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3641} 3642 3643type StoreLayoutPagesListResponse struct { 3644 // Page: A store page of an enterprise. 3645 Page []*StorePage `json:"page,omitempty"` 3646 3647 // ServerResponse contains the HTTP response code and headers from the 3648 // server. 3649 googleapi.ServerResponse `json:"-"` 3650 3651 // ForceSendFields is a list of field names (e.g. "Page") to 3652 // unconditionally include in API requests. By default, fields with 3653 // empty or default values are omitted from API requests. However, any 3654 // non-pointer, non-interface field appearing in ForceSendFields will be 3655 // sent to the server regardless of whether the field is empty or not. 3656 // This may be used to include empty fields in Patch requests. 3657 ForceSendFields []string `json:"-"` 3658 3659 // NullFields is a list of field names (e.g. "Page") to include in API 3660 // requests with the JSON null value. By default, fields with empty 3661 // values are omitted from API requests. However, any field with an 3662 // empty value appearing in NullFields will be sent to the server as 3663 // null. It is an error if a field in this list has a non-empty value. 3664 // This may be used to include null fields in Patch requests. 3665 NullFields []string `json:"-"` 3666} 3667 3668func (s *StoreLayoutPagesListResponse) MarshalJSON() ([]byte, error) { 3669 type NoMethod StoreLayoutPagesListResponse 3670 raw := NoMethod(*s) 3671 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3672} 3673 3674// StorePage: Definition of a managed Google Play store page, made of a 3675// localized name and links to other pages. A page also contains 3676// clusters defined as a subcollection. 3677type StorePage struct { 3678 // Id: Unique ID of this page. Assigned by the server. Immutable once 3679 // assigned. 3680 Id string `json:"id,omitempty"` 3681 3682 // Link: Ordered list of pages a user should be able to reach from this 3683 // page. The list can't include this page. It is recommended that the 3684 // basic pages are created first, before adding the links between pages. 3685 // The API doesn't verify that the pages exist or the pages are 3686 // reachable. 3687 Link []string `json:"link,omitempty"` 3688 3689 // Name: Ordered list of localized strings giving the name of this page. 3690 // The text displayed is the one that best matches the user locale, or 3691 // the first entry if there is no good match. There needs to be at least 3692 // one entry. 3693 Name []*LocalizedText `json:"name,omitempty"` 3694 3695 // ServerResponse contains the HTTP response code and headers from the 3696 // server. 3697 googleapi.ServerResponse `json:"-"` 3698 3699 // ForceSendFields is a list of field names (e.g. "Id") to 3700 // unconditionally include in API requests. By default, fields with 3701 // empty or default values are omitted from API requests. However, any 3702 // non-pointer, non-interface field appearing in ForceSendFields will be 3703 // sent to the server regardless of whether the field is empty or not. 3704 // This may be used to include empty fields in Patch requests. 3705 ForceSendFields []string `json:"-"` 3706 3707 // NullFields is a list of field names (e.g. "Id") to include in API 3708 // requests with the JSON null value. By default, fields with empty 3709 // values are omitted from API requests. However, any field with an 3710 // empty value appearing in NullFields will be sent to the server as 3711 // null. It is an error if a field in this list has a non-empty value. 3712 // This may be used to include null fields in Patch requests. 3713 NullFields []string `json:"-"` 3714} 3715 3716func (s *StorePage) MarshalJSON() ([]byte, error) { 3717 type NoMethod StorePage 3718 raw := NoMethod(*s) 3719 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3720} 3721 3722// TokenPagination: Pagination information returned by a List operation 3723// when token pagination is enabled. List operations that supports 3724// paging return only one "page" of results. This protocol buffer 3725// message describes the page that has been returned. When using token 3726// pagination, clients should use the next/previous token to get another 3727// page of the result. The presence or absence of next/previous token 3728// indicates whether a next/previous page is available and provides a 3729// mean of accessing this page. ListRequest.page_token should be set to 3730// either next_page_token or previous_page_token to access another page. 3731type TokenPagination struct { 3732 // NextPageToken: Tokens to pass to the standard list field 3733 // 'page_token'. Whenever available, tokens are preferred over 3734 // manipulating start_index. 3735 NextPageToken string `json:"nextPageToken,omitempty"` 3736 3737 PreviousPageToken string `json:"previousPageToken,omitempty"` 3738 3739 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3740 // unconditionally include in API requests. By default, fields with 3741 // empty or default values are omitted from API requests. However, any 3742 // non-pointer, non-interface field appearing in ForceSendFields will be 3743 // sent to the server regardless of whether the field is empty or not. 3744 // This may be used to include empty fields in Patch requests. 3745 ForceSendFields []string `json:"-"` 3746 3747 // NullFields is a list of field names (e.g. "NextPageToken") to include 3748 // in API requests with the JSON null value. By default, fields with 3749 // empty values are omitted from API requests. However, any field with 3750 // an empty value appearing in NullFields will be sent to the server as 3751 // null. It is an error if a field in this list has a non-empty value. 3752 // This may be used to include null fields in Patch requests. 3753 NullFields []string `json:"-"` 3754} 3755 3756func (s *TokenPagination) MarshalJSON() ([]byte, error) { 3757 type NoMethod TokenPagination 3758 raw := NoMethod(*s) 3759 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3760} 3761 3762// TrackInfo: Id to name association of a track. 3763type TrackInfo struct { 3764 // TrackAlias: A modifiable name for a track. This is the visible name 3765 // in the play developer console. 3766 TrackAlias string `json:"trackAlias,omitempty"` 3767 3768 // TrackId: Unmodifiable, unique track identifier. This identifier is 3769 // the releaseTrackId in the url of the play developer console page that 3770 // displays the track information. 3771 TrackId string `json:"trackId,omitempty"` 3772 3773 // ForceSendFields is a list of field names (e.g. "TrackAlias") to 3774 // unconditionally include in API requests. By default, fields with 3775 // empty or default values are omitted from API requests. However, any 3776 // non-pointer, non-interface field appearing in ForceSendFields will be 3777 // sent to the server regardless of whether the field is empty or not. 3778 // This may be used to include empty fields in Patch requests. 3779 ForceSendFields []string `json:"-"` 3780 3781 // NullFields is a list of field names (e.g. "TrackAlias") to include in 3782 // API requests with the JSON null value. By default, fields with empty 3783 // values are omitted from API requests. However, any field with an 3784 // empty value appearing in NullFields will be sent to the server as 3785 // null. It is an error if a field in this list has a non-empty value. 3786 // This may be used to include null fields in Patch requests. 3787 NullFields []string `json:"-"` 3788} 3789 3790func (s *TrackInfo) MarshalJSON() ([]byte, error) { 3791 type NoMethod TrackInfo 3792 raw := NoMethod(*s) 3793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3794} 3795 3796// User: A Users resource represents an account associated with an 3797// enterprise. The account may be specific to a device or to an 3798// individual user (who can then use the account across multiple 3799// devices). The account may provide access to managed Google Play only, 3800// or to other Google services, depending on the identity model: - The 3801// Google managed domain identity model requires synchronization to 3802// Google account sources (via primaryEmail). - The managed Google Play 3803// Accounts identity model provides a dynamic means for enterprises to 3804// create user or device accounts as needed. These accounts provide 3805// access to managed Google Play. 3806type User struct { 3807 // AccountIdentifier: A unique identifier you create for this user, such 3808 // as "user342" or "asset#44418". Do not use personally identifiable 3809 // information (PII) for this property. Must always be set for 3810 // EMM-managed users. Not set for Google-managed users. 3811 AccountIdentifier string `json:"accountIdentifier,omitempty"` 3812 3813 // AccountType: The type of account that this user represents. A 3814 // userAccount can be installed on multiple devices, but a deviceAccount 3815 // is specific to a single device. An EMM-managed user (emmManaged) can 3816 // be either type (userAccount, deviceAccount), but a Google-managed 3817 // user (googleManaged) is always a userAccount. 3818 // 3819 // Possible values: 3820 // "deviceAccount" 3821 // "userAccount" 3822 AccountType string `json:"accountType,omitempty"` 3823 3824 // DisplayName: The name that will appear in user interfaces. Setting 3825 // this property is optional when creating EMM-managed users. If you do 3826 // set this property, use something generic about the organization (such 3827 // as "Example, Inc.") or your name (as EMM). Not used for 3828 // Google-managed user accounts. @mutable androidenterprise.users.update 3829 DisplayName string `json:"displayName,omitempty"` 3830 3831 // Id: The unique ID for the user. 3832 Id string `json:"id,omitempty"` 3833 3834 // ManagementType: The entity that manages the user. With googleManaged 3835 // users, the source of truth is Google so EMMs have to make sure a 3836 // Google Account exists for the user. With emmManaged users, the EMM is 3837 // in charge. 3838 // 3839 // Possible values: 3840 // "googleManaged" 3841 // "emmManaged" 3842 ManagementType string `json:"managementType,omitempty"` 3843 3844 // PrimaryEmail: The user's primary email address, for example, 3845 // "jsmith@example.com". Will always be set for Google managed users and 3846 // not set for EMM managed users. 3847 PrimaryEmail string `json:"primaryEmail,omitempty"` 3848 3849 // ServerResponse contains the HTTP response code and headers from the 3850 // server. 3851 googleapi.ServerResponse `json:"-"` 3852 3853 // ForceSendFields is a list of field names (e.g. "AccountIdentifier") 3854 // to unconditionally include in API requests. By default, fields with 3855 // empty or default values are omitted from API requests. However, any 3856 // non-pointer, non-interface field appearing in ForceSendFields will be 3857 // sent to the server regardless of whether the field is empty or not. 3858 // This may be used to include empty fields in Patch requests. 3859 ForceSendFields []string `json:"-"` 3860 3861 // NullFields is a list of field names (e.g. "AccountIdentifier") to 3862 // include in API requests with the JSON null value. By default, fields 3863 // with empty values are omitted from API requests. However, any field 3864 // with an empty value appearing in NullFields will be sent to the 3865 // server as null. It is an error if a field in this list has a 3866 // non-empty value. This may be used to include null fields in Patch 3867 // requests. 3868 NullFields []string `json:"-"` 3869} 3870 3871func (s *User) MarshalJSON() ([]byte, error) { 3872 type NoMethod User 3873 raw := NoMethod(*s) 3874 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3875} 3876 3877type UsersListResponse struct { 3878 // User: A user of an enterprise. 3879 User []*User `json:"user,omitempty"` 3880 3881 // ServerResponse contains the HTTP response code and headers from the 3882 // server. 3883 googleapi.ServerResponse `json:"-"` 3884 3885 // ForceSendFields is a list of field names (e.g. "User") to 3886 // unconditionally include in API requests. By default, fields with 3887 // empty or default values are omitted from API requests. However, any 3888 // non-pointer, non-interface field appearing in ForceSendFields will be 3889 // sent to the server regardless of whether the field is empty or not. 3890 // This may be used to include empty fields in Patch requests. 3891 ForceSendFields []string `json:"-"` 3892 3893 // NullFields is a list of field names (e.g. "User") to include in API 3894 // requests with the JSON null value. By default, fields with empty 3895 // values are omitted from API requests. However, any field with an 3896 // empty value appearing in NullFields will be sent to the server as 3897 // null. It is an error if a field in this list has a non-empty value. 3898 // This may be used to include null fields in Patch requests. 3899 NullFields []string `json:"-"` 3900} 3901 3902func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 3903 type NoMethod UsersListResponse 3904 raw := NoMethod(*s) 3905 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3906} 3907 3908// VariableSet: A variable set is a key-value pair of EMM-provided 3909// placeholders and its corresponding value, which is attributed to a 3910// user. For example, $FIRSTNAME could be a placeholder, and its value 3911// could be Alice. Placeholders should start with a '$' sign and should 3912// be alphanumeric only. 3913type VariableSet struct { 3914 // Placeholder: The placeholder string; defined by EMM. 3915 Placeholder string `json:"placeholder,omitempty"` 3916 3917 // UserValue: The value of the placeholder, specific to the user. 3918 UserValue string `json:"userValue,omitempty"` 3919 3920 // ForceSendFields is a list of field names (e.g. "Placeholder") to 3921 // unconditionally include in API requests. By default, fields with 3922 // empty or default values are omitted from API requests. However, any 3923 // non-pointer, non-interface field appearing in ForceSendFields will be 3924 // sent to the server regardless of whether the field is empty or not. 3925 // This may be used to include empty fields in Patch requests. 3926 ForceSendFields []string `json:"-"` 3927 3928 // NullFields is a list of field names (e.g. "Placeholder") to include 3929 // in API requests with the JSON null value. By default, fields with 3930 // empty values are omitted from API requests. However, any field with 3931 // an empty value appearing in NullFields will be sent to the server as 3932 // null. It is an error if a field in this list has a non-empty value. 3933 // This may be used to include null fields in Patch requests. 3934 NullFields []string `json:"-"` 3935} 3936 3937func (s *VariableSet) MarshalJSON() ([]byte, error) { 3938 type NoMethod VariableSet 3939 raw := NoMethod(*s) 3940 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3941} 3942 3943// WebApp: A WebApps resource represents a web app created for an 3944// enterprise. Web apps are published to managed Google Play and can be 3945// distributed like other Android apps. On a user's device, a web app 3946// opens its specified URL. 3947type WebApp struct { 3948 // DisplayMode: The display mode of the web app. Possible values 3949 // include: - "minimalUi", the device's status bar, navigation bar, the 3950 // app's URL, and a refresh button are visible when the app is open. For 3951 // HTTP URLs, you can only select this option. - "standalone", the 3952 // device's status bar and navigation bar are visible when the app is 3953 // open. - "fullScreen", the app opens in full screen mode, hiding the 3954 // device's status and navigation bars. All browser UI elements, page 3955 // URL, system status bar and back button are not visible, and the web 3956 // app takes up the entirety of the available display area. 3957 // 3958 // Possible values: 3959 // "displayModeUnspecified" 3960 // "minimalUi" - Opens the web app with a minimal set of browser UI 3961 // elements for controlling navigation and viewing the page URL. 3962 // "standalone" - Opens the web app to look and feel like a standalone 3963 // native application. The browser UI elements and page URL are not 3964 // visible, however the system status bar and back button are visible. 3965 // "fullScreen" - Opens the web app in full screen without any visible 3966 // controls. The browser UI elements, page URL, system status bar and 3967 // back button are not visible, and the web app takes up the entirety of 3968 // the available display area. 3969 DisplayMode string `json:"displayMode,omitempty"` 3970 3971 // Icons: A list of icons representing this website. If absent, a 3972 // default icon (for create) or the current icon (for update) will be 3973 // used. 3974 Icons []*WebAppIcon `json:"icons,omitempty"` 3975 3976 // IsPublished: A flag whether the app has been published to the Play 3977 // store yet. 3978 IsPublished bool `json:"isPublished,omitempty"` 3979 3980 // StartUrl: The start URL, i.e. the URL that should load when the user 3981 // opens the application. 3982 StartUrl string `json:"startUrl,omitempty"` 3983 3984 // Title: The title of the web app as displayed to the user (e.g., 3985 // amongst a list of other applications, or as a label for an icon). 3986 Title string `json:"title,omitempty"` 3987 3988 // VersionCode: The current version of the app. Note that the version 3989 // can automatically increase during the lifetime of the web app, while 3990 // Google does internal housekeeping to keep the web app up-to-date. 3991 VersionCode int64 `json:"versionCode,omitempty,string"` 3992 3993 // WebAppId: The ID of the application. A string of the form 3994 // "app:<package name>" where the package name always starts with the 3995 // prefix "com.google.enterprise.webapp." followed by a random id. 3996 WebAppId string `json:"webAppId,omitempty"` 3997 3998 // ServerResponse contains the HTTP response code and headers from the 3999 // server. 4000 googleapi.ServerResponse `json:"-"` 4001 4002 // ForceSendFields is a list of field names (e.g. "DisplayMode") to 4003 // unconditionally include in API requests. By default, fields with 4004 // empty or default values are omitted from API requests. However, any 4005 // non-pointer, non-interface field appearing in ForceSendFields will be 4006 // sent to the server regardless of whether the field is empty or not. 4007 // This may be used to include empty fields in Patch requests. 4008 ForceSendFields []string `json:"-"` 4009 4010 // NullFields is a list of field names (e.g. "DisplayMode") to include 4011 // in API requests with the JSON null value. By default, fields with 4012 // empty values are omitted from API requests. However, any field with 4013 // an empty value appearing in NullFields will be sent to the server as 4014 // null. It is an error if a field in this list has a non-empty value. 4015 // This may be used to include null fields in Patch requests. 4016 NullFields []string `json:"-"` 4017} 4018 4019func (s *WebApp) MarshalJSON() ([]byte, error) { 4020 type NoMethod WebApp 4021 raw := NoMethod(*s) 4022 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4023} 4024 4025// WebAppIcon: Icon for a web app. 4026type WebAppIcon struct { 4027 // ImageData: The actual bytes of the image in a base64url encoded 4028 // string (c.f. RFC4648, section 5 "Base 64 Encoding with URL and 4029 // Filename Safe Alphabet"). - The image type can be png or jpg. - The 4030 // image should ideally be square. - The image should ideally have a 4031 // size of 512x512. 4032 ImageData string `json:"imageData,omitempty"` 4033 4034 // ForceSendFields is a list of field names (e.g. "ImageData") to 4035 // unconditionally include in API requests. By default, fields with 4036 // empty or default values are omitted from API requests. However, any 4037 // non-pointer, non-interface field appearing in ForceSendFields will be 4038 // sent to the server regardless of whether the field is empty or not. 4039 // This may be used to include empty fields in Patch requests. 4040 ForceSendFields []string `json:"-"` 4041 4042 // NullFields is a list of field names (e.g. "ImageData") to include in 4043 // API requests with the JSON null value. By default, fields with empty 4044 // values are omitted from API requests. However, any field with an 4045 // empty value appearing in NullFields will be sent to the server as 4046 // null. It is an error if a field in this list has a non-empty value. 4047 // This may be used to include null fields in Patch requests. 4048 NullFields []string `json:"-"` 4049} 4050 4051func (s *WebAppIcon) MarshalJSON() ([]byte, error) { 4052 type NoMethod WebAppIcon 4053 raw := NoMethod(*s) 4054 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4055} 4056 4057type WebAppsListResponse struct { 4058 // WebApp: The manifest describing a web app. 4059 WebApp []*WebApp `json:"webApp,omitempty"` 4060 4061 // ServerResponse contains the HTTP response code and headers from the 4062 // server. 4063 googleapi.ServerResponse `json:"-"` 4064 4065 // ForceSendFields is a list of field names (e.g. "WebApp") to 4066 // unconditionally include in API requests. By default, fields with 4067 // empty or default values are omitted from API requests. However, any 4068 // non-pointer, non-interface field appearing in ForceSendFields will be 4069 // sent to the server regardless of whether the field is empty or not. 4070 // This may be used to include empty fields in Patch requests. 4071 ForceSendFields []string `json:"-"` 4072 4073 // NullFields is a list of field names (e.g. "WebApp") to include in API 4074 // requests with the JSON null value. By default, fields with empty 4075 // values are omitted from API requests. However, any field with an 4076 // empty value appearing in NullFields will be sent to the server as 4077 // null. It is an error if a field in this list has a non-empty value. 4078 // This may be used to include null fields in Patch requests. 4079 NullFields []string `json:"-"` 4080} 4081 4082func (s *WebAppsListResponse) MarshalJSON() ([]byte, error) { 4083 type NoMethod WebAppsListResponse 4084 raw := NoMethod(*s) 4085 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4086} 4087 4088// method id "androidenterprise.devices.forceReportUpload": 4089 4090type DevicesForceReportUploadCall struct { 4091 s *Service 4092 enterpriseId string 4093 userId string 4094 deviceId string 4095 urlParams_ gensupport.URLParams 4096 ctx_ context.Context 4097 header_ http.Header 4098} 4099 4100// ForceReportUpload: Uploads a report containing any changes in app 4101// states on the device since the last report was generated. You can 4102// call this method up to 3 times every 24 hours for a given device. If 4103// you exceed the quota, then the Google Play EMM API returns HTTP 429 4104// Too Many Requests. 4105// 4106// - deviceId: The ID of the device. 4107// - enterpriseId: The ID of the enterprise. 4108// - userId: The ID of the user. 4109func (r *DevicesService) ForceReportUpload(enterpriseId string, userId string, deviceId string) *DevicesForceReportUploadCall { 4110 c := &DevicesForceReportUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4111 c.enterpriseId = enterpriseId 4112 c.userId = userId 4113 c.deviceId = deviceId 4114 return c 4115} 4116 4117// Fields allows partial responses to be retrieved. See 4118// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4119// for more information. 4120func (c *DevicesForceReportUploadCall) Fields(s ...googleapi.Field) *DevicesForceReportUploadCall { 4121 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4122 return c 4123} 4124 4125// Context sets the context to be used in this call's Do method. Any 4126// pending HTTP request will be aborted if the provided context is 4127// canceled. 4128func (c *DevicesForceReportUploadCall) Context(ctx context.Context) *DevicesForceReportUploadCall { 4129 c.ctx_ = ctx 4130 return c 4131} 4132 4133// Header returns an http.Header that can be modified by the caller to 4134// add HTTP headers to the request. 4135func (c *DevicesForceReportUploadCall) Header() http.Header { 4136 if c.header_ == nil { 4137 c.header_ = make(http.Header) 4138 } 4139 return c.header_ 4140} 4141 4142func (c *DevicesForceReportUploadCall) doRequest(alt string) (*http.Response, error) { 4143 reqHeaders := make(http.Header) 4144 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4145 for k, v := range c.header_ { 4146 reqHeaders[k] = v 4147 } 4148 reqHeaders.Set("User-Agent", c.s.userAgent()) 4149 var body io.Reader = nil 4150 c.urlParams_.Set("alt", alt) 4151 c.urlParams_.Set("prettyPrint", "false") 4152 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload") 4153 urls += "?" + c.urlParams_.Encode() 4154 req, err := http.NewRequest("POST", urls, body) 4155 if err != nil { 4156 return nil, err 4157 } 4158 req.Header = reqHeaders 4159 googleapi.Expand(req.URL, map[string]string{ 4160 "enterpriseId": c.enterpriseId, 4161 "userId": c.userId, 4162 "deviceId": c.deviceId, 4163 }) 4164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4165} 4166 4167// Do executes the "androidenterprise.devices.forceReportUpload" call. 4168func (c *DevicesForceReportUploadCall) Do(opts ...googleapi.CallOption) error { 4169 gensupport.SetOptions(c.urlParams_, opts...) 4170 res, err := c.doRequest("json") 4171 if err != nil { 4172 return err 4173 } 4174 defer googleapi.CloseBody(res) 4175 if err := googleapi.CheckResponse(res); err != nil { 4176 return err 4177 } 4178 return nil 4179 // { 4180 // "description": "Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device. If you exceed the quota, then the Google Play EMM API returns HTTP 429 Too Many Requests.", 4181 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload", 4182 // "httpMethod": "POST", 4183 // "id": "androidenterprise.devices.forceReportUpload", 4184 // "parameterOrder": [ 4185 // "enterpriseId", 4186 // "userId", 4187 // "deviceId" 4188 // ], 4189 // "parameters": { 4190 // "deviceId": { 4191 // "description": "The ID of the device.", 4192 // "location": "path", 4193 // "required": true, 4194 // "type": "string" 4195 // }, 4196 // "enterpriseId": { 4197 // "description": "The ID of the enterprise.", 4198 // "location": "path", 4199 // "required": true, 4200 // "type": "string" 4201 // }, 4202 // "userId": { 4203 // "description": "The ID of the user.", 4204 // "location": "path", 4205 // "required": true, 4206 // "type": "string" 4207 // } 4208 // }, 4209 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload", 4210 // "scopes": [ 4211 // "https://www.googleapis.com/auth/androidenterprise" 4212 // ] 4213 // } 4214 4215} 4216 4217// method id "androidenterprise.devices.get": 4218 4219type DevicesGetCall struct { 4220 s *Service 4221 enterpriseId string 4222 userId string 4223 deviceId string 4224 urlParams_ gensupport.URLParams 4225 ifNoneMatch_ string 4226 ctx_ context.Context 4227 header_ http.Header 4228} 4229 4230// Get: Retrieves the details of a device. 4231// 4232// - deviceId: The ID of the device. 4233// - enterpriseId: The ID of the enterprise. 4234// - userId: The ID of the user. 4235func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall { 4236 c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4237 c.enterpriseId = enterpriseId 4238 c.userId = userId 4239 c.deviceId = deviceId 4240 return c 4241} 4242 4243// Fields allows partial responses to be retrieved. See 4244// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4245// for more information. 4246func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall { 4247 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4248 return c 4249} 4250 4251// IfNoneMatch sets the optional parameter which makes the operation 4252// fail if the object's ETag matches the given value. This is useful for 4253// getting updates only after the object has changed since the last 4254// request. Use googleapi.IsNotModified to check whether the response 4255// error from Do is the result of In-None-Match. 4256func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall { 4257 c.ifNoneMatch_ = entityTag 4258 return c 4259} 4260 4261// Context sets the context to be used in this call's Do method. Any 4262// pending HTTP request will be aborted if the provided context is 4263// canceled. 4264func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall { 4265 c.ctx_ = ctx 4266 return c 4267} 4268 4269// Header returns an http.Header that can be modified by the caller to 4270// add HTTP headers to the request. 4271func (c *DevicesGetCall) Header() http.Header { 4272 if c.header_ == nil { 4273 c.header_ = make(http.Header) 4274 } 4275 return c.header_ 4276} 4277 4278func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { 4279 reqHeaders := make(http.Header) 4280 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4281 for k, v := range c.header_ { 4282 reqHeaders[k] = v 4283 } 4284 reqHeaders.Set("User-Agent", c.s.userAgent()) 4285 if c.ifNoneMatch_ != "" { 4286 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4287 } 4288 var body io.Reader = nil 4289 c.urlParams_.Set("alt", alt) 4290 c.urlParams_.Set("prettyPrint", "false") 4291 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") 4292 urls += "?" + c.urlParams_.Encode() 4293 req, err := http.NewRequest("GET", urls, body) 4294 if err != nil { 4295 return nil, err 4296 } 4297 req.Header = reqHeaders 4298 googleapi.Expand(req.URL, map[string]string{ 4299 "enterpriseId": c.enterpriseId, 4300 "userId": c.userId, 4301 "deviceId": c.deviceId, 4302 }) 4303 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4304} 4305 4306// Do executes the "androidenterprise.devices.get" call. 4307// Exactly one of *Device or error will be non-nil. Any non-2xx status 4308// code is an error. Response headers are in either 4309// *Device.ServerResponse.Header or (if a response was returned at all) 4310// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4311// check whether the returned error was because http.StatusNotModified 4312// was returned. 4313func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4314 gensupport.SetOptions(c.urlParams_, opts...) 4315 res, err := c.doRequest("json") 4316 if res != nil && res.StatusCode == http.StatusNotModified { 4317 if res.Body != nil { 4318 res.Body.Close() 4319 } 4320 return nil, &googleapi.Error{ 4321 Code: res.StatusCode, 4322 Header: res.Header, 4323 } 4324 } 4325 if err != nil { 4326 return nil, err 4327 } 4328 defer googleapi.CloseBody(res) 4329 if err := googleapi.CheckResponse(res); err != nil { 4330 return nil, err 4331 } 4332 ret := &Device{ 4333 ServerResponse: googleapi.ServerResponse{ 4334 Header: res.Header, 4335 HTTPStatusCode: res.StatusCode, 4336 }, 4337 } 4338 target := &ret 4339 if err := gensupport.DecodeResponse(target, res); err != nil { 4340 return nil, err 4341 } 4342 return ret, nil 4343 // { 4344 // "description": "Retrieves the details of a device.", 4345 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 4346 // "httpMethod": "GET", 4347 // "id": "androidenterprise.devices.get", 4348 // "parameterOrder": [ 4349 // "enterpriseId", 4350 // "userId", 4351 // "deviceId" 4352 // ], 4353 // "parameters": { 4354 // "deviceId": { 4355 // "description": "The ID of the device.", 4356 // "location": "path", 4357 // "required": true, 4358 // "type": "string" 4359 // }, 4360 // "enterpriseId": { 4361 // "description": "The ID of the enterprise.", 4362 // "location": "path", 4363 // "required": true, 4364 // "type": "string" 4365 // }, 4366 // "userId": { 4367 // "description": "The ID of the user.", 4368 // "location": "path", 4369 // "required": true, 4370 // "type": "string" 4371 // } 4372 // }, 4373 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 4374 // "response": { 4375 // "$ref": "Device" 4376 // }, 4377 // "scopes": [ 4378 // "https://www.googleapis.com/auth/androidenterprise" 4379 // ] 4380 // } 4381 4382} 4383 4384// method id "androidenterprise.devices.getState": 4385 4386type DevicesGetStateCall struct { 4387 s *Service 4388 enterpriseId string 4389 userId string 4390 deviceId string 4391 urlParams_ gensupport.URLParams 4392 ifNoneMatch_ string 4393 ctx_ context.Context 4394 header_ http.Header 4395} 4396 4397// GetState: Retrieves whether a device's access to Google services is 4398// enabled or disabled. The device state takes effect only if enforcing 4399// EMM policies on Android devices is enabled in the Google Admin 4400// Console. Otherwise, the device state is ignored and all devices are 4401// allowed access to Google services. This is only supported for 4402// Google-managed users. 4403// 4404// - deviceId: The ID of the device. 4405// - enterpriseId: The ID of the enterprise. 4406// - userId: The ID of the user. 4407func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall { 4408 c := &DevicesGetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4409 c.enterpriseId = enterpriseId 4410 c.userId = userId 4411 c.deviceId = deviceId 4412 return c 4413} 4414 4415// Fields allows partial responses to be retrieved. See 4416// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4417// for more information. 4418func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall { 4419 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4420 return c 4421} 4422 4423// IfNoneMatch sets the optional parameter which makes the operation 4424// fail if the object's ETag matches the given value. This is useful for 4425// getting updates only after the object has changed since the last 4426// request. Use googleapi.IsNotModified to check whether the response 4427// error from Do is the result of In-None-Match. 4428func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall { 4429 c.ifNoneMatch_ = entityTag 4430 return c 4431} 4432 4433// Context sets the context to be used in this call's Do method. Any 4434// pending HTTP request will be aborted if the provided context is 4435// canceled. 4436func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall { 4437 c.ctx_ = ctx 4438 return c 4439} 4440 4441// Header returns an http.Header that can be modified by the caller to 4442// add HTTP headers to the request. 4443func (c *DevicesGetStateCall) Header() http.Header { 4444 if c.header_ == nil { 4445 c.header_ = make(http.Header) 4446 } 4447 return c.header_ 4448} 4449 4450func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) { 4451 reqHeaders := make(http.Header) 4452 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4453 for k, v := range c.header_ { 4454 reqHeaders[k] = v 4455 } 4456 reqHeaders.Set("User-Agent", c.s.userAgent()) 4457 if c.ifNoneMatch_ != "" { 4458 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4459 } 4460 var body io.Reader = nil 4461 c.urlParams_.Set("alt", alt) 4462 c.urlParams_.Set("prettyPrint", "false") 4463 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") 4464 urls += "?" + c.urlParams_.Encode() 4465 req, err := http.NewRequest("GET", urls, body) 4466 if err != nil { 4467 return nil, err 4468 } 4469 req.Header = reqHeaders 4470 googleapi.Expand(req.URL, map[string]string{ 4471 "enterpriseId": c.enterpriseId, 4472 "userId": c.userId, 4473 "deviceId": c.deviceId, 4474 }) 4475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4476} 4477 4478// Do executes the "androidenterprise.devices.getState" call. 4479// Exactly one of *DeviceState or error will be non-nil. Any non-2xx 4480// status code is an error. Response headers are in either 4481// *DeviceState.ServerResponse.Header or (if a response was returned at 4482// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4483// to check whether the returned error was because 4484// http.StatusNotModified was returned. 4485func (c *DevicesGetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) { 4486 gensupport.SetOptions(c.urlParams_, opts...) 4487 res, err := c.doRequest("json") 4488 if res != nil && res.StatusCode == http.StatusNotModified { 4489 if res.Body != nil { 4490 res.Body.Close() 4491 } 4492 return nil, &googleapi.Error{ 4493 Code: res.StatusCode, 4494 Header: res.Header, 4495 } 4496 } 4497 if err != nil { 4498 return nil, err 4499 } 4500 defer googleapi.CloseBody(res) 4501 if err := googleapi.CheckResponse(res); err != nil { 4502 return nil, err 4503 } 4504 ret := &DeviceState{ 4505 ServerResponse: googleapi.ServerResponse{ 4506 Header: res.Header, 4507 HTTPStatusCode: res.StatusCode, 4508 }, 4509 } 4510 target := &ret 4511 if err := gensupport.DecodeResponse(target, res); err != nil { 4512 return nil, err 4513 } 4514 return ret, nil 4515 // { 4516 // "description": "Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.", 4517 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4518 // "httpMethod": "GET", 4519 // "id": "androidenterprise.devices.getState", 4520 // "parameterOrder": [ 4521 // "enterpriseId", 4522 // "userId", 4523 // "deviceId" 4524 // ], 4525 // "parameters": { 4526 // "deviceId": { 4527 // "description": "The ID of the device.", 4528 // "location": "path", 4529 // "required": true, 4530 // "type": "string" 4531 // }, 4532 // "enterpriseId": { 4533 // "description": "The ID of the enterprise.", 4534 // "location": "path", 4535 // "required": true, 4536 // "type": "string" 4537 // }, 4538 // "userId": { 4539 // "description": "The ID of the user.", 4540 // "location": "path", 4541 // "required": true, 4542 // "type": "string" 4543 // } 4544 // }, 4545 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4546 // "response": { 4547 // "$ref": "DeviceState" 4548 // }, 4549 // "scopes": [ 4550 // "https://www.googleapis.com/auth/androidenterprise" 4551 // ] 4552 // } 4553 4554} 4555 4556// method id "androidenterprise.devices.list": 4557 4558type DevicesListCall struct { 4559 s *Service 4560 enterpriseId string 4561 userId string 4562 urlParams_ gensupport.URLParams 4563 ifNoneMatch_ string 4564 ctx_ context.Context 4565 header_ http.Header 4566} 4567 4568// List: Retrieves the IDs of all of a user's devices. 4569// 4570// - enterpriseId: The ID of the enterprise. 4571// - userId: The ID of the user. 4572func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall { 4573 c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4574 c.enterpriseId = enterpriseId 4575 c.userId = userId 4576 return c 4577} 4578 4579// Fields allows partial responses to be retrieved. See 4580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4581// for more information. 4582func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall { 4583 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4584 return c 4585} 4586 4587// IfNoneMatch sets the optional parameter which makes the operation 4588// fail if the object's ETag matches the given value. This is useful for 4589// getting updates only after the object has changed since the last 4590// request. Use googleapi.IsNotModified to check whether the response 4591// error from Do is the result of In-None-Match. 4592func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall { 4593 c.ifNoneMatch_ = entityTag 4594 return c 4595} 4596 4597// Context sets the context to be used in this call's Do method. Any 4598// pending HTTP request will be aborted if the provided context is 4599// canceled. 4600func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall { 4601 c.ctx_ = ctx 4602 return c 4603} 4604 4605// Header returns an http.Header that can be modified by the caller to 4606// add HTTP headers to the request. 4607func (c *DevicesListCall) Header() http.Header { 4608 if c.header_ == nil { 4609 c.header_ = make(http.Header) 4610 } 4611 return c.header_ 4612} 4613 4614func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { 4615 reqHeaders := make(http.Header) 4616 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4617 for k, v := range c.header_ { 4618 reqHeaders[k] = v 4619 } 4620 reqHeaders.Set("User-Agent", c.s.userAgent()) 4621 if c.ifNoneMatch_ != "" { 4622 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4623 } 4624 var body io.Reader = nil 4625 c.urlParams_.Set("alt", alt) 4626 c.urlParams_.Set("prettyPrint", "false") 4627 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices") 4628 urls += "?" + c.urlParams_.Encode() 4629 req, err := http.NewRequest("GET", urls, body) 4630 if err != nil { 4631 return nil, err 4632 } 4633 req.Header = reqHeaders 4634 googleapi.Expand(req.URL, map[string]string{ 4635 "enterpriseId": c.enterpriseId, 4636 "userId": c.userId, 4637 }) 4638 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4639} 4640 4641// Do executes the "androidenterprise.devices.list" call. 4642// Exactly one of *DevicesListResponse or error will be non-nil. Any 4643// non-2xx status code is an error. Response headers are in either 4644// *DevicesListResponse.ServerResponse.Header or (if a response was 4645// returned at all) in error.(*googleapi.Error).Header. Use 4646// googleapi.IsNotModified to check whether the returned error was 4647// because http.StatusNotModified was returned. 4648func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*DevicesListResponse, error) { 4649 gensupport.SetOptions(c.urlParams_, opts...) 4650 res, err := c.doRequest("json") 4651 if res != nil && res.StatusCode == http.StatusNotModified { 4652 if res.Body != nil { 4653 res.Body.Close() 4654 } 4655 return nil, &googleapi.Error{ 4656 Code: res.StatusCode, 4657 Header: res.Header, 4658 } 4659 } 4660 if err != nil { 4661 return nil, err 4662 } 4663 defer googleapi.CloseBody(res) 4664 if err := googleapi.CheckResponse(res); err != nil { 4665 return nil, err 4666 } 4667 ret := &DevicesListResponse{ 4668 ServerResponse: googleapi.ServerResponse{ 4669 Header: res.Header, 4670 HTTPStatusCode: res.StatusCode, 4671 }, 4672 } 4673 target := &ret 4674 if err := gensupport.DecodeResponse(target, res); err != nil { 4675 return nil, err 4676 } 4677 return ret, nil 4678 // { 4679 // "description": "Retrieves the IDs of all of a user's devices.", 4680 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices", 4681 // "httpMethod": "GET", 4682 // "id": "androidenterprise.devices.list", 4683 // "parameterOrder": [ 4684 // "enterpriseId", 4685 // "userId" 4686 // ], 4687 // "parameters": { 4688 // "enterpriseId": { 4689 // "description": "The ID of the enterprise.", 4690 // "location": "path", 4691 // "required": true, 4692 // "type": "string" 4693 // }, 4694 // "userId": { 4695 // "description": "The ID of the user.", 4696 // "location": "path", 4697 // "required": true, 4698 // "type": "string" 4699 // } 4700 // }, 4701 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices", 4702 // "response": { 4703 // "$ref": "DevicesListResponse" 4704 // }, 4705 // "scopes": [ 4706 // "https://www.googleapis.com/auth/androidenterprise" 4707 // ] 4708 // } 4709 4710} 4711 4712// method id "androidenterprise.devices.setState": 4713 4714type DevicesSetStateCall struct { 4715 s *Service 4716 enterpriseId string 4717 userId string 4718 deviceId string 4719 devicestate *DeviceState 4720 urlParams_ gensupport.URLParams 4721 ctx_ context.Context 4722 header_ http.Header 4723} 4724 4725// SetState: Sets whether a device's access to Google services is 4726// enabled or disabled. The device state takes effect only if enforcing 4727// EMM policies on Android devices is enabled in the Google Admin 4728// Console. Otherwise, the device state is ignored and all devices are 4729// allowed access to Google services. This is only supported for 4730// Google-managed users. 4731// 4732// - deviceId: The ID of the device. 4733// - enterpriseId: The ID of the enterprise. 4734// - userId: The ID of the user. 4735func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall { 4736 c := &DevicesSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4737 c.enterpriseId = enterpriseId 4738 c.userId = userId 4739 c.deviceId = deviceId 4740 c.devicestate = devicestate 4741 return c 4742} 4743 4744// Fields allows partial responses to be retrieved. See 4745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4746// for more information. 4747func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall { 4748 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4749 return c 4750} 4751 4752// Context sets the context to be used in this call's Do method. Any 4753// pending HTTP request will be aborted if the provided context is 4754// canceled. 4755func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall { 4756 c.ctx_ = ctx 4757 return c 4758} 4759 4760// Header returns an http.Header that can be modified by the caller to 4761// add HTTP headers to the request. 4762func (c *DevicesSetStateCall) Header() http.Header { 4763 if c.header_ == nil { 4764 c.header_ = make(http.Header) 4765 } 4766 return c.header_ 4767} 4768 4769func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) { 4770 reqHeaders := make(http.Header) 4771 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4772 for k, v := range c.header_ { 4773 reqHeaders[k] = v 4774 } 4775 reqHeaders.Set("User-Agent", c.s.userAgent()) 4776 var body io.Reader = nil 4777 body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate) 4778 if err != nil { 4779 return nil, err 4780 } 4781 reqHeaders.Set("Content-Type", "application/json") 4782 c.urlParams_.Set("alt", alt) 4783 c.urlParams_.Set("prettyPrint", "false") 4784 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") 4785 urls += "?" + c.urlParams_.Encode() 4786 req, err := http.NewRequest("PUT", urls, body) 4787 if err != nil { 4788 return nil, err 4789 } 4790 req.Header = reqHeaders 4791 googleapi.Expand(req.URL, map[string]string{ 4792 "enterpriseId": c.enterpriseId, 4793 "userId": c.userId, 4794 "deviceId": c.deviceId, 4795 }) 4796 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4797} 4798 4799// Do executes the "androidenterprise.devices.setState" call. 4800// Exactly one of *DeviceState or error will be non-nil. Any non-2xx 4801// status code is an error. Response headers are in either 4802// *DeviceState.ServerResponse.Header or (if a response was returned at 4803// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4804// to check whether the returned error was because 4805// http.StatusNotModified was returned. 4806func (c *DevicesSetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) { 4807 gensupport.SetOptions(c.urlParams_, opts...) 4808 res, err := c.doRequest("json") 4809 if res != nil && res.StatusCode == http.StatusNotModified { 4810 if res.Body != nil { 4811 res.Body.Close() 4812 } 4813 return nil, &googleapi.Error{ 4814 Code: res.StatusCode, 4815 Header: res.Header, 4816 } 4817 } 4818 if err != nil { 4819 return nil, err 4820 } 4821 defer googleapi.CloseBody(res) 4822 if err := googleapi.CheckResponse(res); err != nil { 4823 return nil, err 4824 } 4825 ret := &DeviceState{ 4826 ServerResponse: googleapi.ServerResponse{ 4827 Header: res.Header, 4828 HTTPStatusCode: res.StatusCode, 4829 }, 4830 } 4831 target := &ret 4832 if err := gensupport.DecodeResponse(target, res); err != nil { 4833 return nil, err 4834 } 4835 return ret, nil 4836 // { 4837 // "description": "Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.", 4838 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4839 // "httpMethod": "PUT", 4840 // "id": "androidenterprise.devices.setState", 4841 // "parameterOrder": [ 4842 // "enterpriseId", 4843 // "userId", 4844 // "deviceId" 4845 // ], 4846 // "parameters": { 4847 // "deviceId": { 4848 // "description": "The ID of the device.", 4849 // "location": "path", 4850 // "required": true, 4851 // "type": "string" 4852 // }, 4853 // "enterpriseId": { 4854 // "description": "The ID of the enterprise.", 4855 // "location": "path", 4856 // "required": true, 4857 // "type": "string" 4858 // }, 4859 // "userId": { 4860 // "description": "The ID of the user.", 4861 // "location": "path", 4862 // "required": true, 4863 // "type": "string" 4864 // } 4865 // }, 4866 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4867 // "request": { 4868 // "$ref": "DeviceState" 4869 // }, 4870 // "response": { 4871 // "$ref": "DeviceState" 4872 // }, 4873 // "scopes": [ 4874 // "https://www.googleapis.com/auth/androidenterprise" 4875 // ] 4876 // } 4877 4878} 4879 4880// method id "androidenterprise.devices.update": 4881 4882type DevicesUpdateCall struct { 4883 s *Service 4884 enterpriseId string 4885 userId string 4886 deviceId string 4887 device *Device 4888 urlParams_ gensupport.URLParams 4889 ctx_ context.Context 4890 header_ http.Header 4891} 4892 4893// Update: Updates the device policy. To ensure the policy is properly 4894// enforced, you need to prevent unmanaged accounts from accessing 4895// Google Play by setting the allowed_accounts in the managed 4896// configuration for the Google Play package. See restrict accounts in 4897// Google Play. When provisioning a new device, you should set the 4898// device policy using this method before adding the managed Google Play 4899// Account to the device, otherwise the policy will not be applied for a 4900// short period of time after adding the account to the device. 4901// 4902// - deviceId: The ID of the device. 4903// - enterpriseId: The ID of the enterprise. 4904// - userId: The ID of the user. 4905func (r *DevicesService) Update(enterpriseId string, userId string, deviceId string, device *Device) *DevicesUpdateCall { 4906 c := &DevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4907 c.enterpriseId = enterpriseId 4908 c.userId = userId 4909 c.deviceId = deviceId 4910 c.device = device 4911 return c 4912} 4913 4914// UpdateMask sets the optional parameter "updateMask": Mask that 4915// identifies which fields to update. If not set, all modifiable fields 4916// will be modified. When set in a query parameter, this field should be 4917// specified as updateMask=<field1>,<field2>,... 4918func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall { 4919 c.urlParams_.Set("updateMask", updateMask) 4920 return c 4921} 4922 4923// Fields allows partial responses to be retrieved. See 4924// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4925// for more information. 4926func (c *DevicesUpdateCall) Fields(s ...googleapi.Field) *DevicesUpdateCall { 4927 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4928 return c 4929} 4930 4931// Context sets the context to be used in this call's Do method. Any 4932// pending HTTP request will be aborted if the provided context is 4933// canceled. 4934func (c *DevicesUpdateCall) Context(ctx context.Context) *DevicesUpdateCall { 4935 c.ctx_ = ctx 4936 return c 4937} 4938 4939// Header returns an http.Header that can be modified by the caller to 4940// add HTTP headers to the request. 4941func (c *DevicesUpdateCall) Header() http.Header { 4942 if c.header_ == nil { 4943 c.header_ = make(http.Header) 4944 } 4945 return c.header_ 4946} 4947 4948func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) { 4949 reqHeaders := make(http.Header) 4950 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4951 for k, v := range c.header_ { 4952 reqHeaders[k] = v 4953 } 4954 reqHeaders.Set("User-Agent", c.s.userAgent()) 4955 var body io.Reader = nil 4956 body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) 4957 if err != nil { 4958 return nil, err 4959 } 4960 reqHeaders.Set("Content-Type", "application/json") 4961 c.urlParams_.Set("alt", alt) 4962 c.urlParams_.Set("prettyPrint", "false") 4963 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") 4964 urls += "?" + c.urlParams_.Encode() 4965 req, err := http.NewRequest("PUT", urls, body) 4966 if err != nil { 4967 return nil, err 4968 } 4969 req.Header = reqHeaders 4970 googleapi.Expand(req.URL, map[string]string{ 4971 "enterpriseId": c.enterpriseId, 4972 "userId": c.userId, 4973 "deviceId": c.deviceId, 4974 }) 4975 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4976} 4977 4978// Do executes the "androidenterprise.devices.update" call. 4979// Exactly one of *Device or error will be non-nil. Any non-2xx status 4980// code is an error. Response headers are in either 4981// *Device.ServerResponse.Header or (if a response was returned at all) 4982// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4983// check whether the returned error was because http.StatusNotModified 4984// was returned. 4985func (c *DevicesUpdateCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4986 gensupport.SetOptions(c.urlParams_, opts...) 4987 res, err := c.doRequest("json") 4988 if res != nil && res.StatusCode == http.StatusNotModified { 4989 if res.Body != nil { 4990 res.Body.Close() 4991 } 4992 return nil, &googleapi.Error{ 4993 Code: res.StatusCode, 4994 Header: res.Header, 4995 } 4996 } 4997 if err != nil { 4998 return nil, err 4999 } 5000 defer googleapi.CloseBody(res) 5001 if err := googleapi.CheckResponse(res); err != nil { 5002 return nil, err 5003 } 5004 ret := &Device{ 5005 ServerResponse: googleapi.ServerResponse{ 5006 Header: res.Header, 5007 HTTPStatusCode: res.StatusCode, 5008 }, 5009 } 5010 target := &ret 5011 if err := gensupport.DecodeResponse(target, res); err != nil { 5012 return nil, err 5013 } 5014 return ret, nil 5015 // { 5016 // "description": "Updates the device policy. To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package. See restrict accounts in Google Play. When provisioning a new device, you should set the device policy using this method before adding the managed Google Play Account to the device, otherwise the policy will not be applied for a short period of time after adding the account to the device.", 5017 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 5018 // "httpMethod": "PUT", 5019 // "id": "androidenterprise.devices.update", 5020 // "parameterOrder": [ 5021 // "enterpriseId", 5022 // "userId", 5023 // "deviceId" 5024 // ], 5025 // "parameters": { 5026 // "deviceId": { 5027 // "description": "The ID of the device.", 5028 // "location": "path", 5029 // "required": true, 5030 // "type": "string" 5031 // }, 5032 // "enterpriseId": { 5033 // "description": "The ID of the enterprise.", 5034 // "location": "path", 5035 // "required": true, 5036 // "type": "string" 5037 // }, 5038 // "updateMask": { 5039 // "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified. When set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...", 5040 // "location": "query", 5041 // "type": "string" 5042 // }, 5043 // "userId": { 5044 // "description": "The ID of the user.", 5045 // "location": "path", 5046 // "required": true, 5047 // "type": "string" 5048 // } 5049 // }, 5050 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 5051 // "request": { 5052 // "$ref": "Device" 5053 // }, 5054 // "response": { 5055 // "$ref": "Device" 5056 // }, 5057 // "scopes": [ 5058 // "https://www.googleapis.com/auth/androidenterprise" 5059 // ] 5060 // } 5061 5062} 5063 5064// method id "androidenterprise.enterprises.acknowledgeNotificationSet": 5065 5066type EnterprisesAcknowledgeNotificationSetCall struct { 5067 s *Service 5068 urlParams_ gensupport.URLParams 5069 ctx_ context.Context 5070 header_ http.Header 5071} 5072 5073// AcknowledgeNotificationSet: Acknowledges notifications that were 5074// received from Enterprises.PullNotificationSet to prevent subsequent 5075// calls from returning the same notifications. 5076func (r *EnterprisesService) AcknowledgeNotificationSet() *EnterprisesAcknowledgeNotificationSetCall { 5077 c := &EnterprisesAcknowledgeNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5078 return c 5079} 5080 5081// NotificationSetId sets the optional parameter "notificationSetId": 5082// The notification set ID as returned by 5083// Enterprises.PullNotificationSet. This must be provided. 5084func (c *EnterprisesAcknowledgeNotificationSetCall) NotificationSetId(notificationSetId string) *EnterprisesAcknowledgeNotificationSetCall { 5085 c.urlParams_.Set("notificationSetId", notificationSetId) 5086 return c 5087} 5088 5089// Fields allows partial responses to be retrieved. See 5090// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5091// for more information. 5092func (c *EnterprisesAcknowledgeNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesAcknowledgeNotificationSetCall { 5093 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5094 return c 5095} 5096 5097// Context sets the context to be used in this call's Do method. Any 5098// pending HTTP request will be aborted if the provided context is 5099// canceled. 5100func (c *EnterprisesAcknowledgeNotificationSetCall) Context(ctx context.Context) *EnterprisesAcknowledgeNotificationSetCall { 5101 c.ctx_ = ctx 5102 return c 5103} 5104 5105// Header returns an http.Header that can be modified by the caller to 5106// add HTTP headers to the request. 5107func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header { 5108 if c.header_ == nil { 5109 c.header_ = make(http.Header) 5110 } 5111 return c.header_ 5112} 5113 5114func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) { 5115 reqHeaders := make(http.Header) 5116 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5117 for k, v := range c.header_ { 5118 reqHeaders[k] = v 5119 } 5120 reqHeaders.Set("User-Agent", c.s.userAgent()) 5121 var body io.Reader = nil 5122 c.urlParams_.Set("alt", alt) 5123 c.urlParams_.Set("prettyPrint", "false") 5124 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/acknowledgeNotificationSet") 5125 urls += "?" + c.urlParams_.Encode() 5126 req, err := http.NewRequest("POST", urls, body) 5127 if err != nil { 5128 return nil, err 5129 } 5130 req.Header = reqHeaders 5131 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5132} 5133 5134// Do executes the "androidenterprise.enterprises.acknowledgeNotificationSet" call. 5135func (c *EnterprisesAcknowledgeNotificationSetCall) Do(opts ...googleapi.CallOption) error { 5136 gensupport.SetOptions(c.urlParams_, opts...) 5137 res, err := c.doRequest("json") 5138 if err != nil { 5139 return err 5140 } 5141 defer googleapi.CloseBody(res) 5142 if err := googleapi.CheckResponse(res); err != nil { 5143 return err 5144 } 5145 return nil 5146 // { 5147 // "description": "Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.", 5148 // "flatPath": "androidenterprise/v1/enterprises/acknowledgeNotificationSet", 5149 // "httpMethod": "POST", 5150 // "id": "androidenterprise.enterprises.acknowledgeNotificationSet", 5151 // "parameterOrder": [], 5152 // "parameters": { 5153 // "notificationSetId": { 5154 // "description": "The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided.", 5155 // "location": "query", 5156 // "type": "string" 5157 // } 5158 // }, 5159 // "path": "androidenterprise/v1/enterprises/acknowledgeNotificationSet", 5160 // "scopes": [ 5161 // "https://www.googleapis.com/auth/androidenterprise" 5162 // ] 5163 // } 5164 5165} 5166 5167// method id "androidenterprise.enterprises.completeSignup": 5168 5169type EnterprisesCompleteSignupCall struct { 5170 s *Service 5171 urlParams_ gensupport.URLParams 5172 ctx_ context.Context 5173 header_ http.Header 5174} 5175 5176// CompleteSignup: Completes the signup flow, by specifying the 5177// Completion token and Enterprise token. This request must not be 5178// called multiple times for a given Enterprise Token. 5179func (r *EnterprisesService) CompleteSignup() *EnterprisesCompleteSignupCall { 5180 c := &EnterprisesCompleteSignupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5181 return c 5182} 5183 5184// CompletionToken sets the optional parameter "completionToken": The 5185// Completion token initially returned by GenerateSignupUrl. 5186func (c *EnterprisesCompleteSignupCall) CompletionToken(completionToken string) *EnterprisesCompleteSignupCall { 5187 c.urlParams_.Set("completionToken", completionToken) 5188 return c 5189} 5190 5191// EnterpriseToken sets the optional parameter "enterpriseToken": The 5192// Enterprise token appended to the Callback URL. 5193func (c *EnterprisesCompleteSignupCall) EnterpriseToken(enterpriseToken string) *EnterprisesCompleteSignupCall { 5194 c.urlParams_.Set("enterpriseToken", enterpriseToken) 5195 return c 5196} 5197 5198// Fields allows partial responses to be retrieved. See 5199// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5200// for more information. 5201func (c *EnterprisesCompleteSignupCall) Fields(s ...googleapi.Field) *EnterprisesCompleteSignupCall { 5202 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5203 return c 5204} 5205 5206// Context sets the context to be used in this call's Do method. Any 5207// pending HTTP request will be aborted if the provided context is 5208// canceled. 5209func (c *EnterprisesCompleteSignupCall) Context(ctx context.Context) *EnterprisesCompleteSignupCall { 5210 c.ctx_ = ctx 5211 return c 5212} 5213 5214// Header returns an http.Header that can be modified by the caller to 5215// add HTTP headers to the request. 5216func (c *EnterprisesCompleteSignupCall) Header() http.Header { 5217 if c.header_ == nil { 5218 c.header_ = make(http.Header) 5219 } 5220 return c.header_ 5221} 5222 5223func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) { 5224 reqHeaders := make(http.Header) 5225 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5226 for k, v := range c.header_ { 5227 reqHeaders[k] = v 5228 } 5229 reqHeaders.Set("User-Agent", c.s.userAgent()) 5230 var body io.Reader = nil 5231 c.urlParams_.Set("alt", alt) 5232 c.urlParams_.Set("prettyPrint", "false") 5233 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/completeSignup") 5234 urls += "?" + c.urlParams_.Encode() 5235 req, err := http.NewRequest("POST", urls, body) 5236 if err != nil { 5237 return nil, err 5238 } 5239 req.Header = reqHeaders 5240 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5241} 5242 5243// Do executes the "androidenterprise.enterprises.completeSignup" call. 5244// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5245// status code is an error. Response headers are in either 5246// *Enterprise.ServerResponse.Header or (if a response was returned at 5247// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5248// to check whether the returned error was because 5249// http.StatusNotModified was returned. 5250func (c *EnterprisesCompleteSignupCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5251 gensupport.SetOptions(c.urlParams_, opts...) 5252 res, err := c.doRequest("json") 5253 if res != nil && res.StatusCode == http.StatusNotModified { 5254 if res.Body != nil { 5255 res.Body.Close() 5256 } 5257 return nil, &googleapi.Error{ 5258 Code: res.StatusCode, 5259 Header: res.Header, 5260 } 5261 } 5262 if err != nil { 5263 return nil, err 5264 } 5265 defer googleapi.CloseBody(res) 5266 if err := googleapi.CheckResponse(res); err != nil { 5267 return nil, err 5268 } 5269 ret := &Enterprise{ 5270 ServerResponse: googleapi.ServerResponse{ 5271 Header: res.Header, 5272 HTTPStatusCode: res.StatusCode, 5273 }, 5274 } 5275 target := &ret 5276 if err := gensupport.DecodeResponse(target, res); err != nil { 5277 return nil, err 5278 } 5279 return ret, nil 5280 // { 5281 // "description": "Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token.", 5282 // "flatPath": "androidenterprise/v1/enterprises/completeSignup", 5283 // "httpMethod": "POST", 5284 // "id": "androidenterprise.enterprises.completeSignup", 5285 // "parameterOrder": [], 5286 // "parameters": { 5287 // "completionToken": { 5288 // "description": "The Completion token initially returned by GenerateSignupUrl.", 5289 // "location": "query", 5290 // "type": "string" 5291 // }, 5292 // "enterpriseToken": { 5293 // "description": "The Enterprise token appended to the Callback URL.", 5294 // "location": "query", 5295 // "type": "string" 5296 // } 5297 // }, 5298 // "path": "androidenterprise/v1/enterprises/completeSignup", 5299 // "response": { 5300 // "$ref": "Enterprise" 5301 // }, 5302 // "scopes": [ 5303 // "https://www.googleapis.com/auth/androidenterprise" 5304 // ] 5305 // } 5306 5307} 5308 5309// method id "androidenterprise.enterprises.createWebToken": 5310 5311type EnterprisesCreateWebTokenCall struct { 5312 s *Service 5313 enterpriseId string 5314 administratorwebtokenspec *AdministratorWebTokenSpec 5315 urlParams_ gensupport.URLParams 5316 ctx_ context.Context 5317 header_ http.Header 5318} 5319 5320// CreateWebToken: Returns a unique token to access an embeddable UI. To 5321// generate a web UI, pass the generated token into the managed Google 5322// Play javascript API. Each token may only be used to start one UI 5323// session. See the javascript API documentation for further 5324// information. 5325// 5326// - enterpriseId: The ID of the enterprise. 5327func (r *EnterprisesService) CreateWebToken(enterpriseId string, administratorwebtokenspec *AdministratorWebTokenSpec) *EnterprisesCreateWebTokenCall { 5328 c := &EnterprisesCreateWebTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5329 c.enterpriseId = enterpriseId 5330 c.administratorwebtokenspec = administratorwebtokenspec 5331 return c 5332} 5333 5334// Fields allows partial responses to be retrieved. See 5335// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5336// for more information. 5337func (c *EnterprisesCreateWebTokenCall) Fields(s ...googleapi.Field) *EnterprisesCreateWebTokenCall { 5338 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5339 return c 5340} 5341 5342// Context sets the context to be used in this call's Do method. Any 5343// pending HTTP request will be aborted if the provided context is 5344// canceled. 5345func (c *EnterprisesCreateWebTokenCall) Context(ctx context.Context) *EnterprisesCreateWebTokenCall { 5346 c.ctx_ = ctx 5347 return c 5348} 5349 5350// Header returns an http.Header that can be modified by the caller to 5351// add HTTP headers to the request. 5352func (c *EnterprisesCreateWebTokenCall) Header() http.Header { 5353 if c.header_ == nil { 5354 c.header_ = make(http.Header) 5355 } 5356 return c.header_ 5357} 5358 5359func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) { 5360 reqHeaders := make(http.Header) 5361 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5362 for k, v := range c.header_ { 5363 reqHeaders[k] = v 5364 } 5365 reqHeaders.Set("User-Agent", c.s.userAgent()) 5366 var body io.Reader = nil 5367 body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec) 5368 if err != nil { 5369 return nil, err 5370 } 5371 reqHeaders.Set("Content-Type", "application/json") 5372 c.urlParams_.Set("alt", alt) 5373 c.urlParams_.Set("prettyPrint", "false") 5374 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken") 5375 urls += "?" + c.urlParams_.Encode() 5376 req, err := http.NewRequest("POST", urls, body) 5377 if err != nil { 5378 return nil, err 5379 } 5380 req.Header = reqHeaders 5381 googleapi.Expand(req.URL, map[string]string{ 5382 "enterpriseId": c.enterpriseId, 5383 }) 5384 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5385} 5386 5387// Do executes the "androidenterprise.enterprises.createWebToken" call. 5388// Exactly one of *AdministratorWebToken or error will be non-nil. Any 5389// non-2xx status code is an error. Response headers are in either 5390// *AdministratorWebToken.ServerResponse.Header or (if a response was 5391// returned at all) in error.(*googleapi.Error).Header. Use 5392// googleapi.IsNotModified to check whether the returned error was 5393// because http.StatusNotModified was returned. 5394func (c *EnterprisesCreateWebTokenCall) Do(opts ...googleapi.CallOption) (*AdministratorWebToken, error) { 5395 gensupport.SetOptions(c.urlParams_, opts...) 5396 res, err := c.doRequest("json") 5397 if res != nil && res.StatusCode == http.StatusNotModified { 5398 if res.Body != nil { 5399 res.Body.Close() 5400 } 5401 return nil, &googleapi.Error{ 5402 Code: res.StatusCode, 5403 Header: res.Header, 5404 } 5405 } 5406 if err != nil { 5407 return nil, err 5408 } 5409 defer googleapi.CloseBody(res) 5410 if err := googleapi.CheckResponse(res); err != nil { 5411 return nil, err 5412 } 5413 ret := &AdministratorWebToken{ 5414 ServerResponse: googleapi.ServerResponse{ 5415 Header: res.Header, 5416 HTTPStatusCode: res.StatusCode, 5417 }, 5418 } 5419 target := &ret 5420 if err := gensupport.DecodeResponse(target, res); err != nil { 5421 return nil, err 5422 } 5423 return ret, nil 5424 // { 5425 // "description": "Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.", 5426 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken", 5427 // "httpMethod": "POST", 5428 // "id": "androidenterprise.enterprises.createWebToken", 5429 // "parameterOrder": [ 5430 // "enterpriseId" 5431 // ], 5432 // "parameters": { 5433 // "enterpriseId": { 5434 // "description": "The ID of the enterprise.", 5435 // "location": "path", 5436 // "required": true, 5437 // "type": "string" 5438 // } 5439 // }, 5440 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken", 5441 // "request": { 5442 // "$ref": "AdministratorWebTokenSpec" 5443 // }, 5444 // "response": { 5445 // "$ref": "AdministratorWebToken" 5446 // }, 5447 // "scopes": [ 5448 // "https://www.googleapis.com/auth/androidenterprise" 5449 // ] 5450 // } 5451 5452} 5453 5454// method id "androidenterprise.enterprises.enroll": 5455 5456type EnterprisesEnrollCall struct { 5457 s *Service 5458 enterprise *Enterprise 5459 urlParams_ gensupport.URLParams 5460 ctx_ context.Context 5461 header_ http.Header 5462} 5463 5464// Enroll: Enrolls an enterprise with the calling EMM. 5465// 5466// - token: The token provided by the enterprise to register the EMM. 5467func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall { 5468 c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5469 c.urlParams_.Set("token", token) 5470 c.enterprise = enterprise 5471 return c 5472} 5473 5474// Fields allows partial responses to be retrieved. See 5475// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5476// for more information. 5477func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall { 5478 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5479 return c 5480} 5481 5482// Context sets the context to be used in this call's Do method. Any 5483// pending HTTP request will be aborted if the provided context is 5484// canceled. 5485func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall { 5486 c.ctx_ = ctx 5487 return c 5488} 5489 5490// Header returns an http.Header that can be modified by the caller to 5491// add HTTP headers to the request. 5492func (c *EnterprisesEnrollCall) Header() http.Header { 5493 if c.header_ == nil { 5494 c.header_ = make(http.Header) 5495 } 5496 return c.header_ 5497} 5498 5499func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) { 5500 reqHeaders := make(http.Header) 5501 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5502 for k, v := range c.header_ { 5503 reqHeaders[k] = v 5504 } 5505 reqHeaders.Set("User-Agent", c.s.userAgent()) 5506 var body io.Reader = nil 5507 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) 5508 if err != nil { 5509 return nil, err 5510 } 5511 reqHeaders.Set("Content-Type", "application/json") 5512 c.urlParams_.Set("alt", alt) 5513 c.urlParams_.Set("prettyPrint", "false") 5514 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/enroll") 5515 urls += "?" + c.urlParams_.Encode() 5516 req, err := http.NewRequest("POST", urls, body) 5517 if err != nil { 5518 return nil, err 5519 } 5520 req.Header = reqHeaders 5521 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5522} 5523 5524// Do executes the "androidenterprise.enterprises.enroll" call. 5525// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5526// status code is an error. Response headers are in either 5527// *Enterprise.ServerResponse.Header or (if a response was returned at 5528// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5529// to check whether the returned error was because 5530// http.StatusNotModified was returned. 5531func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5532 gensupport.SetOptions(c.urlParams_, opts...) 5533 res, err := c.doRequest("json") 5534 if res != nil && res.StatusCode == http.StatusNotModified { 5535 if res.Body != nil { 5536 res.Body.Close() 5537 } 5538 return nil, &googleapi.Error{ 5539 Code: res.StatusCode, 5540 Header: res.Header, 5541 } 5542 } 5543 if err != nil { 5544 return nil, err 5545 } 5546 defer googleapi.CloseBody(res) 5547 if err := googleapi.CheckResponse(res); err != nil { 5548 return nil, err 5549 } 5550 ret := &Enterprise{ 5551 ServerResponse: googleapi.ServerResponse{ 5552 Header: res.Header, 5553 HTTPStatusCode: res.StatusCode, 5554 }, 5555 } 5556 target := &ret 5557 if err := gensupport.DecodeResponse(target, res); err != nil { 5558 return nil, err 5559 } 5560 return ret, nil 5561 // { 5562 // "description": "Enrolls an enterprise with the calling EMM.", 5563 // "flatPath": "androidenterprise/v1/enterprises/enroll", 5564 // "httpMethod": "POST", 5565 // "id": "androidenterprise.enterprises.enroll", 5566 // "parameterOrder": [ 5567 // "token" 5568 // ], 5569 // "parameters": { 5570 // "token": { 5571 // "description": "Required. The token provided by the enterprise to register the EMM.", 5572 // "location": "query", 5573 // "required": true, 5574 // "type": "string" 5575 // } 5576 // }, 5577 // "path": "androidenterprise/v1/enterprises/enroll", 5578 // "request": { 5579 // "$ref": "Enterprise" 5580 // }, 5581 // "response": { 5582 // "$ref": "Enterprise" 5583 // }, 5584 // "scopes": [ 5585 // "https://www.googleapis.com/auth/androidenterprise" 5586 // ] 5587 // } 5588 5589} 5590 5591// method id "androidenterprise.enterprises.generateSignupUrl": 5592 5593type EnterprisesGenerateSignupUrlCall struct { 5594 s *Service 5595 urlParams_ gensupport.URLParams 5596 ctx_ context.Context 5597 header_ http.Header 5598} 5599 5600// GenerateSignupUrl: Generates a sign-up URL. 5601func (r *EnterprisesService) GenerateSignupUrl() *EnterprisesGenerateSignupUrlCall { 5602 c := &EnterprisesGenerateSignupUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5603 return c 5604} 5605 5606// CallbackUrl sets the optional parameter "callbackUrl": The callback 5607// URL to which the Admin will be redirected after successfully creating 5608// an enterprise. Before redirecting there the system will add a single 5609// query parameter to this URL named "enterpriseToken" which will 5610// contain an opaque token to be used for the CompleteSignup request. 5611// Beware that this means that the URL will be parsed, the parameter 5612// added and then a new URL formatted, i.e. there may be some minor 5613// formatting changes and, more importantly, the URL must be well-formed 5614// so that it can be parsed. 5615func (c *EnterprisesGenerateSignupUrlCall) CallbackUrl(callbackUrl string) *EnterprisesGenerateSignupUrlCall { 5616 c.urlParams_.Set("callbackUrl", callbackUrl) 5617 return c 5618} 5619 5620// Fields allows partial responses to be retrieved. See 5621// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5622// for more information. 5623func (c *EnterprisesGenerateSignupUrlCall) Fields(s ...googleapi.Field) *EnterprisesGenerateSignupUrlCall { 5624 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5625 return c 5626} 5627 5628// Context sets the context to be used in this call's Do method. Any 5629// pending HTTP request will be aborted if the provided context is 5630// canceled. 5631func (c *EnterprisesGenerateSignupUrlCall) Context(ctx context.Context) *EnterprisesGenerateSignupUrlCall { 5632 c.ctx_ = ctx 5633 return c 5634} 5635 5636// Header returns an http.Header that can be modified by the caller to 5637// add HTTP headers to the request. 5638func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header { 5639 if c.header_ == nil { 5640 c.header_ = make(http.Header) 5641 } 5642 return c.header_ 5643} 5644 5645func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) { 5646 reqHeaders := make(http.Header) 5647 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5648 for k, v := range c.header_ { 5649 reqHeaders[k] = v 5650 } 5651 reqHeaders.Set("User-Agent", c.s.userAgent()) 5652 var body io.Reader = nil 5653 c.urlParams_.Set("alt", alt) 5654 c.urlParams_.Set("prettyPrint", "false") 5655 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/signupUrl") 5656 urls += "?" + c.urlParams_.Encode() 5657 req, err := http.NewRequest("POST", urls, body) 5658 if err != nil { 5659 return nil, err 5660 } 5661 req.Header = reqHeaders 5662 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5663} 5664 5665// Do executes the "androidenterprise.enterprises.generateSignupUrl" call. 5666// Exactly one of *SignupInfo or error will be non-nil. Any non-2xx 5667// status code is an error. Response headers are in either 5668// *SignupInfo.ServerResponse.Header or (if a response was returned at 5669// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5670// to check whether the returned error was because 5671// http.StatusNotModified was returned. 5672func (c *EnterprisesGenerateSignupUrlCall) Do(opts ...googleapi.CallOption) (*SignupInfo, error) { 5673 gensupport.SetOptions(c.urlParams_, opts...) 5674 res, err := c.doRequest("json") 5675 if res != nil && res.StatusCode == http.StatusNotModified { 5676 if res.Body != nil { 5677 res.Body.Close() 5678 } 5679 return nil, &googleapi.Error{ 5680 Code: res.StatusCode, 5681 Header: res.Header, 5682 } 5683 } 5684 if err != nil { 5685 return nil, err 5686 } 5687 defer googleapi.CloseBody(res) 5688 if err := googleapi.CheckResponse(res); err != nil { 5689 return nil, err 5690 } 5691 ret := &SignupInfo{ 5692 ServerResponse: googleapi.ServerResponse{ 5693 Header: res.Header, 5694 HTTPStatusCode: res.StatusCode, 5695 }, 5696 } 5697 target := &ret 5698 if err := gensupport.DecodeResponse(target, res); err != nil { 5699 return nil, err 5700 } 5701 return ret, nil 5702 // { 5703 // "description": "Generates a sign-up URL.", 5704 // "flatPath": "androidenterprise/v1/enterprises/signupUrl", 5705 // "httpMethod": "POST", 5706 // "id": "androidenterprise.enterprises.generateSignupUrl", 5707 // "parameterOrder": [], 5708 // "parameters": { 5709 // "callbackUrl": { 5710 // "description": "The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named \"enterpriseToken\" which will contain an opaque token to be used for the CompleteSignup request. Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed.", 5711 // "location": "query", 5712 // "type": "string" 5713 // } 5714 // }, 5715 // "path": "androidenterprise/v1/enterprises/signupUrl", 5716 // "response": { 5717 // "$ref": "SignupInfo" 5718 // }, 5719 // "scopes": [ 5720 // "https://www.googleapis.com/auth/androidenterprise" 5721 // ] 5722 // } 5723 5724} 5725 5726// method id "androidenterprise.enterprises.get": 5727 5728type EnterprisesGetCall struct { 5729 s *Service 5730 enterpriseId string 5731 urlParams_ gensupport.URLParams 5732 ifNoneMatch_ string 5733 ctx_ context.Context 5734 header_ http.Header 5735} 5736 5737// Get: Retrieves the name and domain of an enterprise. 5738// 5739// - enterpriseId: The ID of the enterprise. 5740func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall { 5741 c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5742 c.enterpriseId = enterpriseId 5743 return c 5744} 5745 5746// Fields allows partial responses to be retrieved. See 5747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5748// for more information. 5749func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall { 5750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5751 return c 5752} 5753 5754// IfNoneMatch sets the optional parameter which makes the operation 5755// fail if the object's ETag matches the given value. This is useful for 5756// getting updates only after the object has changed since the last 5757// request. Use googleapi.IsNotModified to check whether the response 5758// error from Do is the result of In-None-Match. 5759func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall { 5760 c.ifNoneMatch_ = entityTag 5761 return c 5762} 5763 5764// Context sets the context to be used in this call's Do method. Any 5765// pending HTTP request will be aborted if the provided context is 5766// canceled. 5767func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall { 5768 c.ctx_ = ctx 5769 return c 5770} 5771 5772// Header returns an http.Header that can be modified by the caller to 5773// add HTTP headers to the request. 5774func (c *EnterprisesGetCall) Header() http.Header { 5775 if c.header_ == nil { 5776 c.header_ = make(http.Header) 5777 } 5778 return c.header_ 5779} 5780 5781func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { 5782 reqHeaders := make(http.Header) 5783 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5784 for k, v := range c.header_ { 5785 reqHeaders[k] = v 5786 } 5787 reqHeaders.Set("User-Agent", c.s.userAgent()) 5788 if c.ifNoneMatch_ != "" { 5789 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5790 } 5791 var body io.Reader = nil 5792 c.urlParams_.Set("alt", alt) 5793 c.urlParams_.Set("prettyPrint", "false") 5794 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}") 5795 urls += "?" + c.urlParams_.Encode() 5796 req, err := http.NewRequest("GET", urls, body) 5797 if err != nil { 5798 return nil, err 5799 } 5800 req.Header = reqHeaders 5801 googleapi.Expand(req.URL, map[string]string{ 5802 "enterpriseId": c.enterpriseId, 5803 }) 5804 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5805} 5806 5807// Do executes the "androidenterprise.enterprises.get" call. 5808// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5809// status code is an error. Response headers are in either 5810// *Enterprise.ServerResponse.Header or (if a response was returned at 5811// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5812// to check whether the returned error was because 5813// http.StatusNotModified was returned. 5814func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5815 gensupport.SetOptions(c.urlParams_, opts...) 5816 res, err := c.doRequest("json") 5817 if res != nil && res.StatusCode == http.StatusNotModified { 5818 if res.Body != nil { 5819 res.Body.Close() 5820 } 5821 return nil, &googleapi.Error{ 5822 Code: res.StatusCode, 5823 Header: res.Header, 5824 } 5825 } 5826 if err != nil { 5827 return nil, err 5828 } 5829 defer googleapi.CloseBody(res) 5830 if err := googleapi.CheckResponse(res); err != nil { 5831 return nil, err 5832 } 5833 ret := &Enterprise{ 5834 ServerResponse: googleapi.ServerResponse{ 5835 Header: res.Header, 5836 HTTPStatusCode: res.StatusCode, 5837 }, 5838 } 5839 target := &ret 5840 if err := gensupport.DecodeResponse(target, res); err != nil { 5841 return nil, err 5842 } 5843 return ret, nil 5844 // { 5845 // "description": "Retrieves the name and domain of an enterprise.", 5846 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}", 5847 // "httpMethod": "GET", 5848 // "id": "androidenterprise.enterprises.get", 5849 // "parameterOrder": [ 5850 // "enterpriseId" 5851 // ], 5852 // "parameters": { 5853 // "enterpriseId": { 5854 // "description": "The ID of the enterprise.", 5855 // "location": "path", 5856 // "required": true, 5857 // "type": "string" 5858 // } 5859 // }, 5860 // "path": "androidenterprise/v1/enterprises/{enterpriseId}", 5861 // "response": { 5862 // "$ref": "Enterprise" 5863 // }, 5864 // "scopes": [ 5865 // "https://www.googleapis.com/auth/androidenterprise" 5866 // ] 5867 // } 5868 5869} 5870 5871// method id "androidenterprise.enterprises.getServiceAccount": 5872 5873type EnterprisesGetServiceAccountCall struct { 5874 s *Service 5875 enterpriseId string 5876 urlParams_ gensupport.URLParams 5877 ifNoneMatch_ string 5878 ctx_ context.Context 5879 header_ http.Header 5880} 5881 5882// GetServiceAccount: Returns a service account and credentials. The 5883// service account can be bound to the enterprise by calling setAccount. 5884// The service account is unique to this enterprise and EMM, and will be 5885// deleted if the enterprise is unbound. The credentials contain private 5886// key data and are not stored server-side. This method can only be 5887// called after calling Enterprises.Enroll or 5888// Enterprises.CompleteSignup, and before Enterprises.SetAccount; at 5889// other times it will return an error. Subsequent calls after the first 5890// will generate a new, unique set of credentials, and invalidate the 5891// previously generated credentials. Once the service account is bound 5892// to the enterprise, it can be managed using the serviceAccountKeys 5893// resource. 5894// 5895// - enterpriseId: The ID of the enterprise. 5896func (r *EnterprisesService) GetServiceAccount(enterpriseId string) *EnterprisesGetServiceAccountCall { 5897 c := &EnterprisesGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5898 c.enterpriseId = enterpriseId 5899 return c 5900} 5901 5902// KeyType sets the optional parameter "keyType": The type of credential 5903// to return with the service account. Required. 5904// 5905// Possible values: 5906// "googleCredentials" - Google Credentials File format. 5907// "pkcs12" - PKCS12 format. The password for the PKCS12 file is 5908// 'notasecret'. For more information, see 5909// https://tools.ietf.org/html/rfc7292. The data for keys of this type 5910// are base64 encoded according to RFC 4648 Section 4. See 5911// http://tools.ietf.org/html/rfc4648#section-4. 5912func (c *EnterprisesGetServiceAccountCall) KeyType(keyType string) *EnterprisesGetServiceAccountCall { 5913 c.urlParams_.Set("keyType", keyType) 5914 return c 5915} 5916 5917// Fields allows partial responses to be retrieved. See 5918// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5919// for more information. 5920func (c *EnterprisesGetServiceAccountCall) Fields(s ...googleapi.Field) *EnterprisesGetServiceAccountCall { 5921 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5922 return c 5923} 5924 5925// IfNoneMatch sets the optional parameter which makes the operation 5926// fail if the object's ETag matches the given value. This is useful for 5927// getting updates only after the object has changed since the last 5928// request. Use googleapi.IsNotModified to check whether the response 5929// error from Do is the result of In-None-Match. 5930func (c *EnterprisesGetServiceAccountCall) IfNoneMatch(entityTag string) *EnterprisesGetServiceAccountCall { 5931 c.ifNoneMatch_ = entityTag 5932 return c 5933} 5934 5935// Context sets the context to be used in this call's Do method. Any 5936// pending HTTP request will be aborted if the provided context is 5937// canceled. 5938func (c *EnterprisesGetServiceAccountCall) Context(ctx context.Context) *EnterprisesGetServiceAccountCall { 5939 c.ctx_ = ctx 5940 return c 5941} 5942 5943// Header returns an http.Header that can be modified by the caller to 5944// add HTTP headers to the request. 5945func (c *EnterprisesGetServiceAccountCall) Header() http.Header { 5946 if c.header_ == nil { 5947 c.header_ = make(http.Header) 5948 } 5949 return c.header_ 5950} 5951 5952func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response, error) { 5953 reqHeaders := make(http.Header) 5954 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5955 for k, v := range c.header_ { 5956 reqHeaders[k] = v 5957 } 5958 reqHeaders.Set("User-Agent", c.s.userAgent()) 5959 if c.ifNoneMatch_ != "" { 5960 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5961 } 5962 var body io.Reader = nil 5963 c.urlParams_.Set("alt", alt) 5964 c.urlParams_.Set("prettyPrint", "false") 5965 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount") 5966 urls += "?" + c.urlParams_.Encode() 5967 req, err := http.NewRequest("GET", urls, body) 5968 if err != nil { 5969 return nil, err 5970 } 5971 req.Header = reqHeaders 5972 googleapi.Expand(req.URL, map[string]string{ 5973 "enterpriseId": c.enterpriseId, 5974 }) 5975 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5976} 5977 5978// Do executes the "androidenterprise.enterprises.getServiceAccount" call. 5979// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx 5980// status code is an error. Response headers are in either 5981// *ServiceAccount.ServerResponse.Header or (if a response was returned 5982// at all) in error.(*googleapi.Error).Header. Use 5983// googleapi.IsNotModified to check whether the returned error was 5984// because http.StatusNotModified was returned. 5985func (c *EnterprisesGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { 5986 gensupport.SetOptions(c.urlParams_, opts...) 5987 res, err := c.doRequest("json") 5988 if res != nil && res.StatusCode == http.StatusNotModified { 5989 if res.Body != nil { 5990 res.Body.Close() 5991 } 5992 return nil, &googleapi.Error{ 5993 Code: res.StatusCode, 5994 Header: res.Header, 5995 } 5996 } 5997 if err != nil { 5998 return nil, err 5999 } 6000 defer googleapi.CloseBody(res) 6001 if err := googleapi.CheckResponse(res); err != nil { 6002 return nil, err 6003 } 6004 ret := &ServiceAccount{ 6005 ServerResponse: googleapi.ServerResponse{ 6006 Header: res.Header, 6007 HTTPStatusCode: res.StatusCode, 6008 }, 6009 } 6010 target := &ret 6011 if err := gensupport.DecodeResponse(target, res); err != nil { 6012 return nil, err 6013 } 6014 return ret, nil 6015 // { 6016 // "description": "Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.", 6017 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount", 6018 // "httpMethod": "GET", 6019 // "id": "androidenterprise.enterprises.getServiceAccount", 6020 // "parameterOrder": [ 6021 // "enterpriseId" 6022 // ], 6023 // "parameters": { 6024 // "enterpriseId": { 6025 // "description": "The ID of the enterprise.", 6026 // "location": "path", 6027 // "required": true, 6028 // "type": "string" 6029 // }, 6030 // "keyType": { 6031 // "description": "The type of credential to return with the service account. Required.", 6032 // "enum": [ 6033 // "googleCredentials", 6034 // "pkcs12" 6035 // ], 6036 // "enumDescriptions": [ 6037 // "Google Credentials File format.", 6038 // "PKCS12 format. The password for the PKCS12 file is 'notasecret'. For more information, see https://tools.ietf.org/html/rfc7292. The data for keys of this type are base64 encoded according to RFC 4648 Section 4. See http://tools.ietf.org/html/rfc4648#section-4." 6039 // ], 6040 // "location": "query", 6041 // "type": "string" 6042 // } 6043 // }, 6044 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount", 6045 // "response": { 6046 // "$ref": "ServiceAccount" 6047 // }, 6048 // "scopes": [ 6049 // "https://www.googleapis.com/auth/androidenterprise" 6050 // ] 6051 // } 6052 6053} 6054 6055// method id "androidenterprise.enterprises.getStoreLayout": 6056 6057type EnterprisesGetStoreLayoutCall struct { 6058 s *Service 6059 enterpriseId string 6060 urlParams_ gensupport.URLParams 6061 ifNoneMatch_ string 6062 ctx_ context.Context 6063 header_ http.Header 6064} 6065 6066// GetStoreLayout: Returns the store layout for the enterprise. If the 6067// store layout has not been set, returns "basic" as the store layout 6068// type and no homepage. 6069// 6070// - enterpriseId: The ID of the enterprise. 6071func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall { 6072 c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6073 c.enterpriseId = enterpriseId 6074 return c 6075} 6076 6077// Fields allows partial responses to be retrieved. See 6078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6079// for more information. 6080func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall { 6081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6082 return c 6083} 6084 6085// IfNoneMatch sets the optional parameter which makes the operation 6086// fail if the object's ETag matches the given value. This is useful for 6087// getting updates only after the object has changed since the last 6088// request. Use googleapi.IsNotModified to check whether the response 6089// error from Do is the result of In-None-Match. 6090func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall { 6091 c.ifNoneMatch_ = entityTag 6092 return c 6093} 6094 6095// Context sets the context to be used in this call's Do method. Any 6096// pending HTTP request will be aborted if the provided context is 6097// canceled. 6098func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall { 6099 c.ctx_ = ctx 6100 return c 6101} 6102 6103// Header returns an http.Header that can be modified by the caller to 6104// add HTTP headers to the request. 6105func (c *EnterprisesGetStoreLayoutCall) Header() http.Header { 6106 if c.header_ == nil { 6107 c.header_ = make(http.Header) 6108 } 6109 return c.header_ 6110} 6111 6112func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 6113 reqHeaders := make(http.Header) 6114 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6115 for k, v := range c.header_ { 6116 reqHeaders[k] = v 6117 } 6118 reqHeaders.Set("User-Agent", c.s.userAgent()) 6119 if c.ifNoneMatch_ != "" { 6120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6121 } 6122 var body io.Reader = nil 6123 c.urlParams_.Set("alt", alt) 6124 c.urlParams_.Set("prettyPrint", "false") 6125 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout") 6126 urls += "?" + c.urlParams_.Encode() 6127 req, err := http.NewRequest("GET", urls, body) 6128 if err != nil { 6129 return nil, err 6130 } 6131 req.Header = reqHeaders 6132 googleapi.Expand(req.URL, map[string]string{ 6133 "enterpriseId": c.enterpriseId, 6134 }) 6135 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6136} 6137 6138// Do executes the "androidenterprise.enterprises.getStoreLayout" call. 6139// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 6140// status code is an error. Response headers are in either 6141// *StoreLayout.ServerResponse.Header or (if a response was returned at 6142// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6143// to check whether the returned error was because 6144// http.StatusNotModified was returned. 6145func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 6146 gensupport.SetOptions(c.urlParams_, opts...) 6147 res, err := c.doRequest("json") 6148 if res != nil && res.StatusCode == http.StatusNotModified { 6149 if res.Body != nil { 6150 res.Body.Close() 6151 } 6152 return nil, &googleapi.Error{ 6153 Code: res.StatusCode, 6154 Header: res.Header, 6155 } 6156 } 6157 if err != nil { 6158 return nil, err 6159 } 6160 defer googleapi.CloseBody(res) 6161 if err := googleapi.CheckResponse(res); err != nil { 6162 return nil, err 6163 } 6164 ret := &StoreLayout{ 6165 ServerResponse: googleapi.ServerResponse{ 6166 Header: res.Header, 6167 HTTPStatusCode: res.StatusCode, 6168 }, 6169 } 6170 target := &ret 6171 if err := gensupport.DecodeResponse(target, res); err != nil { 6172 return nil, err 6173 } 6174 return ret, nil 6175 // { 6176 // "description": "Returns the store layout for the enterprise. If the store layout has not been set, returns \"basic\" as the store layout type and no homepage.", 6177 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6178 // "httpMethod": "GET", 6179 // "id": "androidenterprise.enterprises.getStoreLayout", 6180 // "parameterOrder": [ 6181 // "enterpriseId" 6182 // ], 6183 // "parameters": { 6184 // "enterpriseId": { 6185 // "description": "The ID of the enterprise.", 6186 // "location": "path", 6187 // "required": true, 6188 // "type": "string" 6189 // } 6190 // }, 6191 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6192 // "response": { 6193 // "$ref": "StoreLayout" 6194 // }, 6195 // "scopes": [ 6196 // "https://www.googleapis.com/auth/androidenterprise" 6197 // ] 6198 // } 6199 6200} 6201 6202// method id "androidenterprise.enterprises.list": 6203 6204type EnterprisesListCall struct { 6205 s *Service 6206 urlParams_ gensupport.URLParams 6207 ifNoneMatch_ string 6208 ctx_ context.Context 6209 header_ http.Header 6210} 6211 6212// List: Looks up an enterprise by domain name. This is only supported 6213// for enterprises created via the Google-initiated creation flow. 6214// Lookup of the id is not needed for enterprises created via the 6215// EMM-initiated flow since the EMM learns the enterprise ID in the 6216// callback specified in the Enterprises.generateSignupUrl call. 6217// 6218// - domain: The exact primary domain name of the enterprise to look up. 6219func (r *EnterprisesService) List(domain string) *EnterprisesListCall { 6220 c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6221 c.urlParams_.Set("domain", domain) 6222 return c 6223} 6224 6225// Fields allows partial responses to be retrieved. See 6226// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6227// for more information. 6228func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall { 6229 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6230 return c 6231} 6232 6233// IfNoneMatch sets the optional parameter which makes the operation 6234// fail if the object's ETag matches the given value. This is useful for 6235// getting updates only after the object has changed since the last 6236// request. Use googleapi.IsNotModified to check whether the response 6237// error from Do is the result of In-None-Match. 6238func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall { 6239 c.ifNoneMatch_ = entityTag 6240 return c 6241} 6242 6243// Context sets the context to be used in this call's Do method. Any 6244// pending HTTP request will be aborted if the provided context is 6245// canceled. 6246func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall { 6247 c.ctx_ = ctx 6248 return c 6249} 6250 6251// Header returns an http.Header that can be modified by the caller to 6252// add HTTP headers to the request. 6253func (c *EnterprisesListCall) Header() http.Header { 6254 if c.header_ == nil { 6255 c.header_ = make(http.Header) 6256 } 6257 return c.header_ 6258} 6259 6260func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { 6261 reqHeaders := make(http.Header) 6262 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6263 for k, v := range c.header_ { 6264 reqHeaders[k] = v 6265 } 6266 reqHeaders.Set("User-Agent", c.s.userAgent()) 6267 if c.ifNoneMatch_ != "" { 6268 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6269 } 6270 var body io.Reader = nil 6271 c.urlParams_.Set("alt", alt) 6272 c.urlParams_.Set("prettyPrint", "false") 6273 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises") 6274 urls += "?" + c.urlParams_.Encode() 6275 req, err := http.NewRequest("GET", urls, body) 6276 if err != nil { 6277 return nil, err 6278 } 6279 req.Header = reqHeaders 6280 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6281} 6282 6283// Do executes the "androidenterprise.enterprises.list" call. 6284// Exactly one of *EnterprisesListResponse or error will be non-nil. Any 6285// non-2xx status code is an error. Response headers are in either 6286// *EnterprisesListResponse.ServerResponse.Header or (if a response was 6287// returned at all) in error.(*googleapi.Error).Header. Use 6288// googleapi.IsNotModified to check whether the returned error was 6289// because http.StatusNotModified was returned. 6290func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) { 6291 gensupport.SetOptions(c.urlParams_, opts...) 6292 res, err := c.doRequest("json") 6293 if res != nil && res.StatusCode == http.StatusNotModified { 6294 if res.Body != nil { 6295 res.Body.Close() 6296 } 6297 return nil, &googleapi.Error{ 6298 Code: res.StatusCode, 6299 Header: res.Header, 6300 } 6301 } 6302 if err != nil { 6303 return nil, err 6304 } 6305 defer googleapi.CloseBody(res) 6306 if err := googleapi.CheckResponse(res); err != nil { 6307 return nil, err 6308 } 6309 ret := &EnterprisesListResponse{ 6310 ServerResponse: googleapi.ServerResponse{ 6311 Header: res.Header, 6312 HTTPStatusCode: res.StatusCode, 6313 }, 6314 } 6315 target := &ret 6316 if err := gensupport.DecodeResponse(target, res); err != nil { 6317 return nil, err 6318 } 6319 return ret, nil 6320 // { 6321 // "description": "Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call.", 6322 // "flatPath": "androidenterprise/v1/enterprises", 6323 // "httpMethod": "GET", 6324 // "id": "androidenterprise.enterprises.list", 6325 // "parameterOrder": [ 6326 // "domain" 6327 // ], 6328 // "parameters": { 6329 // "domain": { 6330 // "description": "Required. The exact primary domain name of the enterprise to look up.", 6331 // "location": "query", 6332 // "required": true, 6333 // "type": "string" 6334 // } 6335 // }, 6336 // "path": "androidenterprise/v1/enterprises", 6337 // "response": { 6338 // "$ref": "EnterprisesListResponse" 6339 // }, 6340 // "scopes": [ 6341 // "https://www.googleapis.com/auth/androidenterprise" 6342 // ] 6343 // } 6344 6345} 6346 6347// method id "androidenterprise.enterprises.pullNotificationSet": 6348 6349type EnterprisesPullNotificationSetCall struct { 6350 s *Service 6351 urlParams_ gensupport.URLParams 6352 ctx_ context.Context 6353 header_ http.Header 6354} 6355 6356// PullNotificationSet: Pulls and returns a notification set for the 6357// enterprises associated with the service account authenticated for the 6358// request. The notification set may be empty if no notification are 6359// pending. A notification set returned needs to be acknowledged within 6360// 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless 6361// the notification set is empty. Notifications that are not 6362// acknowledged within the 20 seconds will eventually be included again 6363// in the response to another PullNotificationSet request, and those 6364// that are never acknowledged will ultimately be deleted according to 6365// the Google Cloud Platform Pub/Sub system policy. Multiple requests 6366// might be performed concurrently to retrieve notifications, in which 6367// case the pending notifications (if any) will be split among each 6368// caller, if any are pending. If no notifications are present, an empty 6369// notification list is returned. Subsequent requests may return more 6370// notifications once they become available. 6371func (r *EnterprisesService) PullNotificationSet() *EnterprisesPullNotificationSetCall { 6372 c := &EnterprisesPullNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6373 return c 6374} 6375 6376// RequestMode sets the optional parameter "requestMode": The request 6377// mode for pulling notifications. Specifying waitForNotifications will 6378// cause the request to block and wait until one or more notifications 6379// are present, or return an empty notification list if no notifications 6380// are present after some time. Speciying returnImmediately will cause 6381// the request to immediately return the pending notifications, or an 6382// empty list if no notifications are present. If omitted, defaults to 6383// waitForNotifications. 6384// 6385// Possible values: 6386// "waitForNotifications" - Wait until one or more notifications are 6387// present. 6388// "returnImmediately" - Returns immediately whether notifications are 6389// present or not. 6390func (c *EnterprisesPullNotificationSetCall) RequestMode(requestMode string) *EnterprisesPullNotificationSetCall { 6391 c.urlParams_.Set("requestMode", requestMode) 6392 return c 6393} 6394 6395// Fields allows partial responses to be retrieved. See 6396// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6397// for more information. 6398func (c *EnterprisesPullNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesPullNotificationSetCall { 6399 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6400 return c 6401} 6402 6403// Context sets the context to be used in this call's Do method. Any 6404// pending HTTP request will be aborted if the provided context is 6405// canceled. 6406func (c *EnterprisesPullNotificationSetCall) Context(ctx context.Context) *EnterprisesPullNotificationSetCall { 6407 c.ctx_ = ctx 6408 return c 6409} 6410 6411// Header returns an http.Header that can be modified by the caller to 6412// add HTTP headers to the request. 6413func (c *EnterprisesPullNotificationSetCall) Header() http.Header { 6414 if c.header_ == nil { 6415 c.header_ = make(http.Header) 6416 } 6417 return c.header_ 6418} 6419 6420func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) { 6421 reqHeaders := make(http.Header) 6422 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6423 for k, v := range c.header_ { 6424 reqHeaders[k] = v 6425 } 6426 reqHeaders.Set("User-Agent", c.s.userAgent()) 6427 var body io.Reader = nil 6428 c.urlParams_.Set("alt", alt) 6429 c.urlParams_.Set("prettyPrint", "false") 6430 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/pullNotificationSet") 6431 urls += "?" + c.urlParams_.Encode() 6432 req, err := http.NewRequest("POST", urls, body) 6433 if err != nil { 6434 return nil, err 6435 } 6436 req.Header = reqHeaders 6437 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6438} 6439 6440// Do executes the "androidenterprise.enterprises.pullNotificationSet" call. 6441// Exactly one of *NotificationSet or error will be non-nil. Any non-2xx 6442// status code is an error. Response headers are in either 6443// *NotificationSet.ServerResponse.Header or (if a response was returned 6444// at all) in error.(*googleapi.Error).Header. Use 6445// googleapi.IsNotModified to check whether the returned error was 6446// because http.StatusNotModified was returned. 6447func (c *EnterprisesPullNotificationSetCall) Do(opts ...googleapi.CallOption) (*NotificationSet, error) { 6448 gensupport.SetOptions(c.urlParams_, opts...) 6449 res, err := c.doRequest("json") 6450 if res != nil && res.StatusCode == http.StatusNotModified { 6451 if res.Body != nil { 6452 res.Body.Close() 6453 } 6454 return nil, &googleapi.Error{ 6455 Code: res.StatusCode, 6456 Header: res.Header, 6457 } 6458 } 6459 if err != nil { 6460 return nil, err 6461 } 6462 defer googleapi.CloseBody(res) 6463 if err := googleapi.CheckResponse(res); err != nil { 6464 return nil, err 6465 } 6466 ret := &NotificationSet{ 6467 ServerResponse: googleapi.ServerResponse{ 6468 Header: res.Header, 6469 HTTPStatusCode: res.StatusCode, 6470 }, 6471 } 6472 target := &ret 6473 if err := gensupport.DecodeResponse(target, res); err != nil { 6474 return nil, err 6475 } 6476 return ret, nil 6477 // { 6478 // "description": "Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.", 6479 // "flatPath": "androidenterprise/v1/enterprises/pullNotificationSet", 6480 // "httpMethod": "POST", 6481 // "id": "androidenterprise.enterprises.pullNotificationSet", 6482 // "parameterOrder": [], 6483 // "parameters": { 6484 // "requestMode": { 6485 // "description": "The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications.", 6486 // "enum": [ 6487 // "waitForNotifications", 6488 // "returnImmediately" 6489 // ], 6490 // "enumDescriptions": [ 6491 // "Wait until one or more notifications are present.", 6492 // "Returns immediately whether notifications are present or not." 6493 // ], 6494 // "location": "query", 6495 // "type": "string" 6496 // } 6497 // }, 6498 // "path": "androidenterprise/v1/enterprises/pullNotificationSet", 6499 // "response": { 6500 // "$ref": "NotificationSet" 6501 // }, 6502 // "scopes": [ 6503 // "https://www.googleapis.com/auth/androidenterprise" 6504 // ] 6505 // } 6506 6507} 6508 6509// method id "androidenterprise.enterprises.sendTestPushNotification": 6510 6511type EnterprisesSendTestPushNotificationCall struct { 6512 s *Service 6513 enterpriseId string 6514 urlParams_ gensupport.URLParams 6515 ctx_ context.Context 6516 header_ http.Header 6517} 6518 6519// SendTestPushNotification: Sends a test notification to validate the 6520// EMM integration with the Google Cloud Pub/Sub service for this 6521// enterprise. 6522// 6523// - enterpriseId: The ID of the enterprise. 6524func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall { 6525 c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6526 c.enterpriseId = enterpriseId 6527 return c 6528} 6529 6530// Fields allows partial responses to be retrieved. See 6531// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6532// for more information. 6533func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall { 6534 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6535 return c 6536} 6537 6538// Context sets the context to be used in this call's Do method. Any 6539// pending HTTP request will be aborted if the provided context is 6540// canceled. 6541func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall { 6542 c.ctx_ = ctx 6543 return c 6544} 6545 6546// Header returns an http.Header that can be modified by the caller to 6547// add HTTP headers to the request. 6548func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header { 6549 if c.header_ == nil { 6550 c.header_ = make(http.Header) 6551 } 6552 return c.header_ 6553} 6554 6555func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) { 6556 reqHeaders := make(http.Header) 6557 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6558 for k, v := range c.header_ { 6559 reqHeaders[k] = v 6560 } 6561 reqHeaders.Set("User-Agent", c.s.userAgent()) 6562 var body io.Reader = nil 6563 c.urlParams_.Set("alt", alt) 6564 c.urlParams_.Set("prettyPrint", "false") 6565 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification") 6566 urls += "?" + c.urlParams_.Encode() 6567 req, err := http.NewRequest("POST", urls, body) 6568 if err != nil { 6569 return nil, err 6570 } 6571 req.Header = reqHeaders 6572 googleapi.Expand(req.URL, map[string]string{ 6573 "enterpriseId": c.enterpriseId, 6574 }) 6575 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6576} 6577 6578// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call. 6579// Exactly one of *EnterprisesSendTestPushNotificationResponse or error 6580// will be non-nil. Any non-2xx status code is an error. Response 6581// headers are in either 6582// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or 6583// (if a response was returned at all) in 6584// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6585// whether the returned error was because http.StatusNotModified was 6586// returned. 6587func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) { 6588 gensupport.SetOptions(c.urlParams_, opts...) 6589 res, err := c.doRequest("json") 6590 if res != nil && res.StatusCode == http.StatusNotModified { 6591 if res.Body != nil { 6592 res.Body.Close() 6593 } 6594 return nil, &googleapi.Error{ 6595 Code: res.StatusCode, 6596 Header: res.Header, 6597 } 6598 } 6599 if err != nil { 6600 return nil, err 6601 } 6602 defer googleapi.CloseBody(res) 6603 if err := googleapi.CheckResponse(res); err != nil { 6604 return nil, err 6605 } 6606 ret := &EnterprisesSendTestPushNotificationResponse{ 6607 ServerResponse: googleapi.ServerResponse{ 6608 Header: res.Header, 6609 HTTPStatusCode: res.StatusCode, 6610 }, 6611 } 6612 target := &ret 6613 if err := gensupport.DecodeResponse(target, res); err != nil { 6614 return nil, err 6615 } 6616 return ret, nil 6617 // { 6618 // "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.", 6619 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification", 6620 // "httpMethod": "POST", 6621 // "id": "androidenterprise.enterprises.sendTestPushNotification", 6622 // "parameterOrder": [ 6623 // "enterpriseId" 6624 // ], 6625 // "parameters": { 6626 // "enterpriseId": { 6627 // "description": "The ID of the enterprise.", 6628 // "location": "path", 6629 // "required": true, 6630 // "type": "string" 6631 // } 6632 // }, 6633 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification", 6634 // "response": { 6635 // "$ref": "EnterprisesSendTestPushNotificationResponse" 6636 // }, 6637 // "scopes": [ 6638 // "https://www.googleapis.com/auth/androidenterprise" 6639 // ] 6640 // } 6641 6642} 6643 6644// method id "androidenterprise.enterprises.setAccount": 6645 6646type EnterprisesSetAccountCall struct { 6647 s *Service 6648 enterpriseId string 6649 enterpriseaccount *EnterpriseAccount 6650 urlParams_ gensupport.URLParams 6651 ctx_ context.Context 6652 header_ http.Header 6653} 6654 6655// SetAccount: Sets the account that will be used to authenticate to the 6656// API as the enterprise. 6657// 6658// - enterpriseId: The ID of the enterprise. 6659func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall { 6660 c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6661 c.enterpriseId = enterpriseId 6662 c.enterpriseaccount = enterpriseaccount 6663 return c 6664} 6665 6666// Fields allows partial responses to be retrieved. See 6667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6668// for more information. 6669func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall { 6670 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6671 return c 6672} 6673 6674// Context sets the context to be used in this call's Do method. Any 6675// pending HTTP request will be aborted if the provided context is 6676// canceled. 6677func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall { 6678 c.ctx_ = ctx 6679 return c 6680} 6681 6682// Header returns an http.Header that can be modified by the caller to 6683// add HTTP headers to the request. 6684func (c *EnterprisesSetAccountCall) Header() http.Header { 6685 if c.header_ == nil { 6686 c.header_ = make(http.Header) 6687 } 6688 return c.header_ 6689} 6690 6691func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) { 6692 reqHeaders := make(http.Header) 6693 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6694 for k, v := range c.header_ { 6695 reqHeaders[k] = v 6696 } 6697 reqHeaders.Set("User-Agent", c.s.userAgent()) 6698 var body io.Reader = nil 6699 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount) 6700 if err != nil { 6701 return nil, err 6702 } 6703 reqHeaders.Set("Content-Type", "application/json") 6704 c.urlParams_.Set("alt", alt) 6705 c.urlParams_.Set("prettyPrint", "false") 6706 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/account") 6707 urls += "?" + c.urlParams_.Encode() 6708 req, err := http.NewRequest("PUT", urls, body) 6709 if err != nil { 6710 return nil, err 6711 } 6712 req.Header = reqHeaders 6713 googleapi.Expand(req.URL, map[string]string{ 6714 "enterpriseId": c.enterpriseId, 6715 }) 6716 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6717} 6718 6719// Do executes the "androidenterprise.enterprises.setAccount" call. 6720// Exactly one of *EnterpriseAccount or error will be non-nil. Any 6721// non-2xx status code is an error. Response headers are in either 6722// *EnterpriseAccount.ServerResponse.Header or (if a response was 6723// returned at all) in error.(*googleapi.Error).Header. Use 6724// googleapi.IsNotModified to check whether the returned error was 6725// because http.StatusNotModified was returned. 6726func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) { 6727 gensupport.SetOptions(c.urlParams_, opts...) 6728 res, err := c.doRequest("json") 6729 if res != nil && res.StatusCode == http.StatusNotModified { 6730 if res.Body != nil { 6731 res.Body.Close() 6732 } 6733 return nil, &googleapi.Error{ 6734 Code: res.StatusCode, 6735 Header: res.Header, 6736 } 6737 } 6738 if err != nil { 6739 return nil, err 6740 } 6741 defer googleapi.CloseBody(res) 6742 if err := googleapi.CheckResponse(res); err != nil { 6743 return nil, err 6744 } 6745 ret := &EnterpriseAccount{ 6746 ServerResponse: googleapi.ServerResponse{ 6747 Header: res.Header, 6748 HTTPStatusCode: res.StatusCode, 6749 }, 6750 } 6751 target := &ret 6752 if err := gensupport.DecodeResponse(target, res); err != nil { 6753 return nil, err 6754 } 6755 return ret, nil 6756 // { 6757 // "description": "Sets the account that will be used to authenticate to the API as the enterprise.", 6758 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/account", 6759 // "httpMethod": "PUT", 6760 // "id": "androidenterprise.enterprises.setAccount", 6761 // "parameterOrder": [ 6762 // "enterpriseId" 6763 // ], 6764 // "parameters": { 6765 // "enterpriseId": { 6766 // "description": "The ID of the enterprise.", 6767 // "location": "path", 6768 // "required": true, 6769 // "type": "string" 6770 // } 6771 // }, 6772 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/account", 6773 // "request": { 6774 // "$ref": "EnterpriseAccount" 6775 // }, 6776 // "response": { 6777 // "$ref": "EnterpriseAccount" 6778 // }, 6779 // "scopes": [ 6780 // "https://www.googleapis.com/auth/androidenterprise" 6781 // ] 6782 // } 6783 6784} 6785 6786// method id "androidenterprise.enterprises.setStoreLayout": 6787 6788type EnterprisesSetStoreLayoutCall struct { 6789 s *Service 6790 enterpriseId string 6791 storelayout *StoreLayout 6792 urlParams_ gensupport.URLParams 6793 ctx_ context.Context 6794 header_ http.Header 6795} 6796 6797// SetStoreLayout: Sets the store layout for the enterprise. By default, 6798// storeLayoutType is set to "basic" and the basic store layout is 6799// enabled. The basic layout only contains apps approved by the admin, 6800// and that have been added to the available product set for a user 6801// (using the setAvailableProductSet call). Apps on the page are sorted 6802// in order of their product ID value. If you create a custom store 6803// layout (by setting storeLayoutType = "custom" and setting a 6804// homepage), the basic store layout is disabled. 6805// 6806// - enterpriseId: The ID of the enterprise. 6807func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall { 6808 c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6809 c.enterpriseId = enterpriseId 6810 c.storelayout = storelayout 6811 return c 6812} 6813 6814// Fields allows partial responses to be retrieved. See 6815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6816// for more information. 6817func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall { 6818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6819 return c 6820} 6821 6822// Context sets the context to be used in this call's Do method. Any 6823// pending HTTP request will be aborted if the provided context is 6824// canceled. 6825func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall { 6826 c.ctx_ = ctx 6827 return c 6828} 6829 6830// Header returns an http.Header that can be modified by the caller to 6831// add HTTP headers to the request. 6832func (c *EnterprisesSetStoreLayoutCall) Header() http.Header { 6833 if c.header_ == nil { 6834 c.header_ = make(http.Header) 6835 } 6836 return c.header_ 6837} 6838 6839func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 6840 reqHeaders := make(http.Header) 6841 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6842 for k, v := range c.header_ { 6843 reqHeaders[k] = v 6844 } 6845 reqHeaders.Set("User-Agent", c.s.userAgent()) 6846 var body io.Reader = nil 6847 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout) 6848 if err != nil { 6849 return nil, err 6850 } 6851 reqHeaders.Set("Content-Type", "application/json") 6852 c.urlParams_.Set("alt", alt) 6853 c.urlParams_.Set("prettyPrint", "false") 6854 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout") 6855 urls += "?" + c.urlParams_.Encode() 6856 req, err := http.NewRequest("PUT", urls, body) 6857 if err != nil { 6858 return nil, err 6859 } 6860 req.Header = reqHeaders 6861 googleapi.Expand(req.URL, map[string]string{ 6862 "enterpriseId": c.enterpriseId, 6863 }) 6864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6865} 6866 6867// Do executes the "androidenterprise.enterprises.setStoreLayout" call. 6868// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 6869// status code is an error. Response headers are in either 6870// *StoreLayout.ServerResponse.Header or (if a response was returned at 6871// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6872// to check whether the returned error was because 6873// http.StatusNotModified was returned. 6874func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 6875 gensupport.SetOptions(c.urlParams_, opts...) 6876 res, err := c.doRequest("json") 6877 if res != nil && res.StatusCode == http.StatusNotModified { 6878 if res.Body != nil { 6879 res.Body.Close() 6880 } 6881 return nil, &googleapi.Error{ 6882 Code: res.StatusCode, 6883 Header: res.Header, 6884 } 6885 } 6886 if err != nil { 6887 return nil, err 6888 } 6889 defer googleapi.CloseBody(res) 6890 if err := googleapi.CheckResponse(res); err != nil { 6891 return nil, err 6892 } 6893 ret := &StoreLayout{ 6894 ServerResponse: googleapi.ServerResponse{ 6895 Header: res.Header, 6896 HTTPStatusCode: res.StatusCode, 6897 }, 6898 } 6899 target := &ret 6900 if err := gensupport.DecodeResponse(target, res); err != nil { 6901 return nil, err 6902 } 6903 return ret, nil 6904 // { 6905 // "description": "Sets the store layout for the enterprise. By default, storeLayoutType is set to \"basic\" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = \"custom\" and setting a homepage), the basic store layout is disabled.", 6906 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6907 // "httpMethod": "PUT", 6908 // "id": "androidenterprise.enterprises.setStoreLayout", 6909 // "parameterOrder": [ 6910 // "enterpriseId" 6911 // ], 6912 // "parameters": { 6913 // "enterpriseId": { 6914 // "description": "The ID of the enterprise.", 6915 // "location": "path", 6916 // "required": true, 6917 // "type": "string" 6918 // } 6919 // }, 6920 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6921 // "request": { 6922 // "$ref": "StoreLayout" 6923 // }, 6924 // "response": { 6925 // "$ref": "StoreLayout" 6926 // }, 6927 // "scopes": [ 6928 // "https://www.googleapis.com/auth/androidenterprise" 6929 // ] 6930 // } 6931 6932} 6933 6934// method id "androidenterprise.enterprises.unenroll": 6935 6936type EnterprisesUnenrollCall struct { 6937 s *Service 6938 enterpriseId string 6939 urlParams_ gensupport.URLParams 6940 ctx_ context.Context 6941 header_ http.Header 6942} 6943 6944// Unenroll: Unenrolls an enterprise from the calling EMM. 6945// 6946// - enterpriseId: The ID of the enterprise. 6947func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall { 6948 c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6949 c.enterpriseId = enterpriseId 6950 return c 6951} 6952 6953// Fields allows partial responses to be retrieved. See 6954// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6955// for more information. 6956func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall { 6957 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6958 return c 6959} 6960 6961// Context sets the context to be used in this call's Do method. Any 6962// pending HTTP request will be aborted if the provided context is 6963// canceled. 6964func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall { 6965 c.ctx_ = ctx 6966 return c 6967} 6968 6969// Header returns an http.Header that can be modified by the caller to 6970// add HTTP headers to the request. 6971func (c *EnterprisesUnenrollCall) Header() http.Header { 6972 if c.header_ == nil { 6973 c.header_ = make(http.Header) 6974 } 6975 return c.header_ 6976} 6977 6978func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) { 6979 reqHeaders := make(http.Header) 6980 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6981 for k, v := range c.header_ { 6982 reqHeaders[k] = v 6983 } 6984 reqHeaders.Set("User-Agent", c.s.userAgent()) 6985 var body io.Reader = nil 6986 c.urlParams_.Set("alt", alt) 6987 c.urlParams_.Set("prettyPrint", "false") 6988 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/unenroll") 6989 urls += "?" + c.urlParams_.Encode() 6990 req, err := http.NewRequest("POST", urls, body) 6991 if err != nil { 6992 return nil, err 6993 } 6994 req.Header = reqHeaders 6995 googleapi.Expand(req.URL, map[string]string{ 6996 "enterpriseId": c.enterpriseId, 6997 }) 6998 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6999} 7000 7001// Do executes the "androidenterprise.enterprises.unenroll" call. 7002func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error { 7003 gensupport.SetOptions(c.urlParams_, opts...) 7004 res, err := c.doRequest("json") 7005 if err != nil { 7006 return err 7007 } 7008 defer googleapi.CloseBody(res) 7009 if err := googleapi.CheckResponse(res); err != nil { 7010 return err 7011 } 7012 return nil 7013 // { 7014 // "description": "Unenrolls an enterprise from the calling EMM.", 7015 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/unenroll", 7016 // "httpMethod": "POST", 7017 // "id": "androidenterprise.enterprises.unenroll", 7018 // "parameterOrder": [ 7019 // "enterpriseId" 7020 // ], 7021 // "parameters": { 7022 // "enterpriseId": { 7023 // "description": "The ID of the enterprise.", 7024 // "location": "path", 7025 // "required": true, 7026 // "type": "string" 7027 // } 7028 // }, 7029 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/unenroll", 7030 // "scopes": [ 7031 // "https://www.googleapis.com/auth/androidenterprise" 7032 // ] 7033 // } 7034 7035} 7036 7037// method id "androidenterprise.entitlements.delete": 7038 7039type EntitlementsDeleteCall struct { 7040 s *Service 7041 enterpriseId string 7042 userId string 7043 entitlementId string 7044 urlParams_ gensupport.URLParams 7045 ctx_ context.Context 7046 header_ http.Header 7047} 7048 7049// Delete: Removes an entitlement to an app for a user. 7050// 7051// - enterpriseId: The ID of the enterprise. 7052// - entitlementId: The ID of the entitlement (a product ID), e.g. 7053// "app:com.google.android.gm". 7054// - userId: The ID of the user. 7055func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall { 7056 c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7057 c.enterpriseId = enterpriseId 7058 c.userId = userId 7059 c.entitlementId = entitlementId 7060 return c 7061} 7062 7063// Fields allows partial responses to be retrieved. See 7064// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7065// for more information. 7066func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall { 7067 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7068 return c 7069} 7070 7071// Context sets the context to be used in this call's Do method. Any 7072// pending HTTP request will be aborted if the provided context is 7073// canceled. 7074func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall { 7075 c.ctx_ = ctx 7076 return c 7077} 7078 7079// Header returns an http.Header that can be modified by the caller to 7080// add HTTP headers to the request. 7081func (c *EntitlementsDeleteCall) Header() http.Header { 7082 if c.header_ == nil { 7083 c.header_ = make(http.Header) 7084 } 7085 return c.header_ 7086} 7087 7088func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) { 7089 reqHeaders := make(http.Header) 7090 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7091 for k, v := range c.header_ { 7092 reqHeaders[k] = v 7093 } 7094 reqHeaders.Set("User-Agent", c.s.userAgent()) 7095 var body io.Reader = nil 7096 c.urlParams_.Set("alt", alt) 7097 c.urlParams_.Set("prettyPrint", "false") 7098 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7099 urls += "?" + c.urlParams_.Encode() 7100 req, err := http.NewRequest("DELETE", urls, body) 7101 if err != nil { 7102 return nil, err 7103 } 7104 req.Header = reqHeaders 7105 googleapi.Expand(req.URL, map[string]string{ 7106 "enterpriseId": c.enterpriseId, 7107 "userId": c.userId, 7108 "entitlementId": c.entitlementId, 7109 }) 7110 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7111} 7112 7113// Do executes the "androidenterprise.entitlements.delete" call. 7114func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error { 7115 gensupport.SetOptions(c.urlParams_, opts...) 7116 res, err := c.doRequest("json") 7117 if err != nil { 7118 return err 7119 } 7120 defer googleapi.CloseBody(res) 7121 if err := googleapi.CheckResponse(res); err != nil { 7122 return err 7123 } 7124 return nil 7125 // { 7126 // "description": "Removes an entitlement to an app for a user.", 7127 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7128 // "httpMethod": "DELETE", 7129 // "id": "androidenterprise.entitlements.delete", 7130 // "parameterOrder": [ 7131 // "enterpriseId", 7132 // "userId", 7133 // "entitlementId" 7134 // ], 7135 // "parameters": { 7136 // "enterpriseId": { 7137 // "description": "The ID of the enterprise.", 7138 // "location": "path", 7139 // "required": true, 7140 // "type": "string" 7141 // }, 7142 // "entitlementId": { 7143 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7144 // "location": "path", 7145 // "required": true, 7146 // "type": "string" 7147 // }, 7148 // "userId": { 7149 // "description": "The ID of the user.", 7150 // "location": "path", 7151 // "required": true, 7152 // "type": "string" 7153 // } 7154 // }, 7155 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7156 // "scopes": [ 7157 // "https://www.googleapis.com/auth/androidenterprise" 7158 // ] 7159 // } 7160 7161} 7162 7163// method id "androidenterprise.entitlements.get": 7164 7165type EntitlementsGetCall struct { 7166 s *Service 7167 enterpriseId string 7168 userId string 7169 entitlementId string 7170 urlParams_ gensupport.URLParams 7171 ifNoneMatch_ string 7172 ctx_ context.Context 7173 header_ http.Header 7174} 7175 7176// Get: Retrieves details of an entitlement. 7177// 7178// - enterpriseId: The ID of the enterprise. 7179// - entitlementId: The ID of the entitlement (a product ID), e.g. 7180// "app:com.google.android.gm". 7181// - userId: The ID of the user. 7182func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall { 7183 c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7184 c.enterpriseId = enterpriseId 7185 c.userId = userId 7186 c.entitlementId = entitlementId 7187 return c 7188} 7189 7190// Fields allows partial responses to be retrieved. See 7191// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7192// for more information. 7193func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall { 7194 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7195 return c 7196} 7197 7198// IfNoneMatch sets the optional parameter which makes the operation 7199// fail if the object's ETag matches the given value. This is useful for 7200// getting updates only after the object has changed since the last 7201// request. Use googleapi.IsNotModified to check whether the response 7202// error from Do is the result of In-None-Match. 7203func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall { 7204 c.ifNoneMatch_ = entityTag 7205 return c 7206} 7207 7208// Context sets the context to be used in this call's Do method. Any 7209// pending HTTP request will be aborted if the provided context is 7210// canceled. 7211func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall { 7212 c.ctx_ = ctx 7213 return c 7214} 7215 7216// Header returns an http.Header that can be modified by the caller to 7217// add HTTP headers to the request. 7218func (c *EntitlementsGetCall) Header() http.Header { 7219 if c.header_ == nil { 7220 c.header_ = make(http.Header) 7221 } 7222 return c.header_ 7223} 7224 7225func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) { 7226 reqHeaders := make(http.Header) 7227 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7228 for k, v := range c.header_ { 7229 reqHeaders[k] = v 7230 } 7231 reqHeaders.Set("User-Agent", c.s.userAgent()) 7232 if c.ifNoneMatch_ != "" { 7233 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7234 } 7235 var body io.Reader = nil 7236 c.urlParams_.Set("alt", alt) 7237 c.urlParams_.Set("prettyPrint", "false") 7238 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7239 urls += "?" + c.urlParams_.Encode() 7240 req, err := http.NewRequest("GET", urls, body) 7241 if err != nil { 7242 return nil, err 7243 } 7244 req.Header = reqHeaders 7245 googleapi.Expand(req.URL, map[string]string{ 7246 "enterpriseId": c.enterpriseId, 7247 "userId": c.userId, 7248 "entitlementId": c.entitlementId, 7249 }) 7250 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7251} 7252 7253// Do executes the "androidenterprise.entitlements.get" call. 7254// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7255// status code is an error. Response headers are in either 7256// *Entitlement.ServerResponse.Header or (if a response was returned at 7257// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7258// to check whether the returned error was because 7259// http.StatusNotModified was returned. 7260func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7261 gensupport.SetOptions(c.urlParams_, opts...) 7262 res, err := c.doRequest("json") 7263 if res != nil && res.StatusCode == http.StatusNotModified { 7264 if res.Body != nil { 7265 res.Body.Close() 7266 } 7267 return nil, &googleapi.Error{ 7268 Code: res.StatusCode, 7269 Header: res.Header, 7270 } 7271 } 7272 if err != nil { 7273 return nil, err 7274 } 7275 defer googleapi.CloseBody(res) 7276 if err := googleapi.CheckResponse(res); err != nil { 7277 return nil, err 7278 } 7279 ret := &Entitlement{ 7280 ServerResponse: googleapi.ServerResponse{ 7281 Header: res.Header, 7282 HTTPStatusCode: res.StatusCode, 7283 }, 7284 } 7285 target := &ret 7286 if err := gensupport.DecodeResponse(target, res); err != nil { 7287 return nil, err 7288 } 7289 return ret, nil 7290 // { 7291 // "description": "Retrieves details of an entitlement.", 7292 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7293 // "httpMethod": "GET", 7294 // "id": "androidenterprise.entitlements.get", 7295 // "parameterOrder": [ 7296 // "enterpriseId", 7297 // "userId", 7298 // "entitlementId" 7299 // ], 7300 // "parameters": { 7301 // "enterpriseId": { 7302 // "description": "The ID of the enterprise.", 7303 // "location": "path", 7304 // "required": true, 7305 // "type": "string" 7306 // }, 7307 // "entitlementId": { 7308 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7309 // "location": "path", 7310 // "required": true, 7311 // "type": "string" 7312 // }, 7313 // "userId": { 7314 // "description": "The ID of the user.", 7315 // "location": "path", 7316 // "required": true, 7317 // "type": "string" 7318 // } 7319 // }, 7320 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7321 // "response": { 7322 // "$ref": "Entitlement" 7323 // }, 7324 // "scopes": [ 7325 // "https://www.googleapis.com/auth/androidenterprise" 7326 // ] 7327 // } 7328 7329} 7330 7331// method id "androidenterprise.entitlements.list": 7332 7333type EntitlementsListCall struct { 7334 s *Service 7335 enterpriseId string 7336 userId string 7337 urlParams_ gensupport.URLParams 7338 ifNoneMatch_ string 7339 ctx_ context.Context 7340 header_ http.Header 7341} 7342 7343// List: Lists all entitlements for the specified user. Only the ID is 7344// set. 7345// 7346// - enterpriseId: The ID of the enterprise. 7347// - userId: The ID of the user. 7348func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall { 7349 c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7350 c.enterpriseId = enterpriseId 7351 c.userId = userId 7352 return c 7353} 7354 7355// Fields allows partial responses to be retrieved. See 7356// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7357// for more information. 7358func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall { 7359 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7360 return c 7361} 7362 7363// IfNoneMatch sets the optional parameter which makes the operation 7364// fail if the object's ETag matches the given value. This is useful for 7365// getting updates only after the object has changed since the last 7366// request. Use googleapi.IsNotModified to check whether the response 7367// error from Do is the result of In-None-Match. 7368func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall { 7369 c.ifNoneMatch_ = entityTag 7370 return c 7371} 7372 7373// Context sets the context to be used in this call's Do method. Any 7374// pending HTTP request will be aborted if the provided context is 7375// canceled. 7376func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall { 7377 c.ctx_ = ctx 7378 return c 7379} 7380 7381// Header returns an http.Header that can be modified by the caller to 7382// add HTTP headers to the request. 7383func (c *EntitlementsListCall) Header() http.Header { 7384 if c.header_ == nil { 7385 c.header_ = make(http.Header) 7386 } 7387 return c.header_ 7388} 7389 7390func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { 7391 reqHeaders := make(http.Header) 7392 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7393 for k, v := range c.header_ { 7394 reqHeaders[k] = v 7395 } 7396 reqHeaders.Set("User-Agent", c.s.userAgent()) 7397 if c.ifNoneMatch_ != "" { 7398 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7399 } 7400 var body io.Reader = nil 7401 c.urlParams_.Set("alt", alt) 7402 c.urlParams_.Set("prettyPrint", "false") 7403 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements") 7404 urls += "?" + c.urlParams_.Encode() 7405 req, err := http.NewRequest("GET", urls, body) 7406 if err != nil { 7407 return nil, err 7408 } 7409 req.Header = reqHeaders 7410 googleapi.Expand(req.URL, map[string]string{ 7411 "enterpriseId": c.enterpriseId, 7412 "userId": c.userId, 7413 }) 7414 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7415} 7416 7417// Do executes the "androidenterprise.entitlements.list" call. 7418// Exactly one of *EntitlementsListResponse or error will be non-nil. 7419// Any non-2xx status code is an error. Response headers are in either 7420// *EntitlementsListResponse.ServerResponse.Header or (if a response was 7421// returned at all) in error.(*googleapi.Error).Header. Use 7422// googleapi.IsNotModified to check whether the returned error was 7423// because http.StatusNotModified was returned. 7424func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) { 7425 gensupport.SetOptions(c.urlParams_, opts...) 7426 res, err := c.doRequest("json") 7427 if res != nil && res.StatusCode == http.StatusNotModified { 7428 if res.Body != nil { 7429 res.Body.Close() 7430 } 7431 return nil, &googleapi.Error{ 7432 Code: res.StatusCode, 7433 Header: res.Header, 7434 } 7435 } 7436 if err != nil { 7437 return nil, err 7438 } 7439 defer googleapi.CloseBody(res) 7440 if err := googleapi.CheckResponse(res); err != nil { 7441 return nil, err 7442 } 7443 ret := &EntitlementsListResponse{ 7444 ServerResponse: googleapi.ServerResponse{ 7445 Header: res.Header, 7446 HTTPStatusCode: res.StatusCode, 7447 }, 7448 } 7449 target := &ret 7450 if err := gensupport.DecodeResponse(target, res); err != nil { 7451 return nil, err 7452 } 7453 return ret, nil 7454 // { 7455 // "description": "Lists all entitlements for the specified user. Only the ID is set.", 7456 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements", 7457 // "httpMethod": "GET", 7458 // "id": "androidenterprise.entitlements.list", 7459 // "parameterOrder": [ 7460 // "enterpriseId", 7461 // "userId" 7462 // ], 7463 // "parameters": { 7464 // "enterpriseId": { 7465 // "description": "The ID of the enterprise.", 7466 // "location": "path", 7467 // "required": true, 7468 // "type": "string" 7469 // }, 7470 // "userId": { 7471 // "description": "The ID of the user.", 7472 // "location": "path", 7473 // "required": true, 7474 // "type": "string" 7475 // } 7476 // }, 7477 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements", 7478 // "response": { 7479 // "$ref": "EntitlementsListResponse" 7480 // }, 7481 // "scopes": [ 7482 // "https://www.googleapis.com/auth/androidenterprise" 7483 // ] 7484 // } 7485 7486} 7487 7488// method id "androidenterprise.entitlements.update": 7489 7490type EntitlementsUpdateCall struct { 7491 s *Service 7492 enterpriseId string 7493 userId string 7494 entitlementId string 7495 entitlement *Entitlement 7496 urlParams_ gensupport.URLParams 7497 ctx_ context.Context 7498 header_ http.Header 7499} 7500 7501// Update: Adds or updates an entitlement to an app for a user. 7502// 7503// - enterpriseId: The ID of the enterprise. 7504// - entitlementId: The ID of the entitlement (a product ID), e.g. 7505// "app:com.google.android.gm". 7506// - userId: The ID of the user. 7507func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall { 7508 c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7509 c.enterpriseId = enterpriseId 7510 c.userId = userId 7511 c.entitlementId = entitlementId 7512 c.entitlement = entitlement 7513 return c 7514} 7515 7516// Install sets the optional parameter "install": Set to true to also 7517// install the product on all the user's devices where possible. Failure 7518// to install on one or more devices will not prevent this operation 7519// from returning successfully, as long as the entitlement was 7520// successfully assigned to the user. 7521func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall { 7522 c.urlParams_.Set("install", fmt.Sprint(install)) 7523 return c 7524} 7525 7526// Fields allows partial responses to be retrieved. See 7527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7528// for more information. 7529func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall { 7530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7531 return c 7532} 7533 7534// Context sets the context to be used in this call's Do method. Any 7535// pending HTTP request will be aborted if the provided context is 7536// canceled. 7537func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall { 7538 c.ctx_ = ctx 7539 return c 7540} 7541 7542// Header returns an http.Header that can be modified by the caller to 7543// add HTTP headers to the request. 7544func (c *EntitlementsUpdateCall) Header() http.Header { 7545 if c.header_ == nil { 7546 c.header_ = make(http.Header) 7547 } 7548 return c.header_ 7549} 7550 7551func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) { 7552 reqHeaders := make(http.Header) 7553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7554 for k, v := range c.header_ { 7555 reqHeaders[k] = v 7556 } 7557 reqHeaders.Set("User-Agent", c.s.userAgent()) 7558 var body io.Reader = nil 7559 body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) 7560 if err != nil { 7561 return nil, err 7562 } 7563 reqHeaders.Set("Content-Type", "application/json") 7564 c.urlParams_.Set("alt", alt) 7565 c.urlParams_.Set("prettyPrint", "false") 7566 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7567 urls += "?" + c.urlParams_.Encode() 7568 req, err := http.NewRequest("PUT", urls, body) 7569 if err != nil { 7570 return nil, err 7571 } 7572 req.Header = reqHeaders 7573 googleapi.Expand(req.URL, map[string]string{ 7574 "enterpriseId": c.enterpriseId, 7575 "userId": c.userId, 7576 "entitlementId": c.entitlementId, 7577 }) 7578 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7579} 7580 7581// Do executes the "androidenterprise.entitlements.update" call. 7582// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7583// status code is an error. Response headers are in either 7584// *Entitlement.ServerResponse.Header or (if a response was returned at 7585// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7586// to check whether the returned error was because 7587// http.StatusNotModified was returned. 7588func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7589 gensupport.SetOptions(c.urlParams_, opts...) 7590 res, err := c.doRequest("json") 7591 if res != nil && res.StatusCode == http.StatusNotModified { 7592 if res.Body != nil { 7593 res.Body.Close() 7594 } 7595 return nil, &googleapi.Error{ 7596 Code: res.StatusCode, 7597 Header: res.Header, 7598 } 7599 } 7600 if err != nil { 7601 return nil, err 7602 } 7603 defer googleapi.CloseBody(res) 7604 if err := googleapi.CheckResponse(res); err != nil { 7605 return nil, err 7606 } 7607 ret := &Entitlement{ 7608 ServerResponse: googleapi.ServerResponse{ 7609 Header: res.Header, 7610 HTTPStatusCode: res.StatusCode, 7611 }, 7612 } 7613 target := &ret 7614 if err := gensupport.DecodeResponse(target, res); err != nil { 7615 return nil, err 7616 } 7617 return ret, nil 7618 // { 7619 // "description": "Adds or updates an entitlement to an app for a user.", 7620 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7621 // "httpMethod": "PUT", 7622 // "id": "androidenterprise.entitlements.update", 7623 // "parameterOrder": [ 7624 // "enterpriseId", 7625 // "userId", 7626 // "entitlementId" 7627 // ], 7628 // "parameters": { 7629 // "enterpriseId": { 7630 // "description": "The ID of the enterprise.", 7631 // "location": "path", 7632 // "required": true, 7633 // "type": "string" 7634 // }, 7635 // "entitlementId": { 7636 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7637 // "location": "path", 7638 // "required": true, 7639 // "type": "string" 7640 // }, 7641 // "install": { 7642 // "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.", 7643 // "location": "query", 7644 // "type": "boolean" 7645 // }, 7646 // "userId": { 7647 // "description": "The ID of the user.", 7648 // "location": "path", 7649 // "required": true, 7650 // "type": "string" 7651 // } 7652 // }, 7653 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7654 // "request": { 7655 // "$ref": "Entitlement" 7656 // }, 7657 // "response": { 7658 // "$ref": "Entitlement" 7659 // }, 7660 // "scopes": [ 7661 // "https://www.googleapis.com/auth/androidenterprise" 7662 // ] 7663 // } 7664 7665} 7666 7667// method id "androidenterprise.grouplicenses.get": 7668 7669type GrouplicensesGetCall struct { 7670 s *Service 7671 enterpriseId string 7672 groupLicenseId string 7673 urlParams_ gensupport.URLParams 7674 ifNoneMatch_ string 7675 ctx_ context.Context 7676 header_ http.Header 7677} 7678 7679// Get: Retrieves details of an enterprise's group license for a 7680// product. 7681// 7682// - enterpriseId: The ID of the enterprise. 7683// - groupLicenseId: The ID of the product the group license is for, 7684// e.g. "app:com.google.android.gm". 7685func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall { 7686 c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7687 c.enterpriseId = enterpriseId 7688 c.groupLicenseId = groupLicenseId 7689 return c 7690} 7691 7692// Fields allows partial responses to be retrieved. See 7693// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7694// for more information. 7695func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall { 7696 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7697 return c 7698} 7699 7700// IfNoneMatch sets the optional parameter which makes the operation 7701// fail if the object's ETag matches the given value. This is useful for 7702// getting updates only after the object has changed since the last 7703// request. Use googleapi.IsNotModified to check whether the response 7704// error from Do is the result of In-None-Match. 7705func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall { 7706 c.ifNoneMatch_ = entityTag 7707 return c 7708} 7709 7710// Context sets the context to be used in this call's Do method. Any 7711// pending HTTP request will be aborted if the provided context is 7712// canceled. 7713func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall { 7714 c.ctx_ = ctx 7715 return c 7716} 7717 7718// Header returns an http.Header that can be modified by the caller to 7719// add HTTP headers to the request. 7720func (c *GrouplicensesGetCall) Header() http.Header { 7721 if c.header_ == nil { 7722 c.header_ = make(http.Header) 7723 } 7724 return c.header_ 7725} 7726 7727func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) { 7728 reqHeaders := make(http.Header) 7729 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7730 for k, v := range c.header_ { 7731 reqHeaders[k] = v 7732 } 7733 reqHeaders.Set("User-Agent", c.s.userAgent()) 7734 if c.ifNoneMatch_ != "" { 7735 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7736 } 7737 var body io.Reader = nil 7738 c.urlParams_.Set("alt", alt) 7739 c.urlParams_.Set("prettyPrint", "false") 7740 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}") 7741 urls += "?" + c.urlParams_.Encode() 7742 req, err := http.NewRequest("GET", urls, body) 7743 if err != nil { 7744 return nil, err 7745 } 7746 req.Header = reqHeaders 7747 googleapi.Expand(req.URL, map[string]string{ 7748 "enterpriseId": c.enterpriseId, 7749 "groupLicenseId": c.groupLicenseId, 7750 }) 7751 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7752} 7753 7754// Do executes the "androidenterprise.grouplicenses.get" call. 7755// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx 7756// status code is an error. Response headers are in either 7757// *GroupLicense.ServerResponse.Header or (if a response was returned at 7758// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7759// to check whether the returned error was because 7760// http.StatusNotModified was returned. 7761func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) { 7762 gensupport.SetOptions(c.urlParams_, opts...) 7763 res, err := c.doRequest("json") 7764 if res != nil && res.StatusCode == http.StatusNotModified { 7765 if res.Body != nil { 7766 res.Body.Close() 7767 } 7768 return nil, &googleapi.Error{ 7769 Code: res.StatusCode, 7770 Header: res.Header, 7771 } 7772 } 7773 if err != nil { 7774 return nil, err 7775 } 7776 defer googleapi.CloseBody(res) 7777 if err := googleapi.CheckResponse(res); err != nil { 7778 return nil, err 7779 } 7780 ret := &GroupLicense{ 7781 ServerResponse: googleapi.ServerResponse{ 7782 Header: res.Header, 7783 HTTPStatusCode: res.StatusCode, 7784 }, 7785 } 7786 target := &ret 7787 if err := gensupport.DecodeResponse(target, res); err != nil { 7788 return nil, err 7789 } 7790 return ret, nil 7791 // { 7792 // "description": "Retrieves details of an enterprise's group license for a product.", 7793 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", 7794 // "httpMethod": "GET", 7795 // "id": "androidenterprise.grouplicenses.get", 7796 // "parameterOrder": [ 7797 // "enterpriseId", 7798 // "groupLicenseId" 7799 // ], 7800 // "parameters": { 7801 // "enterpriseId": { 7802 // "description": "The ID of the enterprise.", 7803 // "location": "path", 7804 // "required": true, 7805 // "type": "string" 7806 // }, 7807 // "groupLicenseId": { 7808 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 7809 // "location": "path", 7810 // "required": true, 7811 // "type": "string" 7812 // } 7813 // }, 7814 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", 7815 // "response": { 7816 // "$ref": "GroupLicense" 7817 // }, 7818 // "scopes": [ 7819 // "https://www.googleapis.com/auth/androidenterprise" 7820 // ] 7821 // } 7822 7823} 7824 7825// method id "androidenterprise.grouplicenses.list": 7826 7827type GrouplicensesListCall struct { 7828 s *Service 7829 enterpriseId string 7830 urlParams_ gensupport.URLParams 7831 ifNoneMatch_ string 7832 ctx_ context.Context 7833 header_ http.Header 7834} 7835 7836// List: Retrieves IDs of all products for which the enterprise has a 7837// group license. 7838// 7839// - enterpriseId: The ID of the enterprise. 7840func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall { 7841 c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7842 c.enterpriseId = enterpriseId 7843 return c 7844} 7845 7846// Fields allows partial responses to be retrieved. See 7847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7848// for more information. 7849func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall { 7850 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7851 return c 7852} 7853 7854// IfNoneMatch sets the optional parameter which makes the operation 7855// fail if the object's ETag matches the given value. This is useful for 7856// getting updates only after the object has changed since the last 7857// request. Use googleapi.IsNotModified to check whether the response 7858// error from Do is the result of In-None-Match. 7859func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall { 7860 c.ifNoneMatch_ = entityTag 7861 return c 7862} 7863 7864// Context sets the context to be used in this call's Do method. Any 7865// pending HTTP request will be aborted if the provided context is 7866// canceled. 7867func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall { 7868 c.ctx_ = ctx 7869 return c 7870} 7871 7872// Header returns an http.Header that can be modified by the caller to 7873// add HTTP headers to the request. 7874func (c *GrouplicensesListCall) Header() http.Header { 7875 if c.header_ == nil { 7876 c.header_ = make(http.Header) 7877 } 7878 return c.header_ 7879} 7880 7881func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) { 7882 reqHeaders := make(http.Header) 7883 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7884 for k, v := range c.header_ { 7885 reqHeaders[k] = v 7886 } 7887 reqHeaders.Set("User-Agent", c.s.userAgent()) 7888 if c.ifNoneMatch_ != "" { 7889 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7890 } 7891 var body io.Reader = nil 7892 c.urlParams_.Set("alt", alt) 7893 c.urlParams_.Set("prettyPrint", "false") 7894 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses") 7895 urls += "?" + c.urlParams_.Encode() 7896 req, err := http.NewRequest("GET", urls, body) 7897 if err != nil { 7898 return nil, err 7899 } 7900 req.Header = reqHeaders 7901 googleapi.Expand(req.URL, map[string]string{ 7902 "enterpriseId": c.enterpriseId, 7903 }) 7904 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7905} 7906 7907// Do executes the "androidenterprise.grouplicenses.list" call. 7908// Exactly one of *GroupLicensesListResponse or error will be non-nil. 7909// Any non-2xx status code is an error. Response headers are in either 7910// *GroupLicensesListResponse.ServerResponse.Header or (if a response 7911// was returned at all) in error.(*googleapi.Error).Header. Use 7912// googleapi.IsNotModified to check whether the returned error was 7913// because http.StatusNotModified was returned. 7914func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) { 7915 gensupport.SetOptions(c.urlParams_, opts...) 7916 res, err := c.doRequest("json") 7917 if res != nil && res.StatusCode == http.StatusNotModified { 7918 if res.Body != nil { 7919 res.Body.Close() 7920 } 7921 return nil, &googleapi.Error{ 7922 Code: res.StatusCode, 7923 Header: res.Header, 7924 } 7925 } 7926 if err != nil { 7927 return nil, err 7928 } 7929 defer googleapi.CloseBody(res) 7930 if err := googleapi.CheckResponse(res); err != nil { 7931 return nil, err 7932 } 7933 ret := &GroupLicensesListResponse{ 7934 ServerResponse: googleapi.ServerResponse{ 7935 Header: res.Header, 7936 HTTPStatusCode: res.StatusCode, 7937 }, 7938 } 7939 target := &ret 7940 if err := gensupport.DecodeResponse(target, res); err != nil { 7941 return nil, err 7942 } 7943 return ret, nil 7944 // { 7945 // "description": "Retrieves IDs of all products for which the enterprise has a group license.", 7946 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses", 7947 // "httpMethod": "GET", 7948 // "id": "androidenterprise.grouplicenses.list", 7949 // "parameterOrder": [ 7950 // "enterpriseId" 7951 // ], 7952 // "parameters": { 7953 // "enterpriseId": { 7954 // "description": "The ID of the enterprise.", 7955 // "location": "path", 7956 // "required": true, 7957 // "type": "string" 7958 // } 7959 // }, 7960 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses", 7961 // "response": { 7962 // "$ref": "GroupLicensesListResponse" 7963 // }, 7964 // "scopes": [ 7965 // "https://www.googleapis.com/auth/androidenterprise" 7966 // ] 7967 // } 7968 7969} 7970 7971// method id "androidenterprise.grouplicenseusers.list": 7972 7973type GrouplicenseusersListCall struct { 7974 s *Service 7975 enterpriseId string 7976 groupLicenseId string 7977 urlParams_ gensupport.URLParams 7978 ifNoneMatch_ string 7979 ctx_ context.Context 7980 header_ http.Header 7981} 7982 7983// List: Retrieves the IDs of the users who have been granted 7984// entitlements under the license. 7985// 7986// - enterpriseId: The ID of the enterprise. 7987// - groupLicenseId: The ID of the product the group license is for, 7988// e.g. "app:com.google.android.gm". 7989func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall { 7990 c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7991 c.enterpriseId = enterpriseId 7992 c.groupLicenseId = groupLicenseId 7993 return c 7994} 7995 7996// Fields allows partial responses to be retrieved. See 7997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7998// for more information. 7999func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall { 8000 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8001 return c 8002} 8003 8004// IfNoneMatch sets the optional parameter which makes the operation 8005// fail if the object's ETag matches the given value. This is useful for 8006// getting updates only after the object has changed since the last 8007// request. Use googleapi.IsNotModified to check whether the response 8008// error from Do is the result of In-None-Match. 8009func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall { 8010 c.ifNoneMatch_ = entityTag 8011 return c 8012} 8013 8014// Context sets the context to be used in this call's Do method. Any 8015// pending HTTP request will be aborted if the provided context is 8016// canceled. 8017func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall { 8018 c.ctx_ = ctx 8019 return c 8020} 8021 8022// Header returns an http.Header that can be modified by the caller to 8023// add HTTP headers to the request. 8024func (c *GrouplicenseusersListCall) Header() http.Header { 8025 if c.header_ == nil { 8026 c.header_ = make(http.Header) 8027 } 8028 return c.header_ 8029} 8030 8031func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) { 8032 reqHeaders := make(http.Header) 8033 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8034 for k, v := range c.header_ { 8035 reqHeaders[k] = v 8036 } 8037 reqHeaders.Set("User-Agent", c.s.userAgent()) 8038 if c.ifNoneMatch_ != "" { 8039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8040 } 8041 var body io.Reader = nil 8042 c.urlParams_.Set("alt", alt) 8043 c.urlParams_.Set("prettyPrint", "false") 8044 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users") 8045 urls += "?" + c.urlParams_.Encode() 8046 req, err := http.NewRequest("GET", urls, body) 8047 if err != nil { 8048 return nil, err 8049 } 8050 req.Header = reqHeaders 8051 googleapi.Expand(req.URL, map[string]string{ 8052 "enterpriseId": c.enterpriseId, 8053 "groupLicenseId": c.groupLicenseId, 8054 }) 8055 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8056} 8057 8058// Do executes the "androidenterprise.grouplicenseusers.list" call. 8059// Exactly one of *GroupLicenseUsersListResponse or error will be 8060// non-nil. Any non-2xx status code is an error. Response headers are in 8061// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a 8062// response was returned at all) in error.(*googleapi.Error).Header. Use 8063// googleapi.IsNotModified to check whether the returned error was 8064// because http.StatusNotModified was returned. 8065func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) { 8066 gensupport.SetOptions(c.urlParams_, opts...) 8067 res, err := c.doRequest("json") 8068 if res != nil && res.StatusCode == http.StatusNotModified { 8069 if res.Body != nil { 8070 res.Body.Close() 8071 } 8072 return nil, &googleapi.Error{ 8073 Code: res.StatusCode, 8074 Header: res.Header, 8075 } 8076 } 8077 if err != nil { 8078 return nil, err 8079 } 8080 defer googleapi.CloseBody(res) 8081 if err := googleapi.CheckResponse(res); err != nil { 8082 return nil, err 8083 } 8084 ret := &GroupLicenseUsersListResponse{ 8085 ServerResponse: googleapi.ServerResponse{ 8086 Header: res.Header, 8087 HTTPStatusCode: res.StatusCode, 8088 }, 8089 } 8090 target := &ret 8091 if err := gensupport.DecodeResponse(target, res); err != nil { 8092 return nil, err 8093 } 8094 return ret, nil 8095 // { 8096 // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.", 8097 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", 8098 // "httpMethod": "GET", 8099 // "id": "androidenterprise.grouplicenseusers.list", 8100 // "parameterOrder": [ 8101 // "enterpriseId", 8102 // "groupLicenseId" 8103 // ], 8104 // "parameters": { 8105 // "enterpriseId": { 8106 // "description": "The ID of the enterprise.", 8107 // "location": "path", 8108 // "required": true, 8109 // "type": "string" 8110 // }, 8111 // "groupLicenseId": { 8112 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 8113 // "location": "path", 8114 // "required": true, 8115 // "type": "string" 8116 // } 8117 // }, 8118 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", 8119 // "response": { 8120 // "$ref": "GroupLicenseUsersListResponse" 8121 // }, 8122 // "scopes": [ 8123 // "https://www.googleapis.com/auth/androidenterprise" 8124 // ] 8125 // } 8126 8127} 8128 8129// method id "androidenterprise.installs.delete": 8130 8131type InstallsDeleteCall struct { 8132 s *Service 8133 enterpriseId string 8134 userId string 8135 deviceId string 8136 installId string 8137 urlParams_ gensupport.URLParams 8138 ctx_ context.Context 8139 header_ http.Header 8140} 8141 8142// Delete: Requests to remove an app from a device. A call to get or 8143// list will still show the app as installed on the device until it is 8144// actually removed. 8145// 8146// - deviceId: The Android ID of the device. 8147// - enterpriseId: The ID of the enterprise. 8148// - installId: The ID of the product represented by the install, e.g. 8149// "app:com.google.android.gm". 8150// - userId: The ID of the user. 8151func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall { 8152 c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8153 c.enterpriseId = enterpriseId 8154 c.userId = userId 8155 c.deviceId = deviceId 8156 c.installId = installId 8157 return c 8158} 8159 8160// Fields allows partial responses to be retrieved. See 8161// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8162// for more information. 8163func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall { 8164 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8165 return c 8166} 8167 8168// Context sets the context to be used in this call's Do method. Any 8169// pending HTTP request will be aborted if the provided context is 8170// canceled. 8171func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall { 8172 c.ctx_ = ctx 8173 return c 8174} 8175 8176// Header returns an http.Header that can be modified by the caller to 8177// add HTTP headers to the request. 8178func (c *InstallsDeleteCall) Header() http.Header { 8179 if c.header_ == nil { 8180 c.header_ = make(http.Header) 8181 } 8182 return c.header_ 8183} 8184 8185func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) { 8186 reqHeaders := make(http.Header) 8187 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8188 for k, v := range c.header_ { 8189 reqHeaders[k] = v 8190 } 8191 reqHeaders.Set("User-Agent", c.s.userAgent()) 8192 var body io.Reader = nil 8193 c.urlParams_.Set("alt", alt) 8194 c.urlParams_.Set("prettyPrint", "false") 8195 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8196 urls += "?" + c.urlParams_.Encode() 8197 req, err := http.NewRequest("DELETE", urls, body) 8198 if err != nil { 8199 return nil, err 8200 } 8201 req.Header = reqHeaders 8202 googleapi.Expand(req.URL, map[string]string{ 8203 "enterpriseId": c.enterpriseId, 8204 "userId": c.userId, 8205 "deviceId": c.deviceId, 8206 "installId": c.installId, 8207 }) 8208 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8209} 8210 8211// Do executes the "androidenterprise.installs.delete" call. 8212func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error { 8213 gensupport.SetOptions(c.urlParams_, opts...) 8214 res, err := c.doRequest("json") 8215 if err != nil { 8216 return err 8217 } 8218 defer googleapi.CloseBody(res) 8219 if err := googleapi.CheckResponse(res); err != nil { 8220 return err 8221 } 8222 return nil 8223 // { 8224 // "description": "Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.", 8225 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8226 // "httpMethod": "DELETE", 8227 // "id": "androidenterprise.installs.delete", 8228 // "parameterOrder": [ 8229 // "enterpriseId", 8230 // "userId", 8231 // "deviceId", 8232 // "installId" 8233 // ], 8234 // "parameters": { 8235 // "deviceId": { 8236 // "description": "The Android ID of the device.", 8237 // "location": "path", 8238 // "required": true, 8239 // "type": "string" 8240 // }, 8241 // "enterpriseId": { 8242 // "description": "The ID of the enterprise.", 8243 // "location": "path", 8244 // "required": true, 8245 // "type": "string" 8246 // }, 8247 // "installId": { 8248 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8249 // "location": "path", 8250 // "required": true, 8251 // "type": "string" 8252 // }, 8253 // "userId": { 8254 // "description": "The ID of the user.", 8255 // "location": "path", 8256 // "required": true, 8257 // "type": "string" 8258 // } 8259 // }, 8260 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8261 // "scopes": [ 8262 // "https://www.googleapis.com/auth/androidenterprise" 8263 // ] 8264 // } 8265 8266} 8267 8268// method id "androidenterprise.installs.get": 8269 8270type InstallsGetCall struct { 8271 s *Service 8272 enterpriseId string 8273 userId string 8274 deviceId string 8275 installId string 8276 urlParams_ gensupport.URLParams 8277 ifNoneMatch_ string 8278 ctx_ context.Context 8279 header_ http.Header 8280} 8281 8282// Get: Retrieves details of an installation of an app on a device. 8283// 8284// - deviceId: The Android ID of the device. 8285// - enterpriseId: The ID of the enterprise. 8286// - installId: The ID of the product represented by the install, e.g. 8287// "app:com.google.android.gm". 8288// - userId: The ID of the user. 8289func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall { 8290 c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8291 c.enterpriseId = enterpriseId 8292 c.userId = userId 8293 c.deviceId = deviceId 8294 c.installId = installId 8295 return c 8296} 8297 8298// Fields allows partial responses to be retrieved. See 8299// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8300// for more information. 8301func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall { 8302 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8303 return c 8304} 8305 8306// IfNoneMatch sets the optional parameter which makes the operation 8307// fail if the object's ETag matches the given value. This is useful for 8308// getting updates only after the object has changed since the last 8309// request. Use googleapi.IsNotModified to check whether the response 8310// error from Do is the result of In-None-Match. 8311func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall { 8312 c.ifNoneMatch_ = entityTag 8313 return c 8314} 8315 8316// Context sets the context to be used in this call's Do method. Any 8317// pending HTTP request will be aborted if the provided context is 8318// canceled. 8319func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall { 8320 c.ctx_ = ctx 8321 return c 8322} 8323 8324// Header returns an http.Header that can be modified by the caller to 8325// add HTTP headers to the request. 8326func (c *InstallsGetCall) Header() http.Header { 8327 if c.header_ == nil { 8328 c.header_ = make(http.Header) 8329 } 8330 return c.header_ 8331} 8332 8333func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) { 8334 reqHeaders := make(http.Header) 8335 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8336 for k, v := range c.header_ { 8337 reqHeaders[k] = v 8338 } 8339 reqHeaders.Set("User-Agent", c.s.userAgent()) 8340 if c.ifNoneMatch_ != "" { 8341 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8342 } 8343 var body io.Reader = nil 8344 c.urlParams_.Set("alt", alt) 8345 c.urlParams_.Set("prettyPrint", "false") 8346 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8347 urls += "?" + c.urlParams_.Encode() 8348 req, err := http.NewRequest("GET", urls, body) 8349 if err != nil { 8350 return nil, err 8351 } 8352 req.Header = reqHeaders 8353 googleapi.Expand(req.URL, map[string]string{ 8354 "enterpriseId": c.enterpriseId, 8355 "userId": c.userId, 8356 "deviceId": c.deviceId, 8357 "installId": c.installId, 8358 }) 8359 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8360} 8361 8362// Do executes the "androidenterprise.installs.get" call. 8363// Exactly one of *Install or error will be non-nil. Any non-2xx status 8364// code is an error. Response headers are in either 8365// *Install.ServerResponse.Header or (if a response was returned at all) 8366// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8367// check whether the returned error was because http.StatusNotModified 8368// was returned. 8369func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8370 gensupport.SetOptions(c.urlParams_, opts...) 8371 res, err := c.doRequest("json") 8372 if res != nil && res.StatusCode == http.StatusNotModified { 8373 if res.Body != nil { 8374 res.Body.Close() 8375 } 8376 return nil, &googleapi.Error{ 8377 Code: res.StatusCode, 8378 Header: res.Header, 8379 } 8380 } 8381 if err != nil { 8382 return nil, err 8383 } 8384 defer googleapi.CloseBody(res) 8385 if err := googleapi.CheckResponse(res); err != nil { 8386 return nil, err 8387 } 8388 ret := &Install{ 8389 ServerResponse: googleapi.ServerResponse{ 8390 Header: res.Header, 8391 HTTPStatusCode: res.StatusCode, 8392 }, 8393 } 8394 target := &ret 8395 if err := gensupport.DecodeResponse(target, res); err != nil { 8396 return nil, err 8397 } 8398 return ret, nil 8399 // { 8400 // "description": "Retrieves details of an installation of an app on a device.", 8401 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8402 // "httpMethod": "GET", 8403 // "id": "androidenterprise.installs.get", 8404 // "parameterOrder": [ 8405 // "enterpriseId", 8406 // "userId", 8407 // "deviceId", 8408 // "installId" 8409 // ], 8410 // "parameters": { 8411 // "deviceId": { 8412 // "description": "The Android ID of the device.", 8413 // "location": "path", 8414 // "required": true, 8415 // "type": "string" 8416 // }, 8417 // "enterpriseId": { 8418 // "description": "The ID of the enterprise.", 8419 // "location": "path", 8420 // "required": true, 8421 // "type": "string" 8422 // }, 8423 // "installId": { 8424 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8425 // "location": "path", 8426 // "required": true, 8427 // "type": "string" 8428 // }, 8429 // "userId": { 8430 // "description": "The ID of the user.", 8431 // "location": "path", 8432 // "required": true, 8433 // "type": "string" 8434 // } 8435 // }, 8436 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8437 // "response": { 8438 // "$ref": "Install" 8439 // }, 8440 // "scopes": [ 8441 // "https://www.googleapis.com/auth/androidenterprise" 8442 // ] 8443 // } 8444 8445} 8446 8447// method id "androidenterprise.installs.list": 8448 8449type InstallsListCall struct { 8450 s *Service 8451 enterpriseId string 8452 userId string 8453 deviceId string 8454 urlParams_ gensupport.URLParams 8455 ifNoneMatch_ string 8456 ctx_ context.Context 8457 header_ http.Header 8458} 8459 8460// List: Retrieves the details of all apps installed on the specified 8461// device. 8462// 8463// - deviceId: The Android ID of the device. 8464// - enterpriseId: The ID of the enterprise. 8465// - userId: The ID of the user. 8466func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall { 8467 c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8468 c.enterpriseId = enterpriseId 8469 c.userId = userId 8470 c.deviceId = deviceId 8471 return c 8472} 8473 8474// Fields allows partial responses to be retrieved. See 8475// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8476// for more information. 8477func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall { 8478 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8479 return c 8480} 8481 8482// IfNoneMatch sets the optional parameter which makes the operation 8483// fail if the object's ETag matches the given value. This is useful for 8484// getting updates only after the object has changed since the last 8485// request. Use googleapi.IsNotModified to check whether the response 8486// error from Do is the result of In-None-Match. 8487func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall { 8488 c.ifNoneMatch_ = entityTag 8489 return c 8490} 8491 8492// Context sets the context to be used in this call's Do method. Any 8493// pending HTTP request will be aborted if the provided context is 8494// canceled. 8495func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall { 8496 c.ctx_ = ctx 8497 return c 8498} 8499 8500// Header returns an http.Header that can be modified by the caller to 8501// add HTTP headers to the request. 8502func (c *InstallsListCall) Header() http.Header { 8503 if c.header_ == nil { 8504 c.header_ = make(http.Header) 8505 } 8506 return c.header_ 8507} 8508 8509func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) { 8510 reqHeaders := make(http.Header) 8511 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8512 for k, v := range c.header_ { 8513 reqHeaders[k] = v 8514 } 8515 reqHeaders.Set("User-Agent", c.s.userAgent()) 8516 if c.ifNoneMatch_ != "" { 8517 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8518 } 8519 var body io.Reader = nil 8520 c.urlParams_.Set("alt", alt) 8521 c.urlParams_.Set("prettyPrint", "false") 8522 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs") 8523 urls += "?" + c.urlParams_.Encode() 8524 req, err := http.NewRequest("GET", urls, body) 8525 if err != nil { 8526 return nil, err 8527 } 8528 req.Header = reqHeaders 8529 googleapi.Expand(req.URL, map[string]string{ 8530 "enterpriseId": c.enterpriseId, 8531 "userId": c.userId, 8532 "deviceId": c.deviceId, 8533 }) 8534 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8535} 8536 8537// Do executes the "androidenterprise.installs.list" call. 8538// Exactly one of *InstallsListResponse or error will be non-nil. Any 8539// non-2xx status code is an error. Response headers are in either 8540// *InstallsListResponse.ServerResponse.Header or (if a response was 8541// returned at all) in error.(*googleapi.Error).Header. Use 8542// googleapi.IsNotModified to check whether the returned error was 8543// because http.StatusNotModified was returned. 8544func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) { 8545 gensupport.SetOptions(c.urlParams_, opts...) 8546 res, err := c.doRequest("json") 8547 if res != nil && res.StatusCode == http.StatusNotModified { 8548 if res.Body != nil { 8549 res.Body.Close() 8550 } 8551 return nil, &googleapi.Error{ 8552 Code: res.StatusCode, 8553 Header: res.Header, 8554 } 8555 } 8556 if err != nil { 8557 return nil, err 8558 } 8559 defer googleapi.CloseBody(res) 8560 if err := googleapi.CheckResponse(res); err != nil { 8561 return nil, err 8562 } 8563 ret := &InstallsListResponse{ 8564 ServerResponse: googleapi.ServerResponse{ 8565 Header: res.Header, 8566 HTTPStatusCode: res.StatusCode, 8567 }, 8568 } 8569 target := &ret 8570 if err := gensupport.DecodeResponse(target, res); err != nil { 8571 return nil, err 8572 } 8573 return ret, nil 8574 // { 8575 // "description": "Retrieves the details of all apps installed on the specified device.", 8576 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", 8577 // "httpMethod": "GET", 8578 // "id": "androidenterprise.installs.list", 8579 // "parameterOrder": [ 8580 // "enterpriseId", 8581 // "userId", 8582 // "deviceId" 8583 // ], 8584 // "parameters": { 8585 // "deviceId": { 8586 // "description": "The Android ID of the device.", 8587 // "location": "path", 8588 // "required": true, 8589 // "type": "string" 8590 // }, 8591 // "enterpriseId": { 8592 // "description": "The ID of the enterprise.", 8593 // "location": "path", 8594 // "required": true, 8595 // "type": "string" 8596 // }, 8597 // "userId": { 8598 // "description": "The ID of the user.", 8599 // "location": "path", 8600 // "required": true, 8601 // "type": "string" 8602 // } 8603 // }, 8604 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", 8605 // "response": { 8606 // "$ref": "InstallsListResponse" 8607 // }, 8608 // "scopes": [ 8609 // "https://www.googleapis.com/auth/androidenterprise" 8610 // ] 8611 // } 8612 8613} 8614 8615// method id "androidenterprise.installs.update": 8616 8617type InstallsUpdateCall struct { 8618 s *Service 8619 enterpriseId string 8620 userId string 8621 deviceId string 8622 installId string 8623 install *Install 8624 urlParams_ gensupport.URLParams 8625 ctx_ context.Context 8626 header_ http.Header 8627} 8628 8629// Update: Requests to install the latest version of an app to a device. 8630// If the app is already installed, then it is updated to the latest 8631// version if necessary. 8632// 8633// - deviceId: The Android ID of the device. 8634// - enterpriseId: The ID of the enterprise. 8635// - installId: The ID of the product represented by the install, e.g. 8636// "app:com.google.android.gm". 8637// - userId: The ID of the user. 8638func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall { 8639 c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8640 c.enterpriseId = enterpriseId 8641 c.userId = userId 8642 c.deviceId = deviceId 8643 c.installId = installId 8644 c.install = install 8645 return c 8646} 8647 8648// Fields allows partial responses to be retrieved. See 8649// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8650// for more information. 8651func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall { 8652 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8653 return c 8654} 8655 8656// Context sets the context to be used in this call's Do method. Any 8657// pending HTTP request will be aborted if the provided context is 8658// canceled. 8659func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall { 8660 c.ctx_ = ctx 8661 return c 8662} 8663 8664// Header returns an http.Header that can be modified by the caller to 8665// add HTTP headers to the request. 8666func (c *InstallsUpdateCall) Header() http.Header { 8667 if c.header_ == nil { 8668 c.header_ = make(http.Header) 8669 } 8670 return c.header_ 8671} 8672 8673func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) { 8674 reqHeaders := make(http.Header) 8675 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8676 for k, v := range c.header_ { 8677 reqHeaders[k] = v 8678 } 8679 reqHeaders.Set("User-Agent", c.s.userAgent()) 8680 var body io.Reader = nil 8681 body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) 8682 if err != nil { 8683 return nil, err 8684 } 8685 reqHeaders.Set("Content-Type", "application/json") 8686 c.urlParams_.Set("alt", alt) 8687 c.urlParams_.Set("prettyPrint", "false") 8688 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8689 urls += "?" + c.urlParams_.Encode() 8690 req, err := http.NewRequest("PUT", urls, body) 8691 if err != nil { 8692 return nil, err 8693 } 8694 req.Header = reqHeaders 8695 googleapi.Expand(req.URL, map[string]string{ 8696 "enterpriseId": c.enterpriseId, 8697 "userId": c.userId, 8698 "deviceId": c.deviceId, 8699 "installId": c.installId, 8700 }) 8701 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8702} 8703 8704// Do executes the "androidenterprise.installs.update" call. 8705// Exactly one of *Install or error will be non-nil. Any non-2xx status 8706// code is an error. Response headers are in either 8707// *Install.ServerResponse.Header or (if a response was returned at all) 8708// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8709// check whether the returned error was because http.StatusNotModified 8710// was returned. 8711func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8712 gensupport.SetOptions(c.urlParams_, opts...) 8713 res, err := c.doRequest("json") 8714 if res != nil && res.StatusCode == http.StatusNotModified { 8715 if res.Body != nil { 8716 res.Body.Close() 8717 } 8718 return nil, &googleapi.Error{ 8719 Code: res.StatusCode, 8720 Header: res.Header, 8721 } 8722 } 8723 if err != nil { 8724 return nil, err 8725 } 8726 defer googleapi.CloseBody(res) 8727 if err := googleapi.CheckResponse(res); err != nil { 8728 return nil, err 8729 } 8730 ret := &Install{ 8731 ServerResponse: googleapi.ServerResponse{ 8732 Header: res.Header, 8733 HTTPStatusCode: res.StatusCode, 8734 }, 8735 } 8736 target := &ret 8737 if err := gensupport.DecodeResponse(target, res); err != nil { 8738 return nil, err 8739 } 8740 return ret, nil 8741 // { 8742 // "description": "Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary.", 8743 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8744 // "httpMethod": "PUT", 8745 // "id": "androidenterprise.installs.update", 8746 // "parameterOrder": [ 8747 // "enterpriseId", 8748 // "userId", 8749 // "deviceId", 8750 // "installId" 8751 // ], 8752 // "parameters": { 8753 // "deviceId": { 8754 // "description": "The Android ID of the device.", 8755 // "location": "path", 8756 // "required": true, 8757 // "type": "string" 8758 // }, 8759 // "enterpriseId": { 8760 // "description": "The ID of the enterprise.", 8761 // "location": "path", 8762 // "required": true, 8763 // "type": "string" 8764 // }, 8765 // "installId": { 8766 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8767 // "location": "path", 8768 // "required": true, 8769 // "type": "string" 8770 // }, 8771 // "userId": { 8772 // "description": "The ID of the user.", 8773 // "location": "path", 8774 // "required": true, 8775 // "type": "string" 8776 // } 8777 // }, 8778 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8779 // "request": { 8780 // "$ref": "Install" 8781 // }, 8782 // "response": { 8783 // "$ref": "Install" 8784 // }, 8785 // "scopes": [ 8786 // "https://www.googleapis.com/auth/androidenterprise" 8787 // ] 8788 // } 8789 8790} 8791 8792// method id "androidenterprise.managedconfigurationsfordevice.delete": 8793 8794type ManagedconfigurationsfordeviceDeleteCall struct { 8795 s *Service 8796 enterpriseId string 8797 userId string 8798 deviceId string 8799 managedConfigurationForDeviceId string 8800 urlParams_ gensupport.URLParams 8801 ctx_ context.Context 8802 header_ http.Header 8803} 8804 8805// Delete: Removes a per-device managed configuration for an app for the 8806// specified device. 8807// 8808// - deviceId: The Android ID of the device. 8809// - enterpriseId: The ID of the enterprise. 8810// - managedConfigurationForDeviceId: The ID of the managed 8811// configuration (a product ID), e.g. "app:com.google.android.gm". 8812// - userId: The ID of the user. 8813func (r *ManagedconfigurationsfordeviceService) Delete(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceDeleteCall { 8814 c := &ManagedconfigurationsfordeviceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8815 c.enterpriseId = enterpriseId 8816 c.userId = userId 8817 c.deviceId = deviceId 8818 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8819 return c 8820} 8821 8822// Fields allows partial responses to be retrieved. See 8823// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8824// for more information. 8825func (c *ManagedconfigurationsfordeviceDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceDeleteCall { 8826 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8827 return c 8828} 8829 8830// Context sets the context to be used in this call's Do method. Any 8831// pending HTTP request will be aborted if the provided context is 8832// canceled. 8833func (c *ManagedconfigurationsfordeviceDeleteCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceDeleteCall { 8834 c.ctx_ = ctx 8835 return c 8836} 8837 8838// Header returns an http.Header that can be modified by the caller to 8839// add HTTP headers to the request. 8840func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header { 8841 if c.header_ == nil { 8842 c.header_ = make(http.Header) 8843 } 8844 return c.header_ 8845} 8846 8847func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) { 8848 reqHeaders := make(http.Header) 8849 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8850 for k, v := range c.header_ { 8851 reqHeaders[k] = v 8852 } 8853 reqHeaders.Set("User-Agent", c.s.userAgent()) 8854 var body io.Reader = nil 8855 c.urlParams_.Set("alt", alt) 8856 c.urlParams_.Set("prettyPrint", "false") 8857 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 8858 urls += "?" + c.urlParams_.Encode() 8859 req, err := http.NewRequest("DELETE", urls, body) 8860 if err != nil { 8861 return nil, err 8862 } 8863 req.Header = reqHeaders 8864 googleapi.Expand(req.URL, map[string]string{ 8865 "enterpriseId": c.enterpriseId, 8866 "userId": c.userId, 8867 "deviceId": c.deviceId, 8868 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 8869 }) 8870 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8871} 8872 8873// Do executes the "androidenterprise.managedconfigurationsfordevice.delete" call. 8874func (c *ManagedconfigurationsfordeviceDeleteCall) Do(opts ...googleapi.CallOption) error { 8875 gensupport.SetOptions(c.urlParams_, opts...) 8876 res, err := c.doRequest("json") 8877 if err != nil { 8878 return err 8879 } 8880 defer googleapi.CloseBody(res) 8881 if err := googleapi.CheckResponse(res); err != nil { 8882 return err 8883 } 8884 return nil 8885 // { 8886 // "description": "Removes a per-device managed configuration for an app for the specified device.", 8887 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8888 // "httpMethod": "DELETE", 8889 // "id": "androidenterprise.managedconfigurationsfordevice.delete", 8890 // "parameterOrder": [ 8891 // "enterpriseId", 8892 // "userId", 8893 // "deviceId", 8894 // "managedConfigurationForDeviceId" 8895 // ], 8896 // "parameters": { 8897 // "deviceId": { 8898 // "description": "The Android ID of the device.", 8899 // "location": "path", 8900 // "required": true, 8901 // "type": "string" 8902 // }, 8903 // "enterpriseId": { 8904 // "description": "The ID of the enterprise.", 8905 // "location": "path", 8906 // "required": true, 8907 // "type": "string" 8908 // }, 8909 // "managedConfigurationForDeviceId": { 8910 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 8911 // "location": "path", 8912 // "required": true, 8913 // "type": "string" 8914 // }, 8915 // "userId": { 8916 // "description": "The ID of the user.", 8917 // "location": "path", 8918 // "required": true, 8919 // "type": "string" 8920 // } 8921 // }, 8922 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8923 // "scopes": [ 8924 // "https://www.googleapis.com/auth/androidenterprise" 8925 // ] 8926 // } 8927 8928} 8929 8930// method id "androidenterprise.managedconfigurationsfordevice.get": 8931 8932type ManagedconfigurationsfordeviceGetCall struct { 8933 s *Service 8934 enterpriseId string 8935 userId string 8936 deviceId string 8937 managedConfigurationForDeviceId string 8938 urlParams_ gensupport.URLParams 8939 ifNoneMatch_ string 8940 ctx_ context.Context 8941 header_ http.Header 8942} 8943 8944// Get: Retrieves details of a per-device managed configuration. 8945// 8946// - deviceId: The Android ID of the device. 8947// - enterpriseId: The ID of the enterprise. 8948// - managedConfigurationForDeviceId: The ID of the managed 8949// configuration (a product ID), e.g. "app:com.google.android.gm". 8950// - userId: The ID of the user. 8951func (r *ManagedconfigurationsfordeviceService) Get(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceGetCall { 8952 c := &ManagedconfigurationsfordeviceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8953 c.enterpriseId = enterpriseId 8954 c.userId = userId 8955 c.deviceId = deviceId 8956 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8957 return c 8958} 8959 8960// Fields allows partial responses to be retrieved. See 8961// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8962// for more information. 8963func (c *ManagedconfigurationsfordeviceGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceGetCall { 8964 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8965 return c 8966} 8967 8968// IfNoneMatch sets the optional parameter which makes the operation 8969// fail if the object's ETag matches the given value. This is useful for 8970// getting updates only after the object has changed since the last 8971// request. Use googleapi.IsNotModified to check whether the response 8972// error from Do is the result of In-None-Match. 8973func (c *ManagedconfigurationsfordeviceGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceGetCall { 8974 c.ifNoneMatch_ = entityTag 8975 return c 8976} 8977 8978// Context sets the context to be used in this call's Do method. Any 8979// pending HTTP request will be aborted if the provided context is 8980// canceled. 8981func (c *ManagedconfigurationsfordeviceGetCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceGetCall { 8982 c.ctx_ = ctx 8983 return c 8984} 8985 8986// Header returns an http.Header that can be modified by the caller to 8987// add HTTP headers to the request. 8988func (c *ManagedconfigurationsfordeviceGetCall) Header() http.Header { 8989 if c.header_ == nil { 8990 c.header_ = make(http.Header) 8991 } 8992 return c.header_ 8993} 8994 8995func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Response, error) { 8996 reqHeaders := make(http.Header) 8997 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8998 for k, v := range c.header_ { 8999 reqHeaders[k] = v 9000 } 9001 reqHeaders.Set("User-Agent", c.s.userAgent()) 9002 if c.ifNoneMatch_ != "" { 9003 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9004 } 9005 var body io.Reader = nil 9006 c.urlParams_.Set("alt", alt) 9007 c.urlParams_.Set("prettyPrint", "false") 9008 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 9009 urls += "?" + c.urlParams_.Encode() 9010 req, err := http.NewRequest("GET", urls, body) 9011 if err != nil { 9012 return nil, err 9013 } 9014 req.Header = reqHeaders 9015 googleapi.Expand(req.URL, map[string]string{ 9016 "enterpriseId": c.enterpriseId, 9017 "userId": c.userId, 9018 "deviceId": c.deviceId, 9019 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 9020 }) 9021 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9022} 9023 9024// Do executes the "androidenterprise.managedconfigurationsfordevice.get" call. 9025// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9026// non-2xx status code is an error. Response headers are in either 9027// *ManagedConfiguration.ServerResponse.Header or (if a response was 9028// returned at all) in error.(*googleapi.Error).Header. Use 9029// googleapi.IsNotModified to check whether the returned error was 9030// because http.StatusNotModified was returned. 9031func (c *ManagedconfigurationsfordeviceGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9032 gensupport.SetOptions(c.urlParams_, opts...) 9033 res, err := c.doRequest("json") 9034 if res != nil && res.StatusCode == http.StatusNotModified { 9035 if res.Body != nil { 9036 res.Body.Close() 9037 } 9038 return nil, &googleapi.Error{ 9039 Code: res.StatusCode, 9040 Header: res.Header, 9041 } 9042 } 9043 if err != nil { 9044 return nil, err 9045 } 9046 defer googleapi.CloseBody(res) 9047 if err := googleapi.CheckResponse(res); err != nil { 9048 return nil, err 9049 } 9050 ret := &ManagedConfiguration{ 9051 ServerResponse: googleapi.ServerResponse{ 9052 Header: res.Header, 9053 HTTPStatusCode: res.StatusCode, 9054 }, 9055 } 9056 target := &ret 9057 if err := gensupport.DecodeResponse(target, res); err != nil { 9058 return nil, err 9059 } 9060 return ret, nil 9061 // { 9062 // "description": "Retrieves details of a per-device managed configuration.", 9063 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9064 // "httpMethod": "GET", 9065 // "id": "androidenterprise.managedconfigurationsfordevice.get", 9066 // "parameterOrder": [ 9067 // "enterpriseId", 9068 // "userId", 9069 // "deviceId", 9070 // "managedConfigurationForDeviceId" 9071 // ], 9072 // "parameters": { 9073 // "deviceId": { 9074 // "description": "The Android ID of the device.", 9075 // "location": "path", 9076 // "required": true, 9077 // "type": "string" 9078 // }, 9079 // "enterpriseId": { 9080 // "description": "The ID of the enterprise.", 9081 // "location": "path", 9082 // "required": true, 9083 // "type": "string" 9084 // }, 9085 // "managedConfigurationForDeviceId": { 9086 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9087 // "location": "path", 9088 // "required": true, 9089 // "type": "string" 9090 // }, 9091 // "userId": { 9092 // "description": "The ID of the user.", 9093 // "location": "path", 9094 // "required": true, 9095 // "type": "string" 9096 // } 9097 // }, 9098 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9099 // "response": { 9100 // "$ref": "ManagedConfiguration" 9101 // }, 9102 // "scopes": [ 9103 // "https://www.googleapis.com/auth/androidenterprise" 9104 // ] 9105 // } 9106 9107} 9108 9109// method id "androidenterprise.managedconfigurationsfordevice.list": 9110 9111type ManagedconfigurationsfordeviceListCall struct { 9112 s *Service 9113 enterpriseId string 9114 userId string 9115 deviceId string 9116 urlParams_ gensupport.URLParams 9117 ifNoneMatch_ string 9118 ctx_ context.Context 9119 header_ http.Header 9120} 9121 9122// List: Lists all the per-device managed configurations for the 9123// specified device. Only the ID is set. 9124// 9125// - deviceId: The Android ID of the device. 9126// - enterpriseId: The ID of the enterprise. 9127// - userId: The ID of the user. 9128func (r *ManagedconfigurationsfordeviceService) List(enterpriseId string, userId string, deviceId string) *ManagedconfigurationsfordeviceListCall { 9129 c := &ManagedconfigurationsfordeviceListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9130 c.enterpriseId = enterpriseId 9131 c.userId = userId 9132 c.deviceId = deviceId 9133 return c 9134} 9135 9136// Fields allows partial responses to be retrieved. See 9137// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9138// for more information. 9139func (c *ManagedconfigurationsfordeviceListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceListCall { 9140 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9141 return c 9142} 9143 9144// IfNoneMatch sets the optional parameter which makes the operation 9145// fail if the object's ETag matches the given value. This is useful for 9146// getting updates only after the object has changed since the last 9147// request. Use googleapi.IsNotModified to check whether the response 9148// error from Do is the result of In-None-Match. 9149func (c *ManagedconfigurationsfordeviceListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceListCall { 9150 c.ifNoneMatch_ = entityTag 9151 return c 9152} 9153 9154// Context sets the context to be used in this call's Do method. Any 9155// pending HTTP request will be aborted if the provided context is 9156// canceled. 9157func (c *ManagedconfigurationsfordeviceListCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceListCall { 9158 c.ctx_ = ctx 9159 return c 9160} 9161 9162// Header returns an http.Header that can be modified by the caller to 9163// add HTTP headers to the request. 9164func (c *ManagedconfigurationsfordeviceListCall) Header() http.Header { 9165 if c.header_ == nil { 9166 c.header_ = make(http.Header) 9167 } 9168 return c.header_ 9169} 9170 9171func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Response, error) { 9172 reqHeaders := make(http.Header) 9173 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9174 for k, v := range c.header_ { 9175 reqHeaders[k] = v 9176 } 9177 reqHeaders.Set("User-Agent", c.s.userAgent()) 9178 if c.ifNoneMatch_ != "" { 9179 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9180 } 9181 var body io.Reader = nil 9182 c.urlParams_.Set("alt", alt) 9183 c.urlParams_.Set("prettyPrint", "false") 9184 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice") 9185 urls += "?" + c.urlParams_.Encode() 9186 req, err := http.NewRequest("GET", urls, body) 9187 if err != nil { 9188 return nil, err 9189 } 9190 req.Header = reqHeaders 9191 googleapi.Expand(req.URL, map[string]string{ 9192 "enterpriseId": c.enterpriseId, 9193 "userId": c.userId, 9194 "deviceId": c.deviceId, 9195 }) 9196 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9197} 9198 9199// Do executes the "androidenterprise.managedconfigurationsfordevice.list" call. 9200// Exactly one of *ManagedConfigurationsForDeviceListResponse or error 9201// will be non-nil. Any non-2xx status code is an error. Response 9202// headers are in either 9203// *ManagedConfigurationsForDeviceListResponse.ServerResponse.Header or 9204// (if a response was returned at all) in 9205// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9206// whether the returned error was because http.StatusNotModified was 9207// returned. 9208func (c *ManagedconfigurationsfordeviceListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForDeviceListResponse, error) { 9209 gensupport.SetOptions(c.urlParams_, opts...) 9210 res, err := c.doRequest("json") 9211 if res != nil && res.StatusCode == http.StatusNotModified { 9212 if res.Body != nil { 9213 res.Body.Close() 9214 } 9215 return nil, &googleapi.Error{ 9216 Code: res.StatusCode, 9217 Header: res.Header, 9218 } 9219 } 9220 if err != nil { 9221 return nil, err 9222 } 9223 defer googleapi.CloseBody(res) 9224 if err := googleapi.CheckResponse(res); err != nil { 9225 return nil, err 9226 } 9227 ret := &ManagedConfigurationsForDeviceListResponse{ 9228 ServerResponse: googleapi.ServerResponse{ 9229 Header: res.Header, 9230 HTTPStatusCode: res.StatusCode, 9231 }, 9232 } 9233 target := &ret 9234 if err := gensupport.DecodeResponse(target, res); err != nil { 9235 return nil, err 9236 } 9237 return ret, nil 9238 // { 9239 // "description": "Lists all the per-device managed configurations for the specified device. Only the ID is set.", 9240 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice", 9241 // "httpMethod": "GET", 9242 // "id": "androidenterprise.managedconfigurationsfordevice.list", 9243 // "parameterOrder": [ 9244 // "enterpriseId", 9245 // "userId", 9246 // "deviceId" 9247 // ], 9248 // "parameters": { 9249 // "deviceId": { 9250 // "description": "The Android ID of the device.", 9251 // "location": "path", 9252 // "required": true, 9253 // "type": "string" 9254 // }, 9255 // "enterpriseId": { 9256 // "description": "The ID of the enterprise.", 9257 // "location": "path", 9258 // "required": true, 9259 // "type": "string" 9260 // }, 9261 // "userId": { 9262 // "description": "The ID of the user.", 9263 // "location": "path", 9264 // "required": true, 9265 // "type": "string" 9266 // } 9267 // }, 9268 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice", 9269 // "response": { 9270 // "$ref": "ManagedConfigurationsForDeviceListResponse" 9271 // }, 9272 // "scopes": [ 9273 // "https://www.googleapis.com/auth/androidenterprise" 9274 // ] 9275 // } 9276 9277} 9278 9279// method id "androidenterprise.managedconfigurationsfordevice.update": 9280 9281type ManagedconfigurationsfordeviceUpdateCall struct { 9282 s *Service 9283 enterpriseId string 9284 userId string 9285 deviceId string 9286 managedConfigurationForDeviceId string 9287 managedconfiguration *ManagedConfiguration 9288 urlParams_ gensupport.URLParams 9289 ctx_ context.Context 9290 header_ http.Header 9291} 9292 9293// Update: Adds or updates a per-device managed configuration for an app 9294// for the specified device. 9295// 9296// - deviceId: The Android ID of the device. 9297// - enterpriseId: The ID of the enterprise. 9298// - managedConfigurationForDeviceId: The ID of the managed 9299// configuration (a product ID), e.g. "app:com.google.android.gm". 9300// - userId: The ID of the user. 9301func (r *ManagedconfigurationsfordeviceService) Update(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordeviceUpdateCall { 9302 c := &ManagedconfigurationsfordeviceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9303 c.enterpriseId = enterpriseId 9304 c.userId = userId 9305 c.deviceId = deviceId 9306 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 9307 c.managedconfiguration = managedconfiguration 9308 return c 9309} 9310 9311// Fields allows partial responses to be retrieved. See 9312// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9313// for more information. 9314func (c *ManagedconfigurationsfordeviceUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceUpdateCall { 9315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9316 return c 9317} 9318 9319// Context sets the context to be used in this call's Do method. Any 9320// pending HTTP request will be aborted if the provided context is 9321// canceled. 9322func (c *ManagedconfigurationsfordeviceUpdateCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceUpdateCall { 9323 c.ctx_ = ctx 9324 return c 9325} 9326 9327// Header returns an http.Header that can be modified by the caller to 9328// add HTTP headers to the request. 9329func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header { 9330 if c.header_ == nil { 9331 c.header_ = make(http.Header) 9332 } 9333 return c.header_ 9334} 9335 9336func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) { 9337 reqHeaders := make(http.Header) 9338 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9339 for k, v := range c.header_ { 9340 reqHeaders[k] = v 9341 } 9342 reqHeaders.Set("User-Agent", c.s.userAgent()) 9343 var body io.Reader = nil 9344 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9345 if err != nil { 9346 return nil, err 9347 } 9348 reqHeaders.Set("Content-Type", "application/json") 9349 c.urlParams_.Set("alt", alt) 9350 c.urlParams_.Set("prettyPrint", "false") 9351 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 9352 urls += "?" + c.urlParams_.Encode() 9353 req, err := http.NewRequest("PUT", urls, body) 9354 if err != nil { 9355 return nil, err 9356 } 9357 req.Header = reqHeaders 9358 googleapi.Expand(req.URL, map[string]string{ 9359 "enterpriseId": c.enterpriseId, 9360 "userId": c.userId, 9361 "deviceId": c.deviceId, 9362 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 9363 }) 9364 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9365} 9366 9367// Do executes the "androidenterprise.managedconfigurationsfordevice.update" call. 9368// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9369// non-2xx status code is an error. Response headers are in either 9370// *ManagedConfiguration.ServerResponse.Header or (if a response was 9371// returned at all) in error.(*googleapi.Error).Header. Use 9372// googleapi.IsNotModified to check whether the returned error was 9373// because http.StatusNotModified was returned. 9374func (c *ManagedconfigurationsfordeviceUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9375 gensupport.SetOptions(c.urlParams_, opts...) 9376 res, err := c.doRequest("json") 9377 if res != nil && res.StatusCode == http.StatusNotModified { 9378 if res.Body != nil { 9379 res.Body.Close() 9380 } 9381 return nil, &googleapi.Error{ 9382 Code: res.StatusCode, 9383 Header: res.Header, 9384 } 9385 } 9386 if err != nil { 9387 return nil, err 9388 } 9389 defer googleapi.CloseBody(res) 9390 if err := googleapi.CheckResponse(res); err != nil { 9391 return nil, err 9392 } 9393 ret := &ManagedConfiguration{ 9394 ServerResponse: googleapi.ServerResponse{ 9395 Header: res.Header, 9396 HTTPStatusCode: res.StatusCode, 9397 }, 9398 } 9399 target := &ret 9400 if err := gensupport.DecodeResponse(target, res); err != nil { 9401 return nil, err 9402 } 9403 return ret, nil 9404 // { 9405 // "description": "Adds or updates a per-device managed configuration for an app for the specified device.", 9406 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9407 // "httpMethod": "PUT", 9408 // "id": "androidenterprise.managedconfigurationsfordevice.update", 9409 // "parameterOrder": [ 9410 // "enterpriseId", 9411 // "userId", 9412 // "deviceId", 9413 // "managedConfigurationForDeviceId" 9414 // ], 9415 // "parameters": { 9416 // "deviceId": { 9417 // "description": "The Android ID of the device.", 9418 // "location": "path", 9419 // "required": true, 9420 // "type": "string" 9421 // }, 9422 // "enterpriseId": { 9423 // "description": "The ID of the enterprise.", 9424 // "location": "path", 9425 // "required": true, 9426 // "type": "string" 9427 // }, 9428 // "managedConfigurationForDeviceId": { 9429 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9430 // "location": "path", 9431 // "required": true, 9432 // "type": "string" 9433 // }, 9434 // "userId": { 9435 // "description": "The ID of the user.", 9436 // "location": "path", 9437 // "required": true, 9438 // "type": "string" 9439 // } 9440 // }, 9441 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9442 // "request": { 9443 // "$ref": "ManagedConfiguration" 9444 // }, 9445 // "response": { 9446 // "$ref": "ManagedConfiguration" 9447 // }, 9448 // "scopes": [ 9449 // "https://www.googleapis.com/auth/androidenterprise" 9450 // ] 9451 // } 9452 9453} 9454 9455// method id "androidenterprise.managedconfigurationsforuser.delete": 9456 9457type ManagedconfigurationsforuserDeleteCall struct { 9458 s *Service 9459 enterpriseId string 9460 userId string 9461 managedConfigurationForUserId string 9462 urlParams_ gensupport.URLParams 9463 ctx_ context.Context 9464 header_ http.Header 9465} 9466 9467// Delete: Removes a per-user managed configuration for an app for the 9468// specified user. 9469// 9470// - enterpriseId: The ID of the enterprise. 9471// - managedConfigurationForUserId: The ID of the managed configuration 9472// (a product ID), e.g. "app:com.google.android.gm". 9473// - userId: The ID of the user. 9474func (r *ManagedconfigurationsforuserService) Delete(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserDeleteCall { 9475 c := &ManagedconfigurationsforuserDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9476 c.enterpriseId = enterpriseId 9477 c.userId = userId 9478 c.managedConfigurationForUserId = managedConfigurationForUserId 9479 return c 9480} 9481 9482// Fields allows partial responses to be retrieved. See 9483// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9484// for more information. 9485func (c *ManagedconfigurationsforuserDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserDeleteCall { 9486 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9487 return c 9488} 9489 9490// Context sets the context to be used in this call's Do method. Any 9491// pending HTTP request will be aborted if the provided context is 9492// canceled. 9493func (c *ManagedconfigurationsforuserDeleteCall) Context(ctx context.Context) *ManagedconfigurationsforuserDeleteCall { 9494 c.ctx_ = ctx 9495 return c 9496} 9497 9498// Header returns an http.Header that can be modified by the caller to 9499// add HTTP headers to the request. 9500func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header { 9501 if c.header_ == nil { 9502 c.header_ = make(http.Header) 9503 } 9504 return c.header_ 9505} 9506 9507func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) { 9508 reqHeaders := make(http.Header) 9509 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9510 for k, v := range c.header_ { 9511 reqHeaders[k] = v 9512 } 9513 reqHeaders.Set("User-Agent", c.s.userAgent()) 9514 var body io.Reader = nil 9515 c.urlParams_.Set("alt", alt) 9516 c.urlParams_.Set("prettyPrint", "false") 9517 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9518 urls += "?" + c.urlParams_.Encode() 9519 req, err := http.NewRequest("DELETE", urls, body) 9520 if err != nil { 9521 return nil, err 9522 } 9523 req.Header = reqHeaders 9524 googleapi.Expand(req.URL, map[string]string{ 9525 "enterpriseId": c.enterpriseId, 9526 "userId": c.userId, 9527 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9528 }) 9529 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9530} 9531 9532// Do executes the "androidenterprise.managedconfigurationsforuser.delete" call. 9533func (c *ManagedconfigurationsforuserDeleteCall) Do(opts ...googleapi.CallOption) error { 9534 gensupport.SetOptions(c.urlParams_, opts...) 9535 res, err := c.doRequest("json") 9536 if err != nil { 9537 return err 9538 } 9539 defer googleapi.CloseBody(res) 9540 if err := googleapi.CheckResponse(res); err != nil { 9541 return err 9542 } 9543 return nil 9544 // { 9545 // "description": "Removes a per-user managed configuration for an app for the specified user.", 9546 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9547 // "httpMethod": "DELETE", 9548 // "id": "androidenterprise.managedconfigurationsforuser.delete", 9549 // "parameterOrder": [ 9550 // "enterpriseId", 9551 // "userId", 9552 // "managedConfigurationForUserId" 9553 // ], 9554 // "parameters": { 9555 // "enterpriseId": { 9556 // "description": "The ID of the enterprise.", 9557 // "location": "path", 9558 // "required": true, 9559 // "type": "string" 9560 // }, 9561 // "managedConfigurationForUserId": { 9562 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9563 // "location": "path", 9564 // "required": true, 9565 // "type": "string" 9566 // }, 9567 // "userId": { 9568 // "description": "The ID of the user.", 9569 // "location": "path", 9570 // "required": true, 9571 // "type": "string" 9572 // } 9573 // }, 9574 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9575 // "scopes": [ 9576 // "https://www.googleapis.com/auth/androidenterprise" 9577 // ] 9578 // } 9579 9580} 9581 9582// method id "androidenterprise.managedconfigurationsforuser.get": 9583 9584type ManagedconfigurationsforuserGetCall struct { 9585 s *Service 9586 enterpriseId string 9587 userId string 9588 managedConfigurationForUserId string 9589 urlParams_ gensupport.URLParams 9590 ifNoneMatch_ string 9591 ctx_ context.Context 9592 header_ http.Header 9593} 9594 9595// Get: Retrieves details of a per-user managed configuration for an app 9596// for the specified user. 9597// 9598// - enterpriseId: The ID of the enterprise. 9599// - managedConfigurationForUserId: The ID of the managed configuration 9600// (a product ID), e.g. "app:com.google.android.gm". 9601// - userId: The ID of the user. 9602func (r *ManagedconfigurationsforuserService) Get(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserGetCall { 9603 c := &ManagedconfigurationsforuserGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9604 c.enterpriseId = enterpriseId 9605 c.userId = userId 9606 c.managedConfigurationForUserId = managedConfigurationForUserId 9607 return c 9608} 9609 9610// Fields allows partial responses to be retrieved. See 9611// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9612// for more information. 9613func (c *ManagedconfigurationsforuserGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserGetCall { 9614 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9615 return c 9616} 9617 9618// IfNoneMatch sets the optional parameter which makes the operation 9619// fail if the object's ETag matches the given value. This is useful for 9620// getting updates only after the object has changed since the last 9621// request. Use googleapi.IsNotModified to check whether the response 9622// error from Do is the result of In-None-Match. 9623func (c *ManagedconfigurationsforuserGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserGetCall { 9624 c.ifNoneMatch_ = entityTag 9625 return c 9626} 9627 9628// Context sets the context to be used in this call's Do method. Any 9629// pending HTTP request will be aborted if the provided context is 9630// canceled. 9631func (c *ManagedconfigurationsforuserGetCall) Context(ctx context.Context) *ManagedconfigurationsforuserGetCall { 9632 c.ctx_ = ctx 9633 return c 9634} 9635 9636// Header returns an http.Header that can be modified by the caller to 9637// add HTTP headers to the request. 9638func (c *ManagedconfigurationsforuserGetCall) Header() http.Header { 9639 if c.header_ == nil { 9640 c.header_ = make(http.Header) 9641 } 9642 return c.header_ 9643} 9644 9645func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Response, error) { 9646 reqHeaders := make(http.Header) 9647 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9648 for k, v := range c.header_ { 9649 reqHeaders[k] = v 9650 } 9651 reqHeaders.Set("User-Agent", c.s.userAgent()) 9652 if c.ifNoneMatch_ != "" { 9653 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9654 } 9655 var body io.Reader = nil 9656 c.urlParams_.Set("alt", alt) 9657 c.urlParams_.Set("prettyPrint", "false") 9658 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9659 urls += "?" + c.urlParams_.Encode() 9660 req, err := http.NewRequest("GET", urls, body) 9661 if err != nil { 9662 return nil, err 9663 } 9664 req.Header = reqHeaders 9665 googleapi.Expand(req.URL, map[string]string{ 9666 "enterpriseId": c.enterpriseId, 9667 "userId": c.userId, 9668 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9669 }) 9670 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9671} 9672 9673// Do executes the "androidenterprise.managedconfigurationsforuser.get" call. 9674// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9675// non-2xx status code is an error. Response headers are in either 9676// *ManagedConfiguration.ServerResponse.Header or (if a response was 9677// returned at all) in error.(*googleapi.Error).Header. Use 9678// googleapi.IsNotModified to check whether the returned error was 9679// because http.StatusNotModified was returned. 9680func (c *ManagedconfigurationsforuserGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9681 gensupport.SetOptions(c.urlParams_, opts...) 9682 res, err := c.doRequest("json") 9683 if res != nil && res.StatusCode == http.StatusNotModified { 9684 if res.Body != nil { 9685 res.Body.Close() 9686 } 9687 return nil, &googleapi.Error{ 9688 Code: res.StatusCode, 9689 Header: res.Header, 9690 } 9691 } 9692 if err != nil { 9693 return nil, err 9694 } 9695 defer googleapi.CloseBody(res) 9696 if err := googleapi.CheckResponse(res); err != nil { 9697 return nil, err 9698 } 9699 ret := &ManagedConfiguration{ 9700 ServerResponse: googleapi.ServerResponse{ 9701 Header: res.Header, 9702 HTTPStatusCode: res.StatusCode, 9703 }, 9704 } 9705 target := &ret 9706 if err := gensupport.DecodeResponse(target, res); err != nil { 9707 return nil, err 9708 } 9709 return ret, nil 9710 // { 9711 // "description": "Retrieves details of a per-user managed configuration for an app for the specified user.", 9712 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9713 // "httpMethod": "GET", 9714 // "id": "androidenterprise.managedconfigurationsforuser.get", 9715 // "parameterOrder": [ 9716 // "enterpriseId", 9717 // "userId", 9718 // "managedConfigurationForUserId" 9719 // ], 9720 // "parameters": { 9721 // "enterpriseId": { 9722 // "description": "The ID of the enterprise.", 9723 // "location": "path", 9724 // "required": true, 9725 // "type": "string" 9726 // }, 9727 // "managedConfigurationForUserId": { 9728 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9729 // "location": "path", 9730 // "required": true, 9731 // "type": "string" 9732 // }, 9733 // "userId": { 9734 // "description": "The ID of the user.", 9735 // "location": "path", 9736 // "required": true, 9737 // "type": "string" 9738 // } 9739 // }, 9740 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9741 // "response": { 9742 // "$ref": "ManagedConfiguration" 9743 // }, 9744 // "scopes": [ 9745 // "https://www.googleapis.com/auth/androidenterprise" 9746 // ] 9747 // } 9748 9749} 9750 9751// method id "androidenterprise.managedconfigurationsforuser.list": 9752 9753type ManagedconfigurationsforuserListCall struct { 9754 s *Service 9755 enterpriseId string 9756 userId string 9757 urlParams_ gensupport.URLParams 9758 ifNoneMatch_ string 9759 ctx_ context.Context 9760 header_ http.Header 9761} 9762 9763// List: Lists all the per-user managed configurations for the specified 9764// user. Only the ID is set. 9765// 9766// - enterpriseId: The ID of the enterprise. 9767// - userId: The ID of the user. 9768func (r *ManagedconfigurationsforuserService) List(enterpriseId string, userId string) *ManagedconfigurationsforuserListCall { 9769 c := &ManagedconfigurationsforuserListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9770 c.enterpriseId = enterpriseId 9771 c.userId = userId 9772 return c 9773} 9774 9775// Fields allows partial responses to be retrieved. See 9776// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9777// for more information. 9778func (c *ManagedconfigurationsforuserListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserListCall { 9779 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9780 return c 9781} 9782 9783// IfNoneMatch sets the optional parameter which makes the operation 9784// fail if the object's ETag matches the given value. This is useful for 9785// getting updates only after the object has changed since the last 9786// request. Use googleapi.IsNotModified to check whether the response 9787// error from Do is the result of In-None-Match. 9788func (c *ManagedconfigurationsforuserListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserListCall { 9789 c.ifNoneMatch_ = entityTag 9790 return c 9791} 9792 9793// Context sets the context to be used in this call's Do method. Any 9794// pending HTTP request will be aborted if the provided context is 9795// canceled. 9796func (c *ManagedconfigurationsforuserListCall) Context(ctx context.Context) *ManagedconfigurationsforuserListCall { 9797 c.ctx_ = ctx 9798 return c 9799} 9800 9801// Header returns an http.Header that can be modified by the caller to 9802// add HTTP headers to the request. 9803func (c *ManagedconfigurationsforuserListCall) Header() http.Header { 9804 if c.header_ == nil { 9805 c.header_ = make(http.Header) 9806 } 9807 return c.header_ 9808} 9809 9810func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Response, error) { 9811 reqHeaders := make(http.Header) 9812 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9813 for k, v := range c.header_ { 9814 reqHeaders[k] = v 9815 } 9816 reqHeaders.Set("User-Agent", c.s.userAgent()) 9817 if c.ifNoneMatch_ != "" { 9818 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9819 } 9820 var body io.Reader = nil 9821 c.urlParams_.Set("alt", alt) 9822 c.urlParams_.Set("prettyPrint", "false") 9823 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser") 9824 urls += "?" + c.urlParams_.Encode() 9825 req, err := http.NewRequest("GET", urls, body) 9826 if err != nil { 9827 return nil, err 9828 } 9829 req.Header = reqHeaders 9830 googleapi.Expand(req.URL, map[string]string{ 9831 "enterpriseId": c.enterpriseId, 9832 "userId": c.userId, 9833 }) 9834 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9835} 9836 9837// Do executes the "androidenterprise.managedconfigurationsforuser.list" call. 9838// Exactly one of *ManagedConfigurationsForUserListResponse or error 9839// will be non-nil. Any non-2xx status code is an error. Response 9840// headers are in either 9841// *ManagedConfigurationsForUserListResponse.ServerResponse.Header or 9842// (if a response was returned at all) in 9843// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9844// whether the returned error was because http.StatusNotModified was 9845// returned. 9846func (c *ManagedconfigurationsforuserListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForUserListResponse, error) { 9847 gensupport.SetOptions(c.urlParams_, opts...) 9848 res, err := c.doRequest("json") 9849 if res != nil && res.StatusCode == http.StatusNotModified { 9850 if res.Body != nil { 9851 res.Body.Close() 9852 } 9853 return nil, &googleapi.Error{ 9854 Code: res.StatusCode, 9855 Header: res.Header, 9856 } 9857 } 9858 if err != nil { 9859 return nil, err 9860 } 9861 defer googleapi.CloseBody(res) 9862 if err := googleapi.CheckResponse(res); err != nil { 9863 return nil, err 9864 } 9865 ret := &ManagedConfigurationsForUserListResponse{ 9866 ServerResponse: googleapi.ServerResponse{ 9867 Header: res.Header, 9868 HTTPStatusCode: res.StatusCode, 9869 }, 9870 } 9871 target := &ret 9872 if err := gensupport.DecodeResponse(target, res); err != nil { 9873 return nil, err 9874 } 9875 return ret, nil 9876 // { 9877 // "description": "Lists all the per-user managed configurations for the specified user. Only the ID is set.", 9878 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser", 9879 // "httpMethod": "GET", 9880 // "id": "androidenterprise.managedconfigurationsforuser.list", 9881 // "parameterOrder": [ 9882 // "enterpriseId", 9883 // "userId" 9884 // ], 9885 // "parameters": { 9886 // "enterpriseId": { 9887 // "description": "The ID of the enterprise.", 9888 // "location": "path", 9889 // "required": true, 9890 // "type": "string" 9891 // }, 9892 // "userId": { 9893 // "description": "The ID of the user.", 9894 // "location": "path", 9895 // "required": true, 9896 // "type": "string" 9897 // } 9898 // }, 9899 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser", 9900 // "response": { 9901 // "$ref": "ManagedConfigurationsForUserListResponse" 9902 // }, 9903 // "scopes": [ 9904 // "https://www.googleapis.com/auth/androidenterprise" 9905 // ] 9906 // } 9907 9908} 9909 9910// method id "androidenterprise.managedconfigurationsforuser.update": 9911 9912type ManagedconfigurationsforuserUpdateCall struct { 9913 s *Service 9914 enterpriseId string 9915 userId string 9916 managedConfigurationForUserId string 9917 managedconfiguration *ManagedConfiguration 9918 urlParams_ gensupport.URLParams 9919 ctx_ context.Context 9920 header_ http.Header 9921} 9922 9923// Update: Adds or updates the managed configuration settings for an app 9924// for the specified user. If you support the Managed configurations 9925// iframe, you can apply managed configurations to a user by specifying 9926// an mcmId and its associated configuration variables (if any) in the 9927// request. Alternatively, all EMMs can apply managed configurations by 9928// passing a list of managed properties. 9929// 9930// - enterpriseId: The ID of the enterprise. 9931// - managedConfigurationForUserId: The ID of the managed configuration 9932// (a product ID), e.g. "app:com.google.android.gm". 9933// - userId: The ID of the user. 9934func (r *ManagedconfigurationsforuserService) Update(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserUpdateCall { 9935 c := &ManagedconfigurationsforuserUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9936 c.enterpriseId = enterpriseId 9937 c.userId = userId 9938 c.managedConfigurationForUserId = managedConfigurationForUserId 9939 c.managedconfiguration = managedconfiguration 9940 return c 9941} 9942 9943// Fields allows partial responses to be retrieved. See 9944// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9945// for more information. 9946func (c *ManagedconfigurationsforuserUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserUpdateCall { 9947 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9948 return c 9949} 9950 9951// Context sets the context to be used in this call's Do method. Any 9952// pending HTTP request will be aborted if the provided context is 9953// canceled. 9954func (c *ManagedconfigurationsforuserUpdateCall) Context(ctx context.Context) *ManagedconfigurationsforuserUpdateCall { 9955 c.ctx_ = ctx 9956 return c 9957} 9958 9959// Header returns an http.Header that can be modified by the caller to 9960// add HTTP headers to the request. 9961func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header { 9962 if c.header_ == nil { 9963 c.header_ = make(http.Header) 9964 } 9965 return c.header_ 9966} 9967 9968func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) { 9969 reqHeaders := make(http.Header) 9970 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9971 for k, v := range c.header_ { 9972 reqHeaders[k] = v 9973 } 9974 reqHeaders.Set("User-Agent", c.s.userAgent()) 9975 var body io.Reader = nil 9976 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9977 if err != nil { 9978 return nil, err 9979 } 9980 reqHeaders.Set("Content-Type", "application/json") 9981 c.urlParams_.Set("alt", alt) 9982 c.urlParams_.Set("prettyPrint", "false") 9983 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9984 urls += "?" + c.urlParams_.Encode() 9985 req, err := http.NewRequest("PUT", urls, body) 9986 if err != nil { 9987 return nil, err 9988 } 9989 req.Header = reqHeaders 9990 googleapi.Expand(req.URL, map[string]string{ 9991 "enterpriseId": c.enterpriseId, 9992 "userId": c.userId, 9993 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9994 }) 9995 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9996} 9997 9998// Do executes the "androidenterprise.managedconfigurationsforuser.update" call. 9999// Exactly one of *ManagedConfiguration or error will be non-nil. Any 10000// non-2xx status code is an error. Response headers are in either 10001// *ManagedConfiguration.ServerResponse.Header or (if a response was 10002// returned at all) in error.(*googleapi.Error).Header. Use 10003// googleapi.IsNotModified to check whether the returned error was 10004// because http.StatusNotModified was returned. 10005func (c *ManagedconfigurationsforuserUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 10006 gensupport.SetOptions(c.urlParams_, opts...) 10007 res, err := c.doRequest("json") 10008 if res != nil && res.StatusCode == http.StatusNotModified { 10009 if res.Body != nil { 10010 res.Body.Close() 10011 } 10012 return nil, &googleapi.Error{ 10013 Code: res.StatusCode, 10014 Header: res.Header, 10015 } 10016 } 10017 if err != nil { 10018 return nil, err 10019 } 10020 defer googleapi.CloseBody(res) 10021 if err := googleapi.CheckResponse(res); err != nil { 10022 return nil, err 10023 } 10024 ret := &ManagedConfiguration{ 10025 ServerResponse: googleapi.ServerResponse{ 10026 Header: res.Header, 10027 HTTPStatusCode: res.StatusCode, 10028 }, 10029 } 10030 target := &ret 10031 if err := gensupport.DecodeResponse(target, res); err != nil { 10032 return nil, err 10033 } 10034 return ret, nil 10035 // { 10036 // "description": "Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties.", 10037 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 10038 // "httpMethod": "PUT", 10039 // "id": "androidenterprise.managedconfigurationsforuser.update", 10040 // "parameterOrder": [ 10041 // "enterpriseId", 10042 // "userId", 10043 // "managedConfigurationForUserId" 10044 // ], 10045 // "parameters": { 10046 // "enterpriseId": { 10047 // "description": "The ID of the enterprise.", 10048 // "location": "path", 10049 // "required": true, 10050 // "type": "string" 10051 // }, 10052 // "managedConfigurationForUserId": { 10053 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 10054 // "location": "path", 10055 // "required": true, 10056 // "type": "string" 10057 // }, 10058 // "userId": { 10059 // "description": "The ID of the user.", 10060 // "location": "path", 10061 // "required": true, 10062 // "type": "string" 10063 // } 10064 // }, 10065 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 10066 // "request": { 10067 // "$ref": "ManagedConfiguration" 10068 // }, 10069 // "response": { 10070 // "$ref": "ManagedConfiguration" 10071 // }, 10072 // "scopes": [ 10073 // "https://www.googleapis.com/auth/androidenterprise" 10074 // ] 10075 // } 10076 10077} 10078 10079// method id "androidenterprise.managedconfigurationssettings.list": 10080 10081type ManagedconfigurationssettingsListCall struct { 10082 s *Service 10083 enterpriseId string 10084 productId string 10085 urlParams_ gensupport.URLParams 10086 ifNoneMatch_ string 10087 ctx_ context.Context 10088 header_ http.Header 10089} 10090 10091// List: Lists all the managed configurations settings for the specified 10092// app. 10093// 10094// - enterpriseId: The ID of the enterprise. 10095// - productId: The ID of the product for which the managed 10096// configurations settings applies to. 10097func (r *ManagedconfigurationssettingsService) List(enterpriseId string, productId string) *ManagedconfigurationssettingsListCall { 10098 c := &ManagedconfigurationssettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10099 c.enterpriseId = enterpriseId 10100 c.productId = productId 10101 return c 10102} 10103 10104// Fields allows partial responses to be retrieved. See 10105// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10106// for more information. 10107func (c *ManagedconfigurationssettingsListCall) Fields(s ...googleapi.Field) *ManagedconfigurationssettingsListCall { 10108 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10109 return c 10110} 10111 10112// IfNoneMatch sets the optional parameter which makes the operation 10113// fail if the object's ETag matches the given value. This is useful for 10114// getting updates only after the object has changed since the last 10115// request. Use googleapi.IsNotModified to check whether the response 10116// error from Do is the result of In-None-Match. 10117func (c *ManagedconfigurationssettingsListCall) IfNoneMatch(entityTag string) *ManagedconfigurationssettingsListCall { 10118 c.ifNoneMatch_ = entityTag 10119 return c 10120} 10121 10122// Context sets the context to be used in this call's Do method. Any 10123// pending HTTP request will be aborted if the provided context is 10124// canceled. 10125func (c *ManagedconfigurationssettingsListCall) Context(ctx context.Context) *ManagedconfigurationssettingsListCall { 10126 c.ctx_ = ctx 10127 return c 10128} 10129 10130// Header returns an http.Header that can be modified by the caller to 10131// add HTTP headers to the request. 10132func (c *ManagedconfigurationssettingsListCall) Header() http.Header { 10133 if c.header_ == nil { 10134 c.header_ = make(http.Header) 10135 } 10136 return c.header_ 10137} 10138 10139func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Response, error) { 10140 reqHeaders := make(http.Header) 10141 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10142 for k, v := range c.header_ { 10143 reqHeaders[k] = v 10144 } 10145 reqHeaders.Set("User-Agent", c.s.userAgent()) 10146 if c.ifNoneMatch_ != "" { 10147 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10148 } 10149 var body io.Reader = nil 10150 c.urlParams_.Set("alt", alt) 10151 c.urlParams_.Set("prettyPrint", "false") 10152 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings") 10153 urls += "?" + c.urlParams_.Encode() 10154 req, err := http.NewRequest("GET", urls, body) 10155 if err != nil { 10156 return nil, err 10157 } 10158 req.Header = reqHeaders 10159 googleapi.Expand(req.URL, map[string]string{ 10160 "enterpriseId": c.enterpriseId, 10161 "productId": c.productId, 10162 }) 10163 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10164} 10165 10166// Do executes the "androidenterprise.managedconfigurationssettings.list" call. 10167// Exactly one of *ManagedConfigurationsSettingsListResponse or error 10168// will be non-nil. Any non-2xx status code is an error. Response 10169// headers are in either 10170// *ManagedConfigurationsSettingsListResponse.ServerResponse.Header or 10171// (if a response was returned at all) in 10172// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10173// whether the returned error was because http.StatusNotModified was 10174// returned. 10175func (c *ManagedconfigurationssettingsListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsSettingsListResponse, error) { 10176 gensupport.SetOptions(c.urlParams_, opts...) 10177 res, err := c.doRequest("json") 10178 if res != nil && res.StatusCode == http.StatusNotModified { 10179 if res.Body != nil { 10180 res.Body.Close() 10181 } 10182 return nil, &googleapi.Error{ 10183 Code: res.StatusCode, 10184 Header: res.Header, 10185 } 10186 } 10187 if err != nil { 10188 return nil, err 10189 } 10190 defer googleapi.CloseBody(res) 10191 if err := googleapi.CheckResponse(res); err != nil { 10192 return nil, err 10193 } 10194 ret := &ManagedConfigurationsSettingsListResponse{ 10195 ServerResponse: googleapi.ServerResponse{ 10196 Header: res.Header, 10197 HTTPStatusCode: res.StatusCode, 10198 }, 10199 } 10200 target := &ret 10201 if err := gensupport.DecodeResponse(target, res); err != nil { 10202 return nil, err 10203 } 10204 return ret, nil 10205 // { 10206 // "description": "Lists all the managed configurations settings for the specified app.", 10207 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", 10208 // "httpMethod": "GET", 10209 // "id": "androidenterprise.managedconfigurationssettings.list", 10210 // "parameterOrder": [ 10211 // "enterpriseId", 10212 // "productId" 10213 // ], 10214 // "parameters": { 10215 // "enterpriseId": { 10216 // "description": "The ID of the enterprise.", 10217 // "location": "path", 10218 // "required": true, 10219 // "type": "string" 10220 // }, 10221 // "productId": { 10222 // "description": "The ID of the product for which the managed configurations settings applies to.", 10223 // "location": "path", 10224 // "required": true, 10225 // "type": "string" 10226 // } 10227 // }, 10228 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", 10229 // "response": { 10230 // "$ref": "ManagedConfigurationsSettingsListResponse" 10231 // }, 10232 // "scopes": [ 10233 // "https://www.googleapis.com/auth/androidenterprise" 10234 // ] 10235 // } 10236 10237} 10238 10239// method id "androidenterprise.permissions.get": 10240 10241type PermissionsGetCall struct { 10242 s *Service 10243 permissionId string 10244 urlParams_ gensupport.URLParams 10245 ifNoneMatch_ string 10246 ctx_ context.Context 10247 header_ http.Header 10248} 10249 10250// Get: Retrieves details of an Android app permission for display to an 10251// enterprise admin. 10252// 10253// - permissionId: The ID of the permission. 10254func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall { 10255 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10256 c.permissionId = permissionId 10257 return c 10258} 10259 10260// Language sets the optional parameter "language": The BCP47 tag for 10261// the user's preferred language (e.g. "en-US", "de") 10262func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall { 10263 c.urlParams_.Set("language", language) 10264 return c 10265} 10266 10267// Fields allows partial responses to be retrieved. See 10268// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10269// for more information. 10270func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 10271 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10272 return c 10273} 10274 10275// IfNoneMatch sets the optional parameter which makes the operation 10276// fail if the object's ETag matches the given value. This is useful for 10277// getting updates only after the object has changed since the last 10278// request. Use googleapi.IsNotModified to check whether the response 10279// error from Do is the result of In-None-Match. 10280func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 10281 c.ifNoneMatch_ = entityTag 10282 return c 10283} 10284 10285// Context sets the context to be used in this call's Do method. Any 10286// pending HTTP request will be aborted if the provided context is 10287// canceled. 10288func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 10289 c.ctx_ = ctx 10290 return c 10291} 10292 10293// Header returns an http.Header that can be modified by the caller to 10294// add HTTP headers to the request. 10295func (c *PermissionsGetCall) Header() http.Header { 10296 if c.header_ == nil { 10297 c.header_ = make(http.Header) 10298 } 10299 return c.header_ 10300} 10301 10302func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 10303 reqHeaders := make(http.Header) 10304 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10305 for k, v := range c.header_ { 10306 reqHeaders[k] = v 10307 } 10308 reqHeaders.Set("User-Agent", c.s.userAgent()) 10309 if c.ifNoneMatch_ != "" { 10310 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10311 } 10312 var body io.Reader = nil 10313 c.urlParams_.Set("alt", alt) 10314 c.urlParams_.Set("prettyPrint", "false") 10315 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/permissions/{permissionId}") 10316 urls += "?" + c.urlParams_.Encode() 10317 req, err := http.NewRequest("GET", urls, body) 10318 if err != nil { 10319 return nil, err 10320 } 10321 req.Header = reqHeaders 10322 googleapi.Expand(req.URL, map[string]string{ 10323 "permissionId": c.permissionId, 10324 }) 10325 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10326} 10327 10328// Do executes the "androidenterprise.permissions.get" call. 10329// Exactly one of *Permission or error will be non-nil. Any non-2xx 10330// status code is an error. Response headers are in either 10331// *Permission.ServerResponse.Header or (if a response was returned at 10332// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10333// to check whether the returned error was because 10334// http.StatusNotModified was returned. 10335func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 10336 gensupport.SetOptions(c.urlParams_, opts...) 10337 res, err := c.doRequest("json") 10338 if res != nil && res.StatusCode == http.StatusNotModified { 10339 if res.Body != nil { 10340 res.Body.Close() 10341 } 10342 return nil, &googleapi.Error{ 10343 Code: res.StatusCode, 10344 Header: res.Header, 10345 } 10346 } 10347 if err != nil { 10348 return nil, err 10349 } 10350 defer googleapi.CloseBody(res) 10351 if err := googleapi.CheckResponse(res); err != nil { 10352 return nil, err 10353 } 10354 ret := &Permission{ 10355 ServerResponse: googleapi.ServerResponse{ 10356 Header: res.Header, 10357 HTTPStatusCode: res.StatusCode, 10358 }, 10359 } 10360 target := &ret 10361 if err := gensupport.DecodeResponse(target, res); err != nil { 10362 return nil, err 10363 } 10364 return ret, nil 10365 // { 10366 // "description": "Retrieves details of an Android app permission for display to an enterprise admin.", 10367 // "flatPath": "androidenterprise/v1/permissions/{permissionId}", 10368 // "httpMethod": "GET", 10369 // "id": "androidenterprise.permissions.get", 10370 // "parameterOrder": [ 10371 // "permissionId" 10372 // ], 10373 // "parameters": { 10374 // "language": { 10375 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")", 10376 // "location": "query", 10377 // "type": "string" 10378 // }, 10379 // "permissionId": { 10380 // "description": "The ID of the permission.", 10381 // "location": "path", 10382 // "required": true, 10383 // "type": "string" 10384 // } 10385 // }, 10386 // "path": "androidenterprise/v1/permissions/{permissionId}", 10387 // "response": { 10388 // "$ref": "Permission" 10389 // }, 10390 // "scopes": [ 10391 // "https://www.googleapis.com/auth/androidenterprise" 10392 // ] 10393 // } 10394 10395} 10396 10397// method id "androidenterprise.products.approve": 10398 10399type ProductsApproveCall struct { 10400 s *Service 10401 enterpriseId string 10402 productId string 10403 productsapproverequest *ProductsApproveRequest 10404 urlParams_ gensupport.URLParams 10405 ctx_ context.Context 10406 header_ http.Header 10407} 10408 10409// Approve: Approves the specified product and the relevant app 10410// permissions, if any. The maximum number of products that you can 10411// approve per enterprise customer is 1,000. To learn how to use managed 10412// Google Play to design and create a store layout to display approved 10413// products to your users, see Store Layout Design. 10414// 10415// - enterpriseId: The ID of the enterprise. 10416// - productId: The ID of the product. 10417func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall { 10418 c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10419 c.enterpriseId = enterpriseId 10420 c.productId = productId 10421 c.productsapproverequest = productsapproverequest 10422 return c 10423} 10424 10425// Fields allows partial responses to be retrieved. See 10426// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10427// for more information. 10428func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall { 10429 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10430 return c 10431} 10432 10433// Context sets the context to be used in this call's Do method. Any 10434// pending HTTP request will be aborted if the provided context is 10435// canceled. 10436func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall { 10437 c.ctx_ = ctx 10438 return c 10439} 10440 10441// Header returns an http.Header that can be modified by the caller to 10442// add HTTP headers to the request. 10443func (c *ProductsApproveCall) Header() http.Header { 10444 if c.header_ == nil { 10445 c.header_ = make(http.Header) 10446 } 10447 return c.header_ 10448} 10449 10450func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) { 10451 reqHeaders := make(http.Header) 10452 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10453 for k, v := range c.header_ { 10454 reqHeaders[k] = v 10455 } 10456 reqHeaders.Set("User-Agent", c.s.userAgent()) 10457 var body io.Reader = nil 10458 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest) 10459 if err != nil { 10460 return nil, err 10461 } 10462 reqHeaders.Set("Content-Type", "application/json") 10463 c.urlParams_.Set("alt", alt) 10464 c.urlParams_.Set("prettyPrint", "false") 10465 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve") 10466 urls += "?" + c.urlParams_.Encode() 10467 req, err := http.NewRequest("POST", urls, body) 10468 if err != nil { 10469 return nil, err 10470 } 10471 req.Header = reqHeaders 10472 googleapi.Expand(req.URL, map[string]string{ 10473 "enterpriseId": c.enterpriseId, 10474 "productId": c.productId, 10475 }) 10476 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10477} 10478 10479// Do executes the "androidenterprise.products.approve" call. 10480func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error { 10481 gensupport.SetOptions(c.urlParams_, opts...) 10482 res, err := c.doRequest("json") 10483 if err != nil { 10484 return err 10485 } 10486 defer googleapi.CloseBody(res) 10487 if err := googleapi.CheckResponse(res); err != nil { 10488 return err 10489 } 10490 return nil 10491 // { 10492 // "description": " Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. ", 10493 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve", 10494 // "httpMethod": "POST", 10495 // "id": "androidenterprise.products.approve", 10496 // "parameterOrder": [ 10497 // "enterpriseId", 10498 // "productId" 10499 // ], 10500 // "parameters": { 10501 // "enterpriseId": { 10502 // "description": "The ID of the enterprise.", 10503 // "location": "path", 10504 // "required": true, 10505 // "type": "string" 10506 // }, 10507 // "productId": { 10508 // "description": "The ID of the product.", 10509 // "location": "path", 10510 // "required": true, 10511 // "type": "string" 10512 // } 10513 // }, 10514 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve", 10515 // "request": { 10516 // "$ref": "ProductsApproveRequest" 10517 // }, 10518 // "scopes": [ 10519 // "https://www.googleapis.com/auth/androidenterprise" 10520 // ] 10521 // } 10522 10523} 10524 10525// method id "androidenterprise.products.generateApprovalUrl": 10526 10527type ProductsGenerateApprovalUrlCall struct { 10528 s *Service 10529 enterpriseId string 10530 productId string 10531 urlParams_ gensupport.URLParams 10532 ctx_ context.Context 10533 header_ http.Header 10534} 10535 10536// GenerateApprovalUrl: Generates a URL that can be rendered in an 10537// iframe to display the permissions (if any) of a product. An 10538// enterprise admin must view these permissions and accept them on 10539// behalf of their organization in order to approve that product. Admins 10540// should accept the displayed permissions by interacting with a 10541// separate UI element in the EMM console, which in turn should trigger 10542// the use of this URL as the approvalUrlInfo.approvalUrl property in a 10543// Products.approve call to approve the product. This URL can only be 10544// used to display permissions for up to 1 day. 10545// 10546// - enterpriseId: The ID of the enterprise. 10547// - productId: The ID of the product. 10548func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall { 10549 c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10550 c.enterpriseId = enterpriseId 10551 c.productId = productId 10552 return c 10553} 10554 10555// LanguageCode sets the optional parameter "languageCode": The BCP 47 10556// language code used for permission names and descriptions in the 10557// returned iframe, for instance "en-US". 10558func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall { 10559 c.urlParams_.Set("languageCode", languageCode) 10560 return c 10561} 10562 10563// Fields allows partial responses to be retrieved. See 10564// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10565// for more information. 10566func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall { 10567 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10568 return c 10569} 10570 10571// Context sets the context to be used in this call's Do method. Any 10572// pending HTTP request will be aborted if the provided context is 10573// canceled. 10574func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall { 10575 c.ctx_ = ctx 10576 return c 10577} 10578 10579// Header returns an http.Header that can be modified by the caller to 10580// add HTTP headers to the request. 10581func (c *ProductsGenerateApprovalUrlCall) Header() http.Header { 10582 if c.header_ == nil { 10583 c.header_ = make(http.Header) 10584 } 10585 return c.header_ 10586} 10587 10588func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) { 10589 reqHeaders := make(http.Header) 10590 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10591 for k, v := range c.header_ { 10592 reqHeaders[k] = v 10593 } 10594 reqHeaders.Set("User-Agent", c.s.userAgent()) 10595 var body io.Reader = nil 10596 c.urlParams_.Set("alt", alt) 10597 c.urlParams_.Set("prettyPrint", "false") 10598 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl") 10599 urls += "?" + c.urlParams_.Encode() 10600 req, err := http.NewRequest("POST", urls, body) 10601 if err != nil { 10602 return nil, err 10603 } 10604 req.Header = reqHeaders 10605 googleapi.Expand(req.URL, map[string]string{ 10606 "enterpriseId": c.enterpriseId, 10607 "productId": c.productId, 10608 }) 10609 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10610} 10611 10612// Do executes the "androidenterprise.products.generateApprovalUrl" call. 10613// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be 10614// non-nil. Any non-2xx status code is an error. Response headers are in 10615// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or 10616// (if a response was returned at all) in 10617// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10618// whether the returned error was because http.StatusNotModified was 10619// returned. 10620func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) { 10621 gensupport.SetOptions(c.urlParams_, opts...) 10622 res, err := c.doRequest("json") 10623 if res != nil && res.StatusCode == http.StatusNotModified { 10624 if res.Body != nil { 10625 res.Body.Close() 10626 } 10627 return nil, &googleapi.Error{ 10628 Code: res.StatusCode, 10629 Header: res.Header, 10630 } 10631 } 10632 if err != nil { 10633 return nil, err 10634 } 10635 defer googleapi.CloseBody(res) 10636 if err := googleapi.CheckResponse(res); err != nil { 10637 return nil, err 10638 } 10639 ret := &ProductsGenerateApprovalUrlResponse{ 10640 ServerResponse: googleapi.ServerResponse{ 10641 Header: res.Header, 10642 HTTPStatusCode: res.StatusCode, 10643 }, 10644 } 10645 target := &ret 10646 if err := gensupport.DecodeResponse(target, res); err != nil { 10647 return nil, err 10648 } 10649 return ret, nil 10650 // { 10651 // "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.", 10652 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", 10653 // "httpMethod": "POST", 10654 // "id": "androidenterprise.products.generateApprovalUrl", 10655 // "parameterOrder": [ 10656 // "enterpriseId", 10657 // "productId" 10658 // ], 10659 // "parameters": { 10660 // "enterpriseId": { 10661 // "description": "The ID of the enterprise.", 10662 // "location": "path", 10663 // "required": true, 10664 // "type": "string" 10665 // }, 10666 // "languageCode": { 10667 // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", 10668 // "location": "query", 10669 // "type": "string" 10670 // }, 10671 // "productId": { 10672 // "description": "The ID of the product.", 10673 // "location": "path", 10674 // "required": true, 10675 // "type": "string" 10676 // } 10677 // }, 10678 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", 10679 // "response": { 10680 // "$ref": "ProductsGenerateApprovalUrlResponse" 10681 // }, 10682 // "scopes": [ 10683 // "https://www.googleapis.com/auth/androidenterprise" 10684 // ] 10685 // } 10686 10687} 10688 10689// method id "androidenterprise.products.get": 10690 10691type ProductsGetCall struct { 10692 s *Service 10693 enterpriseId string 10694 productId string 10695 urlParams_ gensupport.URLParams 10696 ifNoneMatch_ string 10697 ctx_ context.Context 10698 header_ http.Header 10699} 10700 10701// Get: Retrieves details of a product for display to an enterprise 10702// admin. 10703// 10704// - enterpriseId: The ID of the enterprise. 10705// - productId: The ID of the product, e.g. "app:com.google.android.gm". 10706func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall { 10707 c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10708 c.enterpriseId = enterpriseId 10709 c.productId = productId 10710 return c 10711} 10712 10713// Language sets the optional parameter "language": The BCP47 tag for 10714// the user's preferred language (e.g. "en-US", "de"). 10715func (c *ProductsGetCall) Language(language string) *ProductsGetCall { 10716 c.urlParams_.Set("language", language) 10717 return c 10718} 10719 10720// Fields allows partial responses to be retrieved. See 10721// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10722// for more information. 10723func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall { 10724 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10725 return c 10726} 10727 10728// IfNoneMatch sets the optional parameter which makes the operation 10729// fail if the object's ETag matches the given value. This is useful for 10730// getting updates only after the object has changed since the last 10731// request. Use googleapi.IsNotModified to check whether the response 10732// error from Do is the result of In-None-Match. 10733func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall { 10734 c.ifNoneMatch_ = entityTag 10735 return c 10736} 10737 10738// Context sets the context to be used in this call's Do method. Any 10739// pending HTTP request will be aborted if the provided context is 10740// canceled. 10741func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall { 10742 c.ctx_ = ctx 10743 return c 10744} 10745 10746// Header returns an http.Header that can be modified by the caller to 10747// add HTTP headers to the request. 10748func (c *ProductsGetCall) Header() http.Header { 10749 if c.header_ == nil { 10750 c.header_ = make(http.Header) 10751 } 10752 return c.header_ 10753} 10754 10755func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { 10756 reqHeaders := make(http.Header) 10757 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10758 for k, v := range c.header_ { 10759 reqHeaders[k] = v 10760 } 10761 reqHeaders.Set("User-Agent", c.s.userAgent()) 10762 if c.ifNoneMatch_ != "" { 10763 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10764 } 10765 var body io.Reader = nil 10766 c.urlParams_.Set("alt", alt) 10767 c.urlParams_.Set("prettyPrint", "false") 10768 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}") 10769 urls += "?" + c.urlParams_.Encode() 10770 req, err := http.NewRequest("GET", urls, body) 10771 if err != nil { 10772 return nil, err 10773 } 10774 req.Header = reqHeaders 10775 googleapi.Expand(req.URL, map[string]string{ 10776 "enterpriseId": c.enterpriseId, 10777 "productId": c.productId, 10778 }) 10779 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10780} 10781 10782// Do executes the "androidenterprise.products.get" call. 10783// Exactly one of *Product or error will be non-nil. Any non-2xx status 10784// code is an error. Response headers are in either 10785// *Product.ServerResponse.Header or (if a response was returned at all) 10786// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10787// check whether the returned error was because http.StatusNotModified 10788// was returned. 10789func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) { 10790 gensupport.SetOptions(c.urlParams_, opts...) 10791 res, err := c.doRequest("json") 10792 if res != nil && res.StatusCode == http.StatusNotModified { 10793 if res.Body != nil { 10794 res.Body.Close() 10795 } 10796 return nil, &googleapi.Error{ 10797 Code: res.StatusCode, 10798 Header: res.Header, 10799 } 10800 } 10801 if err != nil { 10802 return nil, err 10803 } 10804 defer googleapi.CloseBody(res) 10805 if err := googleapi.CheckResponse(res); err != nil { 10806 return nil, err 10807 } 10808 ret := &Product{ 10809 ServerResponse: googleapi.ServerResponse{ 10810 Header: res.Header, 10811 HTTPStatusCode: res.StatusCode, 10812 }, 10813 } 10814 target := &ret 10815 if err := gensupport.DecodeResponse(target, res); err != nil { 10816 return nil, err 10817 } 10818 return ret, nil 10819 // { 10820 // "description": "Retrieves details of a product for display to an enterprise admin.", 10821 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}", 10822 // "httpMethod": "GET", 10823 // "id": "androidenterprise.products.get", 10824 // "parameterOrder": [ 10825 // "enterpriseId", 10826 // "productId" 10827 // ], 10828 // "parameters": { 10829 // "enterpriseId": { 10830 // "description": "The ID of the enterprise.", 10831 // "location": "path", 10832 // "required": true, 10833 // "type": "string" 10834 // }, 10835 // "language": { 10836 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 10837 // "location": "query", 10838 // "type": "string" 10839 // }, 10840 // "productId": { 10841 // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".", 10842 // "location": "path", 10843 // "required": true, 10844 // "type": "string" 10845 // } 10846 // }, 10847 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}", 10848 // "response": { 10849 // "$ref": "Product" 10850 // }, 10851 // "scopes": [ 10852 // "https://www.googleapis.com/auth/androidenterprise" 10853 // ] 10854 // } 10855 10856} 10857 10858// method id "androidenterprise.products.getAppRestrictionsSchema": 10859 10860type ProductsGetAppRestrictionsSchemaCall struct { 10861 s *Service 10862 enterpriseId string 10863 productId string 10864 urlParams_ gensupport.URLParams 10865 ifNoneMatch_ string 10866 ctx_ context.Context 10867 header_ http.Header 10868} 10869 10870// GetAppRestrictionsSchema: Retrieves the schema that defines the 10871// configurable properties for this product. All products have a schema, 10872// but this schema may be empty if no managed configurations have been 10873// defined. This schema can be used to populate a UI that allows an 10874// admin to configure the product. To apply a managed configuration 10875// based on the schema obtained using this API, see Managed 10876// Configurations through Play. 10877// 10878// - enterpriseId: The ID of the enterprise. 10879// - productId: The ID of the product. 10880func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall { 10881 c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10882 c.enterpriseId = enterpriseId 10883 c.productId = productId 10884 return c 10885} 10886 10887// Language sets the optional parameter "language": The BCP47 tag for 10888// the user's preferred language (e.g. "en-US", "de"). 10889func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall { 10890 c.urlParams_.Set("language", language) 10891 return c 10892} 10893 10894// Fields allows partial responses to be retrieved. See 10895// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10896// for more information. 10897func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall { 10898 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10899 return c 10900} 10901 10902// IfNoneMatch sets the optional parameter which makes the operation 10903// fail if the object's ETag matches the given value. This is useful for 10904// getting updates only after the object has changed since the last 10905// request. Use googleapi.IsNotModified to check whether the response 10906// error from Do is the result of In-None-Match. 10907func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall { 10908 c.ifNoneMatch_ = entityTag 10909 return c 10910} 10911 10912// Context sets the context to be used in this call's Do method. Any 10913// pending HTTP request will be aborted if the provided context is 10914// canceled. 10915func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall { 10916 c.ctx_ = ctx 10917 return c 10918} 10919 10920// Header returns an http.Header that can be modified by the caller to 10921// add HTTP headers to the request. 10922func (c *ProductsGetAppRestrictionsSchemaCall) Header() http.Header { 10923 if c.header_ == nil { 10924 c.header_ = make(http.Header) 10925 } 10926 return c.header_ 10927} 10928 10929func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) { 10930 reqHeaders := make(http.Header) 10931 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10932 for k, v := range c.header_ { 10933 reqHeaders[k] = v 10934 } 10935 reqHeaders.Set("User-Agent", c.s.userAgent()) 10936 if c.ifNoneMatch_ != "" { 10937 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10938 } 10939 var body io.Reader = nil 10940 c.urlParams_.Set("alt", alt) 10941 c.urlParams_.Set("prettyPrint", "false") 10942 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema") 10943 urls += "?" + c.urlParams_.Encode() 10944 req, err := http.NewRequest("GET", urls, body) 10945 if err != nil { 10946 return nil, err 10947 } 10948 req.Header = reqHeaders 10949 googleapi.Expand(req.URL, map[string]string{ 10950 "enterpriseId": c.enterpriseId, 10951 "productId": c.productId, 10952 }) 10953 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10954} 10955 10956// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call. 10957// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any 10958// non-2xx status code is an error. Response headers are in either 10959// *AppRestrictionsSchema.ServerResponse.Header or (if a response was 10960// returned at all) in error.(*googleapi.Error).Header. Use 10961// googleapi.IsNotModified to check whether the returned error was 10962// because http.StatusNotModified was returned. 10963func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) { 10964 gensupport.SetOptions(c.urlParams_, opts...) 10965 res, err := c.doRequest("json") 10966 if res != nil && res.StatusCode == http.StatusNotModified { 10967 if res.Body != nil { 10968 res.Body.Close() 10969 } 10970 return nil, &googleapi.Error{ 10971 Code: res.StatusCode, 10972 Header: res.Header, 10973 } 10974 } 10975 if err != nil { 10976 return nil, err 10977 } 10978 defer googleapi.CloseBody(res) 10979 if err := googleapi.CheckResponse(res); err != nil { 10980 return nil, err 10981 } 10982 ret := &AppRestrictionsSchema{ 10983 ServerResponse: googleapi.ServerResponse{ 10984 Header: res.Header, 10985 HTTPStatusCode: res.StatusCode, 10986 }, 10987 } 10988 target := &ret 10989 if err := gensupport.DecodeResponse(target, res); err != nil { 10990 return nil, err 10991 } 10992 return ret, nil 10993 // { 10994 // "description": "Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play.", 10995 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", 10996 // "httpMethod": "GET", 10997 // "id": "androidenterprise.products.getAppRestrictionsSchema", 10998 // "parameterOrder": [ 10999 // "enterpriseId", 11000 // "productId" 11001 // ], 11002 // "parameters": { 11003 // "enterpriseId": { 11004 // "description": "The ID of the enterprise.", 11005 // "location": "path", 11006 // "required": true, 11007 // "type": "string" 11008 // }, 11009 // "language": { 11010 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 11011 // "location": "query", 11012 // "type": "string" 11013 // }, 11014 // "productId": { 11015 // "description": "The ID of the product.", 11016 // "location": "path", 11017 // "required": true, 11018 // "type": "string" 11019 // } 11020 // }, 11021 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", 11022 // "response": { 11023 // "$ref": "AppRestrictionsSchema" 11024 // }, 11025 // "scopes": [ 11026 // "https://www.googleapis.com/auth/androidenterprise" 11027 // ] 11028 // } 11029 11030} 11031 11032// method id "androidenterprise.products.getPermissions": 11033 11034type ProductsGetPermissionsCall struct { 11035 s *Service 11036 enterpriseId string 11037 productId string 11038 urlParams_ gensupport.URLParams 11039 ifNoneMatch_ string 11040 ctx_ context.Context 11041 header_ http.Header 11042} 11043 11044// GetPermissions: Retrieves the Android app permissions required by 11045// this app. 11046// 11047// - enterpriseId: The ID of the enterprise. 11048// - productId: The ID of the product. 11049func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall { 11050 c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11051 c.enterpriseId = enterpriseId 11052 c.productId = productId 11053 return c 11054} 11055 11056// Fields allows partial responses to be retrieved. See 11057// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11058// for more information. 11059func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall { 11060 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11061 return c 11062} 11063 11064// IfNoneMatch sets the optional parameter which makes the operation 11065// fail if the object's ETag matches the given value. This is useful for 11066// getting updates only after the object has changed since the last 11067// request. Use googleapi.IsNotModified to check whether the response 11068// error from Do is the result of In-None-Match. 11069func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall { 11070 c.ifNoneMatch_ = entityTag 11071 return c 11072} 11073 11074// Context sets the context to be used in this call's Do method. Any 11075// pending HTTP request will be aborted if the provided context is 11076// canceled. 11077func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall { 11078 c.ctx_ = ctx 11079 return c 11080} 11081 11082// Header returns an http.Header that can be modified by the caller to 11083// add HTTP headers to the request. 11084func (c *ProductsGetPermissionsCall) Header() http.Header { 11085 if c.header_ == nil { 11086 c.header_ = make(http.Header) 11087 } 11088 return c.header_ 11089} 11090 11091func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) { 11092 reqHeaders := make(http.Header) 11093 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11094 for k, v := range c.header_ { 11095 reqHeaders[k] = v 11096 } 11097 reqHeaders.Set("User-Agent", c.s.userAgent()) 11098 if c.ifNoneMatch_ != "" { 11099 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11100 } 11101 var body io.Reader = nil 11102 c.urlParams_.Set("alt", alt) 11103 c.urlParams_.Set("prettyPrint", "false") 11104 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions") 11105 urls += "?" + c.urlParams_.Encode() 11106 req, err := http.NewRequest("GET", urls, body) 11107 if err != nil { 11108 return nil, err 11109 } 11110 req.Header = reqHeaders 11111 googleapi.Expand(req.URL, map[string]string{ 11112 "enterpriseId": c.enterpriseId, 11113 "productId": c.productId, 11114 }) 11115 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11116} 11117 11118// Do executes the "androidenterprise.products.getPermissions" call. 11119// Exactly one of *ProductPermissions or error will be non-nil. Any 11120// non-2xx status code is an error. Response headers are in either 11121// *ProductPermissions.ServerResponse.Header or (if a response was 11122// returned at all) in error.(*googleapi.Error).Header. Use 11123// googleapi.IsNotModified to check whether the returned error was 11124// because http.StatusNotModified was returned. 11125func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) { 11126 gensupport.SetOptions(c.urlParams_, opts...) 11127 res, err := c.doRequest("json") 11128 if res != nil && res.StatusCode == http.StatusNotModified { 11129 if res.Body != nil { 11130 res.Body.Close() 11131 } 11132 return nil, &googleapi.Error{ 11133 Code: res.StatusCode, 11134 Header: res.Header, 11135 } 11136 } 11137 if err != nil { 11138 return nil, err 11139 } 11140 defer googleapi.CloseBody(res) 11141 if err := googleapi.CheckResponse(res); err != nil { 11142 return nil, err 11143 } 11144 ret := &ProductPermissions{ 11145 ServerResponse: googleapi.ServerResponse{ 11146 Header: res.Header, 11147 HTTPStatusCode: res.StatusCode, 11148 }, 11149 } 11150 target := &ret 11151 if err := gensupport.DecodeResponse(target, res); err != nil { 11152 return nil, err 11153 } 11154 return ret, nil 11155 // { 11156 // "description": "Retrieves the Android app permissions required by this app.", 11157 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions", 11158 // "httpMethod": "GET", 11159 // "id": "androidenterprise.products.getPermissions", 11160 // "parameterOrder": [ 11161 // "enterpriseId", 11162 // "productId" 11163 // ], 11164 // "parameters": { 11165 // "enterpriseId": { 11166 // "description": "The ID of the enterprise.", 11167 // "location": "path", 11168 // "required": true, 11169 // "type": "string" 11170 // }, 11171 // "productId": { 11172 // "description": "The ID of the product.", 11173 // "location": "path", 11174 // "required": true, 11175 // "type": "string" 11176 // } 11177 // }, 11178 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions", 11179 // "response": { 11180 // "$ref": "ProductPermissions" 11181 // }, 11182 // "scopes": [ 11183 // "https://www.googleapis.com/auth/androidenterprise" 11184 // ] 11185 // } 11186 11187} 11188 11189// method id "androidenterprise.products.list": 11190 11191type ProductsListCall struct { 11192 s *Service 11193 enterpriseId string 11194 urlParams_ gensupport.URLParams 11195 ifNoneMatch_ string 11196 ctx_ context.Context 11197 header_ http.Header 11198} 11199 11200// List: Finds approved products that match a query, or all approved 11201// products if there is no query. 11202// 11203// - enterpriseId: The ID of the enterprise. 11204func (r *ProductsService) List(enterpriseId string) *ProductsListCall { 11205 c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11206 c.enterpriseId = enterpriseId 11207 return c 11208} 11209 11210// Approved sets the optional parameter "approved": Specifies whether to 11211// search among all products (false) or among only products that have 11212// been approved (true). Only "true" is supported, and should be 11213// specified. 11214func (c *ProductsListCall) Approved(approved bool) *ProductsListCall { 11215 c.urlParams_.Set("approved", fmt.Sprint(approved)) 11216 return c 11217} 11218 11219// Language sets the optional parameter "language": The BCP47 tag for 11220// the user's preferred language (e.g. "en-US", "de"). Results are 11221// returned in the language best matching the preferred language. 11222func (c *ProductsListCall) Language(language string) *ProductsListCall { 11223 c.urlParams_.Set("language", language) 11224 return c 11225} 11226 11227// MaxResults sets the optional parameter "maxResults": Defines how many 11228// results the list operation should return. The default number depends 11229// on the resource collection. 11230func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall { 11231 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11232 return c 11233} 11234 11235// Query sets the optional parameter "query": The search query as typed 11236// in the Google Play store search box. If omitted, all approved apps 11237// will be returned (using the pagination parameters), including apps 11238// that are not available in the store (e.g. unpublished apps). 11239func (c *ProductsListCall) Query(query string) *ProductsListCall { 11240 c.urlParams_.Set("query", query) 11241 return c 11242} 11243 11244// Token sets the optional parameter "token": Defines the token of the 11245// page to return, usually taken from TokenPagination. This can only be 11246// used if token paging is enabled. 11247func (c *ProductsListCall) Token(token string) *ProductsListCall { 11248 c.urlParams_.Set("token", token) 11249 return c 11250} 11251 11252// Fields allows partial responses to be retrieved. See 11253// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11254// for more information. 11255func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall { 11256 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11257 return c 11258} 11259 11260// IfNoneMatch sets the optional parameter which makes the operation 11261// fail if the object's ETag matches the given value. This is useful for 11262// getting updates only after the object has changed since the last 11263// request. Use googleapi.IsNotModified to check whether the response 11264// error from Do is the result of In-None-Match. 11265func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall { 11266 c.ifNoneMatch_ = entityTag 11267 return c 11268} 11269 11270// Context sets the context to be used in this call's Do method. Any 11271// pending HTTP request will be aborted if the provided context is 11272// canceled. 11273func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall { 11274 c.ctx_ = ctx 11275 return c 11276} 11277 11278// Header returns an http.Header that can be modified by the caller to 11279// add HTTP headers to the request. 11280func (c *ProductsListCall) Header() http.Header { 11281 if c.header_ == nil { 11282 c.header_ = make(http.Header) 11283 } 11284 return c.header_ 11285} 11286 11287func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { 11288 reqHeaders := make(http.Header) 11289 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11290 for k, v := range c.header_ { 11291 reqHeaders[k] = v 11292 } 11293 reqHeaders.Set("User-Agent", c.s.userAgent()) 11294 if c.ifNoneMatch_ != "" { 11295 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11296 } 11297 var body io.Reader = nil 11298 c.urlParams_.Set("alt", alt) 11299 c.urlParams_.Set("prettyPrint", "false") 11300 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products") 11301 urls += "?" + c.urlParams_.Encode() 11302 req, err := http.NewRequest("GET", urls, body) 11303 if err != nil { 11304 return nil, err 11305 } 11306 req.Header = reqHeaders 11307 googleapi.Expand(req.URL, map[string]string{ 11308 "enterpriseId": c.enterpriseId, 11309 }) 11310 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11311} 11312 11313// Do executes the "androidenterprise.products.list" call. 11314// Exactly one of *ProductsListResponse or error will be non-nil. Any 11315// non-2xx status code is an error. Response headers are in either 11316// *ProductsListResponse.ServerResponse.Header or (if a response was 11317// returned at all) in error.(*googleapi.Error).Header. Use 11318// googleapi.IsNotModified to check whether the returned error was 11319// because http.StatusNotModified was returned. 11320func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) { 11321 gensupport.SetOptions(c.urlParams_, opts...) 11322 res, err := c.doRequest("json") 11323 if res != nil && res.StatusCode == http.StatusNotModified { 11324 if res.Body != nil { 11325 res.Body.Close() 11326 } 11327 return nil, &googleapi.Error{ 11328 Code: res.StatusCode, 11329 Header: res.Header, 11330 } 11331 } 11332 if err != nil { 11333 return nil, err 11334 } 11335 defer googleapi.CloseBody(res) 11336 if err := googleapi.CheckResponse(res); err != nil { 11337 return nil, err 11338 } 11339 ret := &ProductsListResponse{ 11340 ServerResponse: googleapi.ServerResponse{ 11341 Header: res.Header, 11342 HTTPStatusCode: res.StatusCode, 11343 }, 11344 } 11345 target := &ret 11346 if err := gensupport.DecodeResponse(target, res); err != nil { 11347 return nil, err 11348 } 11349 return ret, nil 11350 // { 11351 // "description": "Finds approved products that match a query, or all approved products if there is no query.", 11352 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products", 11353 // "httpMethod": "GET", 11354 // "id": "androidenterprise.products.list", 11355 // "parameterOrder": [ 11356 // "enterpriseId" 11357 // ], 11358 // "parameters": { 11359 // "approved": { 11360 // "description": "Specifies whether to search among all products (false) or among only products that have been approved (true). Only \"true\" is supported, and should be specified.", 11361 // "location": "query", 11362 // "type": "boolean" 11363 // }, 11364 // "enterpriseId": { 11365 // "description": "The ID of the enterprise.", 11366 // "location": "path", 11367 // "required": true, 11368 // "type": "string" 11369 // }, 11370 // "language": { 11371 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\"). Results are returned in the language best matching the preferred language.", 11372 // "location": "query", 11373 // "type": "string" 11374 // }, 11375 // "maxResults": { 11376 // "description": "Defines how many results the list operation should return. The default number depends on the resource collection.", 11377 // "format": "uint32", 11378 // "location": "query", 11379 // "type": "integer" 11380 // }, 11381 // "query": { 11382 // "description": "The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps).", 11383 // "location": "query", 11384 // "type": "string" 11385 // }, 11386 // "token": { 11387 // "description": "Defines the token of the page to return, usually taken from TokenPagination. This can only be used if token paging is enabled.", 11388 // "location": "query", 11389 // "type": "string" 11390 // } 11391 // }, 11392 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products", 11393 // "response": { 11394 // "$ref": "ProductsListResponse" 11395 // }, 11396 // "scopes": [ 11397 // "https://www.googleapis.com/auth/androidenterprise" 11398 // ] 11399 // } 11400 11401} 11402 11403// method id "androidenterprise.products.unapprove": 11404 11405type ProductsUnapproveCall struct { 11406 s *Service 11407 enterpriseId string 11408 productId string 11409 urlParams_ gensupport.URLParams 11410 ctx_ context.Context 11411 header_ http.Header 11412} 11413 11414// Unapprove: Unapproves the specified product (and the relevant app 11415// permissions, if any) 11416// 11417// - enterpriseId: The ID of the enterprise. 11418// - productId: The ID of the product. 11419func (r *ProductsService) Unapprove(enterpriseId string, productId string) *ProductsUnapproveCall { 11420 c := &ProductsUnapproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11421 c.enterpriseId = enterpriseId 11422 c.productId = productId 11423 return c 11424} 11425 11426// Fields allows partial responses to be retrieved. See 11427// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11428// for more information. 11429func (c *ProductsUnapproveCall) Fields(s ...googleapi.Field) *ProductsUnapproveCall { 11430 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11431 return c 11432} 11433 11434// Context sets the context to be used in this call's Do method. Any 11435// pending HTTP request will be aborted if the provided context is 11436// canceled. 11437func (c *ProductsUnapproveCall) Context(ctx context.Context) *ProductsUnapproveCall { 11438 c.ctx_ = ctx 11439 return c 11440} 11441 11442// Header returns an http.Header that can be modified by the caller to 11443// add HTTP headers to the request. 11444func (c *ProductsUnapproveCall) Header() http.Header { 11445 if c.header_ == nil { 11446 c.header_ = make(http.Header) 11447 } 11448 return c.header_ 11449} 11450 11451func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) { 11452 reqHeaders := make(http.Header) 11453 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11454 for k, v := range c.header_ { 11455 reqHeaders[k] = v 11456 } 11457 reqHeaders.Set("User-Agent", c.s.userAgent()) 11458 var body io.Reader = nil 11459 c.urlParams_.Set("alt", alt) 11460 c.urlParams_.Set("prettyPrint", "false") 11461 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove") 11462 urls += "?" + c.urlParams_.Encode() 11463 req, err := http.NewRequest("POST", urls, body) 11464 if err != nil { 11465 return nil, err 11466 } 11467 req.Header = reqHeaders 11468 googleapi.Expand(req.URL, map[string]string{ 11469 "enterpriseId": c.enterpriseId, 11470 "productId": c.productId, 11471 }) 11472 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11473} 11474 11475// Do executes the "androidenterprise.products.unapprove" call. 11476func (c *ProductsUnapproveCall) Do(opts ...googleapi.CallOption) error { 11477 gensupport.SetOptions(c.urlParams_, opts...) 11478 res, err := c.doRequest("json") 11479 if err != nil { 11480 return err 11481 } 11482 defer googleapi.CloseBody(res) 11483 if err := googleapi.CheckResponse(res); err != nil { 11484 return err 11485 } 11486 return nil 11487 // { 11488 // "description": "Unapproves the specified product (and the relevant app permissions, if any)", 11489 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove", 11490 // "httpMethod": "POST", 11491 // "id": "androidenterprise.products.unapprove", 11492 // "parameterOrder": [ 11493 // "enterpriseId", 11494 // "productId" 11495 // ], 11496 // "parameters": { 11497 // "enterpriseId": { 11498 // "description": "The ID of the enterprise.", 11499 // "location": "path", 11500 // "required": true, 11501 // "type": "string" 11502 // }, 11503 // "productId": { 11504 // "description": "The ID of the product.", 11505 // "location": "path", 11506 // "required": true, 11507 // "type": "string" 11508 // } 11509 // }, 11510 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove", 11511 // "scopes": [ 11512 // "https://www.googleapis.com/auth/androidenterprise" 11513 // ] 11514 // } 11515 11516} 11517 11518// method id "androidenterprise.serviceaccountkeys.delete": 11519 11520type ServiceaccountkeysDeleteCall struct { 11521 s *Service 11522 enterpriseId string 11523 keyId string 11524 urlParams_ gensupport.URLParams 11525 ctx_ context.Context 11526 header_ http.Header 11527} 11528 11529// Delete: Removes and invalidates the specified credentials for the 11530// service account associated with this enterprise. The calling service 11531// account must have been retrieved by calling 11532// Enterprises.GetServiceAccount and must have been set as the 11533// enterprise service account by calling Enterprises.SetAccount. 11534// 11535// - enterpriseId: The ID of the enterprise. 11536// - keyId: The ID of the key. 11537func (r *ServiceaccountkeysService) Delete(enterpriseId string, keyId string) *ServiceaccountkeysDeleteCall { 11538 c := &ServiceaccountkeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11539 c.enterpriseId = enterpriseId 11540 c.keyId = keyId 11541 return c 11542} 11543 11544// Fields allows partial responses to be retrieved. See 11545// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11546// for more information. 11547func (c *ServiceaccountkeysDeleteCall) Fields(s ...googleapi.Field) *ServiceaccountkeysDeleteCall { 11548 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11549 return c 11550} 11551 11552// Context sets the context to be used in this call's Do method. Any 11553// pending HTTP request will be aborted if the provided context is 11554// canceled. 11555func (c *ServiceaccountkeysDeleteCall) Context(ctx context.Context) *ServiceaccountkeysDeleteCall { 11556 c.ctx_ = ctx 11557 return c 11558} 11559 11560// Header returns an http.Header that can be modified by the caller to 11561// add HTTP headers to the request. 11562func (c *ServiceaccountkeysDeleteCall) Header() http.Header { 11563 if c.header_ == nil { 11564 c.header_ = make(http.Header) 11565 } 11566 return c.header_ 11567} 11568 11569func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) { 11570 reqHeaders := make(http.Header) 11571 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11572 for k, v := range c.header_ { 11573 reqHeaders[k] = v 11574 } 11575 reqHeaders.Set("User-Agent", c.s.userAgent()) 11576 var body io.Reader = nil 11577 c.urlParams_.Set("alt", alt) 11578 c.urlParams_.Set("prettyPrint", "false") 11579 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}") 11580 urls += "?" + c.urlParams_.Encode() 11581 req, err := http.NewRequest("DELETE", urls, body) 11582 if err != nil { 11583 return nil, err 11584 } 11585 req.Header = reqHeaders 11586 googleapi.Expand(req.URL, map[string]string{ 11587 "enterpriseId": c.enterpriseId, 11588 "keyId": c.keyId, 11589 }) 11590 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11591} 11592 11593// Do executes the "androidenterprise.serviceaccountkeys.delete" call. 11594func (c *ServiceaccountkeysDeleteCall) Do(opts ...googleapi.CallOption) error { 11595 gensupport.SetOptions(c.urlParams_, opts...) 11596 res, err := c.doRequest("json") 11597 if err != nil { 11598 return err 11599 } 11600 defer googleapi.CloseBody(res) 11601 if err := googleapi.CheckResponse(res); err != nil { 11602 return err 11603 } 11604 return nil 11605 // { 11606 // "description": "Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.", 11607 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}", 11608 // "httpMethod": "DELETE", 11609 // "id": "androidenterprise.serviceaccountkeys.delete", 11610 // "parameterOrder": [ 11611 // "enterpriseId", 11612 // "keyId" 11613 // ], 11614 // "parameters": { 11615 // "enterpriseId": { 11616 // "description": "The ID of the enterprise.", 11617 // "location": "path", 11618 // "required": true, 11619 // "type": "string" 11620 // }, 11621 // "keyId": { 11622 // "description": "The ID of the key.", 11623 // "location": "path", 11624 // "required": true, 11625 // "type": "string" 11626 // } 11627 // }, 11628 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}", 11629 // "scopes": [ 11630 // "https://www.googleapis.com/auth/androidenterprise" 11631 // ] 11632 // } 11633 11634} 11635 11636// method id "androidenterprise.serviceaccountkeys.insert": 11637 11638type ServiceaccountkeysInsertCall struct { 11639 s *Service 11640 enterpriseId string 11641 serviceaccountkey *ServiceAccountKey 11642 urlParams_ gensupport.URLParams 11643 ctx_ context.Context 11644 header_ http.Header 11645} 11646 11647// Insert: Generates new credentials for the service account associated 11648// with this enterprise. The calling service account must have been 11649// retrieved by calling Enterprises.GetServiceAccount and must have been 11650// set as the enterprise service account by calling 11651// Enterprises.SetAccount. Only the type of the key should be populated 11652// in the resource to be inserted. 11653// 11654// - enterpriseId: The ID of the enterprise. 11655func (r *ServiceaccountkeysService) Insert(enterpriseId string, serviceaccountkey *ServiceAccountKey) *ServiceaccountkeysInsertCall { 11656 c := &ServiceaccountkeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11657 c.enterpriseId = enterpriseId 11658 c.serviceaccountkey = serviceaccountkey 11659 return c 11660} 11661 11662// Fields allows partial responses to be retrieved. See 11663// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11664// for more information. 11665func (c *ServiceaccountkeysInsertCall) Fields(s ...googleapi.Field) *ServiceaccountkeysInsertCall { 11666 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11667 return c 11668} 11669 11670// Context sets the context to be used in this call's Do method. Any 11671// pending HTTP request will be aborted if the provided context is 11672// canceled. 11673func (c *ServiceaccountkeysInsertCall) Context(ctx context.Context) *ServiceaccountkeysInsertCall { 11674 c.ctx_ = ctx 11675 return c 11676} 11677 11678// Header returns an http.Header that can be modified by the caller to 11679// add HTTP headers to the request. 11680func (c *ServiceaccountkeysInsertCall) Header() http.Header { 11681 if c.header_ == nil { 11682 c.header_ = make(http.Header) 11683 } 11684 return c.header_ 11685} 11686 11687func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) { 11688 reqHeaders := make(http.Header) 11689 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11690 for k, v := range c.header_ { 11691 reqHeaders[k] = v 11692 } 11693 reqHeaders.Set("User-Agent", c.s.userAgent()) 11694 var body io.Reader = nil 11695 body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey) 11696 if err != nil { 11697 return nil, err 11698 } 11699 reqHeaders.Set("Content-Type", "application/json") 11700 c.urlParams_.Set("alt", alt) 11701 c.urlParams_.Set("prettyPrint", "false") 11702 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys") 11703 urls += "?" + c.urlParams_.Encode() 11704 req, err := http.NewRequest("POST", urls, body) 11705 if err != nil { 11706 return nil, err 11707 } 11708 req.Header = reqHeaders 11709 googleapi.Expand(req.URL, map[string]string{ 11710 "enterpriseId": c.enterpriseId, 11711 }) 11712 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11713} 11714 11715// Do executes the "androidenterprise.serviceaccountkeys.insert" call. 11716// Exactly one of *ServiceAccountKey or error will be non-nil. Any 11717// non-2xx status code is an error. Response headers are in either 11718// *ServiceAccountKey.ServerResponse.Header or (if a response was 11719// returned at all) in error.(*googleapi.Error).Header. Use 11720// googleapi.IsNotModified to check whether the returned error was 11721// because http.StatusNotModified was returned. 11722func (c *ServiceaccountkeysInsertCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKey, error) { 11723 gensupport.SetOptions(c.urlParams_, opts...) 11724 res, err := c.doRequest("json") 11725 if res != nil && res.StatusCode == http.StatusNotModified { 11726 if res.Body != nil { 11727 res.Body.Close() 11728 } 11729 return nil, &googleapi.Error{ 11730 Code: res.StatusCode, 11731 Header: res.Header, 11732 } 11733 } 11734 if err != nil { 11735 return nil, err 11736 } 11737 defer googleapi.CloseBody(res) 11738 if err := googleapi.CheckResponse(res); err != nil { 11739 return nil, err 11740 } 11741 ret := &ServiceAccountKey{ 11742 ServerResponse: googleapi.ServerResponse{ 11743 Header: res.Header, 11744 HTTPStatusCode: res.StatusCode, 11745 }, 11746 } 11747 target := &ret 11748 if err := gensupport.DecodeResponse(target, res); err != nil { 11749 return nil, err 11750 } 11751 return ret, nil 11752 // { 11753 // "description": "Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. Only the type of the key should be populated in the resource to be inserted.", 11754 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11755 // "httpMethod": "POST", 11756 // "id": "androidenterprise.serviceaccountkeys.insert", 11757 // "parameterOrder": [ 11758 // "enterpriseId" 11759 // ], 11760 // "parameters": { 11761 // "enterpriseId": { 11762 // "description": "The ID of the enterprise.", 11763 // "location": "path", 11764 // "required": true, 11765 // "type": "string" 11766 // } 11767 // }, 11768 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11769 // "request": { 11770 // "$ref": "ServiceAccountKey" 11771 // }, 11772 // "response": { 11773 // "$ref": "ServiceAccountKey" 11774 // }, 11775 // "scopes": [ 11776 // "https://www.googleapis.com/auth/androidenterprise" 11777 // ] 11778 // } 11779 11780} 11781 11782// method id "androidenterprise.serviceaccountkeys.list": 11783 11784type ServiceaccountkeysListCall struct { 11785 s *Service 11786 enterpriseId string 11787 urlParams_ gensupport.URLParams 11788 ifNoneMatch_ string 11789 ctx_ context.Context 11790 header_ http.Header 11791} 11792 11793// List: Lists all active credentials for the service account associated 11794// with this enterprise. Only the ID and key type are returned. The 11795// calling service account must have been retrieved by calling 11796// Enterprises.GetServiceAccount and must have been set as the 11797// enterprise service account by calling Enterprises.SetAccount. 11798// 11799// - enterpriseId: The ID of the enterprise. 11800func (r *ServiceaccountkeysService) List(enterpriseId string) *ServiceaccountkeysListCall { 11801 c := &ServiceaccountkeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11802 c.enterpriseId = enterpriseId 11803 return c 11804} 11805 11806// Fields allows partial responses to be retrieved. See 11807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11808// for more information. 11809func (c *ServiceaccountkeysListCall) Fields(s ...googleapi.Field) *ServiceaccountkeysListCall { 11810 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11811 return c 11812} 11813 11814// IfNoneMatch sets the optional parameter which makes the operation 11815// fail if the object's ETag matches the given value. This is useful for 11816// getting updates only after the object has changed since the last 11817// request. Use googleapi.IsNotModified to check whether the response 11818// error from Do is the result of In-None-Match. 11819func (c *ServiceaccountkeysListCall) IfNoneMatch(entityTag string) *ServiceaccountkeysListCall { 11820 c.ifNoneMatch_ = entityTag 11821 return c 11822} 11823 11824// Context sets the context to be used in this call's Do method. Any 11825// pending HTTP request will be aborted if the provided context is 11826// canceled. 11827func (c *ServiceaccountkeysListCall) Context(ctx context.Context) *ServiceaccountkeysListCall { 11828 c.ctx_ = ctx 11829 return c 11830} 11831 11832// Header returns an http.Header that can be modified by the caller to 11833// add HTTP headers to the request. 11834func (c *ServiceaccountkeysListCall) Header() http.Header { 11835 if c.header_ == nil { 11836 c.header_ = make(http.Header) 11837 } 11838 return c.header_ 11839} 11840 11841func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, error) { 11842 reqHeaders := make(http.Header) 11843 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11844 for k, v := range c.header_ { 11845 reqHeaders[k] = v 11846 } 11847 reqHeaders.Set("User-Agent", c.s.userAgent()) 11848 if c.ifNoneMatch_ != "" { 11849 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11850 } 11851 var body io.Reader = nil 11852 c.urlParams_.Set("alt", alt) 11853 c.urlParams_.Set("prettyPrint", "false") 11854 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys") 11855 urls += "?" + c.urlParams_.Encode() 11856 req, err := http.NewRequest("GET", urls, body) 11857 if err != nil { 11858 return nil, err 11859 } 11860 req.Header = reqHeaders 11861 googleapi.Expand(req.URL, map[string]string{ 11862 "enterpriseId": c.enterpriseId, 11863 }) 11864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11865} 11866 11867// Do executes the "androidenterprise.serviceaccountkeys.list" call. 11868// Exactly one of *ServiceAccountKeysListResponse or error will be 11869// non-nil. Any non-2xx status code is an error. Response headers are in 11870// either *ServiceAccountKeysListResponse.ServerResponse.Header or (if a 11871// response was returned at all) in error.(*googleapi.Error).Header. Use 11872// googleapi.IsNotModified to check whether the returned error was 11873// because http.StatusNotModified was returned. 11874func (c *ServiceaccountkeysListCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKeysListResponse, error) { 11875 gensupport.SetOptions(c.urlParams_, opts...) 11876 res, err := c.doRequest("json") 11877 if res != nil && res.StatusCode == http.StatusNotModified { 11878 if res.Body != nil { 11879 res.Body.Close() 11880 } 11881 return nil, &googleapi.Error{ 11882 Code: res.StatusCode, 11883 Header: res.Header, 11884 } 11885 } 11886 if err != nil { 11887 return nil, err 11888 } 11889 defer googleapi.CloseBody(res) 11890 if err := googleapi.CheckResponse(res); err != nil { 11891 return nil, err 11892 } 11893 ret := &ServiceAccountKeysListResponse{ 11894 ServerResponse: googleapi.ServerResponse{ 11895 Header: res.Header, 11896 HTTPStatusCode: res.StatusCode, 11897 }, 11898 } 11899 target := &ret 11900 if err := gensupport.DecodeResponse(target, res); err != nil { 11901 return nil, err 11902 } 11903 return ret, nil 11904 // { 11905 // "description": "Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.", 11906 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11907 // "httpMethod": "GET", 11908 // "id": "androidenterprise.serviceaccountkeys.list", 11909 // "parameterOrder": [ 11910 // "enterpriseId" 11911 // ], 11912 // "parameters": { 11913 // "enterpriseId": { 11914 // "description": "The ID of the enterprise.", 11915 // "location": "path", 11916 // "required": true, 11917 // "type": "string" 11918 // } 11919 // }, 11920 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11921 // "response": { 11922 // "$ref": "ServiceAccountKeysListResponse" 11923 // }, 11924 // "scopes": [ 11925 // "https://www.googleapis.com/auth/androidenterprise" 11926 // ] 11927 // } 11928 11929} 11930 11931// method id "androidenterprise.storelayoutclusters.delete": 11932 11933type StorelayoutclustersDeleteCall struct { 11934 s *Service 11935 enterpriseId string 11936 pageId string 11937 clusterId string 11938 urlParams_ gensupport.URLParams 11939 ctx_ context.Context 11940 header_ http.Header 11941} 11942 11943// Delete: Deletes a cluster. 11944// 11945// - clusterId: The ID of the cluster. 11946// - enterpriseId: The ID of the enterprise. 11947// - pageId: The ID of the page. 11948func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall { 11949 c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11950 c.enterpriseId = enterpriseId 11951 c.pageId = pageId 11952 c.clusterId = clusterId 11953 return c 11954} 11955 11956// Fields allows partial responses to be retrieved. See 11957// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11958// for more information. 11959func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall { 11960 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11961 return c 11962} 11963 11964// Context sets the context to be used in this call's Do method. Any 11965// pending HTTP request will be aborted if the provided context is 11966// canceled. 11967func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall { 11968 c.ctx_ = ctx 11969 return c 11970} 11971 11972// Header returns an http.Header that can be modified by the caller to 11973// add HTTP headers to the request. 11974func (c *StorelayoutclustersDeleteCall) Header() http.Header { 11975 if c.header_ == nil { 11976 c.header_ = make(http.Header) 11977 } 11978 return c.header_ 11979} 11980 11981func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) { 11982 reqHeaders := make(http.Header) 11983 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11984 for k, v := range c.header_ { 11985 reqHeaders[k] = v 11986 } 11987 reqHeaders.Set("User-Agent", c.s.userAgent()) 11988 var body io.Reader = nil 11989 c.urlParams_.Set("alt", alt) 11990 c.urlParams_.Set("prettyPrint", "false") 11991 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 11992 urls += "?" + c.urlParams_.Encode() 11993 req, err := http.NewRequest("DELETE", urls, body) 11994 if err != nil { 11995 return nil, err 11996 } 11997 req.Header = reqHeaders 11998 googleapi.Expand(req.URL, map[string]string{ 11999 "enterpriseId": c.enterpriseId, 12000 "pageId": c.pageId, 12001 "clusterId": c.clusterId, 12002 }) 12003 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12004} 12005 12006// Do executes the "androidenterprise.storelayoutclusters.delete" call. 12007func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error { 12008 gensupport.SetOptions(c.urlParams_, opts...) 12009 res, err := c.doRequest("json") 12010 if err != nil { 12011 return err 12012 } 12013 defer googleapi.CloseBody(res) 12014 if err := googleapi.CheckResponse(res); err != nil { 12015 return err 12016 } 12017 return nil 12018 // { 12019 // "description": "Deletes a cluster.", 12020 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12021 // "httpMethod": "DELETE", 12022 // "id": "androidenterprise.storelayoutclusters.delete", 12023 // "parameterOrder": [ 12024 // "enterpriseId", 12025 // "pageId", 12026 // "clusterId" 12027 // ], 12028 // "parameters": { 12029 // "clusterId": { 12030 // "description": "The ID of the cluster.", 12031 // "location": "path", 12032 // "required": true, 12033 // "type": "string" 12034 // }, 12035 // "enterpriseId": { 12036 // "description": "The ID of the enterprise.", 12037 // "location": "path", 12038 // "required": true, 12039 // "type": "string" 12040 // }, 12041 // "pageId": { 12042 // "description": "The ID of the page.", 12043 // "location": "path", 12044 // "required": true, 12045 // "type": "string" 12046 // } 12047 // }, 12048 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12049 // "scopes": [ 12050 // "https://www.googleapis.com/auth/androidenterprise" 12051 // ] 12052 // } 12053 12054} 12055 12056// method id "androidenterprise.storelayoutclusters.get": 12057 12058type StorelayoutclustersGetCall struct { 12059 s *Service 12060 enterpriseId string 12061 pageId string 12062 clusterId string 12063 urlParams_ gensupport.URLParams 12064 ifNoneMatch_ string 12065 ctx_ context.Context 12066 header_ http.Header 12067} 12068 12069// Get: Retrieves details of a cluster. 12070// 12071// - clusterId: The ID of the cluster. 12072// - enterpriseId: The ID of the enterprise. 12073// - pageId: The ID of the page. 12074func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall { 12075 c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12076 c.enterpriseId = enterpriseId 12077 c.pageId = pageId 12078 c.clusterId = clusterId 12079 return c 12080} 12081 12082// Fields allows partial responses to be retrieved. See 12083// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12084// for more information. 12085func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall { 12086 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12087 return c 12088} 12089 12090// IfNoneMatch sets the optional parameter which makes the operation 12091// fail if the object's ETag matches the given value. This is useful for 12092// getting updates only after the object has changed since the last 12093// request. Use googleapi.IsNotModified to check whether the response 12094// error from Do is the result of In-None-Match. 12095func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall { 12096 c.ifNoneMatch_ = entityTag 12097 return c 12098} 12099 12100// Context sets the context to be used in this call's Do method. Any 12101// pending HTTP request will be aborted if the provided context is 12102// canceled. 12103func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall { 12104 c.ctx_ = ctx 12105 return c 12106} 12107 12108// Header returns an http.Header that can be modified by the caller to 12109// add HTTP headers to the request. 12110func (c *StorelayoutclustersGetCall) Header() http.Header { 12111 if c.header_ == nil { 12112 c.header_ = make(http.Header) 12113 } 12114 return c.header_ 12115} 12116 12117func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) { 12118 reqHeaders := make(http.Header) 12119 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12120 for k, v := range c.header_ { 12121 reqHeaders[k] = v 12122 } 12123 reqHeaders.Set("User-Agent", c.s.userAgent()) 12124 if c.ifNoneMatch_ != "" { 12125 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12126 } 12127 var body io.Reader = nil 12128 c.urlParams_.Set("alt", alt) 12129 c.urlParams_.Set("prettyPrint", "false") 12130 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 12131 urls += "?" + c.urlParams_.Encode() 12132 req, err := http.NewRequest("GET", urls, body) 12133 if err != nil { 12134 return nil, err 12135 } 12136 req.Header = reqHeaders 12137 googleapi.Expand(req.URL, map[string]string{ 12138 "enterpriseId": c.enterpriseId, 12139 "pageId": c.pageId, 12140 "clusterId": c.clusterId, 12141 }) 12142 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12143} 12144 12145// Do executes the "androidenterprise.storelayoutclusters.get" call. 12146// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12147// status code is an error. Response headers are in either 12148// *StoreCluster.ServerResponse.Header or (if a response was returned at 12149// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12150// to check whether the returned error was because 12151// http.StatusNotModified was returned. 12152func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12153 gensupport.SetOptions(c.urlParams_, opts...) 12154 res, err := c.doRequest("json") 12155 if res != nil && res.StatusCode == http.StatusNotModified { 12156 if res.Body != nil { 12157 res.Body.Close() 12158 } 12159 return nil, &googleapi.Error{ 12160 Code: res.StatusCode, 12161 Header: res.Header, 12162 } 12163 } 12164 if err != nil { 12165 return nil, err 12166 } 12167 defer googleapi.CloseBody(res) 12168 if err := googleapi.CheckResponse(res); err != nil { 12169 return nil, err 12170 } 12171 ret := &StoreCluster{ 12172 ServerResponse: googleapi.ServerResponse{ 12173 Header: res.Header, 12174 HTTPStatusCode: res.StatusCode, 12175 }, 12176 } 12177 target := &ret 12178 if err := gensupport.DecodeResponse(target, res); err != nil { 12179 return nil, err 12180 } 12181 return ret, nil 12182 // { 12183 // "description": "Retrieves details of a cluster.", 12184 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12185 // "httpMethod": "GET", 12186 // "id": "androidenterprise.storelayoutclusters.get", 12187 // "parameterOrder": [ 12188 // "enterpriseId", 12189 // "pageId", 12190 // "clusterId" 12191 // ], 12192 // "parameters": { 12193 // "clusterId": { 12194 // "description": "The ID of the cluster.", 12195 // "location": "path", 12196 // "required": true, 12197 // "type": "string" 12198 // }, 12199 // "enterpriseId": { 12200 // "description": "The ID of the enterprise.", 12201 // "location": "path", 12202 // "required": true, 12203 // "type": "string" 12204 // }, 12205 // "pageId": { 12206 // "description": "The ID of the page.", 12207 // "location": "path", 12208 // "required": true, 12209 // "type": "string" 12210 // } 12211 // }, 12212 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12213 // "response": { 12214 // "$ref": "StoreCluster" 12215 // }, 12216 // "scopes": [ 12217 // "https://www.googleapis.com/auth/androidenterprise" 12218 // ] 12219 // } 12220 12221} 12222 12223// method id "androidenterprise.storelayoutclusters.insert": 12224 12225type StorelayoutclustersInsertCall struct { 12226 s *Service 12227 enterpriseId string 12228 pageId string 12229 storecluster *StoreCluster 12230 urlParams_ gensupport.URLParams 12231 ctx_ context.Context 12232 header_ http.Header 12233} 12234 12235// Insert: Inserts a new cluster in a page. 12236// 12237// - enterpriseId: The ID of the enterprise. 12238// - pageId: The ID of the page. 12239func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall { 12240 c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12241 c.enterpriseId = enterpriseId 12242 c.pageId = pageId 12243 c.storecluster = storecluster 12244 return c 12245} 12246 12247// Fields allows partial responses to be retrieved. See 12248// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12249// for more information. 12250func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall { 12251 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12252 return c 12253} 12254 12255// Context sets the context to be used in this call's Do method. Any 12256// pending HTTP request will be aborted if the provided context is 12257// canceled. 12258func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall { 12259 c.ctx_ = ctx 12260 return c 12261} 12262 12263// Header returns an http.Header that can be modified by the caller to 12264// add HTTP headers to the request. 12265func (c *StorelayoutclustersInsertCall) Header() http.Header { 12266 if c.header_ == nil { 12267 c.header_ = make(http.Header) 12268 } 12269 return c.header_ 12270} 12271 12272func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) { 12273 reqHeaders := make(http.Header) 12274 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12275 for k, v := range c.header_ { 12276 reqHeaders[k] = v 12277 } 12278 reqHeaders.Set("User-Agent", c.s.userAgent()) 12279 var body io.Reader = nil 12280 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 12281 if err != nil { 12282 return nil, err 12283 } 12284 reqHeaders.Set("Content-Type", "application/json") 12285 c.urlParams_.Set("alt", alt) 12286 c.urlParams_.Set("prettyPrint", "false") 12287 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 12288 urls += "?" + c.urlParams_.Encode() 12289 req, err := http.NewRequest("POST", urls, body) 12290 if err != nil { 12291 return nil, err 12292 } 12293 req.Header = reqHeaders 12294 googleapi.Expand(req.URL, map[string]string{ 12295 "enterpriseId": c.enterpriseId, 12296 "pageId": c.pageId, 12297 }) 12298 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12299} 12300 12301// Do executes the "androidenterprise.storelayoutclusters.insert" call. 12302// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12303// status code is an error. Response headers are in either 12304// *StoreCluster.ServerResponse.Header or (if a response was returned at 12305// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12306// to check whether the returned error was because 12307// http.StatusNotModified was returned. 12308func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12309 gensupport.SetOptions(c.urlParams_, opts...) 12310 res, err := c.doRequest("json") 12311 if res != nil && res.StatusCode == http.StatusNotModified { 12312 if res.Body != nil { 12313 res.Body.Close() 12314 } 12315 return nil, &googleapi.Error{ 12316 Code: res.StatusCode, 12317 Header: res.Header, 12318 } 12319 } 12320 if err != nil { 12321 return nil, err 12322 } 12323 defer googleapi.CloseBody(res) 12324 if err := googleapi.CheckResponse(res); err != nil { 12325 return nil, err 12326 } 12327 ret := &StoreCluster{ 12328 ServerResponse: googleapi.ServerResponse{ 12329 Header: res.Header, 12330 HTTPStatusCode: res.StatusCode, 12331 }, 12332 } 12333 target := &ret 12334 if err := gensupport.DecodeResponse(target, res); err != nil { 12335 return nil, err 12336 } 12337 return ret, nil 12338 // { 12339 // "description": "Inserts a new cluster in a page.", 12340 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12341 // "httpMethod": "POST", 12342 // "id": "androidenterprise.storelayoutclusters.insert", 12343 // "parameterOrder": [ 12344 // "enterpriseId", 12345 // "pageId" 12346 // ], 12347 // "parameters": { 12348 // "enterpriseId": { 12349 // "description": "The ID of the enterprise.", 12350 // "location": "path", 12351 // "required": true, 12352 // "type": "string" 12353 // }, 12354 // "pageId": { 12355 // "description": "The ID of the page.", 12356 // "location": "path", 12357 // "required": true, 12358 // "type": "string" 12359 // } 12360 // }, 12361 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12362 // "request": { 12363 // "$ref": "StoreCluster" 12364 // }, 12365 // "response": { 12366 // "$ref": "StoreCluster" 12367 // }, 12368 // "scopes": [ 12369 // "https://www.googleapis.com/auth/androidenterprise" 12370 // ] 12371 // } 12372 12373} 12374 12375// method id "androidenterprise.storelayoutclusters.list": 12376 12377type StorelayoutclustersListCall struct { 12378 s *Service 12379 enterpriseId string 12380 pageId string 12381 urlParams_ gensupport.URLParams 12382 ifNoneMatch_ string 12383 ctx_ context.Context 12384 header_ http.Header 12385} 12386 12387// List: Retrieves the details of all clusters on the specified page. 12388// 12389// - enterpriseId: The ID of the enterprise. 12390// - pageId: The ID of the page. 12391func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall { 12392 c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12393 c.enterpriseId = enterpriseId 12394 c.pageId = pageId 12395 return c 12396} 12397 12398// Fields allows partial responses to be retrieved. See 12399// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12400// for more information. 12401func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall { 12402 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12403 return c 12404} 12405 12406// IfNoneMatch sets the optional parameter which makes the operation 12407// fail if the object's ETag matches the given value. This is useful for 12408// getting updates only after the object has changed since the last 12409// request. Use googleapi.IsNotModified to check whether the response 12410// error from Do is the result of In-None-Match. 12411func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall { 12412 c.ifNoneMatch_ = entityTag 12413 return c 12414} 12415 12416// Context sets the context to be used in this call's Do method. Any 12417// pending HTTP request will be aborted if the provided context is 12418// canceled. 12419func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall { 12420 c.ctx_ = ctx 12421 return c 12422} 12423 12424// Header returns an http.Header that can be modified by the caller to 12425// add HTTP headers to the request. 12426func (c *StorelayoutclustersListCall) Header() http.Header { 12427 if c.header_ == nil { 12428 c.header_ = make(http.Header) 12429 } 12430 return c.header_ 12431} 12432 12433func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) { 12434 reqHeaders := make(http.Header) 12435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12436 for k, v := range c.header_ { 12437 reqHeaders[k] = v 12438 } 12439 reqHeaders.Set("User-Agent", c.s.userAgent()) 12440 if c.ifNoneMatch_ != "" { 12441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12442 } 12443 var body io.Reader = nil 12444 c.urlParams_.Set("alt", alt) 12445 c.urlParams_.Set("prettyPrint", "false") 12446 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 12447 urls += "?" + c.urlParams_.Encode() 12448 req, err := http.NewRequest("GET", urls, body) 12449 if err != nil { 12450 return nil, err 12451 } 12452 req.Header = reqHeaders 12453 googleapi.Expand(req.URL, map[string]string{ 12454 "enterpriseId": c.enterpriseId, 12455 "pageId": c.pageId, 12456 }) 12457 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12458} 12459 12460// Do executes the "androidenterprise.storelayoutclusters.list" call. 12461// Exactly one of *StoreLayoutClustersListResponse or error will be 12462// non-nil. Any non-2xx status code is an error. Response headers are in 12463// either *StoreLayoutClustersListResponse.ServerResponse.Header or (if 12464// a response was returned at all) in error.(*googleapi.Error).Header. 12465// Use googleapi.IsNotModified to check whether the returned error was 12466// because http.StatusNotModified was returned. 12467func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) { 12468 gensupport.SetOptions(c.urlParams_, opts...) 12469 res, err := c.doRequest("json") 12470 if res != nil && res.StatusCode == http.StatusNotModified { 12471 if res.Body != nil { 12472 res.Body.Close() 12473 } 12474 return nil, &googleapi.Error{ 12475 Code: res.StatusCode, 12476 Header: res.Header, 12477 } 12478 } 12479 if err != nil { 12480 return nil, err 12481 } 12482 defer googleapi.CloseBody(res) 12483 if err := googleapi.CheckResponse(res); err != nil { 12484 return nil, err 12485 } 12486 ret := &StoreLayoutClustersListResponse{ 12487 ServerResponse: googleapi.ServerResponse{ 12488 Header: res.Header, 12489 HTTPStatusCode: res.StatusCode, 12490 }, 12491 } 12492 target := &ret 12493 if err := gensupport.DecodeResponse(target, res); err != nil { 12494 return nil, err 12495 } 12496 return ret, nil 12497 // { 12498 // "description": "Retrieves the details of all clusters on the specified page.", 12499 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12500 // "httpMethod": "GET", 12501 // "id": "androidenterprise.storelayoutclusters.list", 12502 // "parameterOrder": [ 12503 // "enterpriseId", 12504 // "pageId" 12505 // ], 12506 // "parameters": { 12507 // "enterpriseId": { 12508 // "description": "The ID of the enterprise.", 12509 // "location": "path", 12510 // "required": true, 12511 // "type": "string" 12512 // }, 12513 // "pageId": { 12514 // "description": "The ID of the page.", 12515 // "location": "path", 12516 // "required": true, 12517 // "type": "string" 12518 // } 12519 // }, 12520 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12521 // "response": { 12522 // "$ref": "StoreLayoutClustersListResponse" 12523 // }, 12524 // "scopes": [ 12525 // "https://www.googleapis.com/auth/androidenterprise" 12526 // ] 12527 // } 12528 12529} 12530 12531// method id "androidenterprise.storelayoutclusters.update": 12532 12533type StorelayoutclustersUpdateCall struct { 12534 s *Service 12535 enterpriseId string 12536 pageId string 12537 clusterId string 12538 storecluster *StoreCluster 12539 urlParams_ gensupport.URLParams 12540 ctx_ context.Context 12541 header_ http.Header 12542} 12543 12544// Update: Updates a cluster. 12545// 12546// - clusterId: The ID of the cluster. 12547// - enterpriseId: The ID of the enterprise. 12548// - pageId: The ID of the page. 12549func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall { 12550 c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12551 c.enterpriseId = enterpriseId 12552 c.pageId = pageId 12553 c.clusterId = clusterId 12554 c.storecluster = storecluster 12555 return c 12556} 12557 12558// Fields allows partial responses to be retrieved. See 12559// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12560// for more information. 12561func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall { 12562 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12563 return c 12564} 12565 12566// Context sets the context to be used in this call's Do method. Any 12567// pending HTTP request will be aborted if the provided context is 12568// canceled. 12569func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall { 12570 c.ctx_ = ctx 12571 return c 12572} 12573 12574// Header returns an http.Header that can be modified by the caller to 12575// add HTTP headers to the request. 12576func (c *StorelayoutclustersUpdateCall) Header() http.Header { 12577 if c.header_ == nil { 12578 c.header_ = make(http.Header) 12579 } 12580 return c.header_ 12581} 12582 12583func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) { 12584 reqHeaders := make(http.Header) 12585 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12586 for k, v := range c.header_ { 12587 reqHeaders[k] = v 12588 } 12589 reqHeaders.Set("User-Agent", c.s.userAgent()) 12590 var body io.Reader = nil 12591 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 12592 if err != nil { 12593 return nil, err 12594 } 12595 reqHeaders.Set("Content-Type", "application/json") 12596 c.urlParams_.Set("alt", alt) 12597 c.urlParams_.Set("prettyPrint", "false") 12598 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 12599 urls += "?" + c.urlParams_.Encode() 12600 req, err := http.NewRequest("PUT", urls, body) 12601 if err != nil { 12602 return nil, err 12603 } 12604 req.Header = reqHeaders 12605 googleapi.Expand(req.URL, map[string]string{ 12606 "enterpriseId": c.enterpriseId, 12607 "pageId": c.pageId, 12608 "clusterId": c.clusterId, 12609 }) 12610 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12611} 12612 12613// Do executes the "androidenterprise.storelayoutclusters.update" call. 12614// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12615// status code is an error. Response headers are in either 12616// *StoreCluster.ServerResponse.Header or (if a response was returned at 12617// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12618// to check whether the returned error was because 12619// http.StatusNotModified was returned. 12620func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12621 gensupport.SetOptions(c.urlParams_, opts...) 12622 res, err := c.doRequest("json") 12623 if res != nil && res.StatusCode == http.StatusNotModified { 12624 if res.Body != nil { 12625 res.Body.Close() 12626 } 12627 return nil, &googleapi.Error{ 12628 Code: res.StatusCode, 12629 Header: res.Header, 12630 } 12631 } 12632 if err != nil { 12633 return nil, err 12634 } 12635 defer googleapi.CloseBody(res) 12636 if err := googleapi.CheckResponse(res); err != nil { 12637 return nil, err 12638 } 12639 ret := &StoreCluster{ 12640 ServerResponse: googleapi.ServerResponse{ 12641 Header: res.Header, 12642 HTTPStatusCode: res.StatusCode, 12643 }, 12644 } 12645 target := &ret 12646 if err := gensupport.DecodeResponse(target, res); err != nil { 12647 return nil, err 12648 } 12649 return ret, nil 12650 // { 12651 // "description": "Updates a cluster.", 12652 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12653 // "httpMethod": "PUT", 12654 // "id": "androidenterprise.storelayoutclusters.update", 12655 // "parameterOrder": [ 12656 // "enterpriseId", 12657 // "pageId", 12658 // "clusterId" 12659 // ], 12660 // "parameters": { 12661 // "clusterId": { 12662 // "description": "The ID of the cluster.", 12663 // "location": "path", 12664 // "required": true, 12665 // "type": "string" 12666 // }, 12667 // "enterpriseId": { 12668 // "description": "The ID of the enterprise.", 12669 // "location": "path", 12670 // "required": true, 12671 // "type": "string" 12672 // }, 12673 // "pageId": { 12674 // "description": "The ID of the page.", 12675 // "location": "path", 12676 // "required": true, 12677 // "type": "string" 12678 // } 12679 // }, 12680 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12681 // "request": { 12682 // "$ref": "StoreCluster" 12683 // }, 12684 // "response": { 12685 // "$ref": "StoreCluster" 12686 // }, 12687 // "scopes": [ 12688 // "https://www.googleapis.com/auth/androidenterprise" 12689 // ] 12690 // } 12691 12692} 12693 12694// method id "androidenterprise.storelayoutpages.delete": 12695 12696type StorelayoutpagesDeleteCall struct { 12697 s *Service 12698 enterpriseId string 12699 pageId string 12700 urlParams_ gensupport.URLParams 12701 ctx_ context.Context 12702 header_ http.Header 12703} 12704 12705// Delete: Deletes a store page. 12706// 12707// - enterpriseId: The ID of the enterprise. 12708// - pageId: The ID of the page. 12709func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall { 12710 c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12711 c.enterpriseId = enterpriseId 12712 c.pageId = pageId 12713 return c 12714} 12715 12716// Fields allows partial responses to be retrieved. See 12717// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12718// for more information. 12719func (c *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall { 12720 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12721 return c 12722} 12723 12724// Context sets the context to be used in this call's Do method. Any 12725// pending HTTP request will be aborted if the provided context is 12726// canceled. 12727func (c *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall { 12728 c.ctx_ = ctx 12729 return c 12730} 12731 12732// Header returns an http.Header that can be modified by the caller to 12733// add HTTP headers to the request. 12734func (c *StorelayoutpagesDeleteCall) Header() http.Header { 12735 if c.header_ == nil { 12736 c.header_ = make(http.Header) 12737 } 12738 return c.header_ 12739} 12740 12741func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) { 12742 reqHeaders := make(http.Header) 12743 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12744 for k, v := range c.header_ { 12745 reqHeaders[k] = v 12746 } 12747 reqHeaders.Set("User-Agent", c.s.userAgent()) 12748 var body io.Reader = nil 12749 c.urlParams_.Set("alt", alt) 12750 c.urlParams_.Set("prettyPrint", "false") 12751 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12752 urls += "?" + c.urlParams_.Encode() 12753 req, err := http.NewRequest("DELETE", urls, body) 12754 if err != nil { 12755 return nil, err 12756 } 12757 req.Header = reqHeaders 12758 googleapi.Expand(req.URL, map[string]string{ 12759 "enterpriseId": c.enterpriseId, 12760 "pageId": c.pageId, 12761 }) 12762 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12763} 12764 12765// Do executes the "androidenterprise.storelayoutpages.delete" call. 12766func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error { 12767 gensupport.SetOptions(c.urlParams_, opts...) 12768 res, err := c.doRequest("json") 12769 if err != nil { 12770 return err 12771 } 12772 defer googleapi.CloseBody(res) 12773 if err := googleapi.CheckResponse(res); err != nil { 12774 return err 12775 } 12776 return nil 12777 // { 12778 // "description": "Deletes a store page.", 12779 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12780 // "httpMethod": "DELETE", 12781 // "id": "androidenterprise.storelayoutpages.delete", 12782 // "parameterOrder": [ 12783 // "enterpriseId", 12784 // "pageId" 12785 // ], 12786 // "parameters": { 12787 // "enterpriseId": { 12788 // "description": "The ID of the enterprise.", 12789 // "location": "path", 12790 // "required": true, 12791 // "type": "string" 12792 // }, 12793 // "pageId": { 12794 // "description": "The ID of the page.", 12795 // "location": "path", 12796 // "required": true, 12797 // "type": "string" 12798 // } 12799 // }, 12800 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12801 // "scopes": [ 12802 // "https://www.googleapis.com/auth/androidenterprise" 12803 // ] 12804 // } 12805 12806} 12807 12808// method id "androidenterprise.storelayoutpages.get": 12809 12810type StorelayoutpagesGetCall struct { 12811 s *Service 12812 enterpriseId string 12813 pageId string 12814 urlParams_ gensupport.URLParams 12815 ifNoneMatch_ string 12816 ctx_ context.Context 12817 header_ http.Header 12818} 12819 12820// Get: Retrieves details of a store page. 12821// 12822// - enterpriseId: The ID of the enterprise. 12823// - pageId: The ID of the page. 12824func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall { 12825 c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12826 c.enterpriseId = enterpriseId 12827 c.pageId = pageId 12828 return c 12829} 12830 12831// Fields allows partial responses to be retrieved. See 12832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12833// for more information. 12834func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall { 12835 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12836 return c 12837} 12838 12839// IfNoneMatch sets the optional parameter which makes the operation 12840// fail if the object's ETag matches the given value. This is useful for 12841// getting updates only after the object has changed since the last 12842// request. Use googleapi.IsNotModified to check whether the response 12843// error from Do is the result of In-None-Match. 12844func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall { 12845 c.ifNoneMatch_ = entityTag 12846 return c 12847} 12848 12849// Context sets the context to be used in this call's Do method. Any 12850// pending HTTP request will be aborted if the provided context is 12851// canceled. 12852func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall { 12853 c.ctx_ = ctx 12854 return c 12855} 12856 12857// Header returns an http.Header that can be modified by the caller to 12858// add HTTP headers to the request. 12859func (c *StorelayoutpagesGetCall) Header() http.Header { 12860 if c.header_ == nil { 12861 c.header_ = make(http.Header) 12862 } 12863 return c.header_ 12864} 12865 12866func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) { 12867 reqHeaders := make(http.Header) 12868 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12869 for k, v := range c.header_ { 12870 reqHeaders[k] = v 12871 } 12872 reqHeaders.Set("User-Agent", c.s.userAgent()) 12873 if c.ifNoneMatch_ != "" { 12874 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12875 } 12876 var body io.Reader = nil 12877 c.urlParams_.Set("alt", alt) 12878 c.urlParams_.Set("prettyPrint", "false") 12879 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12880 urls += "?" + c.urlParams_.Encode() 12881 req, err := http.NewRequest("GET", urls, body) 12882 if err != nil { 12883 return nil, err 12884 } 12885 req.Header = reqHeaders 12886 googleapi.Expand(req.URL, map[string]string{ 12887 "enterpriseId": c.enterpriseId, 12888 "pageId": c.pageId, 12889 }) 12890 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12891} 12892 12893// Do executes the "androidenterprise.storelayoutpages.get" call. 12894// Exactly one of *StorePage or error will be non-nil. Any non-2xx 12895// status code is an error. Response headers are in either 12896// *StorePage.ServerResponse.Header or (if a response was returned at 12897// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12898// to check whether the returned error was because 12899// http.StatusNotModified was returned. 12900func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 12901 gensupport.SetOptions(c.urlParams_, opts...) 12902 res, err := c.doRequest("json") 12903 if res != nil && res.StatusCode == http.StatusNotModified { 12904 if res.Body != nil { 12905 res.Body.Close() 12906 } 12907 return nil, &googleapi.Error{ 12908 Code: res.StatusCode, 12909 Header: res.Header, 12910 } 12911 } 12912 if err != nil { 12913 return nil, err 12914 } 12915 defer googleapi.CloseBody(res) 12916 if err := googleapi.CheckResponse(res); err != nil { 12917 return nil, err 12918 } 12919 ret := &StorePage{ 12920 ServerResponse: googleapi.ServerResponse{ 12921 Header: res.Header, 12922 HTTPStatusCode: res.StatusCode, 12923 }, 12924 } 12925 target := &ret 12926 if err := gensupport.DecodeResponse(target, res); err != nil { 12927 return nil, err 12928 } 12929 return ret, nil 12930 // { 12931 // "description": "Retrieves details of a store page.", 12932 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12933 // "httpMethod": "GET", 12934 // "id": "androidenterprise.storelayoutpages.get", 12935 // "parameterOrder": [ 12936 // "enterpriseId", 12937 // "pageId" 12938 // ], 12939 // "parameters": { 12940 // "enterpriseId": { 12941 // "description": "The ID of the enterprise.", 12942 // "location": "path", 12943 // "required": true, 12944 // "type": "string" 12945 // }, 12946 // "pageId": { 12947 // "description": "The ID of the page.", 12948 // "location": "path", 12949 // "required": true, 12950 // "type": "string" 12951 // } 12952 // }, 12953 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12954 // "response": { 12955 // "$ref": "StorePage" 12956 // }, 12957 // "scopes": [ 12958 // "https://www.googleapis.com/auth/androidenterprise" 12959 // ] 12960 // } 12961 12962} 12963 12964// method id "androidenterprise.storelayoutpages.insert": 12965 12966type StorelayoutpagesInsertCall struct { 12967 s *Service 12968 enterpriseId string 12969 storepage *StorePage 12970 urlParams_ gensupport.URLParams 12971 ctx_ context.Context 12972 header_ http.Header 12973} 12974 12975// Insert: Inserts a new store page. 12976// 12977// - enterpriseId: The ID of the enterprise. 12978func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall { 12979 c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12980 c.enterpriseId = enterpriseId 12981 c.storepage = storepage 12982 return c 12983} 12984 12985// Fields allows partial responses to be retrieved. See 12986// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12987// for more information. 12988func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall { 12989 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12990 return c 12991} 12992 12993// Context sets the context to be used in this call's Do method. Any 12994// pending HTTP request will be aborted if the provided context is 12995// canceled. 12996func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall { 12997 c.ctx_ = ctx 12998 return c 12999} 13000 13001// Header returns an http.Header that can be modified by the caller to 13002// add HTTP headers to the request. 13003func (c *StorelayoutpagesInsertCall) Header() http.Header { 13004 if c.header_ == nil { 13005 c.header_ = make(http.Header) 13006 } 13007 return c.header_ 13008} 13009 13010func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) { 13011 reqHeaders := make(http.Header) 13012 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13013 for k, v := range c.header_ { 13014 reqHeaders[k] = v 13015 } 13016 reqHeaders.Set("User-Agent", c.s.userAgent()) 13017 var body io.Reader = nil 13018 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 13019 if err != nil { 13020 return nil, err 13021 } 13022 reqHeaders.Set("Content-Type", "application/json") 13023 c.urlParams_.Set("alt", alt) 13024 c.urlParams_.Set("prettyPrint", "false") 13025 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages") 13026 urls += "?" + c.urlParams_.Encode() 13027 req, err := http.NewRequest("POST", urls, body) 13028 if err != nil { 13029 return nil, err 13030 } 13031 req.Header = reqHeaders 13032 googleapi.Expand(req.URL, map[string]string{ 13033 "enterpriseId": c.enterpriseId, 13034 }) 13035 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13036} 13037 13038// Do executes the "androidenterprise.storelayoutpages.insert" call. 13039// Exactly one of *StorePage or error will be non-nil. Any non-2xx 13040// status code is an error. Response headers are in either 13041// *StorePage.ServerResponse.Header or (if a response was returned at 13042// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13043// to check whether the returned error was because 13044// http.StatusNotModified was returned. 13045func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 13046 gensupport.SetOptions(c.urlParams_, opts...) 13047 res, err := c.doRequest("json") 13048 if res != nil && res.StatusCode == http.StatusNotModified { 13049 if res.Body != nil { 13050 res.Body.Close() 13051 } 13052 return nil, &googleapi.Error{ 13053 Code: res.StatusCode, 13054 Header: res.Header, 13055 } 13056 } 13057 if err != nil { 13058 return nil, err 13059 } 13060 defer googleapi.CloseBody(res) 13061 if err := googleapi.CheckResponse(res); err != nil { 13062 return nil, err 13063 } 13064 ret := &StorePage{ 13065 ServerResponse: googleapi.ServerResponse{ 13066 Header: res.Header, 13067 HTTPStatusCode: res.StatusCode, 13068 }, 13069 } 13070 target := &ret 13071 if err := gensupport.DecodeResponse(target, res); err != nil { 13072 return nil, err 13073 } 13074 return ret, nil 13075 // { 13076 // "description": "Inserts a new store page.", 13077 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13078 // "httpMethod": "POST", 13079 // "id": "androidenterprise.storelayoutpages.insert", 13080 // "parameterOrder": [ 13081 // "enterpriseId" 13082 // ], 13083 // "parameters": { 13084 // "enterpriseId": { 13085 // "description": "The ID of the enterprise.", 13086 // "location": "path", 13087 // "required": true, 13088 // "type": "string" 13089 // } 13090 // }, 13091 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13092 // "request": { 13093 // "$ref": "StorePage" 13094 // }, 13095 // "response": { 13096 // "$ref": "StorePage" 13097 // }, 13098 // "scopes": [ 13099 // "https://www.googleapis.com/auth/androidenterprise" 13100 // ] 13101 // } 13102 13103} 13104 13105// method id "androidenterprise.storelayoutpages.list": 13106 13107type StorelayoutpagesListCall struct { 13108 s *Service 13109 enterpriseId string 13110 urlParams_ gensupport.URLParams 13111 ifNoneMatch_ string 13112 ctx_ context.Context 13113 header_ http.Header 13114} 13115 13116// List: Retrieves the details of all pages in the store. 13117// 13118// - enterpriseId: The ID of the enterprise. 13119func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall { 13120 c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13121 c.enterpriseId = enterpriseId 13122 return c 13123} 13124 13125// Fields allows partial responses to be retrieved. See 13126// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13127// for more information. 13128func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall { 13129 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13130 return c 13131} 13132 13133// IfNoneMatch sets the optional parameter which makes the operation 13134// fail if the object's ETag matches the given value. This is useful for 13135// getting updates only after the object has changed since the last 13136// request. Use googleapi.IsNotModified to check whether the response 13137// error from Do is the result of In-None-Match. 13138func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall { 13139 c.ifNoneMatch_ = entityTag 13140 return c 13141} 13142 13143// Context sets the context to be used in this call's Do method. Any 13144// pending HTTP request will be aborted if the provided context is 13145// canceled. 13146func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall { 13147 c.ctx_ = ctx 13148 return c 13149} 13150 13151// Header returns an http.Header that can be modified by the caller to 13152// add HTTP headers to the request. 13153func (c *StorelayoutpagesListCall) Header() http.Header { 13154 if c.header_ == nil { 13155 c.header_ = make(http.Header) 13156 } 13157 return c.header_ 13158} 13159 13160func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) { 13161 reqHeaders := make(http.Header) 13162 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13163 for k, v := range c.header_ { 13164 reqHeaders[k] = v 13165 } 13166 reqHeaders.Set("User-Agent", c.s.userAgent()) 13167 if c.ifNoneMatch_ != "" { 13168 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13169 } 13170 var body io.Reader = nil 13171 c.urlParams_.Set("alt", alt) 13172 c.urlParams_.Set("prettyPrint", "false") 13173 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages") 13174 urls += "?" + c.urlParams_.Encode() 13175 req, err := http.NewRequest("GET", urls, body) 13176 if err != nil { 13177 return nil, err 13178 } 13179 req.Header = reqHeaders 13180 googleapi.Expand(req.URL, map[string]string{ 13181 "enterpriseId": c.enterpriseId, 13182 }) 13183 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13184} 13185 13186// Do executes the "androidenterprise.storelayoutpages.list" call. 13187// Exactly one of *StoreLayoutPagesListResponse or error will be 13188// non-nil. Any non-2xx status code is an error. Response headers are in 13189// either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a 13190// response was returned at all) in error.(*googleapi.Error).Header. Use 13191// googleapi.IsNotModified to check whether the returned error was 13192// because http.StatusNotModified was returned. 13193func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) { 13194 gensupport.SetOptions(c.urlParams_, opts...) 13195 res, err := c.doRequest("json") 13196 if res != nil && res.StatusCode == http.StatusNotModified { 13197 if res.Body != nil { 13198 res.Body.Close() 13199 } 13200 return nil, &googleapi.Error{ 13201 Code: res.StatusCode, 13202 Header: res.Header, 13203 } 13204 } 13205 if err != nil { 13206 return nil, err 13207 } 13208 defer googleapi.CloseBody(res) 13209 if err := googleapi.CheckResponse(res); err != nil { 13210 return nil, err 13211 } 13212 ret := &StoreLayoutPagesListResponse{ 13213 ServerResponse: googleapi.ServerResponse{ 13214 Header: res.Header, 13215 HTTPStatusCode: res.StatusCode, 13216 }, 13217 } 13218 target := &ret 13219 if err := gensupport.DecodeResponse(target, res); err != nil { 13220 return nil, err 13221 } 13222 return ret, nil 13223 // { 13224 // "description": "Retrieves the details of all pages in the store.", 13225 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13226 // "httpMethod": "GET", 13227 // "id": "androidenterprise.storelayoutpages.list", 13228 // "parameterOrder": [ 13229 // "enterpriseId" 13230 // ], 13231 // "parameters": { 13232 // "enterpriseId": { 13233 // "description": "The ID of the enterprise.", 13234 // "location": "path", 13235 // "required": true, 13236 // "type": "string" 13237 // } 13238 // }, 13239 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13240 // "response": { 13241 // "$ref": "StoreLayoutPagesListResponse" 13242 // }, 13243 // "scopes": [ 13244 // "https://www.googleapis.com/auth/androidenterprise" 13245 // ] 13246 // } 13247 13248} 13249 13250// method id "androidenterprise.storelayoutpages.update": 13251 13252type StorelayoutpagesUpdateCall struct { 13253 s *Service 13254 enterpriseId string 13255 pageId string 13256 storepage *StorePage 13257 urlParams_ gensupport.URLParams 13258 ctx_ context.Context 13259 header_ http.Header 13260} 13261 13262// Update: Updates the content of a store page. 13263// 13264// - enterpriseId: The ID of the enterprise. 13265// - pageId: The ID of the page. 13266func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall { 13267 c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13268 c.enterpriseId = enterpriseId 13269 c.pageId = pageId 13270 c.storepage = storepage 13271 return c 13272} 13273 13274// Fields allows partial responses to be retrieved. See 13275// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13276// for more information. 13277func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall { 13278 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13279 return c 13280} 13281 13282// Context sets the context to be used in this call's Do method. Any 13283// pending HTTP request will be aborted if the provided context is 13284// canceled. 13285func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall { 13286 c.ctx_ = ctx 13287 return c 13288} 13289 13290// Header returns an http.Header that can be modified by the caller to 13291// add HTTP headers to the request. 13292func (c *StorelayoutpagesUpdateCall) Header() http.Header { 13293 if c.header_ == nil { 13294 c.header_ = make(http.Header) 13295 } 13296 return c.header_ 13297} 13298 13299func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) { 13300 reqHeaders := make(http.Header) 13301 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13302 for k, v := range c.header_ { 13303 reqHeaders[k] = v 13304 } 13305 reqHeaders.Set("User-Agent", c.s.userAgent()) 13306 var body io.Reader = nil 13307 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 13308 if err != nil { 13309 return nil, err 13310 } 13311 reqHeaders.Set("Content-Type", "application/json") 13312 c.urlParams_.Set("alt", alt) 13313 c.urlParams_.Set("prettyPrint", "false") 13314 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 13315 urls += "?" + c.urlParams_.Encode() 13316 req, err := http.NewRequest("PUT", urls, body) 13317 if err != nil { 13318 return nil, err 13319 } 13320 req.Header = reqHeaders 13321 googleapi.Expand(req.URL, map[string]string{ 13322 "enterpriseId": c.enterpriseId, 13323 "pageId": c.pageId, 13324 }) 13325 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13326} 13327 13328// Do executes the "androidenterprise.storelayoutpages.update" call. 13329// Exactly one of *StorePage or error will be non-nil. Any non-2xx 13330// status code is an error. Response headers are in either 13331// *StorePage.ServerResponse.Header or (if a response was returned at 13332// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13333// to check whether the returned error was because 13334// http.StatusNotModified was returned. 13335func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 13336 gensupport.SetOptions(c.urlParams_, opts...) 13337 res, err := c.doRequest("json") 13338 if res != nil && res.StatusCode == http.StatusNotModified { 13339 if res.Body != nil { 13340 res.Body.Close() 13341 } 13342 return nil, &googleapi.Error{ 13343 Code: res.StatusCode, 13344 Header: res.Header, 13345 } 13346 } 13347 if err != nil { 13348 return nil, err 13349 } 13350 defer googleapi.CloseBody(res) 13351 if err := googleapi.CheckResponse(res); err != nil { 13352 return nil, err 13353 } 13354 ret := &StorePage{ 13355 ServerResponse: googleapi.ServerResponse{ 13356 Header: res.Header, 13357 HTTPStatusCode: res.StatusCode, 13358 }, 13359 } 13360 target := &ret 13361 if err := gensupport.DecodeResponse(target, res); err != nil { 13362 return nil, err 13363 } 13364 return ret, nil 13365 // { 13366 // "description": "Updates the content of a store page.", 13367 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 13368 // "httpMethod": "PUT", 13369 // "id": "androidenterprise.storelayoutpages.update", 13370 // "parameterOrder": [ 13371 // "enterpriseId", 13372 // "pageId" 13373 // ], 13374 // "parameters": { 13375 // "enterpriseId": { 13376 // "description": "The ID of the enterprise.", 13377 // "location": "path", 13378 // "required": true, 13379 // "type": "string" 13380 // }, 13381 // "pageId": { 13382 // "description": "The ID of the page.", 13383 // "location": "path", 13384 // "required": true, 13385 // "type": "string" 13386 // } 13387 // }, 13388 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 13389 // "request": { 13390 // "$ref": "StorePage" 13391 // }, 13392 // "response": { 13393 // "$ref": "StorePage" 13394 // }, 13395 // "scopes": [ 13396 // "https://www.googleapis.com/auth/androidenterprise" 13397 // ] 13398 // } 13399 13400} 13401 13402// method id "androidenterprise.users.delete": 13403 13404type UsersDeleteCall struct { 13405 s *Service 13406 enterpriseId string 13407 userId string 13408 urlParams_ gensupport.URLParams 13409 ctx_ context.Context 13410 header_ http.Header 13411} 13412 13413// Delete: Deleted an EMM-managed user. 13414// 13415// - enterpriseId: The ID of the enterprise. 13416// - userId: The ID of the user. 13417func (r *UsersService) Delete(enterpriseId string, userId string) *UsersDeleteCall { 13418 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13419 c.enterpriseId = enterpriseId 13420 c.userId = userId 13421 return c 13422} 13423 13424// Fields allows partial responses to be retrieved. See 13425// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13426// for more information. 13427func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 13428 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13429 return c 13430} 13431 13432// Context sets the context to be used in this call's Do method. Any 13433// pending HTTP request will be aborted if the provided context is 13434// canceled. 13435func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 13436 c.ctx_ = ctx 13437 return c 13438} 13439 13440// Header returns an http.Header that can be modified by the caller to 13441// add HTTP headers to the request. 13442func (c *UsersDeleteCall) Header() http.Header { 13443 if c.header_ == nil { 13444 c.header_ = make(http.Header) 13445 } 13446 return c.header_ 13447} 13448 13449func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 13450 reqHeaders := make(http.Header) 13451 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13452 for k, v := range c.header_ { 13453 reqHeaders[k] = v 13454 } 13455 reqHeaders.Set("User-Agent", c.s.userAgent()) 13456 var body io.Reader = nil 13457 c.urlParams_.Set("alt", alt) 13458 c.urlParams_.Set("prettyPrint", "false") 13459 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 13460 urls += "?" + c.urlParams_.Encode() 13461 req, err := http.NewRequest("DELETE", urls, body) 13462 if err != nil { 13463 return nil, err 13464 } 13465 req.Header = reqHeaders 13466 googleapi.Expand(req.URL, map[string]string{ 13467 "enterpriseId": c.enterpriseId, 13468 "userId": c.userId, 13469 }) 13470 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13471} 13472 13473// Do executes the "androidenterprise.users.delete" call. 13474func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { 13475 gensupport.SetOptions(c.urlParams_, opts...) 13476 res, err := c.doRequest("json") 13477 if err != nil { 13478 return err 13479 } 13480 defer googleapi.CloseBody(res) 13481 if err := googleapi.CheckResponse(res); err != nil { 13482 return err 13483 } 13484 return nil 13485 // { 13486 // "description": "Deleted an EMM-managed user.", 13487 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13488 // "httpMethod": "DELETE", 13489 // "id": "androidenterprise.users.delete", 13490 // "parameterOrder": [ 13491 // "enterpriseId", 13492 // "userId" 13493 // ], 13494 // "parameters": { 13495 // "enterpriseId": { 13496 // "description": "The ID of the enterprise.", 13497 // "location": "path", 13498 // "required": true, 13499 // "type": "string" 13500 // }, 13501 // "userId": { 13502 // "description": "The ID of the user.", 13503 // "location": "path", 13504 // "required": true, 13505 // "type": "string" 13506 // } 13507 // }, 13508 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13509 // "scopes": [ 13510 // "https://www.googleapis.com/auth/androidenterprise" 13511 // ] 13512 // } 13513 13514} 13515 13516// method id "androidenterprise.users.generateAuthenticationToken": 13517 13518type UsersGenerateAuthenticationTokenCall struct { 13519 s *Service 13520 enterpriseId string 13521 userId string 13522 urlParams_ gensupport.URLParams 13523 ctx_ context.Context 13524 header_ http.Header 13525} 13526 13527// GenerateAuthenticationToken: Generates an authentication token which 13528// the device policy client can use to provision the given EMM-managed 13529// user account on a device. The generated token is single-use and 13530// expires after a few minutes. You can provision a maximum of 10 13531// devices per user. This call only works with EMM-managed accounts. 13532// 13533// - enterpriseId: The ID of the enterprise. 13534// - userId: The ID of the user. 13535func (r *UsersService) GenerateAuthenticationToken(enterpriseId string, userId string) *UsersGenerateAuthenticationTokenCall { 13536 c := &UsersGenerateAuthenticationTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13537 c.enterpriseId = enterpriseId 13538 c.userId = userId 13539 return c 13540} 13541 13542// Fields allows partial responses to be retrieved. See 13543// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13544// for more information. 13545func (c *UsersGenerateAuthenticationTokenCall) Fields(s ...googleapi.Field) *UsersGenerateAuthenticationTokenCall { 13546 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13547 return c 13548} 13549 13550// Context sets the context to be used in this call's Do method. Any 13551// pending HTTP request will be aborted if the provided context is 13552// canceled. 13553func (c *UsersGenerateAuthenticationTokenCall) Context(ctx context.Context) *UsersGenerateAuthenticationTokenCall { 13554 c.ctx_ = ctx 13555 return c 13556} 13557 13558// Header returns an http.Header that can be modified by the caller to 13559// add HTTP headers to the request. 13560func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header { 13561 if c.header_ == nil { 13562 c.header_ = make(http.Header) 13563 } 13564 return c.header_ 13565} 13566 13567func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) { 13568 reqHeaders := make(http.Header) 13569 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13570 for k, v := range c.header_ { 13571 reqHeaders[k] = v 13572 } 13573 reqHeaders.Set("User-Agent", c.s.userAgent()) 13574 var body io.Reader = nil 13575 c.urlParams_.Set("alt", alt) 13576 c.urlParams_.Set("prettyPrint", "false") 13577 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken") 13578 urls += "?" + c.urlParams_.Encode() 13579 req, err := http.NewRequest("POST", urls, body) 13580 if err != nil { 13581 return nil, err 13582 } 13583 req.Header = reqHeaders 13584 googleapi.Expand(req.URL, map[string]string{ 13585 "enterpriseId": c.enterpriseId, 13586 "userId": c.userId, 13587 }) 13588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13589} 13590 13591// Do executes the "androidenterprise.users.generateAuthenticationToken" call. 13592// Exactly one of *AuthenticationToken or error will be non-nil. Any 13593// non-2xx status code is an error. Response headers are in either 13594// *AuthenticationToken.ServerResponse.Header or (if a response was 13595// returned at all) in error.(*googleapi.Error).Header. Use 13596// googleapi.IsNotModified to check whether the returned error was 13597// because http.StatusNotModified was returned. 13598func (c *UsersGenerateAuthenticationTokenCall) Do(opts ...googleapi.CallOption) (*AuthenticationToken, error) { 13599 gensupport.SetOptions(c.urlParams_, opts...) 13600 res, err := c.doRequest("json") 13601 if res != nil && res.StatusCode == http.StatusNotModified { 13602 if res.Body != nil { 13603 res.Body.Close() 13604 } 13605 return nil, &googleapi.Error{ 13606 Code: res.StatusCode, 13607 Header: res.Header, 13608 } 13609 } 13610 if err != nil { 13611 return nil, err 13612 } 13613 defer googleapi.CloseBody(res) 13614 if err := googleapi.CheckResponse(res); err != nil { 13615 return nil, err 13616 } 13617 ret := &AuthenticationToken{ 13618 ServerResponse: googleapi.ServerResponse{ 13619 Header: res.Header, 13620 HTTPStatusCode: res.StatusCode, 13621 }, 13622 } 13623 target := &ret 13624 if err := gensupport.DecodeResponse(target, res); err != nil { 13625 return nil, err 13626 } 13627 return ret, nil 13628 // { 13629 // "description": "Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. You can provision a maximum of 10 devices per user. This call only works with EMM-managed accounts.", 13630 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken", 13631 // "httpMethod": "POST", 13632 // "id": "androidenterprise.users.generateAuthenticationToken", 13633 // "parameterOrder": [ 13634 // "enterpriseId", 13635 // "userId" 13636 // ], 13637 // "parameters": { 13638 // "enterpriseId": { 13639 // "description": "The ID of the enterprise.", 13640 // "location": "path", 13641 // "required": true, 13642 // "type": "string" 13643 // }, 13644 // "userId": { 13645 // "description": "The ID of the user.", 13646 // "location": "path", 13647 // "required": true, 13648 // "type": "string" 13649 // } 13650 // }, 13651 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken", 13652 // "response": { 13653 // "$ref": "AuthenticationToken" 13654 // }, 13655 // "scopes": [ 13656 // "https://www.googleapis.com/auth/androidenterprise" 13657 // ] 13658 // } 13659 13660} 13661 13662// method id "androidenterprise.users.get": 13663 13664type UsersGetCall struct { 13665 s *Service 13666 enterpriseId string 13667 userId string 13668 urlParams_ gensupport.URLParams 13669 ifNoneMatch_ string 13670 ctx_ context.Context 13671 header_ http.Header 13672} 13673 13674// Get: Retrieves a user's details. 13675// 13676// - enterpriseId: The ID of the enterprise. 13677// - userId: The ID of the user. 13678func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall { 13679 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13680 c.enterpriseId = enterpriseId 13681 c.userId = userId 13682 return c 13683} 13684 13685// Fields allows partial responses to be retrieved. See 13686// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13687// for more information. 13688func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 13689 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13690 return c 13691} 13692 13693// IfNoneMatch sets the optional parameter which makes the operation 13694// fail if the object's ETag matches the given value. This is useful for 13695// getting updates only after the object has changed since the last 13696// request. Use googleapi.IsNotModified to check whether the response 13697// error from Do is the result of In-None-Match. 13698func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 13699 c.ifNoneMatch_ = entityTag 13700 return c 13701} 13702 13703// Context sets the context to be used in this call's Do method. Any 13704// pending HTTP request will be aborted if the provided context is 13705// canceled. 13706func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 13707 c.ctx_ = ctx 13708 return c 13709} 13710 13711// Header returns an http.Header that can be modified by the caller to 13712// add HTTP headers to the request. 13713func (c *UsersGetCall) Header() http.Header { 13714 if c.header_ == nil { 13715 c.header_ = make(http.Header) 13716 } 13717 return c.header_ 13718} 13719 13720func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 13721 reqHeaders := make(http.Header) 13722 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13723 for k, v := range c.header_ { 13724 reqHeaders[k] = v 13725 } 13726 reqHeaders.Set("User-Agent", c.s.userAgent()) 13727 if c.ifNoneMatch_ != "" { 13728 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13729 } 13730 var body io.Reader = nil 13731 c.urlParams_.Set("alt", alt) 13732 c.urlParams_.Set("prettyPrint", "false") 13733 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 13734 urls += "?" + c.urlParams_.Encode() 13735 req, err := http.NewRequest("GET", urls, body) 13736 if err != nil { 13737 return nil, err 13738 } 13739 req.Header = reqHeaders 13740 googleapi.Expand(req.URL, map[string]string{ 13741 "enterpriseId": c.enterpriseId, 13742 "userId": c.userId, 13743 }) 13744 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13745} 13746 13747// Do executes the "androidenterprise.users.get" call. 13748// Exactly one of *User or error will be non-nil. Any non-2xx status 13749// code is an error. Response headers are in either 13750// *User.ServerResponse.Header or (if a response was returned at all) in 13751// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13752// whether the returned error was because http.StatusNotModified was 13753// returned. 13754func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 13755 gensupport.SetOptions(c.urlParams_, opts...) 13756 res, err := c.doRequest("json") 13757 if res != nil && res.StatusCode == http.StatusNotModified { 13758 if res.Body != nil { 13759 res.Body.Close() 13760 } 13761 return nil, &googleapi.Error{ 13762 Code: res.StatusCode, 13763 Header: res.Header, 13764 } 13765 } 13766 if err != nil { 13767 return nil, err 13768 } 13769 defer googleapi.CloseBody(res) 13770 if err := googleapi.CheckResponse(res); err != nil { 13771 return nil, err 13772 } 13773 ret := &User{ 13774 ServerResponse: googleapi.ServerResponse{ 13775 Header: res.Header, 13776 HTTPStatusCode: res.StatusCode, 13777 }, 13778 } 13779 target := &ret 13780 if err := gensupport.DecodeResponse(target, res); err != nil { 13781 return nil, err 13782 } 13783 return ret, nil 13784 // { 13785 // "description": "Retrieves a user's details.", 13786 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13787 // "httpMethod": "GET", 13788 // "id": "androidenterprise.users.get", 13789 // "parameterOrder": [ 13790 // "enterpriseId", 13791 // "userId" 13792 // ], 13793 // "parameters": { 13794 // "enterpriseId": { 13795 // "description": "The ID of the enterprise.", 13796 // "location": "path", 13797 // "required": true, 13798 // "type": "string" 13799 // }, 13800 // "userId": { 13801 // "description": "The ID of the user.", 13802 // "location": "path", 13803 // "required": true, 13804 // "type": "string" 13805 // } 13806 // }, 13807 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13808 // "response": { 13809 // "$ref": "User" 13810 // }, 13811 // "scopes": [ 13812 // "https://www.googleapis.com/auth/androidenterprise" 13813 // ] 13814 // } 13815 13816} 13817 13818// method id "androidenterprise.users.getAvailableProductSet": 13819 13820type UsersGetAvailableProductSetCall struct { 13821 s *Service 13822 enterpriseId string 13823 userId string 13824 urlParams_ gensupport.URLParams 13825 ifNoneMatch_ string 13826 ctx_ context.Context 13827 header_ http.Header 13828} 13829 13830// GetAvailableProductSet: Retrieves the set of products a user is 13831// entitled to access. 13832// 13833// - enterpriseId: The ID of the enterprise. 13834// - userId: The ID of the user. 13835func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall { 13836 c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13837 c.enterpriseId = enterpriseId 13838 c.userId = userId 13839 return c 13840} 13841 13842// Fields allows partial responses to be retrieved. See 13843// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13844// for more information. 13845func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall { 13846 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13847 return c 13848} 13849 13850// IfNoneMatch sets the optional parameter which makes the operation 13851// fail if the object's ETag matches the given value. This is useful for 13852// getting updates only after the object has changed since the last 13853// request. Use googleapi.IsNotModified to check whether the response 13854// error from Do is the result of In-None-Match. 13855func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall { 13856 c.ifNoneMatch_ = entityTag 13857 return c 13858} 13859 13860// Context sets the context to be used in this call's Do method. Any 13861// pending HTTP request will be aborted if the provided context is 13862// canceled. 13863func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall { 13864 c.ctx_ = ctx 13865 return c 13866} 13867 13868// Header returns an http.Header that can be modified by the caller to 13869// add HTTP headers to the request. 13870func (c *UsersGetAvailableProductSetCall) Header() http.Header { 13871 if c.header_ == nil { 13872 c.header_ = make(http.Header) 13873 } 13874 return c.header_ 13875} 13876 13877func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 13878 reqHeaders := make(http.Header) 13879 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 13880 for k, v := range c.header_ { 13881 reqHeaders[k] = v 13882 } 13883 reqHeaders.Set("User-Agent", c.s.userAgent()) 13884 if c.ifNoneMatch_ != "" { 13885 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13886 } 13887 var body io.Reader = nil 13888 c.urlParams_.Set("alt", alt) 13889 c.urlParams_.Set("prettyPrint", "false") 13890 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet") 13891 urls += "?" + c.urlParams_.Encode() 13892 req, err := http.NewRequest("GET", urls, body) 13893 if err != nil { 13894 return nil, err 13895 } 13896 req.Header = reqHeaders 13897 googleapi.Expand(req.URL, map[string]string{ 13898 "enterpriseId": c.enterpriseId, 13899 "userId": c.userId, 13900 }) 13901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13902} 13903 13904// Do executes the "androidenterprise.users.getAvailableProductSet" call. 13905// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 13906// status code is an error. Response headers are in either 13907// *ProductSet.ServerResponse.Header or (if a response was returned at 13908// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13909// to check whether the returned error was because 13910// http.StatusNotModified was returned. 13911func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 13912 gensupport.SetOptions(c.urlParams_, opts...) 13913 res, err := c.doRequest("json") 13914 if res != nil && res.StatusCode == http.StatusNotModified { 13915 if res.Body != nil { 13916 res.Body.Close() 13917 } 13918 return nil, &googleapi.Error{ 13919 Code: res.StatusCode, 13920 Header: res.Header, 13921 } 13922 } 13923 if err != nil { 13924 return nil, err 13925 } 13926 defer googleapi.CloseBody(res) 13927 if err := googleapi.CheckResponse(res); err != nil { 13928 return nil, err 13929 } 13930 ret := &ProductSet{ 13931 ServerResponse: googleapi.ServerResponse{ 13932 Header: res.Header, 13933 HTTPStatusCode: res.StatusCode, 13934 }, 13935 } 13936 target := &ret 13937 if err := gensupport.DecodeResponse(target, res); err != nil { 13938 return nil, err 13939 } 13940 return ret, nil 13941 // { 13942 // "description": "Retrieves the set of products a user is entitled to access.", 13943 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 13944 // "httpMethod": "GET", 13945 // "id": "androidenterprise.users.getAvailableProductSet", 13946 // "parameterOrder": [ 13947 // "enterpriseId", 13948 // "userId" 13949 // ], 13950 // "parameters": { 13951 // "enterpriseId": { 13952 // "description": "The ID of the enterprise.", 13953 // "location": "path", 13954 // "required": true, 13955 // "type": "string" 13956 // }, 13957 // "userId": { 13958 // "description": "The ID of the user.", 13959 // "location": "path", 13960 // "required": true, 13961 // "type": "string" 13962 // } 13963 // }, 13964 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 13965 // "response": { 13966 // "$ref": "ProductSet" 13967 // }, 13968 // "scopes": [ 13969 // "https://www.googleapis.com/auth/androidenterprise" 13970 // ] 13971 // } 13972 13973} 13974 13975// method id "androidenterprise.users.insert": 13976 13977type UsersInsertCall struct { 13978 s *Service 13979 enterpriseId string 13980 user *User 13981 urlParams_ gensupport.URLParams 13982 ctx_ context.Context 13983 header_ http.Header 13984} 13985 13986// Insert: Creates a new EMM-managed user. The Users resource passed in 13987// the body of the request should include an accountIdentifier and an 13988// accountType. If a corresponding user already exists with the same 13989// account identifier, the user will be updated with the resource. In 13990// this case only the displayName field can be changed. 13991// 13992// - enterpriseId: The ID of the enterprise. 13993func (r *UsersService) Insert(enterpriseId string, user *User) *UsersInsertCall { 13994 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13995 c.enterpriseId = enterpriseId 13996 c.user = user 13997 return c 13998} 13999 14000// Fields allows partial responses to be retrieved. See 14001// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14002// for more information. 14003func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 14004 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14005 return c 14006} 14007 14008// Context sets the context to be used in this call's Do method. Any 14009// pending HTTP request will be aborted if the provided context is 14010// canceled. 14011func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 14012 c.ctx_ = ctx 14013 return c 14014} 14015 14016// Header returns an http.Header that can be modified by the caller to 14017// add HTTP headers to the request. 14018func (c *UsersInsertCall) Header() http.Header { 14019 if c.header_ == nil { 14020 c.header_ = make(http.Header) 14021 } 14022 return c.header_ 14023} 14024 14025func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 14026 reqHeaders := make(http.Header) 14027 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14028 for k, v := range c.header_ { 14029 reqHeaders[k] = v 14030 } 14031 reqHeaders.Set("User-Agent", c.s.userAgent()) 14032 var body io.Reader = nil 14033 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 14034 if err != nil { 14035 return nil, err 14036 } 14037 reqHeaders.Set("Content-Type", "application/json") 14038 c.urlParams_.Set("alt", alt) 14039 c.urlParams_.Set("prettyPrint", "false") 14040 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users") 14041 urls += "?" + c.urlParams_.Encode() 14042 req, err := http.NewRequest("POST", urls, body) 14043 if err != nil { 14044 return nil, err 14045 } 14046 req.Header = reqHeaders 14047 googleapi.Expand(req.URL, map[string]string{ 14048 "enterpriseId": c.enterpriseId, 14049 }) 14050 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14051} 14052 14053// Do executes the "androidenterprise.users.insert" call. 14054// Exactly one of *User or error will be non-nil. Any non-2xx status 14055// code is an error. Response headers are in either 14056// *User.ServerResponse.Header or (if a response was returned at all) in 14057// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14058// whether the returned error was because http.StatusNotModified was 14059// returned. 14060func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) { 14061 gensupport.SetOptions(c.urlParams_, opts...) 14062 res, err := c.doRequest("json") 14063 if res != nil && res.StatusCode == http.StatusNotModified { 14064 if res.Body != nil { 14065 res.Body.Close() 14066 } 14067 return nil, &googleapi.Error{ 14068 Code: res.StatusCode, 14069 Header: res.Header, 14070 } 14071 } 14072 if err != nil { 14073 return nil, err 14074 } 14075 defer googleapi.CloseBody(res) 14076 if err := googleapi.CheckResponse(res); err != nil { 14077 return nil, err 14078 } 14079 ret := &User{ 14080 ServerResponse: googleapi.ServerResponse{ 14081 Header: res.Header, 14082 HTTPStatusCode: res.StatusCode, 14083 }, 14084 } 14085 target := &ret 14086 if err := gensupport.DecodeResponse(target, res); err != nil { 14087 return nil, err 14088 } 14089 return ret, nil 14090 // { 14091 // "description": "Creates a new EMM-managed user. The Users resource passed in the body of the request should include an accountIdentifier and an accountType. If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed.", 14092 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14093 // "httpMethod": "POST", 14094 // "id": "androidenterprise.users.insert", 14095 // "parameterOrder": [ 14096 // "enterpriseId" 14097 // ], 14098 // "parameters": { 14099 // "enterpriseId": { 14100 // "description": "The ID of the enterprise.", 14101 // "location": "path", 14102 // "required": true, 14103 // "type": "string" 14104 // } 14105 // }, 14106 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14107 // "request": { 14108 // "$ref": "User" 14109 // }, 14110 // "response": { 14111 // "$ref": "User" 14112 // }, 14113 // "scopes": [ 14114 // "https://www.googleapis.com/auth/androidenterprise" 14115 // ] 14116 // } 14117 14118} 14119 14120// method id "androidenterprise.users.list": 14121 14122type UsersListCall struct { 14123 s *Service 14124 enterpriseId string 14125 urlParams_ gensupport.URLParams 14126 ifNoneMatch_ string 14127 ctx_ context.Context 14128 header_ http.Header 14129} 14130 14131// List: Looks up a user by primary email address. This is only 14132// supported for Google-managed users. Lookup of the id is not needed 14133// for EMM-managed users because the id is already returned in the 14134// result of the Users.insert call. 14135// 14136// - email: The exact primary email address of the user to look up. 14137// - enterpriseId: The ID of the enterprise. 14138func (r *UsersService) List(enterpriseId string, email string) *UsersListCall { 14139 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14140 c.enterpriseId = enterpriseId 14141 c.urlParams_.Set("email", email) 14142 return c 14143} 14144 14145// Fields allows partial responses to be retrieved. See 14146// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14147// for more information. 14148func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 14149 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14150 return c 14151} 14152 14153// IfNoneMatch sets the optional parameter which makes the operation 14154// fail if the object's ETag matches the given value. This is useful for 14155// getting updates only after the object has changed since the last 14156// request. Use googleapi.IsNotModified to check whether the response 14157// error from Do is the result of In-None-Match. 14158func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 14159 c.ifNoneMatch_ = entityTag 14160 return c 14161} 14162 14163// Context sets the context to be used in this call's Do method. Any 14164// pending HTTP request will be aborted if the provided context is 14165// canceled. 14166func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 14167 c.ctx_ = ctx 14168 return c 14169} 14170 14171// Header returns an http.Header that can be modified by the caller to 14172// add HTTP headers to the request. 14173func (c *UsersListCall) Header() http.Header { 14174 if c.header_ == nil { 14175 c.header_ = make(http.Header) 14176 } 14177 return c.header_ 14178} 14179 14180func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 14181 reqHeaders := make(http.Header) 14182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14183 for k, v := range c.header_ { 14184 reqHeaders[k] = v 14185 } 14186 reqHeaders.Set("User-Agent", c.s.userAgent()) 14187 if c.ifNoneMatch_ != "" { 14188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14189 } 14190 var body io.Reader = nil 14191 c.urlParams_.Set("alt", alt) 14192 c.urlParams_.Set("prettyPrint", "false") 14193 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users") 14194 urls += "?" + c.urlParams_.Encode() 14195 req, err := http.NewRequest("GET", urls, body) 14196 if err != nil { 14197 return nil, err 14198 } 14199 req.Header = reqHeaders 14200 googleapi.Expand(req.URL, map[string]string{ 14201 "enterpriseId": c.enterpriseId, 14202 }) 14203 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14204} 14205 14206// Do executes the "androidenterprise.users.list" call. 14207// Exactly one of *UsersListResponse or error will be non-nil. Any 14208// non-2xx status code is an error. Response headers are in either 14209// *UsersListResponse.ServerResponse.Header or (if a response was 14210// returned at all) in error.(*googleapi.Error).Header. Use 14211// googleapi.IsNotModified to check whether the returned error was 14212// because http.StatusNotModified was returned. 14213func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 14214 gensupport.SetOptions(c.urlParams_, opts...) 14215 res, err := c.doRequest("json") 14216 if res != nil && res.StatusCode == http.StatusNotModified { 14217 if res.Body != nil { 14218 res.Body.Close() 14219 } 14220 return nil, &googleapi.Error{ 14221 Code: res.StatusCode, 14222 Header: res.Header, 14223 } 14224 } 14225 if err != nil { 14226 return nil, err 14227 } 14228 defer googleapi.CloseBody(res) 14229 if err := googleapi.CheckResponse(res); err != nil { 14230 return nil, err 14231 } 14232 ret := &UsersListResponse{ 14233 ServerResponse: googleapi.ServerResponse{ 14234 Header: res.Header, 14235 HTTPStatusCode: res.StatusCode, 14236 }, 14237 } 14238 target := &ret 14239 if err := gensupport.DecodeResponse(target, res); err != nil { 14240 return nil, err 14241 } 14242 return ret, nil 14243 // { 14244 // "description": "Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call.", 14245 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14246 // "httpMethod": "GET", 14247 // "id": "androidenterprise.users.list", 14248 // "parameterOrder": [ 14249 // "enterpriseId", 14250 // "email" 14251 // ], 14252 // "parameters": { 14253 // "email": { 14254 // "description": "Required. The exact primary email address of the user to look up.", 14255 // "location": "query", 14256 // "required": true, 14257 // "type": "string" 14258 // }, 14259 // "enterpriseId": { 14260 // "description": "The ID of the enterprise.", 14261 // "location": "path", 14262 // "required": true, 14263 // "type": "string" 14264 // } 14265 // }, 14266 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14267 // "response": { 14268 // "$ref": "UsersListResponse" 14269 // }, 14270 // "scopes": [ 14271 // "https://www.googleapis.com/auth/androidenterprise" 14272 // ] 14273 // } 14274 14275} 14276 14277// method id "androidenterprise.users.revokeDeviceAccess": 14278 14279type UsersRevokeDeviceAccessCall struct { 14280 s *Service 14281 enterpriseId string 14282 userId string 14283 urlParams_ gensupport.URLParams 14284 ctx_ context.Context 14285 header_ http.Header 14286} 14287 14288// RevokeDeviceAccess: Revokes access to all devices currently 14289// provisioned to the user. The user will no longer be able to use the 14290// managed Play store on any of their managed devices. This call only 14291// works with EMM-managed accounts. 14292// 14293// - enterpriseId: The ID of the enterprise. 14294// - userId: The ID of the user. 14295func (r *UsersService) RevokeDeviceAccess(enterpriseId string, userId string) *UsersRevokeDeviceAccessCall { 14296 c := &UsersRevokeDeviceAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14297 c.enterpriseId = enterpriseId 14298 c.userId = userId 14299 return c 14300} 14301 14302// Fields allows partial responses to be retrieved. See 14303// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14304// for more information. 14305func (c *UsersRevokeDeviceAccessCall) Fields(s ...googleapi.Field) *UsersRevokeDeviceAccessCall { 14306 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14307 return c 14308} 14309 14310// Context sets the context to be used in this call's Do method. Any 14311// pending HTTP request will be aborted if the provided context is 14312// canceled. 14313func (c *UsersRevokeDeviceAccessCall) Context(ctx context.Context) *UsersRevokeDeviceAccessCall { 14314 c.ctx_ = ctx 14315 return c 14316} 14317 14318// Header returns an http.Header that can be modified by the caller to 14319// add HTTP headers to the request. 14320func (c *UsersRevokeDeviceAccessCall) Header() http.Header { 14321 if c.header_ == nil { 14322 c.header_ = make(http.Header) 14323 } 14324 return c.header_ 14325} 14326 14327func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) { 14328 reqHeaders := make(http.Header) 14329 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14330 for k, v := range c.header_ { 14331 reqHeaders[k] = v 14332 } 14333 reqHeaders.Set("User-Agent", c.s.userAgent()) 14334 var body io.Reader = nil 14335 c.urlParams_.Set("alt", alt) 14336 c.urlParams_.Set("prettyPrint", "false") 14337 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess") 14338 urls += "?" + c.urlParams_.Encode() 14339 req, err := http.NewRequest("DELETE", urls, body) 14340 if err != nil { 14341 return nil, err 14342 } 14343 req.Header = reqHeaders 14344 googleapi.Expand(req.URL, map[string]string{ 14345 "enterpriseId": c.enterpriseId, 14346 "userId": c.userId, 14347 }) 14348 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14349} 14350 14351// Do executes the "androidenterprise.users.revokeDeviceAccess" call. 14352func (c *UsersRevokeDeviceAccessCall) Do(opts ...googleapi.CallOption) error { 14353 gensupport.SetOptions(c.urlParams_, opts...) 14354 res, err := c.doRequest("json") 14355 if err != nil { 14356 return err 14357 } 14358 defer googleapi.CloseBody(res) 14359 if err := googleapi.CheckResponse(res); err != nil { 14360 return err 14361 } 14362 return nil 14363 // { 14364 // "description": "Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices. This call only works with EMM-managed accounts.", 14365 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess", 14366 // "httpMethod": "DELETE", 14367 // "id": "androidenterprise.users.revokeDeviceAccess", 14368 // "parameterOrder": [ 14369 // "enterpriseId", 14370 // "userId" 14371 // ], 14372 // "parameters": { 14373 // "enterpriseId": { 14374 // "description": "The ID of the enterprise.", 14375 // "location": "path", 14376 // "required": true, 14377 // "type": "string" 14378 // }, 14379 // "userId": { 14380 // "description": "The ID of the user.", 14381 // "location": "path", 14382 // "required": true, 14383 // "type": "string" 14384 // } 14385 // }, 14386 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess", 14387 // "scopes": [ 14388 // "https://www.googleapis.com/auth/androidenterprise" 14389 // ] 14390 // } 14391 14392} 14393 14394// method id "androidenterprise.users.setAvailableProductSet": 14395 14396type UsersSetAvailableProductSetCall struct { 14397 s *Service 14398 enterpriseId string 14399 userId string 14400 productset *ProductSet 14401 urlParams_ gensupport.URLParams 14402 ctx_ context.Context 14403 header_ http.Header 14404} 14405 14406// SetAvailableProductSet: Modifies the set of products that a user is 14407// entitled to access (referred to as *whitelisted* products). Only 14408// products that are approved or products that were previously approved 14409// (products with revoked approval) can be whitelisted. 14410// 14411// - enterpriseId: The ID of the enterprise. 14412// - userId: The ID of the user. 14413func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall { 14414 c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14415 c.enterpriseId = enterpriseId 14416 c.userId = userId 14417 c.productset = productset 14418 return c 14419} 14420 14421// Fields allows partial responses to be retrieved. See 14422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14423// for more information. 14424func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall { 14425 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14426 return c 14427} 14428 14429// Context sets the context to be used in this call's Do method. Any 14430// pending HTTP request will be aborted if the provided context is 14431// canceled. 14432func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall { 14433 c.ctx_ = ctx 14434 return c 14435} 14436 14437// Header returns an http.Header that can be modified by the caller to 14438// add HTTP headers to the request. 14439func (c *UsersSetAvailableProductSetCall) Header() http.Header { 14440 if c.header_ == nil { 14441 c.header_ = make(http.Header) 14442 } 14443 return c.header_ 14444} 14445 14446func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 14447 reqHeaders := make(http.Header) 14448 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14449 for k, v := range c.header_ { 14450 reqHeaders[k] = v 14451 } 14452 reqHeaders.Set("User-Agent", c.s.userAgent()) 14453 var body io.Reader = nil 14454 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 14455 if err != nil { 14456 return nil, err 14457 } 14458 reqHeaders.Set("Content-Type", "application/json") 14459 c.urlParams_.Set("alt", alt) 14460 c.urlParams_.Set("prettyPrint", "false") 14461 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet") 14462 urls += "?" + c.urlParams_.Encode() 14463 req, err := http.NewRequest("PUT", urls, body) 14464 if err != nil { 14465 return nil, err 14466 } 14467 req.Header = reqHeaders 14468 googleapi.Expand(req.URL, map[string]string{ 14469 "enterpriseId": c.enterpriseId, 14470 "userId": c.userId, 14471 }) 14472 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14473} 14474 14475// Do executes the "androidenterprise.users.setAvailableProductSet" call. 14476// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 14477// status code is an error. Response headers are in either 14478// *ProductSet.ServerResponse.Header or (if a response was returned at 14479// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14480// to check whether the returned error was because 14481// http.StatusNotModified was returned. 14482func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 14483 gensupport.SetOptions(c.urlParams_, opts...) 14484 res, err := c.doRequest("json") 14485 if res != nil && res.StatusCode == http.StatusNotModified { 14486 if res.Body != nil { 14487 res.Body.Close() 14488 } 14489 return nil, &googleapi.Error{ 14490 Code: res.StatusCode, 14491 Header: res.Header, 14492 } 14493 } 14494 if err != nil { 14495 return nil, err 14496 } 14497 defer googleapi.CloseBody(res) 14498 if err := googleapi.CheckResponse(res); err != nil { 14499 return nil, err 14500 } 14501 ret := &ProductSet{ 14502 ServerResponse: googleapi.ServerResponse{ 14503 Header: res.Header, 14504 HTTPStatusCode: res.StatusCode, 14505 }, 14506 } 14507 target := &ret 14508 if err := gensupport.DecodeResponse(target, res); err != nil { 14509 return nil, err 14510 } 14511 return ret, nil 14512 // { 14513 // "description": "Modifies the set of products that a user is entitled to access (referred to as *whitelisted* products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted.", 14514 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 14515 // "httpMethod": "PUT", 14516 // "id": "androidenterprise.users.setAvailableProductSet", 14517 // "parameterOrder": [ 14518 // "enterpriseId", 14519 // "userId" 14520 // ], 14521 // "parameters": { 14522 // "enterpriseId": { 14523 // "description": "The ID of the enterprise.", 14524 // "location": "path", 14525 // "required": true, 14526 // "type": "string" 14527 // }, 14528 // "userId": { 14529 // "description": "The ID of the user.", 14530 // "location": "path", 14531 // "required": true, 14532 // "type": "string" 14533 // } 14534 // }, 14535 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 14536 // "request": { 14537 // "$ref": "ProductSet" 14538 // }, 14539 // "response": { 14540 // "$ref": "ProductSet" 14541 // }, 14542 // "scopes": [ 14543 // "https://www.googleapis.com/auth/androidenterprise" 14544 // ] 14545 // } 14546 14547} 14548 14549// method id "androidenterprise.users.update": 14550 14551type UsersUpdateCall struct { 14552 s *Service 14553 enterpriseId string 14554 userId string 14555 user *User 14556 urlParams_ gensupport.URLParams 14557 ctx_ context.Context 14558 header_ http.Header 14559} 14560 14561// Update: Updates the details of an EMM-managed user. Can be used with 14562// EMM-managed users only (not Google managed users). Pass the new 14563// details in the Users resource in the request body. Only the 14564// displayName field can be changed. Other fields must either be unset 14565// or have the currently active value. 14566// 14567// - enterpriseId: The ID of the enterprise. 14568// - userId: The ID of the user. 14569func (r *UsersService) Update(enterpriseId string, userId string, user *User) *UsersUpdateCall { 14570 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14571 c.enterpriseId = enterpriseId 14572 c.userId = userId 14573 c.user = user 14574 return c 14575} 14576 14577// Fields allows partial responses to be retrieved. See 14578// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14579// for more information. 14580func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 14581 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14582 return c 14583} 14584 14585// Context sets the context to be used in this call's Do method. Any 14586// pending HTTP request will be aborted if the provided context is 14587// canceled. 14588func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 14589 c.ctx_ = ctx 14590 return c 14591} 14592 14593// Header returns an http.Header that can be modified by the caller to 14594// add HTTP headers to the request. 14595func (c *UsersUpdateCall) Header() http.Header { 14596 if c.header_ == nil { 14597 c.header_ = make(http.Header) 14598 } 14599 return c.header_ 14600} 14601 14602func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 14603 reqHeaders := make(http.Header) 14604 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14605 for k, v := range c.header_ { 14606 reqHeaders[k] = v 14607 } 14608 reqHeaders.Set("User-Agent", c.s.userAgent()) 14609 var body io.Reader = nil 14610 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 14611 if err != nil { 14612 return nil, err 14613 } 14614 reqHeaders.Set("Content-Type", "application/json") 14615 c.urlParams_.Set("alt", alt) 14616 c.urlParams_.Set("prettyPrint", "false") 14617 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 14618 urls += "?" + c.urlParams_.Encode() 14619 req, err := http.NewRequest("PUT", urls, body) 14620 if err != nil { 14621 return nil, err 14622 } 14623 req.Header = reqHeaders 14624 googleapi.Expand(req.URL, map[string]string{ 14625 "enterpriseId": c.enterpriseId, 14626 "userId": c.userId, 14627 }) 14628 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14629} 14630 14631// Do executes the "androidenterprise.users.update" call. 14632// Exactly one of *User or error will be non-nil. Any non-2xx status 14633// code is an error. Response headers are in either 14634// *User.ServerResponse.Header or (if a response was returned at all) in 14635// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14636// whether the returned error was because http.StatusNotModified was 14637// returned. 14638func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) { 14639 gensupport.SetOptions(c.urlParams_, opts...) 14640 res, err := c.doRequest("json") 14641 if res != nil && res.StatusCode == http.StatusNotModified { 14642 if res.Body != nil { 14643 res.Body.Close() 14644 } 14645 return nil, &googleapi.Error{ 14646 Code: res.StatusCode, 14647 Header: res.Header, 14648 } 14649 } 14650 if err != nil { 14651 return nil, err 14652 } 14653 defer googleapi.CloseBody(res) 14654 if err := googleapi.CheckResponse(res); err != nil { 14655 return nil, err 14656 } 14657 ret := &User{ 14658 ServerResponse: googleapi.ServerResponse{ 14659 Header: res.Header, 14660 HTTPStatusCode: res.StatusCode, 14661 }, 14662 } 14663 target := &ret 14664 if err := gensupport.DecodeResponse(target, res); err != nil { 14665 return nil, err 14666 } 14667 return ret, nil 14668 // { 14669 // "description": "Updates the details of an EMM-managed user. Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value.", 14670 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 14671 // "httpMethod": "PUT", 14672 // "id": "androidenterprise.users.update", 14673 // "parameterOrder": [ 14674 // "enterpriseId", 14675 // "userId" 14676 // ], 14677 // "parameters": { 14678 // "enterpriseId": { 14679 // "description": "The ID of the enterprise.", 14680 // "location": "path", 14681 // "required": true, 14682 // "type": "string" 14683 // }, 14684 // "userId": { 14685 // "description": "The ID of the user.", 14686 // "location": "path", 14687 // "required": true, 14688 // "type": "string" 14689 // } 14690 // }, 14691 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 14692 // "request": { 14693 // "$ref": "User" 14694 // }, 14695 // "response": { 14696 // "$ref": "User" 14697 // }, 14698 // "scopes": [ 14699 // "https://www.googleapis.com/auth/androidenterprise" 14700 // ] 14701 // } 14702 14703} 14704 14705// method id "androidenterprise.webapps.delete": 14706 14707type WebappsDeleteCall struct { 14708 s *Service 14709 enterpriseId string 14710 webAppId string 14711 urlParams_ gensupport.URLParams 14712 ctx_ context.Context 14713 header_ http.Header 14714} 14715 14716// Delete: Deletes an existing web app. 14717// 14718// - enterpriseId: The ID of the enterprise. 14719// - webAppId: The ID of the web app. 14720func (r *WebappsService) Delete(enterpriseId string, webAppId string) *WebappsDeleteCall { 14721 c := &WebappsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14722 c.enterpriseId = enterpriseId 14723 c.webAppId = webAppId 14724 return c 14725} 14726 14727// Fields allows partial responses to be retrieved. See 14728// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14729// for more information. 14730func (c *WebappsDeleteCall) Fields(s ...googleapi.Field) *WebappsDeleteCall { 14731 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14732 return c 14733} 14734 14735// Context sets the context to be used in this call's Do method. Any 14736// pending HTTP request will be aborted if the provided context is 14737// canceled. 14738func (c *WebappsDeleteCall) Context(ctx context.Context) *WebappsDeleteCall { 14739 c.ctx_ = ctx 14740 return c 14741} 14742 14743// Header returns an http.Header that can be modified by the caller to 14744// add HTTP headers to the request. 14745func (c *WebappsDeleteCall) Header() http.Header { 14746 if c.header_ == nil { 14747 c.header_ = make(http.Header) 14748 } 14749 return c.header_ 14750} 14751 14752func (c *WebappsDeleteCall) doRequest(alt string) (*http.Response, error) { 14753 reqHeaders := make(http.Header) 14754 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14755 for k, v := range c.header_ { 14756 reqHeaders[k] = v 14757 } 14758 reqHeaders.Set("User-Agent", c.s.userAgent()) 14759 var body io.Reader = nil 14760 c.urlParams_.Set("alt", alt) 14761 c.urlParams_.Set("prettyPrint", "false") 14762 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 14763 urls += "?" + c.urlParams_.Encode() 14764 req, err := http.NewRequest("DELETE", urls, body) 14765 if err != nil { 14766 return nil, err 14767 } 14768 req.Header = reqHeaders 14769 googleapi.Expand(req.URL, map[string]string{ 14770 "enterpriseId": c.enterpriseId, 14771 "webAppId": c.webAppId, 14772 }) 14773 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14774} 14775 14776// Do executes the "androidenterprise.webapps.delete" call. 14777func (c *WebappsDeleteCall) Do(opts ...googleapi.CallOption) error { 14778 gensupport.SetOptions(c.urlParams_, opts...) 14779 res, err := c.doRequest("json") 14780 if err != nil { 14781 return err 14782 } 14783 defer googleapi.CloseBody(res) 14784 if err := googleapi.CheckResponse(res); err != nil { 14785 return err 14786 } 14787 return nil 14788 // { 14789 // "description": "Deletes an existing web app.", 14790 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14791 // "httpMethod": "DELETE", 14792 // "id": "androidenterprise.webapps.delete", 14793 // "parameterOrder": [ 14794 // "enterpriseId", 14795 // "webAppId" 14796 // ], 14797 // "parameters": { 14798 // "enterpriseId": { 14799 // "description": "The ID of the enterprise.", 14800 // "location": "path", 14801 // "required": true, 14802 // "type": "string" 14803 // }, 14804 // "webAppId": { 14805 // "description": "The ID of the web app.", 14806 // "location": "path", 14807 // "required": true, 14808 // "type": "string" 14809 // } 14810 // }, 14811 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14812 // "scopes": [ 14813 // "https://www.googleapis.com/auth/androidenterprise" 14814 // ] 14815 // } 14816 14817} 14818 14819// method id "androidenterprise.webapps.get": 14820 14821type WebappsGetCall struct { 14822 s *Service 14823 enterpriseId string 14824 webAppId string 14825 urlParams_ gensupport.URLParams 14826 ifNoneMatch_ string 14827 ctx_ context.Context 14828 header_ http.Header 14829} 14830 14831// Get: Gets an existing web app. 14832// 14833// - enterpriseId: The ID of the enterprise. 14834// - webAppId: The ID of the web app. 14835func (r *WebappsService) Get(enterpriseId string, webAppId string) *WebappsGetCall { 14836 c := &WebappsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14837 c.enterpriseId = enterpriseId 14838 c.webAppId = webAppId 14839 return c 14840} 14841 14842// Fields allows partial responses to be retrieved. See 14843// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14844// for more information. 14845func (c *WebappsGetCall) Fields(s ...googleapi.Field) *WebappsGetCall { 14846 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14847 return c 14848} 14849 14850// IfNoneMatch sets the optional parameter which makes the operation 14851// fail if the object's ETag matches the given value. This is useful for 14852// getting updates only after the object has changed since the last 14853// request. Use googleapi.IsNotModified to check whether the response 14854// error from Do is the result of In-None-Match. 14855func (c *WebappsGetCall) IfNoneMatch(entityTag string) *WebappsGetCall { 14856 c.ifNoneMatch_ = entityTag 14857 return c 14858} 14859 14860// Context sets the context to be used in this call's Do method. Any 14861// pending HTTP request will be aborted if the provided context is 14862// canceled. 14863func (c *WebappsGetCall) Context(ctx context.Context) *WebappsGetCall { 14864 c.ctx_ = ctx 14865 return c 14866} 14867 14868// Header returns an http.Header that can be modified by the caller to 14869// add HTTP headers to the request. 14870func (c *WebappsGetCall) Header() http.Header { 14871 if c.header_ == nil { 14872 c.header_ = make(http.Header) 14873 } 14874 return c.header_ 14875} 14876 14877func (c *WebappsGetCall) doRequest(alt string) (*http.Response, error) { 14878 reqHeaders := make(http.Header) 14879 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 14880 for k, v := range c.header_ { 14881 reqHeaders[k] = v 14882 } 14883 reqHeaders.Set("User-Agent", c.s.userAgent()) 14884 if c.ifNoneMatch_ != "" { 14885 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14886 } 14887 var body io.Reader = nil 14888 c.urlParams_.Set("alt", alt) 14889 c.urlParams_.Set("prettyPrint", "false") 14890 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 14891 urls += "?" + c.urlParams_.Encode() 14892 req, err := http.NewRequest("GET", urls, body) 14893 if err != nil { 14894 return nil, err 14895 } 14896 req.Header = reqHeaders 14897 googleapi.Expand(req.URL, map[string]string{ 14898 "enterpriseId": c.enterpriseId, 14899 "webAppId": c.webAppId, 14900 }) 14901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14902} 14903 14904// Do executes the "androidenterprise.webapps.get" call. 14905// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 14906// code is an error. Response headers are in either 14907// *WebApp.ServerResponse.Header or (if a response was returned at all) 14908// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14909// check whether the returned error was because http.StatusNotModified 14910// was returned. 14911func (c *WebappsGetCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 14912 gensupport.SetOptions(c.urlParams_, opts...) 14913 res, err := c.doRequest("json") 14914 if res != nil && res.StatusCode == http.StatusNotModified { 14915 if res.Body != nil { 14916 res.Body.Close() 14917 } 14918 return nil, &googleapi.Error{ 14919 Code: res.StatusCode, 14920 Header: res.Header, 14921 } 14922 } 14923 if err != nil { 14924 return nil, err 14925 } 14926 defer googleapi.CloseBody(res) 14927 if err := googleapi.CheckResponse(res); err != nil { 14928 return nil, err 14929 } 14930 ret := &WebApp{ 14931 ServerResponse: googleapi.ServerResponse{ 14932 Header: res.Header, 14933 HTTPStatusCode: res.StatusCode, 14934 }, 14935 } 14936 target := &ret 14937 if err := gensupport.DecodeResponse(target, res); err != nil { 14938 return nil, err 14939 } 14940 return ret, nil 14941 // { 14942 // "description": "Gets an existing web app.", 14943 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14944 // "httpMethod": "GET", 14945 // "id": "androidenterprise.webapps.get", 14946 // "parameterOrder": [ 14947 // "enterpriseId", 14948 // "webAppId" 14949 // ], 14950 // "parameters": { 14951 // "enterpriseId": { 14952 // "description": "The ID of the enterprise.", 14953 // "location": "path", 14954 // "required": true, 14955 // "type": "string" 14956 // }, 14957 // "webAppId": { 14958 // "description": "The ID of the web app.", 14959 // "location": "path", 14960 // "required": true, 14961 // "type": "string" 14962 // } 14963 // }, 14964 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14965 // "response": { 14966 // "$ref": "WebApp" 14967 // }, 14968 // "scopes": [ 14969 // "https://www.googleapis.com/auth/androidenterprise" 14970 // ] 14971 // } 14972 14973} 14974 14975// method id "androidenterprise.webapps.insert": 14976 14977type WebappsInsertCall struct { 14978 s *Service 14979 enterpriseId string 14980 webapp *WebApp 14981 urlParams_ gensupport.URLParams 14982 ctx_ context.Context 14983 header_ http.Header 14984} 14985 14986// Insert: Creates a new web app for the enterprise. 14987// 14988// - enterpriseId: The ID of the enterprise. 14989func (r *WebappsService) Insert(enterpriseId string, webapp *WebApp) *WebappsInsertCall { 14990 c := &WebappsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14991 c.enterpriseId = enterpriseId 14992 c.webapp = webapp 14993 return c 14994} 14995 14996// Fields allows partial responses to be retrieved. See 14997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14998// for more information. 14999func (c *WebappsInsertCall) Fields(s ...googleapi.Field) *WebappsInsertCall { 15000 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15001 return c 15002} 15003 15004// Context sets the context to be used in this call's Do method. Any 15005// pending HTTP request will be aborted if the provided context is 15006// canceled. 15007func (c *WebappsInsertCall) Context(ctx context.Context) *WebappsInsertCall { 15008 c.ctx_ = ctx 15009 return c 15010} 15011 15012// Header returns an http.Header that can be modified by the caller to 15013// add HTTP headers to the request. 15014func (c *WebappsInsertCall) Header() http.Header { 15015 if c.header_ == nil { 15016 c.header_ = make(http.Header) 15017 } 15018 return c.header_ 15019} 15020 15021func (c *WebappsInsertCall) doRequest(alt string) (*http.Response, error) { 15022 reqHeaders := make(http.Header) 15023 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 15024 for k, v := range c.header_ { 15025 reqHeaders[k] = v 15026 } 15027 reqHeaders.Set("User-Agent", c.s.userAgent()) 15028 var body io.Reader = nil 15029 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 15030 if err != nil { 15031 return nil, err 15032 } 15033 reqHeaders.Set("Content-Type", "application/json") 15034 c.urlParams_.Set("alt", alt) 15035 c.urlParams_.Set("prettyPrint", "false") 15036 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps") 15037 urls += "?" + c.urlParams_.Encode() 15038 req, err := http.NewRequest("POST", urls, body) 15039 if err != nil { 15040 return nil, err 15041 } 15042 req.Header = reqHeaders 15043 googleapi.Expand(req.URL, map[string]string{ 15044 "enterpriseId": c.enterpriseId, 15045 }) 15046 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15047} 15048 15049// Do executes the "androidenterprise.webapps.insert" call. 15050// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 15051// code is an error. Response headers are in either 15052// *WebApp.ServerResponse.Header or (if a response was returned at all) 15053// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15054// check whether the returned error was because http.StatusNotModified 15055// was returned. 15056func (c *WebappsInsertCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 15057 gensupport.SetOptions(c.urlParams_, opts...) 15058 res, err := c.doRequest("json") 15059 if res != nil && res.StatusCode == http.StatusNotModified { 15060 if res.Body != nil { 15061 res.Body.Close() 15062 } 15063 return nil, &googleapi.Error{ 15064 Code: res.StatusCode, 15065 Header: res.Header, 15066 } 15067 } 15068 if err != nil { 15069 return nil, err 15070 } 15071 defer googleapi.CloseBody(res) 15072 if err := googleapi.CheckResponse(res); err != nil { 15073 return nil, err 15074 } 15075 ret := &WebApp{ 15076 ServerResponse: googleapi.ServerResponse{ 15077 Header: res.Header, 15078 HTTPStatusCode: res.StatusCode, 15079 }, 15080 } 15081 target := &ret 15082 if err := gensupport.DecodeResponse(target, res); err != nil { 15083 return nil, err 15084 } 15085 return ret, nil 15086 // { 15087 // "description": "Creates a new web app for the enterprise.", 15088 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15089 // "httpMethod": "POST", 15090 // "id": "androidenterprise.webapps.insert", 15091 // "parameterOrder": [ 15092 // "enterpriseId" 15093 // ], 15094 // "parameters": { 15095 // "enterpriseId": { 15096 // "description": "The ID of the enterprise.", 15097 // "location": "path", 15098 // "required": true, 15099 // "type": "string" 15100 // } 15101 // }, 15102 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15103 // "request": { 15104 // "$ref": "WebApp" 15105 // }, 15106 // "response": { 15107 // "$ref": "WebApp" 15108 // }, 15109 // "scopes": [ 15110 // "https://www.googleapis.com/auth/androidenterprise" 15111 // ] 15112 // } 15113 15114} 15115 15116// method id "androidenterprise.webapps.list": 15117 15118type WebappsListCall struct { 15119 s *Service 15120 enterpriseId string 15121 urlParams_ gensupport.URLParams 15122 ifNoneMatch_ string 15123 ctx_ context.Context 15124 header_ http.Header 15125} 15126 15127// List: Retrieves the details of all web apps for a given enterprise. 15128// 15129// - enterpriseId: The ID of the enterprise. 15130func (r *WebappsService) List(enterpriseId string) *WebappsListCall { 15131 c := &WebappsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15132 c.enterpriseId = enterpriseId 15133 return c 15134} 15135 15136// Fields allows partial responses to be retrieved. See 15137// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15138// for more information. 15139func (c *WebappsListCall) Fields(s ...googleapi.Field) *WebappsListCall { 15140 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15141 return c 15142} 15143 15144// IfNoneMatch sets the optional parameter which makes the operation 15145// fail if the object's ETag matches the given value. This is useful for 15146// getting updates only after the object has changed since the last 15147// request. Use googleapi.IsNotModified to check whether the response 15148// error from Do is the result of In-None-Match. 15149func (c *WebappsListCall) IfNoneMatch(entityTag string) *WebappsListCall { 15150 c.ifNoneMatch_ = entityTag 15151 return c 15152} 15153 15154// Context sets the context to be used in this call's Do method. Any 15155// pending HTTP request will be aborted if the provided context is 15156// canceled. 15157func (c *WebappsListCall) Context(ctx context.Context) *WebappsListCall { 15158 c.ctx_ = ctx 15159 return c 15160} 15161 15162// Header returns an http.Header that can be modified by the caller to 15163// add HTTP headers to the request. 15164func (c *WebappsListCall) Header() http.Header { 15165 if c.header_ == nil { 15166 c.header_ = make(http.Header) 15167 } 15168 return c.header_ 15169} 15170 15171func (c *WebappsListCall) doRequest(alt string) (*http.Response, error) { 15172 reqHeaders := make(http.Header) 15173 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 15174 for k, v := range c.header_ { 15175 reqHeaders[k] = v 15176 } 15177 reqHeaders.Set("User-Agent", c.s.userAgent()) 15178 if c.ifNoneMatch_ != "" { 15179 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15180 } 15181 var body io.Reader = nil 15182 c.urlParams_.Set("alt", alt) 15183 c.urlParams_.Set("prettyPrint", "false") 15184 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps") 15185 urls += "?" + c.urlParams_.Encode() 15186 req, err := http.NewRequest("GET", urls, body) 15187 if err != nil { 15188 return nil, err 15189 } 15190 req.Header = reqHeaders 15191 googleapi.Expand(req.URL, map[string]string{ 15192 "enterpriseId": c.enterpriseId, 15193 }) 15194 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15195} 15196 15197// Do executes the "androidenterprise.webapps.list" call. 15198// Exactly one of *WebAppsListResponse or error will be non-nil. Any 15199// non-2xx status code is an error. Response headers are in either 15200// *WebAppsListResponse.ServerResponse.Header or (if a response was 15201// returned at all) in error.(*googleapi.Error).Header. Use 15202// googleapi.IsNotModified to check whether the returned error was 15203// because http.StatusNotModified was returned. 15204func (c *WebappsListCall) Do(opts ...googleapi.CallOption) (*WebAppsListResponse, error) { 15205 gensupport.SetOptions(c.urlParams_, opts...) 15206 res, err := c.doRequest("json") 15207 if res != nil && res.StatusCode == http.StatusNotModified { 15208 if res.Body != nil { 15209 res.Body.Close() 15210 } 15211 return nil, &googleapi.Error{ 15212 Code: res.StatusCode, 15213 Header: res.Header, 15214 } 15215 } 15216 if err != nil { 15217 return nil, err 15218 } 15219 defer googleapi.CloseBody(res) 15220 if err := googleapi.CheckResponse(res); err != nil { 15221 return nil, err 15222 } 15223 ret := &WebAppsListResponse{ 15224 ServerResponse: googleapi.ServerResponse{ 15225 Header: res.Header, 15226 HTTPStatusCode: res.StatusCode, 15227 }, 15228 } 15229 target := &ret 15230 if err := gensupport.DecodeResponse(target, res); err != nil { 15231 return nil, err 15232 } 15233 return ret, nil 15234 // { 15235 // "description": "Retrieves the details of all web apps for a given enterprise.", 15236 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15237 // "httpMethod": "GET", 15238 // "id": "androidenterprise.webapps.list", 15239 // "parameterOrder": [ 15240 // "enterpriseId" 15241 // ], 15242 // "parameters": { 15243 // "enterpriseId": { 15244 // "description": "The ID of the enterprise.", 15245 // "location": "path", 15246 // "required": true, 15247 // "type": "string" 15248 // } 15249 // }, 15250 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15251 // "response": { 15252 // "$ref": "WebAppsListResponse" 15253 // }, 15254 // "scopes": [ 15255 // "https://www.googleapis.com/auth/androidenterprise" 15256 // ] 15257 // } 15258 15259} 15260 15261// method id "androidenterprise.webapps.update": 15262 15263type WebappsUpdateCall struct { 15264 s *Service 15265 enterpriseId string 15266 webAppId string 15267 webapp *WebApp 15268 urlParams_ gensupport.URLParams 15269 ctx_ context.Context 15270 header_ http.Header 15271} 15272 15273// Update: Updates an existing web app. 15274// 15275// - enterpriseId: The ID of the enterprise. 15276// - webAppId: The ID of the web app. 15277func (r *WebappsService) Update(enterpriseId string, webAppId string, webapp *WebApp) *WebappsUpdateCall { 15278 c := &WebappsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15279 c.enterpriseId = enterpriseId 15280 c.webAppId = webAppId 15281 c.webapp = webapp 15282 return c 15283} 15284 15285// Fields allows partial responses to be retrieved. See 15286// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15287// for more information. 15288func (c *WebappsUpdateCall) Fields(s ...googleapi.Field) *WebappsUpdateCall { 15289 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15290 return c 15291} 15292 15293// Context sets the context to be used in this call's Do method. Any 15294// pending HTTP request will be aborted if the provided context is 15295// canceled. 15296func (c *WebappsUpdateCall) Context(ctx context.Context) *WebappsUpdateCall { 15297 c.ctx_ = ctx 15298 return c 15299} 15300 15301// Header returns an http.Header that can be modified by the caller to 15302// add HTTP headers to the request. 15303func (c *WebappsUpdateCall) Header() http.Header { 15304 if c.header_ == nil { 15305 c.header_ = make(http.Header) 15306 } 15307 return c.header_ 15308} 15309 15310func (c *WebappsUpdateCall) doRequest(alt string) (*http.Response, error) { 15311 reqHeaders := make(http.Header) 15312 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 15313 for k, v := range c.header_ { 15314 reqHeaders[k] = v 15315 } 15316 reqHeaders.Set("User-Agent", c.s.userAgent()) 15317 var body io.Reader = nil 15318 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 15319 if err != nil { 15320 return nil, err 15321 } 15322 reqHeaders.Set("Content-Type", "application/json") 15323 c.urlParams_.Set("alt", alt) 15324 c.urlParams_.Set("prettyPrint", "false") 15325 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 15326 urls += "?" + c.urlParams_.Encode() 15327 req, err := http.NewRequest("PUT", urls, body) 15328 if err != nil { 15329 return nil, err 15330 } 15331 req.Header = reqHeaders 15332 googleapi.Expand(req.URL, map[string]string{ 15333 "enterpriseId": c.enterpriseId, 15334 "webAppId": c.webAppId, 15335 }) 15336 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15337} 15338 15339// Do executes the "androidenterprise.webapps.update" call. 15340// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 15341// code is an error. Response headers are in either 15342// *WebApp.ServerResponse.Header or (if a response was returned at all) 15343// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15344// check whether the returned error was because http.StatusNotModified 15345// was returned. 15346func (c *WebappsUpdateCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 15347 gensupport.SetOptions(c.urlParams_, opts...) 15348 res, err := c.doRequest("json") 15349 if res != nil && res.StatusCode == http.StatusNotModified { 15350 if res.Body != nil { 15351 res.Body.Close() 15352 } 15353 return nil, &googleapi.Error{ 15354 Code: res.StatusCode, 15355 Header: res.Header, 15356 } 15357 } 15358 if err != nil { 15359 return nil, err 15360 } 15361 defer googleapi.CloseBody(res) 15362 if err := googleapi.CheckResponse(res); err != nil { 15363 return nil, err 15364 } 15365 ret := &WebApp{ 15366 ServerResponse: googleapi.ServerResponse{ 15367 Header: res.Header, 15368 HTTPStatusCode: res.StatusCode, 15369 }, 15370 } 15371 target := &ret 15372 if err := gensupport.DecodeResponse(target, res); err != nil { 15373 return nil, err 15374 } 15375 return ret, nil 15376 // { 15377 // "description": "Updates an existing web app.", 15378 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 15379 // "httpMethod": "PUT", 15380 // "id": "androidenterprise.webapps.update", 15381 // "parameterOrder": [ 15382 // "enterpriseId", 15383 // "webAppId" 15384 // ], 15385 // "parameters": { 15386 // "enterpriseId": { 15387 // "description": "The ID of the enterprise.", 15388 // "location": "path", 15389 // "required": true, 15390 // "type": "string" 15391 // }, 15392 // "webAppId": { 15393 // "description": "The ID of the web app.", 15394 // "location": "path", 15395 // "required": true, 15396 // "type": "string" 15397 // } 15398 // }, 15399 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 15400 // "request": { 15401 // "$ref": "WebApp" 15402 // }, 15403 // "response": { 15404 // "$ref": "WebApp" 15405 // }, 15406 // "scopes": [ 15407 // "https://www.googleapis.com/auth/androidenterprise" 15408 // ] 15409 // } 15410 15411} 15412