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 values are omitted from API requests. However, any non-pointer, 336 // non-interface field appearing in ForceSendFields will be sent to the 337 // server regardless of whether the field is empty or not. This may be 338 // 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 values are omitted from API requests. However, any non-pointer, 370 // non-interface field appearing in ForceSendFields will be sent to the 371 // server regardless of whether the field is empty or not. This may be 372 // 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 values are omitted from API requests. 429 // 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 values are omitted from API requests. However, any non-pointer, 459 // non-interface field appearing in ForceSendFields will be sent to the 460 // server regardless of whether the field is empty or not. This may be 461 // 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 values are omitted from API requests. However, any non-pointer, 491 // non-interface field appearing in ForceSendFields will be sent to the 492 // server regardless of whether the field is empty or not. This may be 493 // 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 values are omitted from API requests. However, any non-pointer, 518 // non-interface field appearing in ForceSendFields will be sent to the 519 // server regardless of whether the field is empty or not. This may be 520 // 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 values are omitted from API requests. However, any non-pointer, 546 // non-interface field appearing in ForceSendFields will be sent to the 547 // server regardless of whether the field is empty or not. This may be 548 // 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 values are omitted from API requests. However, any non-pointer, 573 // non-interface field appearing in ForceSendFields will be sent to the 574 // server regardless of whether the field is empty or not. This may be 575 // 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 values are omitted from API requests. However, any non-pointer, 601 // non-interface field appearing in ForceSendFields will be sent to the 602 // server regardless of whether the field is empty or not. This may be 603 // 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 values are omitted from API requests. However, any non-pointer, 637 // non-interface field appearing in ForceSendFields will be sent to the 638 // server regardless of whether the field is empty or not. This may be 639 // 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 values are omitted from API requests. However, any non-pointer, 670 // non-interface field appearing in ForceSendFields will be sent to the 671 // server regardless of whether the field is empty or not. This may be 672 // 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 values are omitted from API requests. However, any non-pointer, 743 // non-interface field appearing in ForceSendFields will be sent to the 744 // server regardless of whether the field is empty or not. This may be 745 // 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 values are omitted from API requests. However, any non-pointer, 800 // non-interface field appearing in ForceSendFields will be sent to the 801 // server regardless of whether the field is empty or not. This may be 802 // 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 values are omitted from API requests. However, any non-pointer, 833 // non-interface field appearing in ForceSendFields will be sent to the 834 // server regardless of whether the field is empty or not. This may be 835 // 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 values are omitted from API requests. However, any non-pointer, 866 // non-interface field appearing in ForceSendFields will be sent to the 867 // server regardless of whether the field is empty or not. This may be 868 // 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 values are omitted from API requests. However, any non-pointer, 916 // non-interface field appearing in ForceSendFields will be sent to the 917 // server regardless of whether the field is empty or not. This may be 918 // 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 values are omitted from API requests. However, any non-pointer, 945 // non-interface field appearing in ForceSendFields will be sent to the 946 // server regardless of whether the field is empty or not. This may be 947 // 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 values are omitted from API requests. However, any non-pointer, 981 // non-interface field appearing in ForceSendFields will be sent to the 982 // server regardless of whether the field is empty or not. This may be 983 // 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 values are omitted from API 1033 // requests. However, any non-pointer, non-interface field appearing in 1034 // ForceSendFields will be sent to the server regardless of whether the 1035 // field is empty or not. This may be used to include empty fields in 1036 // 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 values are omitted from API requests. 1088 // 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 values are omitted from API requests. However, any non-pointer, 1125 // non-interface field appearing in ForceSendFields will be sent to the 1126 // server regardless of whether the field is empty or not. This may be 1127 // 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 values are omitted from API requests. However, any non-pointer, 1184 // non-interface field appearing in ForceSendFields will be sent to the 1185 // server regardless of whether the field is empty or not. This may be 1186 // 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 values are omitted from API requests. However, any non-pointer, 1219 // non-interface field appearing in ForceSendFields will be sent to the 1220 // server regardless of whether the field is empty or not. This may be 1221 // 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 values are omitted from API requests. However, any non-pointer, 1256 // non-interface field appearing in ForceSendFields will be sent to the 1257 // server regardless of whether the field is empty or not. This may be 1258 // 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 values are omitted from API requests. However, any non-pointer, 1297 // non-interface field appearing in ForceSendFields will be sent to the 1298 // server regardless of whether the field is empty or not. This may be 1299 // 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 values are omitted from API requests. However, any non-pointer, 1328 // non-interface field appearing in ForceSendFields will be sent to the 1329 // server regardless of whether the field is empty or not. This may be 1330 // 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 values are omitted from API requests. However, any non-pointer, 1383 // non-interface field appearing in ForceSendFields will be sent to the 1384 // server regardless of whether the field is empty or not. This may be 1385 // 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 values are omitted from API requests. However, any non-pointer, 1416 // non-interface field appearing in ForceSendFields will be sent to the 1417 // server regardless of whether the field is empty or not. This may be 1418 // 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 values are omitted from API requests. However, any non-pointer, 1447 // non-interface field appearing in ForceSendFields will be sent to the 1448 // server regardless of whether the field is empty or not. This may be 1449 // 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 values are omitted from API requests. However, any non-pointer, 1483 // non-interface field appearing in ForceSendFields will be sent to the 1484 // server regardless of whether the field is empty or not. This may be 1485 // 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 values are omitted from API requests. However, any non-pointer, 1545 // non-interface field appearing in ForceSendFields will be sent to the 1546 // server regardless of whether the field is empty or not. This may be 1547 // 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 values are omitted from API requests. However, any non-pointer, 1578 // non-interface field appearing in ForceSendFields will be sent to the 1579 // server regardless of whether the field is empty or not. This may be 1580 // 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 values are omitted from API requests. However, any non-pointer, 1676 // non-interface field appearing in ForceSendFields will be sent to the 1677 // server regardless of whether the field is empty or not. This may be 1678 // 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 values are omitted from API requests. However, any non-pointer, 1708 // non-interface field appearing in ForceSendFields will be sent to the 1709 // server regardless of whether the field is empty or not. This may be 1710 // 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 values are omitted from API requests. However, any non-pointer, 1740 // non-interface field appearing in ForceSendFields will be sent to the 1741 // server regardless of whether the field is empty or not. This may be 1742 // 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 values are omitted from API requests. However, any non-pointer, 1806 // non-interface field appearing in ForceSendFields will be sent to the 1807 // server regardless of whether the field is empty or not. This may be 1808 // 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 values are omitted from API requests. However, any non-pointer, 1859 // non-interface field appearing in ForceSendFields will be sent to the 1860 // server regardless of whether the field is empty or not. This may be 1861 // 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 values are omitted from API requests. However, any non-pointer, 1892 // non-interface field appearing in ForceSendFields will be sent to the 1893 // server regardless of whether the field is empty or not. This may be 1894 // 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 values are omitted from API requests. However, any non-pointer, 1947 // non-interface field appearing in ForceSendFields will be sent to the 1948 // server regardless of whether the field is empty or not. This may be 1949 // 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 values are omitted from API requests. However, any non-pointer, 1978 // non-interface field appearing in ForceSendFields will be sent to the 1979 // server regardless of whether the field is empty or not. This may be 1980 // 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 values are omitted from API requests. However, any non-pointer, 2013 // non-interface field appearing in ForceSendFields will be sent to the 2014 // server regardless of whether the field is empty or not. This may be 2015 // 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 values are omitted from API requests. 2061 // 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 values are omitted from API 2095 // requests. However, any non-pointer, non-interface field appearing in 2096 // ForceSendFields will be sent to the server regardless of whether the 2097 // field is empty or not. This may be used to include empty fields in 2098 // 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 values are omitted from API 2129 // requests. However, any non-pointer, non-interface field appearing in 2130 // ForceSendFields will be sent to the server regardless of whether the 2131 // field is empty or not. This may be used to include empty fields in 2132 // 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 values are omitted from API 2170 // requests. However, any non-pointer, non-interface field appearing in 2171 // ForceSendFields will be sent to the server regardless of whether the 2172 // field is empty or not. This may be used to include empty fields in 2173 // 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 values are omitted from API 2204 // requests. However, any non-pointer, non-interface field appearing in 2205 // ForceSendFields will be sent to the server regardless of whether the 2206 // field is empty or not. This may be used to include empty fields in 2207 // 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 values are omitted from API requests. However, any non-pointer, 2262 // non-interface field appearing in ForceSendFields will be sent to the 2263 // server regardless of whether the field is empty or not. This may be 2264 // 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 values are omitted from API requests. However, any non-pointer, 2290 // non-interface field appearing in ForceSendFields will be sent to the 2291 // server regardless of whether the field is empty or not. This may be 2292 // 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 values are omitted from API requests. However, any non-pointer, 2338 // non-interface field appearing in ForceSendFields will be sent to the 2339 // server regardless of whether the field is empty or not. This may be 2340 // 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 values are omitted from API requests. However, any non-pointer, 2379 // non-interface field appearing in ForceSendFields will be sent to the 2380 // server regardless of whether the field is empty or not. This may be 2381 // 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 values are omitted from API 2458 // requests. However, any non-pointer, non-interface field appearing in 2459 // ForceSendFields will be sent to the server regardless of whether the 2460 // field is empty or not. This may be used to include empty fields in 2461 // 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 values are omitted from API requests. However, any non-pointer, 2500 // non-interface field appearing in ForceSendFields will be sent to the 2501 // server regardless of whether the field is empty or not. This may be 2502 // 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 values are omitted from API requests. However, any non-pointer, 2538 // non-interface field appearing in ForceSendFields will be sent to the 2539 // server regardless of whether the field is empty or not. This may be 2540 // 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 values are omitted from API requests. However, any non-pointer, 2584 // non-interface field appearing in ForceSendFields will be sent to the 2585 // server regardless of whether the field is empty or not. This may be 2586 // 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: The auto-update policy for apps installed on the 2607 // device. "choiceToTheUser" allows the device's user to configure the 2608 // app update policy. "always" enables auto updates. "never" disables 2609 // auto updates. "wifiOnly" enables auto updates only when the device is 2610 // connected to wifi. 2611 // 2612 // Possible values: 2613 // "autoUpdatePolicyUnspecified" - The auto update policy is not set. 2614 // "choiceToTheUser" - The user can control auto-updates. 2615 // "never" - Apps are never auto-updated. 2616 // "wifiOnly" - Apps are auto-updated over WiFi only. 2617 // "always" - Apps are auto-updated at any time. Data charges may 2618 // apply. 2619 AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"` 2620 2621 // DeviceReportPolicy: Whether the device reports app states to the EMM. 2622 // The default value is "deviceReportDisabled". 2623 // 2624 // Possible values: 2625 // "deviceReportPolicyUnspecified" - The device report policy is not 2626 // set. 2627 // "deviceReportDisabled" - Device reports are disabled. 2628 // "deviceReportEnabled" - Device reports are enabled. 2629 DeviceReportPolicy string `json:"deviceReportPolicy,omitempty"` 2630 2631 // MaintenanceWindow: The maintenance window defining when apps running 2632 // in the foreground should be updated. 2633 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 2634 2635 // ProductAvailabilityPolicy: The availability granted to the device for 2636 // the specified products. "all" gives the device access to all 2637 // products, regardless of approval status. "all" does not enable 2638 // automatic visibility of "alpha" or "beta" tracks. "whitelist" grants 2639 // the device access the products specified in productPolicy[]. Only 2640 // products that are approved or products that were previously approved 2641 // (products with revoked approval) by the enterprise can be 2642 // whitelisted. If no value is provided, the availability set at the 2643 // user level is applied by default. 2644 // 2645 // Possible values: 2646 // "productAvailabilityPolicyUnspecified" - Unspecified, applies the 2647 // user available product set by default. 2648 // "whitelist" - The approved products with product availability set 2649 // to AVAILABLE in the product policy are available. 2650 // "all" - All products are available except those explicitly marked 2651 // as unavailable in the product availability policy. 2652 ProductAvailabilityPolicy string `json:"productAvailabilityPolicy,omitempty"` 2653 2654 // ProductPolicy: The list of product policies. The 2655 // productAvailabilityPolicy needs to be set to WHITELIST or ALL for the 2656 // product policies to be applied. 2657 ProductPolicy []*ProductPolicy `json:"productPolicy,omitempty"` 2658 2659 // ForceSendFields is a list of field names (e.g. "AutoUpdatePolicy") to 2660 // unconditionally include in API requests. By default, fields with 2661 // empty values are omitted from API requests. However, any non-pointer, 2662 // non-interface field appearing in ForceSendFields will be sent to the 2663 // server regardless of whether the field is empty or not. This may be 2664 // used to include empty fields in Patch requests. 2665 ForceSendFields []string `json:"-"` 2666 2667 // NullFields is a list of field names (e.g. "AutoUpdatePolicy") to 2668 // include in API requests with the JSON null value. By default, fields 2669 // with empty values are omitted from API requests. However, any field 2670 // with an empty value appearing in NullFields will be sent to the 2671 // server as null. It is an error if a field in this list has a 2672 // non-empty value. This may be used to include null fields in Patch 2673 // requests. 2674 NullFields []string `json:"-"` 2675} 2676 2677func (s *Policy) MarshalJSON() ([]byte, error) { 2678 type NoMethod Policy 2679 raw := NoMethod(*s) 2680 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2681} 2682 2683// Product: A Products resource represents an app in the Google Play 2684// store that is available to at least some users in the enterprise. 2685// (Some apps are restricted to a single enterprise, and no information 2686// about them is made available outside that enterprise.) The 2687// information provided for each product (localized name, icon, link to 2688// the full Google Play details page) is intended to allow a basic 2689// representation of the product within an EMM user interface. 2690type Product struct { 2691 // AppTracks: The tracks visible to the enterprise. 2692 AppTracks []*TrackInfo `json:"appTracks,omitempty"` 2693 2694 // AppVersion: App versions currently available for this product. 2695 AppVersion []*AppVersion `json:"appVersion,omitempty"` 2696 2697 // AuthorName: The name of the author of the product (for example, the 2698 // app developer). 2699 AuthorName string `json:"authorName,omitempty"` 2700 2701 // AvailableCountries: The countries which this app is available in. 2702 AvailableCountries []string `json:"availableCountries,omitempty"` 2703 2704 // AvailableTracks: Deprecated, use appTracks instead. 2705 // 2706 // Possible values: 2707 // "appTrackUnspecified" 2708 // "production" 2709 // "beta" 2710 // "alpha" 2711 AvailableTracks []string `json:"availableTracks,omitempty"` 2712 2713 // Category: The app category (e.g. RACING, SOCIAL, etc.) 2714 Category string `json:"category,omitempty"` 2715 2716 // ContentRating: The content rating for this app. 2717 // 2718 // Possible values: 2719 // "ratingUnknown" 2720 // "all" 2721 // "preTeen" 2722 // "teen" 2723 // "mature" 2724 ContentRating string `json:"contentRating,omitempty"` 2725 2726 // Description: The localized promotional description, if available. 2727 Description string `json:"description,omitempty"` 2728 2729 // DetailsUrl: A link to the (consumer) Google Play details page for the 2730 // product. 2731 DetailsUrl string `json:"detailsUrl,omitempty"` 2732 2733 // DistributionChannel: How and to whom the package is made available. 2734 // The value publicGoogleHosted means that the package is available 2735 // through the Play store and not restricted to a specific enterprise. 2736 // The value privateGoogleHosted means that the package is a private app 2737 // (restricted to an enterprise) but hosted by Google. The value 2738 // privateSelfHosted means that the package is a private app (restricted 2739 // to an enterprise) and is privately hosted. 2740 // 2741 // Possible values: 2742 // "publicGoogleHosted" 2743 // "privateGoogleHosted" 2744 // "privateSelfHosted" 2745 DistributionChannel string `json:"distributionChannel,omitempty"` 2746 2747 // Features: Noteworthy features (if any) of this product. 2748 // 2749 // Possible values: 2750 // "featureUnknown" 2751 // "vpnApp" - The app is a VPN. 2752 Features []string `json:"features,omitempty"` 2753 2754 // IconUrl: A link to an image that can be used as an icon for the 2755 // product. This image is suitable for use at up to 512px x 512px. 2756 IconUrl string `json:"iconUrl,omitempty"` 2757 2758 // LastUpdatedTimestampMillis: The approximate time (within 7 days) the 2759 // app was last published, expressed in milliseconds since epoch. 2760 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 2761 2762 // MinAndroidSdkVersion: The minimum Android SDK necessary to run the 2763 // app. 2764 MinAndroidSdkVersion int64 `json:"minAndroidSdkVersion,omitempty"` 2765 2766 // Permissions: A list of permissions required by the app. 2767 Permissions []*ProductPermission `json:"permissions,omitempty"` 2768 2769 // ProductId: A string of the form *app:<package name>*. For example, 2770 // app:com.google.android.gm represents the Gmail app. 2771 ProductId string `json:"productId,omitempty"` 2772 2773 // ProductPricing: Whether this product is free, free with in-app 2774 // purchases, or paid. If the pricing is unknown, this means the product 2775 // is not generally available anymore (even though it might still be 2776 // available to people who own it). 2777 // 2778 // Possible values: 2779 // "unknown" - Unknown pricing, used to denote an approved product 2780 // that is not generally available. 2781 // "free" - The product is free. 2782 // "freeWithInAppPurchase" - The product is free, but offers in-app 2783 // purchases. 2784 // "paid" - The product is paid. 2785 ProductPricing string `json:"productPricing,omitempty"` 2786 2787 // RecentChanges: A description of the recent changes made to the app. 2788 RecentChanges string `json:"recentChanges,omitempty"` 2789 2790 // RequiresContainerApp: Deprecated. 2791 RequiresContainerApp bool `json:"requiresContainerApp,omitempty"` 2792 2793 // ScreenshotUrls: A list of screenshot links representing the app. 2794 ScreenshotUrls []string `json:"screenshotUrls,omitempty"` 2795 2796 // SigningCertificate: The certificate used to sign this product. 2797 SigningCertificate *ProductSigningCertificate `json:"signingCertificate,omitempty"` 2798 2799 // SmallIconUrl: A link to a smaller image that can be used as an icon 2800 // for the product. This image is suitable for use at up to 128px x 2801 // 128px. 2802 SmallIconUrl string `json:"smallIconUrl,omitempty"` 2803 2804 // Title: The name of the product. 2805 Title string `json:"title,omitempty"` 2806 2807 // WorkDetailsUrl: A link to the managed Google Play details page for 2808 // the product, for use by an Enterprise admin. 2809 WorkDetailsUrl string `json:"workDetailsUrl,omitempty"` 2810 2811 // ServerResponse contains the HTTP response code and headers from the 2812 // server. 2813 googleapi.ServerResponse `json:"-"` 2814 2815 // ForceSendFields is a list of field names (e.g. "AppTracks") to 2816 // unconditionally include in API requests. By default, fields with 2817 // empty values are omitted from API requests. However, any non-pointer, 2818 // non-interface field appearing in ForceSendFields will be sent to the 2819 // server regardless of whether the field is empty or not. This may be 2820 // used to include empty fields in Patch requests. 2821 ForceSendFields []string `json:"-"` 2822 2823 // NullFields is a list of field names (e.g. "AppTracks") to include in 2824 // API requests with the JSON null value. By default, fields with empty 2825 // values are omitted from API requests. However, any field with an 2826 // empty value appearing in NullFields will be sent to the server as 2827 // null. It is an error if a field in this list has a non-empty value. 2828 // This may be used to include null fields in Patch requests. 2829 NullFields []string `json:"-"` 2830} 2831 2832func (s *Product) MarshalJSON() ([]byte, error) { 2833 type NoMethod Product 2834 raw := NoMethod(*s) 2835 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2836} 2837 2838// ProductApprovalEvent: An event generated when a product's approval 2839// status is changed. 2840type ProductApprovalEvent struct { 2841 // Approved: Whether the product was approved or unapproved. This field 2842 // will always be present. 2843 // 2844 // Possible values: 2845 // "unknown" - Conveys no information. 2846 // "approved" - The product was approved. 2847 // "unapproved" - The product was unapproved. 2848 Approved string `json:"approved,omitempty"` 2849 2850 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2851 // for which the approval status has changed. This field will always be 2852 // present. 2853 ProductId string `json:"productId,omitempty"` 2854 2855 // ForceSendFields is a list of field names (e.g. "Approved") to 2856 // unconditionally include in API requests. By default, fields with 2857 // empty values are omitted from API requests. However, any non-pointer, 2858 // non-interface field appearing in ForceSendFields will be sent to the 2859 // server regardless of whether the field is empty or not. This may be 2860 // used to include empty fields in Patch requests. 2861 ForceSendFields []string `json:"-"` 2862 2863 // NullFields is a list of field names (e.g. "Approved") to include in 2864 // API requests with the JSON null value. By default, fields with empty 2865 // values are omitted from API requests. However, any field with an 2866 // empty value appearing in NullFields will be sent to the server as 2867 // null. It is an error if a field in this list has a non-empty value. 2868 // This may be used to include null fields in Patch requests. 2869 NullFields []string `json:"-"` 2870} 2871 2872func (s *ProductApprovalEvent) MarshalJSON() ([]byte, error) { 2873 type NoMethod ProductApprovalEvent 2874 raw := NoMethod(*s) 2875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2876} 2877 2878// ProductAvailabilityChangeEvent: An event generated whenever a 2879// product's availability changes. 2880type ProductAvailabilityChangeEvent struct { 2881 // AvailabilityStatus: The new state of the product. This field will 2882 // always be present. 2883 // 2884 // Possible values: 2885 // "unknown" - Conveys no information. 2886 // "available" - The previously unavailable product is again available 2887 // on Google Play. 2888 // "removed" - The product was removed from Google Play. 2889 // "unpublished" - The product was unpublished by the developer. 2890 AvailabilityStatus string `json:"availabilityStatus,omitempty"` 2891 2892 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2893 // for which the product availability changed. This field will always be 2894 // present. 2895 ProductId string `json:"productId,omitempty"` 2896 2897 // ForceSendFields is a list of field names (e.g. "AvailabilityStatus") 2898 // to unconditionally include in API requests. By default, fields with 2899 // empty values are omitted from API requests. However, any non-pointer, 2900 // non-interface field appearing in ForceSendFields will be sent to the 2901 // server regardless of whether the field is empty or not. This may be 2902 // used to include empty fields in Patch requests. 2903 ForceSendFields []string `json:"-"` 2904 2905 // NullFields is a list of field names (e.g. "AvailabilityStatus") to 2906 // include in API requests with the JSON null value. By default, fields 2907 // with empty values are omitted from API requests. However, any field 2908 // with an empty value appearing in NullFields will be sent to the 2909 // server as null. It is an error if a field in this list has a 2910 // non-empty value. This may be used to include null fields in Patch 2911 // requests. 2912 NullFields []string `json:"-"` 2913} 2914 2915func (s *ProductAvailabilityChangeEvent) MarshalJSON() ([]byte, error) { 2916 type NoMethod ProductAvailabilityChangeEvent 2917 raw := NoMethod(*s) 2918 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2919} 2920 2921// ProductPermission: A product permissions resource represents the set 2922// of permissions required by a specific app and whether or not they 2923// have been accepted by an enterprise admin. The API can be used to 2924// read the set of permissions, and also to update the set to indicate 2925// that permissions have been accepted. 2926type ProductPermission struct { 2927 // PermissionId: An opaque string uniquely identifying the permission. 2928 PermissionId string `json:"permissionId,omitempty"` 2929 2930 // State: Whether the permission has been accepted or not. 2931 // 2932 // Possible values: 2933 // "required" - The permission is required by the app but has not yet 2934 // been accepted by the enterprise. 2935 // "accepted" - The permission has been accepted by the enterprise. 2936 State string `json:"state,omitempty"` 2937 2938 // ForceSendFields is a list of field names (e.g. "PermissionId") to 2939 // unconditionally include in API requests. By default, fields with 2940 // empty values are omitted from API requests. However, any non-pointer, 2941 // non-interface field appearing in ForceSendFields will be sent to the 2942 // server regardless of whether the field is empty or not. This may be 2943 // used to include empty fields in Patch requests. 2944 ForceSendFields []string `json:"-"` 2945 2946 // NullFields is a list of field names (e.g. "PermissionId") to include 2947 // in API requests with the JSON null value. By default, fields with 2948 // empty values are omitted from API requests. However, any field with 2949 // an empty value appearing in NullFields will be sent to the server as 2950 // null. It is an error if a field in this list has a non-empty value. 2951 // This may be used to include null fields in Patch requests. 2952 NullFields []string `json:"-"` 2953} 2954 2955func (s *ProductPermission) MarshalJSON() ([]byte, error) { 2956 type NoMethod ProductPermission 2957 raw := NoMethod(*s) 2958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2959} 2960 2961// ProductPermissions: Information about the permissions required by a 2962// specific app and whether they have been accepted by the enterprise. 2963type ProductPermissions struct { 2964 // Permission: The permissions required by the app. 2965 Permission []*ProductPermission `json:"permission,omitempty"` 2966 2967 // ProductId: The ID of the app that the permissions relate to, e.g. 2968 // "app:com.google.android.gm". 2969 ProductId string `json:"productId,omitempty"` 2970 2971 // ServerResponse contains the HTTP response code and headers from the 2972 // server. 2973 googleapi.ServerResponse `json:"-"` 2974 2975 // ForceSendFields is a list of field names (e.g. "Permission") to 2976 // unconditionally include in API requests. By default, fields with 2977 // empty values are omitted from API requests. However, any non-pointer, 2978 // non-interface field appearing in ForceSendFields will be sent to the 2979 // server regardless of whether the field is empty or not. This may be 2980 // used to include empty fields in Patch requests. 2981 ForceSendFields []string `json:"-"` 2982 2983 // NullFields is a list of field names (e.g. "Permission") to include in 2984 // API requests with the JSON null value. By default, fields with empty 2985 // values are omitted from API requests. However, any field with an 2986 // empty value appearing in NullFields will be sent to the server as 2987 // null. It is an error if a field in this list has a non-empty value. 2988 // This may be used to include null fields in Patch requests. 2989 NullFields []string `json:"-"` 2990} 2991 2992func (s *ProductPermissions) MarshalJSON() ([]byte, error) { 2993 type NoMethod ProductPermissions 2994 raw := NoMethod(*s) 2995 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2996} 2997 2998// ProductPolicy: The policy for a product. 2999type ProductPolicy struct { 3000 // AutoInstallPolicy: The auto-install policy for the product. 3001 AutoInstallPolicy *AutoInstallPolicy `json:"autoInstallPolicy,omitempty"` 3002 3003 // AutoUpdateMode: The auto-update mode for the product. 3004 // 3005 // Possible values: 3006 // "autoUpdateModeUnspecified" - Unspecified. Defaults to 3007 // AUTO_UPDATE_DEFAULT. 3008 // "autoUpdateDefault" - The app is automatically updated with low 3009 // priority to minimize the impact on the user. The app is updated when 3010 // the following constraints are met: * The device is not actively used 3011 // * The device is connected to a Wi-Fi network. * The device is 3012 // charging * If the system update policy is set to `WINDOWED`: the 3013 // local time of the device is within the daily maintenance window The 3014 // device is notified about a new update within 24 hours after it is 3015 // published by the developer, after which the app is updated the next 3016 // 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 values are omitted from API requests. However, any non-pointer, 3053 // non-interface field appearing in ForceSendFields will be sent to the 3054 // server regardless of whether the field is empty or not. This may be 3055 // 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 values are omitted from API requests. However, any non-pointer, 3120 // non-interface field appearing in ForceSendFields will be sent to the 3121 // server regardless of whether the field is empty or not. This may be 3122 // 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 values are omitted from API requests. However, any non-pointer, 3153 // non-interface field appearing in ForceSendFields will be sent to the 3154 // server regardless of whether the field is empty or not. This may be 3155 // 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 values are omitted from API requests. However, any non-pointer, 3196 // non-interface field appearing in ForceSendFields will be sent to the 3197 // server regardless of whether the field is empty or not. This may be 3198 // 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 values are omitted from API requests. However, any non-pointer, 3244 // non-interface field appearing in ForceSendFields will be sent to the 3245 // server regardless of whether the field is empty or not. This may be 3246 // 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 values are omitted from API requests. However, any non-pointer, 3284 // non-interface field appearing in ForceSendFields will be sent to the 3285 // server regardless of whether the field is empty or not. This may be 3286 // 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 values are omitted from API requests. However, any non-pointer, 3322 // non-interface field appearing in ForceSendFields will be sent to the 3323 // server regardless of whether the field is empty or not. This may be 3324 // 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 values are omitted from API requests. However, any non-pointer, 3360 // non-interface field appearing in ForceSendFields will be sent to the 3361 // server regardless of whether the field is empty or not. This may be 3362 // 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 values are omitted from API requests. However, any non-pointer, 3416 // non-interface field appearing in ForceSendFields will be sent to the 3417 // server regardless of whether the field is empty or not. This may be 3418 // 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 values are omitted from API requests. However, any non-pointer, 3447 // non-interface field appearing in ForceSendFields will be sent to the 3448 // server regardless of whether the field is empty or not. This may be 3449 // 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 values are omitted from API requests. However, any non-pointer, 3490 // non-interface field appearing in ForceSendFields will be sent to the 3491 // server regardless of whether the field is empty or not. This may be 3492 // 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 values are omitted from API requests. However, any non-pointer, 3544 // non-interface field appearing in ForceSendFields will be sent to the 3545 // server regardless of whether the field is empty or not. This may be 3546 // 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 values are omitted from API requests. However, any non-pointer, 3592 // non-interface field appearing in ForceSendFields will be sent to the 3593 // server regardless of whether the field is empty or not. This may be 3594 // 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 values are omitted from API requests. However, any non-pointer, 3623 // non-interface field appearing in ForceSendFields will be sent to the 3624 // server regardless of whether the field is empty or not. This may be 3625 // 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 values are omitted from API requests. However, any non-pointer, 3654 // non-interface field appearing in ForceSendFields will be sent to the 3655 // server regardless of whether the field is empty or not. This may be 3656 // 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 values are omitted from API requests. However, any non-pointer, 3702 // non-interface field appearing in ForceSendFields will be sent to the 3703 // server regardless of whether the field is empty or not. This may be 3704 // 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 values are omitted from API requests. However, any non-pointer, 3742 // non-interface field appearing in ForceSendFields will be sent to the 3743 // server regardless of whether the field is empty or not. This may be 3744 // 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 values are omitted from API requests. However, any non-pointer, 3776 // non-interface field appearing in ForceSendFields will be sent to the 3777 // server regardless of whether the field is empty or not. This may be 3778 // 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 values are omitted from API requests. However, any non-pointer, 3856 // non-interface field appearing in ForceSendFields will be sent to the 3857 // server regardless of whether the field is empty or not. This may be 3858 // 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 values are omitted from API requests. However, any non-pointer, 3888 // non-interface field appearing in ForceSendFields will be sent to the 3889 // server regardless of whether the field is empty or not. This may be 3890 // 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 values are omitted from API requests. However, any non-pointer, 3923 // non-interface field appearing in ForceSendFields will be sent to the 3924 // server regardless of whether the field is empty or not. This may be 3925 // 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 values are omitted from API requests. However, any non-pointer, 4005 // non-interface field appearing in ForceSendFields will be sent to the 4006 // server regardless of whether the field is empty or not. This may be 4007 // 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 values are omitted from API requests. However, any non-pointer, 4037 // non-interface field appearing in ForceSendFields will be sent to the 4038 // server regardless of whether the field is empty or not. This may be 4039 // 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 values are omitted from API requests. However, any non-pointer, 4068 // non-interface field appearing in ForceSendFields will be sent to the 4069 // server regardless of whether the field is empty or not. This may be 4070 // 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/20210502") 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/20210502") 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/20210502") 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/20210502") 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/20210502") 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. 4898// 4899// - deviceId: The ID of the device. 4900// - enterpriseId: The ID of the enterprise. 4901// - userId: The ID of the user. 4902func (r *DevicesService) Update(enterpriseId string, userId string, deviceId string, device *Device) *DevicesUpdateCall { 4903 c := &DevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4904 c.enterpriseId = enterpriseId 4905 c.userId = userId 4906 c.deviceId = deviceId 4907 c.device = device 4908 return c 4909} 4910 4911// UpdateMask sets the optional parameter "updateMask": Mask that 4912// identifies which fields to update. If not set, all modifiable fields 4913// will be modified. When set in a query parameter, this field should be 4914// specified as updateMask=<field1>,<field2>,... 4915func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall { 4916 c.urlParams_.Set("updateMask", updateMask) 4917 return c 4918} 4919 4920// Fields allows partial responses to be retrieved. See 4921// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4922// for more information. 4923func (c *DevicesUpdateCall) Fields(s ...googleapi.Field) *DevicesUpdateCall { 4924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4925 return c 4926} 4927 4928// Context sets the context to be used in this call's Do method. Any 4929// pending HTTP request will be aborted if the provided context is 4930// canceled. 4931func (c *DevicesUpdateCall) Context(ctx context.Context) *DevicesUpdateCall { 4932 c.ctx_ = ctx 4933 return c 4934} 4935 4936// Header returns an http.Header that can be modified by the caller to 4937// add HTTP headers to the request. 4938func (c *DevicesUpdateCall) Header() http.Header { 4939 if c.header_ == nil { 4940 c.header_ = make(http.Header) 4941 } 4942 return c.header_ 4943} 4944 4945func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) { 4946 reqHeaders := make(http.Header) 4947 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 4948 for k, v := range c.header_ { 4949 reqHeaders[k] = v 4950 } 4951 reqHeaders.Set("User-Agent", c.s.userAgent()) 4952 var body io.Reader = nil 4953 body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) 4954 if err != nil { 4955 return nil, err 4956 } 4957 reqHeaders.Set("Content-Type", "application/json") 4958 c.urlParams_.Set("alt", alt) 4959 c.urlParams_.Set("prettyPrint", "false") 4960 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") 4961 urls += "?" + c.urlParams_.Encode() 4962 req, err := http.NewRequest("PUT", urls, body) 4963 if err != nil { 4964 return nil, err 4965 } 4966 req.Header = reqHeaders 4967 googleapi.Expand(req.URL, map[string]string{ 4968 "enterpriseId": c.enterpriseId, 4969 "userId": c.userId, 4970 "deviceId": c.deviceId, 4971 }) 4972 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4973} 4974 4975// Do executes the "androidenterprise.devices.update" call. 4976// Exactly one of *Device or error will be non-nil. Any non-2xx status 4977// code is an error. Response headers are in either 4978// *Device.ServerResponse.Header or (if a response was returned at all) 4979// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4980// check whether the returned error was because http.StatusNotModified 4981// was returned. 4982func (c *DevicesUpdateCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4983 gensupport.SetOptions(c.urlParams_, opts...) 4984 res, err := c.doRequest("json") 4985 if res != nil && res.StatusCode == http.StatusNotModified { 4986 if res.Body != nil { 4987 res.Body.Close() 4988 } 4989 return nil, &googleapi.Error{ 4990 Code: res.StatusCode, 4991 Header: res.Header, 4992 } 4993 } 4994 if err != nil { 4995 return nil, err 4996 } 4997 defer googleapi.CloseBody(res) 4998 if err := googleapi.CheckResponse(res); err != nil { 4999 return nil, err 5000 } 5001 ret := &Device{ 5002 ServerResponse: googleapi.ServerResponse{ 5003 Header: res.Header, 5004 HTTPStatusCode: res.StatusCode, 5005 }, 5006 } 5007 target := &ret 5008 if err := gensupport.DecodeResponse(target, res); err != nil { 5009 return nil, err 5010 } 5011 return ret, nil 5012 // { 5013 // "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.", 5014 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 5015 // "httpMethod": "PUT", 5016 // "id": "androidenterprise.devices.update", 5017 // "parameterOrder": [ 5018 // "enterpriseId", 5019 // "userId", 5020 // "deviceId" 5021 // ], 5022 // "parameters": { 5023 // "deviceId": { 5024 // "description": "The ID of the device.", 5025 // "location": "path", 5026 // "required": true, 5027 // "type": "string" 5028 // }, 5029 // "enterpriseId": { 5030 // "description": "The ID of the enterprise.", 5031 // "location": "path", 5032 // "required": true, 5033 // "type": "string" 5034 // }, 5035 // "updateMask": { 5036 // "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,...", 5037 // "location": "query", 5038 // "type": "string" 5039 // }, 5040 // "userId": { 5041 // "description": "The ID of the user.", 5042 // "location": "path", 5043 // "required": true, 5044 // "type": "string" 5045 // } 5046 // }, 5047 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 5048 // "request": { 5049 // "$ref": "Device" 5050 // }, 5051 // "response": { 5052 // "$ref": "Device" 5053 // }, 5054 // "scopes": [ 5055 // "https://www.googleapis.com/auth/androidenterprise" 5056 // ] 5057 // } 5058 5059} 5060 5061// method id "androidenterprise.enterprises.acknowledgeNotificationSet": 5062 5063type EnterprisesAcknowledgeNotificationSetCall struct { 5064 s *Service 5065 urlParams_ gensupport.URLParams 5066 ctx_ context.Context 5067 header_ http.Header 5068} 5069 5070// AcknowledgeNotificationSet: Acknowledges notifications that were 5071// received from Enterprises.PullNotificationSet to prevent subsequent 5072// calls from returning the same notifications. 5073func (r *EnterprisesService) AcknowledgeNotificationSet() *EnterprisesAcknowledgeNotificationSetCall { 5074 c := &EnterprisesAcknowledgeNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5075 return c 5076} 5077 5078// NotificationSetId sets the optional parameter "notificationSetId": 5079// The notification set ID as returned by 5080// Enterprises.PullNotificationSet. This must be provided. 5081func (c *EnterprisesAcknowledgeNotificationSetCall) NotificationSetId(notificationSetId string) *EnterprisesAcknowledgeNotificationSetCall { 5082 c.urlParams_.Set("notificationSetId", notificationSetId) 5083 return c 5084} 5085 5086// Fields allows partial responses to be retrieved. See 5087// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5088// for more information. 5089func (c *EnterprisesAcknowledgeNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesAcknowledgeNotificationSetCall { 5090 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5091 return c 5092} 5093 5094// Context sets the context to be used in this call's Do method. Any 5095// pending HTTP request will be aborted if the provided context is 5096// canceled. 5097func (c *EnterprisesAcknowledgeNotificationSetCall) Context(ctx context.Context) *EnterprisesAcknowledgeNotificationSetCall { 5098 c.ctx_ = ctx 5099 return c 5100} 5101 5102// Header returns an http.Header that can be modified by the caller to 5103// add HTTP headers to the request. 5104func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header { 5105 if c.header_ == nil { 5106 c.header_ = make(http.Header) 5107 } 5108 return c.header_ 5109} 5110 5111func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) { 5112 reqHeaders := make(http.Header) 5113 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5114 for k, v := range c.header_ { 5115 reqHeaders[k] = v 5116 } 5117 reqHeaders.Set("User-Agent", c.s.userAgent()) 5118 var body io.Reader = nil 5119 c.urlParams_.Set("alt", alt) 5120 c.urlParams_.Set("prettyPrint", "false") 5121 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/acknowledgeNotificationSet") 5122 urls += "?" + c.urlParams_.Encode() 5123 req, err := http.NewRequest("POST", urls, body) 5124 if err != nil { 5125 return nil, err 5126 } 5127 req.Header = reqHeaders 5128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5129} 5130 5131// Do executes the "androidenterprise.enterprises.acknowledgeNotificationSet" call. 5132func (c *EnterprisesAcknowledgeNotificationSetCall) Do(opts ...googleapi.CallOption) error { 5133 gensupport.SetOptions(c.urlParams_, opts...) 5134 res, err := c.doRequest("json") 5135 if err != nil { 5136 return err 5137 } 5138 defer googleapi.CloseBody(res) 5139 if err := googleapi.CheckResponse(res); err != nil { 5140 return err 5141 } 5142 return nil 5143 // { 5144 // "description": "Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.", 5145 // "flatPath": "androidenterprise/v1/enterprises/acknowledgeNotificationSet", 5146 // "httpMethod": "POST", 5147 // "id": "androidenterprise.enterprises.acknowledgeNotificationSet", 5148 // "parameterOrder": [], 5149 // "parameters": { 5150 // "notificationSetId": { 5151 // "description": "The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided.", 5152 // "location": "query", 5153 // "type": "string" 5154 // } 5155 // }, 5156 // "path": "androidenterprise/v1/enterprises/acknowledgeNotificationSet", 5157 // "scopes": [ 5158 // "https://www.googleapis.com/auth/androidenterprise" 5159 // ] 5160 // } 5161 5162} 5163 5164// method id "androidenterprise.enterprises.completeSignup": 5165 5166type EnterprisesCompleteSignupCall struct { 5167 s *Service 5168 urlParams_ gensupport.URLParams 5169 ctx_ context.Context 5170 header_ http.Header 5171} 5172 5173// CompleteSignup: Completes the signup flow, by specifying the 5174// Completion token and Enterprise token. This request must not be 5175// called multiple times for a given Enterprise Token. 5176func (r *EnterprisesService) CompleteSignup() *EnterprisesCompleteSignupCall { 5177 c := &EnterprisesCompleteSignupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5178 return c 5179} 5180 5181// CompletionToken sets the optional parameter "completionToken": The 5182// Completion token initially returned by GenerateSignupUrl. 5183func (c *EnterprisesCompleteSignupCall) CompletionToken(completionToken string) *EnterprisesCompleteSignupCall { 5184 c.urlParams_.Set("completionToken", completionToken) 5185 return c 5186} 5187 5188// EnterpriseToken sets the optional parameter "enterpriseToken": The 5189// Enterprise token appended to the Callback URL. 5190func (c *EnterprisesCompleteSignupCall) EnterpriseToken(enterpriseToken string) *EnterprisesCompleteSignupCall { 5191 c.urlParams_.Set("enterpriseToken", enterpriseToken) 5192 return c 5193} 5194 5195// Fields allows partial responses to be retrieved. See 5196// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5197// for more information. 5198func (c *EnterprisesCompleteSignupCall) Fields(s ...googleapi.Field) *EnterprisesCompleteSignupCall { 5199 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5200 return c 5201} 5202 5203// Context sets the context to be used in this call's Do method. Any 5204// pending HTTP request will be aborted if the provided context is 5205// canceled. 5206func (c *EnterprisesCompleteSignupCall) Context(ctx context.Context) *EnterprisesCompleteSignupCall { 5207 c.ctx_ = ctx 5208 return c 5209} 5210 5211// Header returns an http.Header that can be modified by the caller to 5212// add HTTP headers to the request. 5213func (c *EnterprisesCompleteSignupCall) Header() http.Header { 5214 if c.header_ == nil { 5215 c.header_ = make(http.Header) 5216 } 5217 return c.header_ 5218} 5219 5220func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) { 5221 reqHeaders := make(http.Header) 5222 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5223 for k, v := range c.header_ { 5224 reqHeaders[k] = v 5225 } 5226 reqHeaders.Set("User-Agent", c.s.userAgent()) 5227 var body io.Reader = nil 5228 c.urlParams_.Set("alt", alt) 5229 c.urlParams_.Set("prettyPrint", "false") 5230 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/completeSignup") 5231 urls += "?" + c.urlParams_.Encode() 5232 req, err := http.NewRequest("POST", urls, body) 5233 if err != nil { 5234 return nil, err 5235 } 5236 req.Header = reqHeaders 5237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5238} 5239 5240// Do executes the "androidenterprise.enterprises.completeSignup" call. 5241// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5242// status code is an error. Response headers are in either 5243// *Enterprise.ServerResponse.Header or (if a response was returned at 5244// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5245// to check whether the returned error was because 5246// http.StatusNotModified was returned. 5247func (c *EnterprisesCompleteSignupCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5248 gensupport.SetOptions(c.urlParams_, opts...) 5249 res, err := c.doRequest("json") 5250 if res != nil && res.StatusCode == http.StatusNotModified { 5251 if res.Body != nil { 5252 res.Body.Close() 5253 } 5254 return nil, &googleapi.Error{ 5255 Code: res.StatusCode, 5256 Header: res.Header, 5257 } 5258 } 5259 if err != nil { 5260 return nil, err 5261 } 5262 defer googleapi.CloseBody(res) 5263 if err := googleapi.CheckResponse(res); err != nil { 5264 return nil, err 5265 } 5266 ret := &Enterprise{ 5267 ServerResponse: googleapi.ServerResponse{ 5268 Header: res.Header, 5269 HTTPStatusCode: res.StatusCode, 5270 }, 5271 } 5272 target := &ret 5273 if err := gensupport.DecodeResponse(target, res); err != nil { 5274 return nil, err 5275 } 5276 return ret, nil 5277 // { 5278 // "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.", 5279 // "flatPath": "androidenterprise/v1/enterprises/completeSignup", 5280 // "httpMethod": "POST", 5281 // "id": "androidenterprise.enterprises.completeSignup", 5282 // "parameterOrder": [], 5283 // "parameters": { 5284 // "completionToken": { 5285 // "description": "The Completion token initially returned by GenerateSignupUrl.", 5286 // "location": "query", 5287 // "type": "string" 5288 // }, 5289 // "enterpriseToken": { 5290 // "description": "The Enterprise token appended to the Callback URL.", 5291 // "location": "query", 5292 // "type": "string" 5293 // } 5294 // }, 5295 // "path": "androidenterprise/v1/enterprises/completeSignup", 5296 // "response": { 5297 // "$ref": "Enterprise" 5298 // }, 5299 // "scopes": [ 5300 // "https://www.googleapis.com/auth/androidenterprise" 5301 // ] 5302 // } 5303 5304} 5305 5306// method id "androidenterprise.enterprises.createWebToken": 5307 5308type EnterprisesCreateWebTokenCall struct { 5309 s *Service 5310 enterpriseId string 5311 administratorwebtokenspec *AdministratorWebTokenSpec 5312 urlParams_ gensupport.URLParams 5313 ctx_ context.Context 5314 header_ http.Header 5315} 5316 5317// CreateWebToken: Returns a unique token to access an embeddable UI. To 5318// generate a web UI, pass the generated token into the managed Google 5319// Play javascript API. Each token may only be used to start one UI 5320// session. See the javascript API documentation for further 5321// information. 5322// 5323// - enterpriseId: The ID of the enterprise. 5324func (r *EnterprisesService) CreateWebToken(enterpriseId string, administratorwebtokenspec *AdministratorWebTokenSpec) *EnterprisesCreateWebTokenCall { 5325 c := &EnterprisesCreateWebTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5326 c.enterpriseId = enterpriseId 5327 c.administratorwebtokenspec = administratorwebtokenspec 5328 return c 5329} 5330 5331// Fields allows partial responses to be retrieved. See 5332// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5333// for more information. 5334func (c *EnterprisesCreateWebTokenCall) Fields(s ...googleapi.Field) *EnterprisesCreateWebTokenCall { 5335 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5336 return c 5337} 5338 5339// Context sets the context to be used in this call's Do method. Any 5340// pending HTTP request will be aborted if the provided context is 5341// canceled. 5342func (c *EnterprisesCreateWebTokenCall) Context(ctx context.Context) *EnterprisesCreateWebTokenCall { 5343 c.ctx_ = ctx 5344 return c 5345} 5346 5347// Header returns an http.Header that can be modified by the caller to 5348// add HTTP headers to the request. 5349func (c *EnterprisesCreateWebTokenCall) Header() http.Header { 5350 if c.header_ == nil { 5351 c.header_ = make(http.Header) 5352 } 5353 return c.header_ 5354} 5355 5356func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) { 5357 reqHeaders := make(http.Header) 5358 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5359 for k, v := range c.header_ { 5360 reqHeaders[k] = v 5361 } 5362 reqHeaders.Set("User-Agent", c.s.userAgent()) 5363 var body io.Reader = nil 5364 body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec) 5365 if err != nil { 5366 return nil, err 5367 } 5368 reqHeaders.Set("Content-Type", "application/json") 5369 c.urlParams_.Set("alt", alt) 5370 c.urlParams_.Set("prettyPrint", "false") 5371 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken") 5372 urls += "?" + c.urlParams_.Encode() 5373 req, err := http.NewRequest("POST", urls, body) 5374 if err != nil { 5375 return nil, err 5376 } 5377 req.Header = reqHeaders 5378 googleapi.Expand(req.URL, map[string]string{ 5379 "enterpriseId": c.enterpriseId, 5380 }) 5381 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5382} 5383 5384// Do executes the "androidenterprise.enterprises.createWebToken" call. 5385// Exactly one of *AdministratorWebToken or error will be non-nil. Any 5386// non-2xx status code is an error. Response headers are in either 5387// *AdministratorWebToken.ServerResponse.Header or (if a response was 5388// returned at all) in error.(*googleapi.Error).Header. Use 5389// googleapi.IsNotModified to check whether the returned error was 5390// because http.StatusNotModified was returned. 5391func (c *EnterprisesCreateWebTokenCall) Do(opts ...googleapi.CallOption) (*AdministratorWebToken, error) { 5392 gensupport.SetOptions(c.urlParams_, opts...) 5393 res, err := c.doRequest("json") 5394 if res != nil && res.StatusCode == http.StatusNotModified { 5395 if res.Body != nil { 5396 res.Body.Close() 5397 } 5398 return nil, &googleapi.Error{ 5399 Code: res.StatusCode, 5400 Header: res.Header, 5401 } 5402 } 5403 if err != nil { 5404 return nil, err 5405 } 5406 defer googleapi.CloseBody(res) 5407 if err := googleapi.CheckResponse(res); err != nil { 5408 return nil, err 5409 } 5410 ret := &AdministratorWebToken{ 5411 ServerResponse: googleapi.ServerResponse{ 5412 Header: res.Header, 5413 HTTPStatusCode: res.StatusCode, 5414 }, 5415 } 5416 target := &ret 5417 if err := gensupport.DecodeResponse(target, res); err != nil { 5418 return nil, err 5419 } 5420 return ret, nil 5421 // { 5422 // "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.", 5423 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken", 5424 // "httpMethod": "POST", 5425 // "id": "androidenterprise.enterprises.createWebToken", 5426 // "parameterOrder": [ 5427 // "enterpriseId" 5428 // ], 5429 // "parameters": { 5430 // "enterpriseId": { 5431 // "description": "The ID of the enterprise.", 5432 // "location": "path", 5433 // "required": true, 5434 // "type": "string" 5435 // } 5436 // }, 5437 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/createWebToken", 5438 // "request": { 5439 // "$ref": "AdministratorWebTokenSpec" 5440 // }, 5441 // "response": { 5442 // "$ref": "AdministratorWebToken" 5443 // }, 5444 // "scopes": [ 5445 // "https://www.googleapis.com/auth/androidenterprise" 5446 // ] 5447 // } 5448 5449} 5450 5451// method id "androidenterprise.enterprises.enroll": 5452 5453type EnterprisesEnrollCall struct { 5454 s *Service 5455 enterprise *Enterprise 5456 urlParams_ gensupport.URLParams 5457 ctx_ context.Context 5458 header_ http.Header 5459} 5460 5461// Enroll: Enrolls an enterprise with the calling EMM. 5462// 5463// - token: The token provided by the enterprise to register the EMM. 5464func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall { 5465 c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5466 c.urlParams_.Set("token", token) 5467 c.enterprise = enterprise 5468 return c 5469} 5470 5471// Fields allows partial responses to be retrieved. See 5472// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5473// for more information. 5474func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall { 5475 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5476 return c 5477} 5478 5479// Context sets the context to be used in this call's Do method. Any 5480// pending HTTP request will be aborted if the provided context is 5481// canceled. 5482func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall { 5483 c.ctx_ = ctx 5484 return c 5485} 5486 5487// Header returns an http.Header that can be modified by the caller to 5488// add HTTP headers to the request. 5489func (c *EnterprisesEnrollCall) Header() http.Header { 5490 if c.header_ == nil { 5491 c.header_ = make(http.Header) 5492 } 5493 return c.header_ 5494} 5495 5496func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) { 5497 reqHeaders := make(http.Header) 5498 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5499 for k, v := range c.header_ { 5500 reqHeaders[k] = v 5501 } 5502 reqHeaders.Set("User-Agent", c.s.userAgent()) 5503 var body io.Reader = nil 5504 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) 5505 if err != nil { 5506 return nil, err 5507 } 5508 reqHeaders.Set("Content-Type", "application/json") 5509 c.urlParams_.Set("alt", alt) 5510 c.urlParams_.Set("prettyPrint", "false") 5511 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/enroll") 5512 urls += "?" + c.urlParams_.Encode() 5513 req, err := http.NewRequest("POST", urls, body) 5514 if err != nil { 5515 return nil, err 5516 } 5517 req.Header = reqHeaders 5518 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5519} 5520 5521// Do executes the "androidenterprise.enterprises.enroll" call. 5522// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5523// status code is an error. Response headers are in either 5524// *Enterprise.ServerResponse.Header or (if a response was returned at 5525// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5526// to check whether the returned error was because 5527// http.StatusNotModified was returned. 5528func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5529 gensupport.SetOptions(c.urlParams_, opts...) 5530 res, err := c.doRequest("json") 5531 if res != nil && res.StatusCode == http.StatusNotModified { 5532 if res.Body != nil { 5533 res.Body.Close() 5534 } 5535 return nil, &googleapi.Error{ 5536 Code: res.StatusCode, 5537 Header: res.Header, 5538 } 5539 } 5540 if err != nil { 5541 return nil, err 5542 } 5543 defer googleapi.CloseBody(res) 5544 if err := googleapi.CheckResponse(res); err != nil { 5545 return nil, err 5546 } 5547 ret := &Enterprise{ 5548 ServerResponse: googleapi.ServerResponse{ 5549 Header: res.Header, 5550 HTTPStatusCode: res.StatusCode, 5551 }, 5552 } 5553 target := &ret 5554 if err := gensupport.DecodeResponse(target, res); err != nil { 5555 return nil, err 5556 } 5557 return ret, nil 5558 // { 5559 // "description": "Enrolls an enterprise with the calling EMM.", 5560 // "flatPath": "androidenterprise/v1/enterprises/enroll", 5561 // "httpMethod": "POST", 5562 // "id": "androidenterprise.enterprises.enroll", 5563 // "parameterOrder": [ 5564 // "token" 5565 // ], 5566 // "parameters": { 5567 // "token": { 5568 // "description": "Required. The token provided by the enterprise to register the EMM.", 5569 // "location": "query", 5570 // "required": true, 5571 // "type": "string" 5572 // } 5573 // }, 5574 // "path": "androidenterprise/v1/enterprises/enroll", 5575 // "request": { 5576 // "$ref": "Enterprise" 5577 // }, 5578 // "response": { 5579 // "$ref": "Enterprise" 5580 // }, 5581 // "scopes": [ 5582 // "https://www.googleapis.com/auth/androidenterprise" 5583 // ] 5584 // } 5585 5586} 5587 5588// method id "androidenterprise.enterprises.generateSignupUrl": 5589 5590type EnterprisesGenerateSignupUrlCall struct { 5591 s *Service 5592 urlParams_ gensupport.URLParams 5593 ctx_ context.Context 5594 header_ http.Header 5595} 5596 5597// GenerateSignupUrl: Generates a sign-up URL. 5598func (r *EnterprisesService) GenerateSignupUrl() *EnterprisesGenerateSignupUrlCall { 5599 c := &EnterprisesGenerateSignupUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5600 return c 5601} 5602 5603// CallbackUrl sets the optional parameter "callbackUrl": The callback 5604// URL to which the Admin will be redirected after successfully creating 5605// an enterprise. Before redirecting there the system will add a single 5606// query parameter to this URL named "enterpriseToken" which will 5607// contain an opaque token to be used for the CompleteSignup request. 5608// Beware that this means that the URL will be parsed, the parameter 5609// added and then a new URL formatted, i.e. there may be some minor 5610// formatting changes and, more importantly, the URL must be well-formed 5611// so that it can be parsed. 5612func (c *EnterprisesGenerateSignupUrlCall) CallbackUrl(callbackUrl string) *EnterprisesGenerateSignupUrlCall { 5613 c.urlParams_.Set("callbackUrl", callbackUrl) 5614 return c 5615} 5616 5617// Fields allows partial responses to be retrieved. See 5618// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5619// for more information. 5620func (c *EnterprisesGenerateSignupUrlCall) Fields(s ...googleapi.Field) *EnterprisesGenerateSignupUrlCall { 5621 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5622 return c 5623} 5624 5625// Context sets the context to be used in this call's Do method. Any 5626// pending HTTP request will be aborted if the provided context is 5627// canceled. 5628func (c *EnterprisesGenerateSignupUrlCall) Context(ctx context.Context) *EnterprisesGenerateSignupUrlCall { 5629 c.ctx_ = ctx 5630 return c 5631} 5632 5633// Header returns an http.Header that can be modified by the caller to 5634// add HTTP headers to the request. 5635func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header { 5636 if c.header_ == nil { 5637 c.header_ = make(http.Header) 5638 } 5639 return c.header_ 5640} 5641 5642func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) { 5643 reqHeaders := make(http.Header) 5644 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5645 for k, v := range c.header_ { 5646 reqHeaders[k] = v 5647 } 5648 reqHeaders.Set("User-Agent", c.s.userAgent()) 5649 var body io.Reader = nil 5650 c.urlParams_.Set("alt", alt) 5651 c.urlParams_.Set("prettyPrint", "false") 5652 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/signupUrl") 5653 urls += "?" + c.urlParams_.Encode() 5654 req, err := http.NewRequest("POST", urls, body) 5655 if err != nil { 5656 return nil, err 5657 } 5658 req.Header = reqHeaders 5659 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5660} 5661 5662// Do executes the "androidenterprise.enterprises.generateSignupUrl" call. 5663// Exactly one of *SignupInfo or error will be non-nil. Any non-2xx 5664// status code is an error. Response headers are in either 5665// *SignupInfo.ServerResponse.Header or (if a response was returned at 5666// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5667// to check whether the returned error was because 5668// http.StatusNotModified was returned. 5669func (c *EnterprisesGenerateSignupUrlCall) Do(opts ...googleapi.CallOption) (*SignupInfo, error) { 5670 gensupport.SetOptions(c.urlParams_, opts...) 5671 res, err := c.doRequest("json") 5672 if res != nil && res.StatusCode == http.StatusNotModified { 5673 if res.Body != nil { 5674 res.Body.Close() 5675 } 5676 return nil, &googleapi.Error{ 5677 Code: res.StatusCode, 5678 Header: res.Header, 5679 } 5680 } 5681 if err != nil { 5682 return nil, err 5683 } 5684 defer googleapi.CloseBody(res) 5685 if err := googleapi.CheckResponse(res); err != nil { 5686 return nil, err 5687 } 5688 ret := &SignupInfo{ 5689 ServerResponse: googleapi.ServerResponse{ 5690 Header: res.Header, 5691 HTTPStatusCode: res.StatusCode, 5692 }, 5693 } 5694 target := &ret 5695 if err := gensupport.DecodeResponse(target, res); err != nil { 5696 return nil, err 5697 } 5698 return ret, nil 5699 // { 5700 // "description": "Generates a sign-up URL.", 5701 // "flatPath": "androidenterprise/v1/enterprises/signupUrl", 5702 // "httpMethod": "POST", 5703 // "id": "androidenterprise.enterprises.generateSignupUrl", 5704 // "parameterOrder": [], 5705 // "parameters": { 5706 // "callbackUrl": { 5707 // "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.", 5708 // "location": "query", 5709 // "type": "string" 5710 // } 5711 // }, 5712 // "path": "androidenterprise/v1/enterprises/signupUrl", 5713 // "response": { 5714 // "$ref": "SignupInfo" 5715 // }, 5716 // "scopes": [ 5717 // "https://www.googleapis.com/auth/androidenterprise" 5718 // ] 5719 // } 5720 5721} 5722 5723// method id "androidenterprise.enterprises.get": 5724 5725type EnterprisesGetCall struct { 5726 s *Service 5727 enterpriseId string 5728 urlParams_ gensupport.URLParams 5729 ifNoneMatch_ string 5730 ctx_ context.Context 5731 header_ http.Header 5732} 5733 5734// Get: Retrieves the name and domain of an enterprise. 5735// 5736// - enterpriseId: The ID of the enterprise. 5737func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall { 5738 c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5739 c.enterpriseId = enterpriseId 5740 return c 5741} 5742 5743// Fields allows partial responses to be retrieved. See 5744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5745// for more information. 5746func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall { 5747 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5748 return c 5749} 5750 5751// IfNoneMatch sets the optional parameter which makes the operation 5752// fail if the object's ETag matches the given value. This is useful for 5753// getting updates only after the object has changed since the last 5754// request. Use googleapi.IsNotModified to check whether the response 5755// error from Do is the result of In-None-Match. 5756func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall { 5757 c.ifNoneMatch_ = entityTag 5758 return c 5759} 5760 5761// Context sets the context to be used in this call's Do method. Any 5762// pending HTTP request will be aborted if the provided context is 5763// canceled. 5764func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall { 5765 c.ctx_ = ctx 5766 return c 5767} 5768 5769// Header returns an http.Header that can be modified by the caller to 5770// add HTTP headers to the request. 5771func (c *EnterprisesGetCall) Header() http.Header { 5772 if c.header_ == nil { 5773 c.header_ = make(http.Header) 5774 } 5775 return c.header_ 5776} 5777 5778func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { 5779 reqHeaders := make(http.Header) 5780 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5781 for k, v := range c.header_ { 5782 reqHeaders[k] = v 5783 } 5784 reqHeaders.Set("User-Agent", c.s.userAgent()) 5785 if c.ifNoneMatch_ != "" { 5786 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5787 } 5788 var body io.Reader = nil 5789 c.urlParams_.Set("alt", alt) 5790 c.urlParams_.Set("prettyPrint", "false") 5791 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}") 5792 urls += "?" + c.urlParams_.Encode() 5793 req, err := http.NewRequest("GET", urls, body) 5794 if err != nil { 5795 return nil, err 5796 } 5797 req.Header = reqHeaders 5798 googleapi.Expand(req.URL, map[string]string{ 5799 "enterpriseId": c.enterpriseId, 5800 }) 5801 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5802} 5803 5804// Do executes the "androidenterprise.enterprises.get" call. 5805// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5806// status code is an error. Response headers are in either 5807// *Enterprise.ServerResponse.Header or (if a response was returned at 5808// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5809// to check whether the returned error was because 5810// http.StatusNotModified was returned. 5811func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5812 gensupport.SetOptions(c.urlParams_, opts...) 5813 res, err := c.doRequest("json") 5814 if res != nil && res.StatusCode == http.StatusNotModified { 5815 if res.Body != nil { 5816 res.Body.Close() 5817 } 5818 return nil, &googleapi.Error{ 5819 Code: res.StatusCode, 5820 Header: res.Header, 5821 } 5822 } 5823 if err != nil { 5824 return nil, err 5825 } 5826 defer googleapi.CloseBody(res) 5827 if err := googleapi.CheckResponse(res); err != nil { 5828 return nil, err 5829 } 5830 ret := &Enterprise{ 5831 ServerResponse: googleapi.ServerResponse{ 5832 Header: res.Header, 5833 HTTPStatusCode: res.StatusCode, 5834 }, 5835 } 5836 target := &ret 5837 if err := gensupport.DecodeResponse(target, res); err != nil { 5838 return nil, err 5839 } 5840 return ret, nil 5841 // { 5842 // "description": "Retrieves the name and domain of an enterprise.", 5843 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}", 5844 // "httpMethod": "GET", 5845 // "id": "androidenterprise.enterprises.get", 5846 // "parameterOrder": [ 5847 // "enterpriseId" 5848 // ], 5849 // "parameters": { 5850 // "enterpriseId": { 5851 // "description": "The ID of the enterprise.", 5852 // "location": "path", 5853 // "required": true, 5854 // "type": "string" 5855 // } 5856 // }, 5857 // "path": "androidenterprise/v1/enterprises/{enterpriseId}", 5858 // "response": { 5859 // "$ref": "Enterprise" 5860 // }, 5861 // "scopes": [ 5862 // "https://www.googleapis.com/auth/androidenterprise" 5863 // ] 5864 // } 5865 5866} 5867 5868// method id "androidenterprise.enterprises.getServiceAccount": 5869 5870type EnterprisesGetServiceAccountCall struct { 5871 s *Service 5872 enterpriseId string 5873 urlParams_ gensupport.URLParams 5874 ifNoneMatch_ string 5875 ctx_ context.Context 5876 header_ http.Header 5877} 5878 5879// GetServiceAccount: Returns a service account and credentials. The 5880// service account can be bound to the enterprise by calling setAccount. 5881// The service account is unique to this enterprise and EMM, and will be 5882// deleted if the enterprise is unbound. The credentials contain private 5883// key data and are not stored server-side. This method can only be 5884// called after calling Enterprises.Enroll or 5885// Enterprises.CompleteSignup, and before Enterprises.SetAccount; at 5886// other times it will return an error. Subsequent calls after the first 5887// will generate a new, unique set of credentials, and invalidate the 5888// previously generated credentials. Once the service account is bound 5889// to the enterprise, it can be managed using the serviceAccountKeys 5890// resource. 5891// 5892// - enterpriseId: The ID of the enterprise. 5893func (r *EnterprisesService) GetServiceAccount(enterpriseId string) *EnterprisesGetServiceAccountCall { 5894 c := &EnterprisesGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5895 c.enterpriseId = enterpriseId 5896 return c 5897} 5898 5899// KeyType sets the optional parameter "keyType": The type of credential 5900// to return with the service account. Required. 5901// 5902// Possible values: 5903// "googleCredentials" - Google Credentials File format. 5904// "pkcs12" - PKCS12 format. The password for the PKCS12 file is 5905// 'notasecret'. For more information, see 5906// https://tools.ietf.org/html/rfc7292. The data for keys of this type 5907// are base64 encoded according to RFC 4648 Section 4. See 5908// http://tools.ietf.org/html/rfc4648#section-4. 5909func (c *EnterprisesGetServiceAccountCall) KeyType(keyType string) *EnterprisesGetServiceAccountCall { 5910 c.urlParams_.Set("keyType", keyType) 5911 return c 5912} 5913 5914// Fields allows partial responses to be retrieved. See 5915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5916// for more information. 5917func (c *EnterprisesGetServiceAccountCall) Fields(s ...googleapi.Field) *EnterprisesGetServiceAccountCall { 5918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5919 return c 5920} 5921 5922// IfNoneMatch sets the optional parameter which makes the operation 5923// fail if the object's ETag matches the given value. This is useful for 5924// getting updates only after the object has changed since the last 5925// request. Use googleapi.IsNotModified to check whether the response 5926// error from Do is the result of In-None-Match. 5927func (c *EnterprisesGetServiceAccountCall) IfNoneMatch(entityTag string) *EnterprisesGetServiceAccountCall { 5928 c.ifNoneMatch_ = entityTag 5929 return c 5930} 5931 5932// Context sets the context to be used in this call's Do method. Any 5933// pending HTTP request will be aborted if the provided context is 5934// canceled. 5935func (c *EnterprisesGetServiceAccountCall) Context(ctx context.Context) *EnterprisesGetServiceAccountCall { 5936 c.ctx_ = ctx 5937 return c 5938} 5939 5940// Header returns an http.Header that can be modified by the caller to 5941// add HTTP headers to the request. 5942func (c *EnterprisesGetServiceAccountCall) Header() http.Header { 5943 if c.header_ == nil { 5944 c.header_ = make(http.Header) 5945 } 5946 return c.header_ 5947} 5948 5949func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response, error) { 5950 reqHeaders := make(http.Header) 5951 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5952 for k, v := range c.header_ { 5953 reqHeaders[k] = v 5954 } 5955 reqHeaders.Set("User-Agent", c.s.userAgent()) 5956 if c.ifNoneMatch_ != "" { 5957 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5958 } 5959 var body io.Reader = nil 5960 c.urlParams_.Set("alt", alt) 5961 c.urlParams_.Set("prettyPrint", "false") 5962 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount") 5963 urls += "?" + c.urlParams_.Encode() 5964 req, err := http.NewRequest("GET", urls, body) 5965 if err != nil { 5966 return nil, err 5967 } 5968 req.Header = reqHeaders 5969 googleapi.Expand(req.URL, map[string]string{ 5970 "enterpriseId": c.enterpriseId, 5971 }) 5972 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5973} 5974 5975// Do executes the "androidenterprise.enterprises.getServiceAccount" call. 5976// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx 5977// status code is an error. Response headers are in either 5978// *ServiceAccount.ServerResponse.Header or (if a response was returned 5979// at all) in error.(*googleapi.Error).Header. Use 5980// googleapi.IsNotModified to check whether the returned error was 5981// because http.StatusNotModified was returned. 5982func (c *EnterprisesGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { 5983 gensupport.SetOptions(c.urlParams_, opts...) 5984 res, err := c.doRequest("json") 5985 if res != nil && res.StatusCode == http.StatusNotModified { 5986 if res.Body != nil { 5987 res.Body.Close() 5988 } 5989 return nil, &googleapi.Error{ 5990 Code: res.StatusCode, 5991 Header: res.Header, 5992 } 5993 } 5994 if err != nil { 5995 return nil, err 5996 } 5997 defer googleapi.CloseBody(res) 5998 if err := googleapi.CheckResponse(res); err != nil { 5999 return nil, err 6000 } 6001 ret := &ServiceAccount{ 6002 ServerResponse: googleapi.ServerResponse{ 6003 Header: res.Header, 6004 HTTPStatusCode: res.StatusCode, 6005 }, 6006 } 6007 target := &ret 6008 if err := gensupport.DecodeResponse(target, res); err != nil { 6009 return nil, err 6010 } 6011 return ret, nil 6012 // { 6013 // "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.", 6014 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount", 6015 // "httpMethod": "GET", 6016 // "id": "androidenterprise.enterprises.getServiceAccount", 6017 // "parameterOrder": [ 6018 // "enterpriseId" 6019 // ], 6020 // "parameters": { 6021 // "enterpriseId": { 6022 // "description": "The ID of the enterprise.", 6023 // "location": "path", 6024 // "required": true, 6025 // "type": "string" 6026 // }, 6027 // "keyType": { 6028 // "description": "The type of credential to return with the service account. Required.", 6029 // "enum": [ 6030 // "googleCredentials", 6031 // "pkcs12" 6032 // ], 6033 // "enumDescriptions": [ 6034 // "Google Credentials File format.", 6035 // "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." 6036 // ], 6037 // "location": "query", 6038 // "type": "string" 6039 // } 6040 // }, 6041 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount", 6042 // "response": { 6043 // "$ref": "ServiceAccount" 6044 // }, 6045 // "scopes": [ 6046 // "https://www.googleapis.com/auth/androidenterprise" 6047 // ] 6048 // } 6049 6050} 6051 6052// method id "androidenterprise.enterprises.getStoreLayout": 6053 6054type EnterprisesGetStoreLayoutCall struct { 6055 s *Service 6056 enterpriseId string 6057 urlParams_ gensupport.URLParams 6058 ifNoneMatch_ string 6059 ctx_ context.Context 6060 header_ http.Header 6061} 6062 6063// GetStoreLayout: Returns the store layout for the enterprise. If the 6064// store layout has not been set, returns "basic" as the store layout 6065// type and no homepage. 6066// 6067// - enterpriseId: The ID of the enterprise. 6068func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall { 6069 c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6070 c.enterpriseId = enterpriseId 6071 return c 6072} 6073 6074// Fields allows partial responses to be retrieved. See 6075// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6076// for more information. 6077func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall { 6078 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6079 return c 6080} 6081 6082// IfNoneMatch sets the optional parameter which makes the operation 6083// fail if the object's ETag matches the given value. This is useful for 6084// getting updates only after the object has changed since the last 6085// request. Use googleapi.IsNotModified to check whether the response 6086// error from Do is the result of In-None-Match. 6087func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall { 6088 c.ifNoneMatch_ = entityTag 6089 return c 6090} 6091 6092// Context sets the context to be used in this call's Do method. Any 6093// pending HTTP request will be aborted if the provided context is 6094// canceled. 6095func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall { 6096 c.ctx_ = ctx 6097 return c 6098} 6099 6100// Header returns an http.Header that can be modified by the caller to 6101// add HTTP headers to the request. 6102func (c *EnterprisesGetStoreLayoutCall) Header() http.Header { 6103 if c.header_ == nil { 6104 c.header_ = make(http.Header) 6105 } 6106 return c.header_ 6107} 6108 6109func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 6110 reqHeaders := make(http.Header) 6111 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6112 for k, v := range c.header_ { 6113 reqHeaders[k] = v 6114 } 6115 reqHeaders.Set("User-Agent", c.s.userAgent()) 6116 if c.ifNoneMatch_ != "" { 6117 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6118 } 6119 var body io.Reader = nil 6120 c.urlParams_.Set("alt", alt) 6121 c.urlParams_.Set("prettyPrint", "false") 6122 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout") 6123 urls += "?" + c.urlParams_.Encode() 6124 req, err := http.NewRequest("GET", urls, body) 6125 if err != nil { 6126 return nil, err 6127 } 6128 req.Header = reqHeaders 6129 googleapi.Expand(req.URL, map[string]string{ 6130 "enterpriseId": c.enterpriseId, 6131 }) 6132 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6133} 6134 6135// Do executes the "androidenterprise.enterprises.getStoreLayout" call. 6136// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 6137// status code is an error. Response headers are in either 6138// *StoreLayout.ServerResponse.Header or (if a response was returned at 6139// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6140// to check whether the returned error was because 6141// http.StatusNotModified was returned. 6142func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 6143 gensupport.SetOptions(c.urlParams_, opts...) 6144 res, err := c.doRequest("json") 6145 if res != nil && res.StatusCode == http.StatusNotModified { 6146 if res.Body != nil { 6147 res.Body.Close() 6148 } 6149 return nil, &googleapi.Error{ 6150 Code: res.StatusCode, 6151 Header: res.Header, 6152 } 6153 } 6154 if err != nil { 6155 return nil, err 6156 } 6157 defer googleapi.CloseBody(res) 6158 if err := googleapi.CheckResponse(res); err != nil { 6159 return nil, err 6160 } 6161 ret := &StoreLayout{ 6162 ServerResponse: googleapi.ServerResponse{ 6163 Header: res.Header, 6164 HTTPStatusCode: res.StatusCode, 6165 }, 6166 } 6167 target := &ret 6168 if err := gensupport.DecodeResponse(target, res); err != nil { 6169 return nil, err 6170 } 6171 return ret, nil 6172 // { 6173 // "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.", 6174 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6175 // "httpMethod": "GET", 6176 // "id": "androidenterprise.enterprises.getStoreLayout", 6177 // "parameterOrder": [ 6178 // "enterpriseId" 6179 // ], 6180 // "parameters": { 6181 // "enterpriseId": { 6182 // "description": "The ID of the enterprise.", 6183 // "location": "path", 6184 // "required": true, 6185 // "type": "string" 6186 // } 6187 // }, 6188 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6189 // "response": { 6190 // "$ref": "StoreLayout" 6191 // }, 6192 // "scopes": [ 6193 // "https://www.googleapis.com/auth/androidenterprise" 6194 // ] 6195 // } 6196 6197} 6198 6199// method id "androidenterprise.enterprises.list": 6200 6201type EnterprisesListCall struct { 6202 s *Service 6203 urlParams_ gensupport.URLParams 6204 ifNoneMatch_ string 6205 ctx_ context.Context 6206 header_ http.Header 6207} 6208 6209// List: Looks up an enterprise by domain name. This is only supported 6210// for enterprises created via the Google-initiated creation flow. 6211// Lookup of the id is not needed for enterprises created via the 6212// EMM-initiated flow since the EMM learns the enterprise ID in the 6213// callback specified in the Enterprises.generateSignupUrl call. 6214// 6215// - domain: The exact primary domain name of the enterprise to look up. 6216func (r *EnterprisesService) List(domain string) *EnterprisesListCall { 6217 c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6218 c.urlParams_.Set("domain", domain) 6219 return c 6220} 6221 6222// Fields allows partial responses to be retrieved. See 6223// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6224// for more information. 6225func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall { 6226 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6227 return c 6228} 6229 6230// IfNoneMatch sets the optional parameter which makes the operation 6231// fail if the object's ETag matches the given value. This is useful for 6232// getting updates only after the object has changed since the last 6233// request. Use googleapi.IsNotModified to check whether the response 6234// error from Do is the result of In-None-Match. 6235func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall { 6236 c.ifNoneMatch_ = entityTag 6237 return c 6238} 6239 6240// Context sets the context to be used in this call's Do method. Any 6241// pending HTTP request will be aborted if the provided context is 6242// canceled. 6243func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall { 6244 c.ctx_ = ctx 6245 return c 6246} 6247 6248// Header returns an http.Header that can be modified by the caller to 6249// add HTTP headers to the request. 6250func (c *EnterprisesListCall) Header() http.Header { 6251 if c.header_ == nil { 6252 c.header_ = make(http.Header) 6253 } 6254 return c.header_ 6255} 6256 6257func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { 6258 reqHeaders := make(http.Header) 6259 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6260 for k, v := range c.header_ { 6261 reqHeaders[k] = v 6262 } 6263 reqHeaders.Set("User-Agent", c.s.userAgent()) 6264 if c.ifNoneMatch_ != "" { 6265 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6266 } 6267 var body io.Reader = nil 6268 c.urlParams_.Set("alt", alt) 6269 c.urlParams_.Set("prettyPrint", "false") 6270 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises") 6271 urls += "?" + c.urlParams_.Encode() 6272 req, err := http.NewRequest("GET", urls, body) 6273 if err != nil { 6274 return nil, err 6275 } 6276 req.Header = reqHeaders 6277 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6278} 6279 6280// Do executes the "androidenterprise.enterprises.list" call. 6281// Exactly one of *EnterprisesListResponse or error will be non-nil. Any 6282// non-2xx status code is an error. Response headers are in either 6283// *EnterprisesListResponse.ServerResponse.Header or (if a response was 6284// returned at all) in error.(*googleapi.Error).Header. Use 6285// googleapi.IsNotModified to check whether the returned error was 6286// because http.StatusNotModified was returned. 6287func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) { 6288 gensupport.SetOptions(c.urlParams_, opts...) 6289 res, err := c.doRequest("json") 6290 if res != nil && res.StatusCode == http.StatusNotModified { 6291 if res.Body != nil { 6292 res.Body.Close() 6293 } 6294 return nil, &googleapi.Error{ 6295 Code: res.StatusCode, 6296 Header: res.Header, 6297 } 6298 } 6299 if err != nil { 6300 return nil, err 6301 } 6302 defer googleapi.CloseBody(res) 6303 if err := googleapi.CheckResponse(res); err != nil { 6304 return nil, err 6305 } 6306 ret := &EnterprisesListResponse{ 6307 ServerResponse: googleapi.ServerResponse{ 6308 Header: res.Header, 6309 HTTPStatusCode: res.StatusCode, 6310 }, 6311 } 6312 target := &ret 6313 if err := gensupport.DecodeResponse(target, res); err != nil { 6314 return nil, err 6315 } 6316 return ret, nil 6317 // { 6318 // "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.", 6319 // "flatPath": "androidenterprise/v1/enterprises", 6320 // "httpMethod": "GET", 6321 // "id": "androidenterprise.enterprises.list", 6322 // "parameterOrder": [ 6323 // "domain" 6324 // ], 6325 // "parameters": { 6326 // "domain": { 6327 // "description": "Required. The exact primary domain name of the enterprise to look up.", 6328 // "location": "query", 6329 // "required": true, 6330 // "type": "string" 6331 // } 6332 // }, 6333 // "path": "androidenterprise/v1/enterprises", 6334 // "response": { 6335 // "$ref": "EnterprisesListResponse" 6336 // }, 6337 // "scopes": [ 6338 // "https://www.googleapis.com/auth/androidenterprise" 6339 // ] 6340 // } 6341 6342} 6343 6344// method id "androidenterprise.enterprises.pullNotificationSet": 6345 6346type EnterprisesPullNotificationSetCall struct { 6347 s *Service 6348 urlParams_ gensupport.URLParams 6349 ctx_ context.Context 6350 header_ http.Header 6351} 6352 6353// PullNotificationSet: Pulls and returns a notification set for the 6354// enterprises associated with the service account authenticated for the 6355// request. The notification set may be empty if no notification are 6356// pending. A notification set returned needs to be acknowledged within 6357// 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless 6358// the notification set is empty. Notifications that are not 6359// acknowledged within the 20 seconds will eventually be included again 6360// in the response to another PullNotificationSet request, and those 6361// that are never acknowledged will ultimately be deleted according to 6362// the Google Cloud Platform Pub/Sub system policy. Multiple requests 6363// might be performed concurrently to retrieve notifications, in which 6364// case the pending notifications (if any) will be split among each 6365// caller, if any are pending. If no notifications are present, an empty 6366// notification list is returned. Subsequent requests may return more 6367// notifications once they become available. 6368func (r *EnterprisesService) PullNotificationSet() *EnterprisesPullNotificationSetCall { 6369 c := &EnterprisesPullNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6370 return c 6371} 6372 6373// RequestMode sets the optional parameter "requestMode": The request 6374// mode for pulling notifications. Specifying waitForNotifications will 6375// cause the request to block and wait until one or more notifications 6376// are present, or return an empty notification list if no notifications 6377// are present after some time. Speciying returnImmediately will cause 6378// the request to immediately return the pending notifications, or an 6379// empty list if no notifications are present. If omitted, defaults to 6380// waitForNotifications. 6381// 6382// Possible values: 6383// "waitForNotifications" - Wait until one or more notifications are 6384// present. 6385// "returnImmediately" - Returns immediately whether notifications are 6386// present or not. 6387func (c *EnterprisesPullNotificationSetCall) RequestMode(requestMode string) *EnterprisesPullNotificationSetCall { 6388 c.urlParams_.Set("requestMode", requestMode) 6389 return c 6390} 6391 6392// Fields allows partial responses to be retrieved. See 6393// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6394// for more information. 6395func (c *EnterprisesPullNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesPullNotificationSetCall { 6396 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6397 return c 6398} 6399 6400// Context sets the context to be used in this call's Do method. Any 6401// pending HTTP request will be aborted if the provided context is 6402// canceled. 6403func (c *EnterprisesPullNotificationSetCall) Context(ctx context.Context) *EnterprisesPullNotificationSetCall { 6404 c.ctx_ = ctx 6405 return c 6406} 6407 6408// Header returns an http.Header that can be modified by the caller to 6409// add HTTP headers to the request. 6410func (c *EnterprisesPullNotificationSetCall) Header() http.Header { 6411 if c.header_ == nil { 6412 c.header_ = make(http.Header) 6413 } 6414 return c.header_ 6415} 6416 6417func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) { 6418 reqHeaders := make(http.Header) 6419 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6420 for k, v := range c.header_ { 6421 reqHeaders[k] = v 6422 } 6423 reqHeaders.Set("User-Agent", c.s.userAgent()) 6424 var body io.Reader = nil 6425 c.urlParams_.Set("alt", alt) 6426 c.urlParams_.Set("prettyPrint", "false") 6427 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/pullNotificationSet") 6428 urls += "?" + c.urlParams_.Encode() 6429 req, err := http.NewRequest("POST", urls, body) 6430 if err != nil { 6431 return nil, err 6432 } 6433 req.Header = reqHeaders 6434 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6435} 6436 6437// Do executes the "androidenterprise.enterprises.pullNotificationSet" call. 6438// Exactly one of *NotificationSet or error will be non-nil. Any non-2xx 6439// status code is an error. Response headers are in either 6440// *NotificationSet.ServerResponse.Header or (if a response was returned 6441// at all) in error.(*googleapi.Error).Header. Use 6442// googleapi.IsNotModified to check whether the returned error was 6443// because http.StatusNotModified was returned. 6444func (c *EnterprisesPullNotificationSetCall) Do(opts ...googleapi.CallOption) (*NotificationSet, error) { 6445 gensupport.SetOptions(c.urlParams_, opts...) 6446 res, err := c.doRequest("json") 6447 if res != nil && res.StatusCode == http.StatusNotModified { 6448 if res.Body != nil { 6449 res.Body.Close() 6450 } 6451 return nil, &googleapi.Error{ 6452 Code: res.StatusCode, 6453 Header: res.Header, 6454 } 6455 } 6456 if err != nil { 6457 return nil, err 6458 } 6459 defer googleapi.CloseBody(res) 6460 if err := googleapi.CheckResponse(res); err != nil { 6461 return nil, err 6462 } 6463 ret := &NotificationSet{ 6464 ServerResponse: googleapi.ServerResponse{ 6465 Header: res.Header, 6466 HTTPStatusCode: res.StatusCode, 6467 }, 6468 } 6469 target := &ret 6470 if err := gensupport.DecodeResponse(target, res); err != nil { 6471 return nil, err 6472 } 6473 return ret, nil 6474 // { 6475 // "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.", 6476 // "flatPath": "androidenterprise/v1/enterprises/pullNotificationSet", 6477 // "httpMethod": "POST", 6478 // "id": "androidenterprise.enterprises.pullNotificationSet", 6479 // "parameterOrder": [], 6480 // "parameters": { 6481 // "requestMode": { 6482 // "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.", 6483 // "enum": [ 6484 // "waitForNotifications", 6485 // "returnImmediately" 6486 // ], 6487 // "enumDescriptions": [ 6488 // "Wait until one or more notifications are present.", 6489 // "Returns immediately whether notifications are present or not." 6490 // ], 6491 // "location": "query", 6492 // "type": "string" 6493 // } 6494 // }, 6495 // "path": "androidenterprise/v1/enterprises/pullNotificationSet", 6496 // "response": { 6497 // "$ref": "NotificationSet" 6498 // }, 6499 // "scopes": [ 6500 // "https://www.googleapis.com/auth/androidenterprise" 6501 // ] 6502 // } 6503 6504} 6505 6506// method id "androidenterprise.enterprises.sendTestPushNotification": 6507 6508type EnterprisesSendTestPushNotificationCall struct { 6509 s *Service 6510 enterpriseId string 6511 urlParams_ gensupport.URLParams 6512 ctx_ context.Context 6513 header_ http.Header 6514} 6515 6516// SendTestPushNotification: Sends a test notification to validate the 6517// EMM integration with the Google Cloud Pub/Sub service for this 6518// enterprise. 6519// 6520// - enterpriseId: The ID of the enterprise. 6521func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall { 6522 c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6523 c.enterpriseId = enterpriseId 6524 return c 6525} 6526 6527// Fields allows partial responses to be retrieved. See 6528// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6529// for more information. 6530func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall { 6531 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6532 return c 6533} 6534 6535// Context sets the context to be used in this call's Do method. Any 6536// pending HTTP request will be aborted if the provided context is 6537// canceled. 6538func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall { 6539 c.ctx_ = ctx 6540 return c 6541} 6542 6543// Header returns an http.Header that can be modified by the caller to 6544// add HTTP headers to the request. 6545func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header { 6546 if c.header_ == nil { 6547 c.header_ = make(http.Header) 6548 } 6549 return c.header_ 6550} 6551 6552func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) { 6553 reqHeaders := make(http.Header) 6554 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6555 for k, v := range c.header_ { 6556 reqHeaders[k] = v 6557 } 6558 reqHeaders.Set("User-Agent", c.s.userAgent()) 6559 var body io.Reader = nil 6560 c.urlParams_.Set("alt", alt) 6561 c.urlParams_.Set("prettyPrint", "false") 6562 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification") 6563 urls += "?" + c.urlParams_.Encode() 6564 req, err := http.NewRequest("POST", urls, body) 6565 if err != nil { 6566 return nil, err 6567 } 6568 req.Header = reqHeaders 6569 googleapi.Expand(req.URL, map[string]string{ 6570 "enterpriseId": c.enterpriseId, 6571 }) 6572 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6573} 6574 6575// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call. 6576// Exactly one of *EnterprisesSendTestPushNotificationResponse or error 6577// will be non-nil. Any non-2xx status code is an error. Response 6578// headers are in either 6579// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or 6580// (if a response was returned at all) in 6581// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6582// whether the returned error was because http.StatusNotModified was 6583// returned. 6584func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) { 6585 gensupport.SetOptions(c.urlParams_, opts...) 6586 res, err := c.doRequest("json") 6587 if res != nil && res.StatusCode == http.StatusNotModified { 6588 if res.Body != nil { 6589 res.Body.Close() 6590 } 6591 return nil, &googleapi.Error{ 6592 Code: res.StatusCode, 6593 Header: res.Header, 6594 } 6595 } 6596 if err != nil { 6597 return nil, err 6598 } 6599 defer googleapi.CloseBody(res) 6600 if err := googleapi.CheckResponse(res); err != nil { 6601 return nil, err 6602 } 6603 ret := &EnterprisesSendTestPushNotificationResponse{ 6604 ServerResponse: googleapi.ServerResponse{ 6605 Header: res.Header, 6606 HTTPStatusCode: res.StatusCode, 6607 }, 6608 } 6609 target := &ret 6610 if err := gensupport.DecodeResponse(target, res); err != nil { 6611 return nil, err 6612 } 6613 return ret, nil 6614 // { 6615 // "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.", 6616 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification", 6617 // "httpMethod": "POST", 6618 // "id": "androidenterprise.enterprises.sendTestPushNotification", 6619 // "parameterOrder": [ 6620 // "enterpriseId" 6621 // ], 6622 // "parameters": { 6623 // "enterpriseId": { 6624 // "description": "The ID of the enterprise.", 6625 // "location": "path", 6626 // "required": true, 6627 // "type": "string" 6628 // } 6629 // }, 6630 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification", 6631 // "response": { 6632 // "$ref": "EnterprisesSendTestPushNotificationResponse" 6633 // }, 6634 // "scopes": [ 6635 // "https://www.googleapis.com/auth/androidenterprise" 6636 // ] 6637 // } 6638 6639} 6640 6641// method id "androidenterprise.enterprises.setAccount": 6642 6643type EnterprisesSetAccountCall struct { 6644 s *Service 6645 enterpriseId string 6646 enterpriseaccount *EnterpriseAccount 6647 urlParams_ gensupport.URLParams 6648 ctx_ context.Context 6649 header_ http.Header 6650} 6651 6652// SetAccount: Sets the account that will be used to authenticate to the 6653// API as the enterprise. 6654// 6655// - enterpriseId: The ID of the enterprise. 6656func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall { 6657 c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6658 c.enterpriseId = enterpriseId 6659 c.enterpriseaccount = enterpriseaccount 6660 return c 6661} 6662 6663// Fields allows partial responses to be retrieved. See 6664// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6665// for more information. 6666func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall { 6667 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6668 return c 6669} 6670 6671// Context sets the context to be used in this call's Do method. Any 6672// pending HTTP request will be aborted if the provided context is 6673// canceled. 6674func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall { 6675 c.ctx_ = ctx 6676 return c 6677} 6678 6679// Header returns an http.Header that can be modified by the caller to 6680// add HTTP headers to the request. 6681func (c *EnterprisesSetAccountCall) Header() http.Header { 6682 if c.header_ == nil { 6683 c.header_ = make(http.Header) 6684 } 6685 return c.header_ 6686} 6687 6688func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) { 6689 reqHeaders := make(http.Header) 6690 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6691 for k, v := range c.header_ { 6692 reqHeaders[k] = v 6693 } 6694 reqHeaders.Set("User-Agent", c.s.userAgent()) 6695 var body io.Reader = nil 6696 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount) 6697 if err != nil { 6698 return nil, err 6699 } 6700 reqHeaders.Set("Content-Type", "application/json") 6701 c.urlParams_.Set("alt", alt) 6702 c.urlParams_.Set("prettyPrint", "false") 6703 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/account") 6704 urls += "?" + c.urlParams_.Encode() 6705 req, err := http.NewRequest("PUT", urls, body) 6706 if err != nil { 6707 return nil, err 6708 } 6709 req.Header = reqHeaders 6710 googleapi.Expand(req.URL, map[string]string{ 6711 "enterpriseId": c.enterpriseId, 6712 }) 6713 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6714} 6715 6716// Do executes the "androidenterprise.enterprises.setAccount" call. 6717// Exactly one of *EnterpriseAccount or error will be non-nil. Any 6718// non-2xx status code is an error. Response headers are in either 6719// *EnterpriseAccount.ServerResponse.Header or (if a response was 6720// returned at all) in error.(*googleapi.Error).Header. Use 6721// googleapi.IsNotModified to check whether the returned error was 6722// because http.StatusNotModified was returned. 6723func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) { 6724 gensupport.SetOptions(c.urlParams_, opts...) 6725 res, err := c.doRequest("json") 6726 if res != nil && res.StatusCode == http.StatusNotModified { 6727 if res.Body != nil { 6728 res.Body.Close() 6729 } 6730 return nil, &googleapi.Error{ 6731 Code: res.StatusCode, 6732 Header: res.Header, 6733 } 6734 } 6735 if err != nil { 6736 return nil, err 6737 } 6738 defer googleapi.CloseBody(res) 6739 if err := googleapi.CheckResponse(res); err != nil { 6740 return nil, err 6741 } 6742 ret := &EnterpriseAccount{ 6743 ServerResponse: googleapi.ServerResponse{ 6744 Header: res.Header, 6745 HTTPStatusCode: res.StatusCode, 6746 }, 6747 } 6748 target := &ret 6749 if err := gensupport.DecodeResponse(target, res); err != nil { 6750 return nil, err 6751 } 6752 return ret, nil 6753 // { 6754 // "description": "Sets the account that will be used to authenticate to the API as the enterprise.", 6755 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/account", 6756 // "httpMethod": "PUT", 6757 // "id": "androidenterprise.enterprises.setAccount", 6758 // "parameterOrder": [ 6759 // "enterpriseId" 6760 // ], 6761 // "parameters": { 6762 // "enterpriseId": { 6763 // "description": "The ID of the enterprise.", 6764 // "location": "path", 6765 // "required": true, 6766 // "type": "string" 6767 // } 6768 // }, 6769 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/account", 6770 // "request": { 6771 // "$ref": "EnterpriseAccount" 6772 // }, 6773 // "response": { 6774 // "$ref": "EnterpriseAccount" 6775 // }, 6776 // "scopes": [ 6777 // "https://www.googleapis.com/auth/androidenterprise" 6778 // ] 6779 // } 6780 6781} 6782 6783// method id "androidenterprise.enterprises.setStoreLayout": 6784 6785type EnterprisesSetStoreLayoutCall struct { 6786 s *Service 6787 enterpriseId string 6788 storelayout *StoreLayout 6789 urlParams_ gensupport.URLParams 6790 ctx_ context.Context 6791 header_ http.Header 6792} 6793 6794// SetStoreLayout: Sets the store layout for the enterprise. By default, 6795// storeLayoutType is set to "basic" and the basic store layout is 6796// enabled. The basic layout only contains apps approved by the admin, 6797// and that have been added to the available product set for a user 6798// (using the setAvailableProductSet call). Apps on the page are sorted 6799// in order of their product ID value. If you create a custom store 6800// layout (by setting storeLayoutType = "custom" and setting a 6801// homepage), the basic store layout is disabled. 6802// 6803// - enterpriseId: The ID of the enterprise. 6804func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall { 6805 c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6806 c.enterpriseId = enterpriseId 6807 c.storelayout = storelayout 6808 return c 6809} 6810 6811// Fields allows partial responses to be retrieved. See 6812// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6813// for more information. 6814func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall { 6815 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6816 return c 6817} 6818 6819// Context sets the context to be used in this call's Do method. Any 6820// pending HTTP request will be aborted if the provided context is 6821// canceled. 6822func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall { 6823 c.ctx_ = ctx 6824 return c 6825} 6826 6827// Header returns an http.Header that can be modified by the caller to 6828// add HTTP headers to the request. 6829func (c *EnterprisesSetStoreLayoutCall) Header() http.Header { 6830 if c.header_ == nil { 6831 c.header_ = make(http.Header) 6832 } 6833 return c.header_ 6834} 6835 6836func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 6837 reqHeaders := make(http.Header) 6838 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6839 for k, v := range c.header_ { 6840 reqHeaders[k] = v 6841 } 6842 reqHeaders.Set("User-Agent", c.s.userAgent()) 6843 var body io.Reader = nil 6844 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout) 6845 if err != nil { 6846 return nil, err 6847 } 6848 reqHeaders.Set("Content-Type", "application/json") 6849 c.urlParams_.Set("alt", alt) 6850 c.urlParams_.Set("prettyPrint", "false") 6851 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout") 6852 urls += "?" + c.urlParams_.Encode() 6853 req, err := http.NewRequest("PUT", urls, body) 6854 if err != nil { 6855 return nil, err 6856 } 6857 req.Header = reqHeaders 6858 googleapi.Expand(req.URL, map[string]string{ 6859 "enterpriseId": c.enterpriseId, 6860 }) 6861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6862} 6863 6864// Do executes the "androidenterprise.enterprises.setStoreLayout" call. 6865// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 6866// status code is an error. Response headers are in either 6867// *StoreLayout.ServerResponse.Header or (if a response was returned at 6868// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6869// to check whether the returned error was because 6870// http.StatusNotModified was returned. 6871func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 6872 gensupport.SetOptions(c.urlParams_, opts...) 6873 res, err := c.doRequest("json") 6874 if res != nil && res.StatusCode == http.StatusNotModified { 6875 if res.Body != nil { 6876 res.Body.Close() 6877 } 6878 return nil, &googleapi.Error{ 6879 Code: res.StatusCode, 6880 Header: res.Header, 6881 } 6882 } 6883 if err != nil { 6884 return nil, err 6885 } 6886 defer googleapi.CloseBody(res) 6887 if err := googleapi.CheckResponse(res); err != nil { 6888 return nil, err 6889 } 6890 ret := &StoreLayout{ 6891 ServerResponse: googleapi.ServerResponse{ 6892 Header: res.Header, 6893 HTTPStatusCode: res.StatusCode, 6894 }, 6895 } 6896 target := &ret 6897 if err := gensupport.DecodeResponse(target, res); err != nil { 6898 return nil, err 6899 } 6900 return ret, nil 6901 // { 6902 // "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.", 6903 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6904 // "httpMethod": "PUT", 6905 // "id": "androidenterprise.enterprises.setStoreLayout", 6906 // "parameterOrder": [ 6907 // "enterpriseId" 6908 // ], 6909 // "parameters": { 6910 // "enterpriseId": { 6911 // "description": "The ID of the enterprise.", 6912 // "location": "path", 6913 // "required": true, 6914 // "type": "string" 6915 // } 6916 // }, 6917 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout", 6918 // "request": { 6919 // "$ref": "StoreLayout" 6920 // }, 6921 // "response": { 6922 // "$ref": "StoreLayout" 6923 // }, 6924 // "scopes": [ 6925 // "https://www.googleapis.com/auth/androidenterprise" 6926 // ] 6927 // } 6928 6929} 6930 6931// method id "androidenterprise.enterprises.unenroll": 6932 6933type EnterprisesUnenrollCall struct { 6934 s *Service 6935 enterpriseId string 6936 urlParams_ gensupport.URLParams 6937 ctx_ context.Context 6938 header_ http.Header 6939} 6940 6941// Unenroll: Unenrolls an enterprise from the calling EMM. 6942// 6943// - enterpriseId: The ID of the enterprise. 6944func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall { 6945 c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6946 c.enterpriseId = enterpriseId 6947 return c 6948} 6949 6950// Fields allows partial responses to be retrieved. See 6951// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6952// for more information. 6953func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall { 6954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6955 return c 6956} 6957 6958// Context sets the context to be used in this call's Do method. Any 6959// pending HTTP request will be aborted if the provided context is 6960// canceled. 6961func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall { 6962 c.ctx_ = ctx 6963 return c 6964} 6965 6966// Header returns an http.Header that can be modified by the caller to 6967// add HTTP headers to the request. 6968func (c *EnterprisesUnenrollCall) Header() http.Header { 6969 if c.header_ == nil { 6970 c.header_ = make(http.Header) 6971 } 6972 return c.header_ 6973} 6974 6975func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) { 6976 reqHeaders := make(http.Header) 6977 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6978 for k, v := range c.header_ { 6979 reqHeaders[k] = v 6980 } 6981 reqHeaders.Set("User-Agent", c.s.userAgent()) 6982 var body io.Reader = nil 6983 c.urlParams_.Set("alt", alt) 6984 c.urlParams_.Set("prettyPrint", "false") 6985 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/unenroll") 6986 urls += "?" + c.urlParams_.Encode() 6987 req, err := http.NewRequest("POST", urls, body) 6988 if err != nil { 6989 return nil, err 6990 } 6991 req.Header = reqHeaders 6992 googleapi.Expand(req.URL, map[string]string{ 6993 "enterpriseId": c.enterpriseId, 6994 }) 6995 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6996} 6997 6998// Do executes the "androidenterprise.enterprises.unenroll" call. 6999func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error { 7000 gensupport.SetOptions(c.urlParams_, opts...) 7001 res, err := c.doRequest("json") 7002 if err != nil { 7003 return err 7004 } 7005 defer googleapi.CloseBody(res) 7006 if err := googleapi.CheckResponse(res); err != nil { 7007 return err 7008 } 7009 return nil 7010 // { 7011 // "description": "Unenrolls an enterprise from the calling EMM.", 7012 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/unenroll", 7013 // "httpMethod": "POST", 7014 // "id": "androidenterprise.enterprises.unenroll", 7015 // "parameterOrder": [ 7016 // "enterpriseId" 7017 // ], 7018 // "parameters": { 7019 // "enterpriseId": { 7020 // "description": "The ID of the enterprise.", 7021 // "location": "path", 7022 // "required": true, 7023 // "type": "string" 7024 // } 7025 // }, 7026 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/unenroll", 7027 // "scopes": [ 7028 // "https://www.googleapis.com/auth/androidenterprise" 7029 // ] 7030 // } 7031 7032} 7033 7034// method id "androidenterprise.entitlements.delete": 7035 7036type EntitlementsDeleteCall struct { 7037 s *Service 7038 enterpriseId string 7039 userId string 7040 entitlementId string 7041 urlParams_ gensupport.URLParams 7042 ctx_ context.Context 7043 header_ http.Header 7044} 7045 7046// Delete: Removes an entitlement to an app for a user. 7047// 7048// - enterpriseId: The ID of the enterprise. 7049// - entitlementId: The ID of the entitlement (a product ID), e.g. 7050// "app:com.google.android.gm". 7051// - userId: The ID of the user. 7052func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall { 7053 c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7054 c.enterpriseId = enterpriseId 7055 c.userId = userId 7056 c.entitlementId = entitlementId 7057 return c 7058} 7059 7060// Fields allows partial responses to be retrieved. See 7061// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7062// for more information. 7063func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall { 7064 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7065 return c 7066} 7067 7068// Context sets the context to be used in this call's Do method. Any 7069// pending HTTP request will be aborted if the provided context is 7070// canceled. 7071func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall { 7072 c.ctx_ = ctx 7073 return c 7074} 7075 7076// Header returns an http.Header that can be modified by the caller to 7077// add HTTP headers to the request. 7078func (c *EntitlementsDeleteCall) Header() http.Header { 7079 if c.header_ == nil { 7080 c.header_ = make(http.Header) 7081 } 7082 return c.header_ 7083} 7084 7085func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) { 7086 reqHeaders := make(http.Header) 7087 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7088 for k, v := range c.header_ { 7089 reqHeaders[k] = v 7090 } 7091 reqHeaders.Set("User-Agent", c.s.userAgent()) 7092 var body io.Reader = nil 7093 c.urlParams_.Set("alt", alt) 7094 c.urlParams_.Set("prettyPrint", "false") 7095 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7096 urls += "?" + c.urlParams_.Encode() 7097 req, err := http.NewRequest("DELETE", urls, body) 7098 if err != nil { 7099 return nil, err 7100 } 7101 req.Header = reqHeaders 7102 googleapi.Expand(req.URL, map[string]string{ 7103 "enterpriseId": c.enterpriseId, 7104 "userId": c.userId, 7105 "entitlementId": c.entitlementId, 7106 }) 7107 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7108} 7109 7110// Do executes the "androidenterprise.entitlements.delete" call. 7111func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error { 7112 gensupport.SetOptions(c.urlParams_, opts...) 7113 res, err := c.doRequest("json") 7114 if err != nil { 7115 return err 7116 } 7117 defer googleapi.CloseBody(res) 7118 if err := googleapi.CheckResponse(res); err != nil { 7119 return err 7120 } 7121 return nil 7122 // { 7123 // "description": "Removes an entitlement to an app for a user.", 7124 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7125 // "httpMethod": "DELETE", 7126 // "id": "androidenterprise.entitlements.delete", 7127 // "parameterOrder": [ 7128 // "enterpriseId", 7129 // "userId", 7130 // "entitlementId" 7131 // ], 7132 // "parameters": { 7133 // "enterpriseId": { 7134 // "description": "The ID of the enterprise.", 7135 // "location": "path", 7136 // "required": true, 7137 // "type": "string" 7138 // }, 7139 // "entitlementId": { 7140 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7141 // "location": "path", 7142 // "required": true, 7143 // "type": "string" 7144 // }, 7145 // "userId": { 7146 // "description": "The ID of the user.", 7147 // "location": "path", 7148 // "required": true, 7149 // "type": "string" 7150 // } 7151 // }, 7152 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7153 // "scopes": [ 7154 // "https://www.googleapis.com/auth/androidenterprise" 7155 // ] 7156 // } 7157 7158} 7159 7160// method id "androidenterprise.entitlements.get": 7161 7162type EntitlementsGetCall struct { 7163 s *Service 7164 enterpriseId string 7165 userId string 7166 entitlementId string 7167 urlParams_ gensupport.URLParams 7168 ifNoneMatch_ string 7169 ctx_ context.Context 7170 header_ http.Header 7171} 7172 7173// Get: Retrieves details of an entitlement. 7174// 7175// - enterpriseId: The ID of the enterprise. 7176// - entitlementId: The ID of the entitlement (a product ID), e.g. 7177// "app:com.google.android.gm". 7178// - userId: The ID of the user. 7179func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall { 7180 c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7181 c.enterpriseId = enterpriseId 7182 c.userId = userId 7183 c.entitlementId = entitlementId 7184 return c 7185} 7186 7187// Fields allows partial responses to be retrieved. See 7188// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7189// for more information. 7190func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall { 7191 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7192 return c 7193} 7194 7195// IfNoneMatch sets the optional parameter which makes the operation 7196// fail if the object's ETag matches the given value. This is useful for 7197// getting updates only after the object has changed since the last 7198// request. Use googleapi.IsNotModified to check whether the response 7199// error from Do is the result of In-None-Match. 7200func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall { 7201 c.ifNoneMatch_ = entityTag 7202 return c 7203} 7204 7205// Context sets the context to be used in this call's Do method. Any 7206// pending HTTP request will be aborted if the provided context is 7207// canceled. 7208func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall { 7209 c.ctx_ = ctx 7210 return c 7211} 7212 7213// Header returns an http.Header that can be modified by the caller to 7214// add HTTP headers to the request. 7215func (c *EntitlementsGetCall) Header() http.Header { 7216 if c.header_ == nil { 7217 c.header_ = make(http.Header) 7218 } 7219 return c.header_ 7220} 7221 7222func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) { 7223 reqHeaders := make(http.Header) 7224 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7225 for k, v := range c.header_ { 7226 reqHeaders[k] = v 7227 } 7228 reqHeaders.Set("User-Agent", c.s.userAgent()) 7229 if c.ifNoneMatch_ != "" { 7230 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7231 } 7232 var body io.Reader = nil 7233 c.urlParams_.Set("alt", alt) 7234 c.urlParams_.Set("prettyPrint", "false") 7235 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7236 urls += "?" + c.urlParams_.Encode() 7237 req, err := http.NewRequest("GET", urls, body) 7238 if err != nil { 7239 return nil, err 7240 } 7241 req.Header = reqHeaders 7242 googleapi.Expand(req.URL, map[string]string{ 7243 "enterpriseId": c.enterpriseId, 7244 "userId": c.userId, 7245 "entitlementId": c.entitlementId, 7246 }) 7247 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7248} 7249 7250// Do executes the "androidenterprise.entitlements.get" call. 7251// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7252// status code is an error. Response headers are in either 7253// *Entitlement.ServerResponse.Header or (if a response was returned at 7254// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7255// to check whether the returned error was because 7256// http.StatusNotModified was returned. 7257func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7258 gensupport.SetOptions(c.urlParams_, opts...) 7259 res, err := c.doRequest("json") 7260 if res != nil && res.StatusCode == http.StatusNotModified { 7261 if res.Body != nil { 7262 res.Body.Close() 7263 } 7264 return nil, &googleapi.Error{ 7265 Code: res.StatusCode, 7266 Header: res.Header, 7267 } 7268 } 7269 if err != nil { 7270 return nil, err 7271 } 7272 defer googleapi.CloseBody(res) 7273 if err := googleapi.CheckResponse(res); err != nil { 7274 return nil, err 7275 } 7276 ret := &Entitlement{ 7277 ServerResponse: googleapi.ServerResponse{ 7278 Header: res.Header, 7279 HTTPStatusCode: res.StatusCode, 7280 }, 7281 } 7282 target := &ret 7283 if err := gensupport.DecodeResponse(target, res); err != nil { 7284 return nil, err 7285 } 7286 return ret, nil 7287 // { 7288 // "description": "Retrieves details of an entitlement.", 7289 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7290 // "httpMethod": "GET", 7291 // "id": "androidenterprise.entitlements.get", 7292 // "parameterOrder": [ 7293 // "enterpriseId", 7294 // "userId", 7295 // "entitlementId" 7296 // ], 7297 // "parameters": { 7298 // "enterpriseId": { 7299 // "description": "The ID of the enterprise.", 7300 // "location": "path", 7301 // "required": true, 7302 // "type": "string" 7303 // }, 7304 // "entitlementId": { 7305 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7306 // "location": "path", 7307 // "required": true, 7308 // "type": "string" 7309 // }, 7310 // "userId": { 7311 // "description": "The ID of the user.", 7312 // "location": "path", 7313 // "required": true, 7314 // "type": "string" 7315 // } 7316 // }, 7317 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7318 // "response": { 7319 // "$ref": "Entitlement" 7320 // }, 7321 // "scopes": [ 7322 // "https://www.googleapis.com/auth/androidenterprise" 7323 // ] 7324 // } 7325 7326} 7327 7328// method id "androidenterprise.entitlements.list": 7329 7330type EntitlementsListCall struct { 7331 s *Service 7332 enterpriseId string 7333 userId string 7334 urlParams_ gensupport.URLParams 7335 ifNoneMatch_ string 7336 ctx_ context.Context 7337 header_ http.Header 7338} 7339 7340// List: Lists all entitlements for the specified user. Only the ID is 7341// set. 7342// 7343// - enterpriseId: The ID of the enterprise. 7344// - userId: The ID of the user. 7345func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall { 7346 c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7347 c.enterpriseId = enterpriseId 7348 c.userId = userId 7349 return c 7350} 7351 7352// Fields allows partial responses to be retrieved. See 7353// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7354// for more information. 7355func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall { 7356 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7357 return c 7358} 7359 7360// IfNoneMatch sets the optional parameter which makes the operation 7361// fail if the object's ETag matches the given value. This is useful for 7362// getting updates only after the object has changed since the last 7363// request. Use googleapi.IsNotModified to check whether the response 7364// error from Do is the result of In-None-Match. 7365func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall { 7366 c.ifNoneMatch_ = entityTag 7367 return c 7368} 7369 7370// Context sets the context to be used in this call's Do method. Any 7371// pending HTTP request will be aborted if the provided context is 7372// canceled. 7373func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall { 7374 c.ctx_ = ctx 7375 return c 7376} 7377 7378// Header returns an http.Header that can be modified by the caller to 7379// add HTTP headers to the request. 7380func (c *EntitlementsListCall) Header() http.Header { 7381 if c.header_ == nil { 7382 c.header_ = make(http.Header) 7383 } 7384 return c.header_ 7385} 7386 7387func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { 7388 reqHeaders := make(http.Header) 7389 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7390 for k, v := range c.header_ { 7391 reqHeaders[k] = v 7392 } 7393 reqHeaders.Set("User-Agent", c.s.userAgent()) 7394 if c.ifNoneMatch_ != "" { 7395 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7396 } 7397 var body io.Reader = nil 7398 c.urlParams_.Set("alt", alt) 7399 c.urlParams_.Set("prettyPrint", "false") 7400 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements") 7401 urls += "?" + c.urlParams_.Encode() 7402 req, err := http.NewRequest("GET", urls, body) 7403 if err != nil { 7404 return nil, err 7405 } 7406 req.Header = reqHeaders 7407 googleapi.Expand(req.URL, map[string]string{ 7408 "enterpriseId": c.enterpriseId, 7409 "userId": c.userId, 7410 }) 7411 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7412} 7413 7414// Do executes the "androidenterprise.entitlements.list" call. 7415// Exactly one of *EntitlementsListResponse or error will be non-nil. 7416// Any non-2xx status code is an error. Response headers are in either 7417// *EntitlementsListResponse.ServerResponse.Header or (if a response was 7418// returned at all) in error.(*googleapi.Error).Header. Use 7419// googleapi.IsNotModified to check whether the returned error was 7420// because http.StatusNotModified was returned. 7421func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) { 7422 gensupport.SetOptions(c.urlParams_, opts...) 7423 res, err := c.doRequest("json") 7424 if res != nil && res.StatusCode == http.StatusNotModified { 7425 if res.Body != nil { 7426 res.Body.Close() 7427 } 7428 return nil, &googleapi.Error{ 7429 Code: res.StatusCode, 7430 Header: res.Header, 7431 } 7432 } 7433 if err != nil { 7434 return nil, err 7435 } 7436 defer googleapi.CloseBody(res) 7437 if err := googleapi.CheckResponse(res); err != nil { 7438 return nil, err 7439 } 7440 ret := &EntitlementsListResponse{ 7441 ServerResponse: googleapi.ServerResponse{ 7442 Header: res.Header, 7443 HTTPStatusCode: res.StatusCode, 7444 }, 7445 } 7446 target := &ret 7447 if err := gensupport.DecodeResponse(target, res); err != nil { 7448 return nil, err 7449 } 7450 return ret, nil 7451 // { 7452 // "description": "Lists all entitlements for the specified user. Only the ID is set.", 7453 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements", 7454 // "httpMethod": "GET", 7455 // "id": "androidenterprise.entitlements.list", 7456 // "parameterOrder": [ 7457 // "enterpriseId", 7458 // "userId" 7459 // ], 7460 // "parameters": { 7461 // "enterpriseId": { 7462 // "description": "The ID of the enterprise.", 7463 // "location": "path", 7464 // "required": true, 7465 // "type": "string" 7466 // }, 7467 // "userId": { 7468 // "description": "The ID of the user.", 7469 // "location": "path", 7470 // "required": true, 7471 // "type": "string" 7472 // } 7473 // }, 7474 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements", 7475 // "response": { 7476 // "$ref": "EntitlementsListResponse" 7477 // }, 7478 // "scopes": [ 7479 // "https://www.googleapis.com/auth/androidenterprise" 7480 // ] 7481 // } 7482 7483} 7484 7485// method id "androidenterprise.entitlements.update": 7486 7487type EntitlementsUpdateCall struct { 7488 s *Service 7489 enterpriseId string 7490 userId string 7491 entitlementId string 7492 entitlement *Entitlement 7493 urlParams_ gensupport.URLParams 7494 ctx_ context.Context 7495 header_ http.Header 7496} 7497 7498// Update: Adds or updates an entitlement to an app for a user. 7499// 7500// - enterpriseId: The ID of the enterprise. 7501// - entitlementId: The ID of the entitlement (a product ID), e.g. 7502// "app:com.google.android.gm". 7503// - userId: The ID of the user. 7504func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall { 7505 c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7506 c.enterpriseId = enterpriseId 7507 c.userId = userId 7508 c.entitlementId = entitlementId 7509 c.entitlement = entitlement 7510 return c 7511} 7512 7513// Install sets the optional parameter "install": Set to true to also 7514// install the product on all the user's devices where possible. Failure 7515// to install on one or more devices will not prevent this operation 7516// from returning successfully, as long as the entitlement was 7517// successfully assigned to the user. 7518func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall { 7519 c.urlParams_.Set("install", fmt.Sprint(install)) 7520 return c 7521} 7522 7523// Fields allows partial responses to be retrieved. See 7524// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7525// for more information. 7526func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall { 7527 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7528 return c 7529} 7530 7531// Context sets the context to be used in this call's Do method. Any 7532// pending HTTP request will be aborted if the provided context is 7533// canceled. 7534func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall { 7535 c.ctx_ = ctx 7536 return c 7537} 7538 7539// Header returns an http.Header that can be modified by the caller to 7540// add HTTP headers to the request. 7541func (c *EntitlementsUpdateCall) Header() http.Header { 7542 if c.header_ == nil { 7543 c.header_ = make(http.Header) 7544 } 7545 return c.header_ 7546} 7547 7548func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) { 7549 reqHeaders := make(http.Header) 7550 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7551 for k, v := range c.header_ { 7552 reqHeaders[k] = v 7553 } 7554 reqHeaders.Set("User-Agent", c.s.userAgent()) 7555 var body io.Reader = nil 7556 body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) 7557 if err != nil { 7558 return nil, err 7559 } 7560 reqHeaders.Set("Content-Type", "application/json") 7561 c.urlParams_.Set("alt", alt) 7562 c.urlParams_.Set("prettyPrint", "false") 7563 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7564 urls += "?" + c.urlParams_.Encode() 7565 req, err := http.NewRequest("PUT", urls, body) 7566 if err != nil { 7567 return nil, err 7568 } 7569 req.Header = reqHeaders 7570 googleapi.Expand(req.URL, map[string]string{ 7571 "enterpriseId": c.enterpriseId, 7572 "userId": c.userId, 7573 "entitlementId": c.entitlementId, 7574 }) 7575 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7576} 7577 7578// Do executes the "androidenterprise.entitlements.update" call. 7579// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7580// status code is an error. Response headers are in either 7581// *Entitlement.ServerResponse.Header or (if a response was returned at 7582// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7583// to check whether the returned error was because 7584// http.StatusNotModified was returned. 7585func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7586 gensupport.SetOptions(c.urlParams_, opts...) 7587 res, err := c.doRequest("json") 7588 if res != nil && res.StatusCode == http.StatusNotModified { 7589 if res.Body != nil { 7590 res.Body.Close() 7591 } 7592 return nil, &googleapi.Error{ 7593 Code: res.StatusCode, 7594 Header: res.Header, 7595 } 7596 } 7597 if err != nil { 7598 return nil, err 7599 } 7600 defer googleapi.CloseBody(res) 7601 if err := googleapi.CheckResponse(res); err != nil { 7602 return nil, err 7603 } 7604 ret := &Entitlement{ 7605 ServerResponse: googleapi.ServerResponse{ 7606 Header: res.Header, 7607 HTTPStatusCode: res.StatusCode, 7608 }, 7609 } 7610 target := &ret 7611 if err := gensupport.DecodeResponse(target, res); err != nil { 7612 return nil, err 7613 } 7614 return ret, nil 7615 // { 7616 // "description": "Adds or updates an entitlement to an app for a user.", 7617 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7618 // "httpMethod": "PUT", 7619 // "id": "androidenterprise.entitlements.update", 7620 // "parameterOrder": [ 7621 // "enterpriseId", 7622 // "userId", 7623 // "entitlementId" 7624 // ], 7625 // "parameters": { 7626 // "enterpriseId": { 7627 // "description": "The ID of the enterprise.", 7628 // "location": "path", 7629 // "required": true, 7630 // "type": "string" 7631 // }, 7632 // "entitlementId": { 7633 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7634 // "location": "path", 7635 // "required": true, 7636 // "type": "string" 7637 // }, 7638 // "install": { 7639 // "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.", 7640 // "location": "query", 7641 // "type": "boolean" 7642 // }, 7643 // "userId": { 7644 // "description": "The ID of the user.", 7645 // "location": "path", 7646 // "required": true, 7647 // "type": "string" 7648 // } 7649 // }, 7650 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7651 // "request": { 7652 // "$ref": "Entitlement" 7653 // }, 7654 // "response": { 7655 // "$ref": "Entitlement" 7656 // }, 7657 // "scopes": [ 7658 // "https://www.googleapis.com/auth/androidenterprise" 7659 // ] 7660 // } 7661 7662} 7663 7664// method id "androidenterprise.grouplicenses.get": 7665 7666type GrouplicensesGetCall struct { 7667 s *Service 7668 enterpriseId string 7669 groupLicenseId string 7670 urlParams_ gensupport.URLParams 7671 ifNoneMatch_ string 7672 ctx_ context.Context 7673 header_ http.Header 7674} 7675 7676// Get: Retrieves details of an enterprise's group license for a 7677// product. 7678// 7679// - enterpriseId: The ID of the enterprise. 7680// - groupLicenseId: The ID of the product the group license is for, 7681// e.g. "app:com.google.android.gm". 7682func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall { 7683 c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7684 c.enterpriseId = enterpriseId 7685 c.groupLicenseId = groupLicenseId 7686 return c 7687} 7688 7689// Fields allows partial responses to be retrieved. See 7690// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7691// for more information. 7692func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall { 7693 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7694 return c 7695} 7696 7697// IfNoneMatch sets the optional parameter which makes the operation 7698// fail if the object's ETag matches the given value. This is useful for 7699// getting updates only after the object has changed since the last 7700// request. Use googleapi.IsNotModified to check whether the response 7701// error from Do is the result of In-None-Match. 7702func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall { 7703 c.ifNoneMatch_ = entityTag 7704 return c 7705} 7706 7707// Context sets the context to be used in this call's Do method. Any 7708// pending HTTP request will be aborted if the provided context is 7709// canceled. 7710func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall { 7711 c.ctx_ = ctx 7712 return c 7713} 7714 7715// Header returns an http.Header that can be modified by the caller to 7716// add HTTP headers to the request. 7717func (c *GrouplicensesGetCall) Header() http.Header { 7718 if c.header_ == nil { 7719 c.header_ = make(http.Header) 7720 } 7721 return c.header_ 7722} 7723 7724func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) { 7725 reqHeaders := make(http.Header) 7726 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7727 for k, v := range c.header_ { 7728 reqHeaders[k] = v 7729 } 7730 reqHeaders.Set("User-Agent", c.s.userAgent()) 7731 if c.ifNoneMatch_ != "" { 7732 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7733 } 7734 var body io.Reader = nil 7735 c.urlParams_.Set("alt", alt) 7736 c.urlParams_.Set("prettyPrint", "false") 7737 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}") 7738 urls += "?" + c.urlParams_.Encode() 7739 req, err := http.NewRequest("GET", urls, body) 7740 if err != nil { 7741 return nil, err 7742 } 7743 req.Header = reqHeaders 7744 googleapi.Expand(req.URL, map[string]string{ 7745 "enterpriseId": c.enterpriseId, 7746 "groupLicenseId": c.groupLicenseId, 7747 }) 7748 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7749} 7750 7751// Do executes the "androidenterprise.grouplicenses.get" call. 7752// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx 7753// status code is an error. Response headers are in either 7754// *GroupLicense.ServerResponse.Header or (if a response was returned at 7755// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7756// to check whether the returned error was because 7757// http.StatusNotModified was returned. 7758func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) { 7759 gensupport.SetOptions(c.urlParams_, opts...) 7760 res, err := c.doRequest("json") 7761 if res != nil && res.StatusCode == http.StatusNotModified { 7762 if res.Body != nil { 7763 res.Body.Close() 7764 } 7765 return nil, &googleapi.Error{ 7766 Code: res.StatusCode, 7767 Header: res.Header, 7768 } 7769 } 7770 if err != nil { 7771 return nil, err 7772 } 7773 defer googleapi.CloseBody(res) 7774 if err := googleapi.CheckResponse(res); err != nil { 7775 return nil, err 7776 } 7777 ret := &GroupLicense{ 7778 ServerResponse: googleapi.ServerResponse{ 7779 Header: res.Header, 7780 HTTPStatusCode: res.StatusCode, 7781 }, 7782 } 7783 target := &ret 7784 if err := gensupport.DecodeResponse(target, res); err != nil { 7785 return nil, err 7786 } 7787 return ret, nil 7788 // { 7789 // "description": "Retrieves details of an enterprise's group license for a product.", 7790 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", 7791 // "httpMethod": "GET", 7792 // "id": "androidenterprise.grouplicenses.get", 7793 // "parameterOrder": [ 7794 // "enterpriseId", 7795 // "groupLicenseId" 7796 // ], 7797 // "parameters": { 7798 // "enterpriseId": { 7799 // "description": "The ID of the enterprise.", 7800 // "location": "path", 7801 // "required": true, 7802 // "type": "string" 7803 // }, 7804 // "groupLicenseId": { 7805 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 7806 // "location": "path", 7807 // "required": true, 7808 // "type": "string" 7809 // } 7810 // }, 7811 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", 7812 // "response": { 7813 // "$ref": "GroupLicense" 7814 // }, 7815 // "scopes": [ 7816 // "https://www.googleapis.com/auth/androidenterprise" 7817 // ] 7818 // } 7819 7820} 7821 7822// method id "androidenterprise.grouplicenses.list": 7823 7824type GrouplicensesListCall struct { 7825 s *Service 7826 enterpriseId string 7827 urlParams_ gensupport.URLParams 7828 ifNoneMatch_ string 7829 ctx_ context.Context 7830 header_ http.Header 7831} 7832 7833// List: Retrieves IDs of all products for which the enterprise has a 7834// group license. 7835// 7836// - enterpriseId: The ID of the enterprise. 7837func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall { 7838 c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7839 c.enterpriseId = enterpriseId 7840 return c 7841} 7842 7843// Fields allows partial responses to be retrieved. See 7844// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7845// for more information. 7846func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall { 7847 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7848 return c 7849} 7850 7851// IfNoneMatch sets the optional parameter which makes the operation 7852// fail if the object's ETag matches the given value. This is useful for 7853// getting updates only after the object has changed since the last 7854// request. Use googleapi.IsNotModified to check whether the response 7855// error from Do is the result of In-None-Match. 7856func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall { 7857 c.ifNoneMatch_ = entityTag 7858 return c 7859} 7860 7861// Context sets the context to be used in this call's Do method. Any 7862// pending HTTP request will be aborted if the provided context is 7863// canceled. 7864func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall { 7865 c.ctx_ = ctx 7866 return c 7867} 7868 7869// Header returns an http.Header that can be modified by the caller to 7870// add HTTP headers to the request. 7871func (c *GrouplicensesListCall) Header() http.Header { 7872 if c.header_ == nil { 7873 c.header_ = make(http.Header) 7874 } 7875 return c.header_ 7876} 7877 7878func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) { 7879 reqHeaders := make(http.Header) 7880 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7881 for k, v := range c.header_ { 7882 reqHeaders[k] = v 7883 } 7884 reqHeaders.Set("User-Agent", c.s.userAgent()) 7885 if c.ifNoneMatch_ != "" { 7886 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7887 } 7888 var body io.Reader = nil 7889 c.urlParams_.Set("alt", alt) 7890 c.urlParams_.Set("prettyPrint", "false") 7891 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses") 7892 urls += "?" + c.urlParams_.Encode() 7893 req, err := http.NewRequest("GET", urls, body) 7894 if err != nil { 7895 return nil, err 7896 } 7897 req.Header = reqHeaders 7898 googleapi.Expand(req.URL, map[string]string{ 7899 "enterpriseId": c.enterpriseId, 7900 }) 7901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7902} 7903 7904// Do executes the "androidenterprise.grouplicenses.list" call. 7905// Exactly one of *GroupLicensesListResponse or error will be non-nil. 7906// Any non-2xx status code is an error. Response headers are in either 7907// *GroupLicensesListResponse.ServerResponse.Header or (if a response 7908// was returned at all) in error.(*googleapi.Error).Header. Use 7909// googleapi.IsNotModified to check whether the returned error was 7910// because http.StatusNotModified was returned. 7911func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) { 7912 gensupport.SetOptions(c.urlParams_, opts...) 7913 res, err := c.doRequest("json") 7914 if res != nil && res.StatusCode == http.StatusNotModified { 7915 if res.Body != nil { 7916 res.Body.Close() 7917 } 7918 return nil, &googleapi.Error{ 7919 Code: res.StatusCode, 7920 Header: res.Header, 7921 } 7922 } 7923 if err != nil { 7924 return nil, err 7925 } 7926 defer googleapi.CloseBody(res) 7927 if err := googleapi.CheckResponse(res); err != nil { 7928 return nil, err 7929 } 7930 ret := &GroupLicensesListResponse{ 7931 ServerResponse: googleapi.ServerResponse{ 7932 Header: res.Header, 7933 HTTPStatusCode: res.StatusCode, 7934 }, 7935 } 7936 target := &ret 7937 if err := gensupport.DecodeResponse(target, res); err != nil { 7938 return nil, err 7939 } 7940 return ret, nil 7941 // { 7942 // "description": "Retrieves IDs of all products for which the enterprise has a group license.", 7943 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses", 7944 // "httpMethod": "GET", 7945 // "id": "androidenterprise.grouplicenses.list", 7946 // "parameterOrder": [ 7947 // "enterpriseId" 7948 // ], 7949 // "parameters": { 7950 // "enterpriseId": { 7951 // "description": "The ID of the enterprise.", 7952 // "location": "path", 7953 // "required": true, 7954 // "type": "string" 7955 // } 7956 // }, 7957 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses", 7958 // "response": { 7959 // "$ref": "GroupLicensesListResponse" 7960 // }, 7961 // "scopes": [ 7962 // "https://www.googleapis.com/auth/androidenterprise" 7963 // ] 7964 // } 7965 7966} 7967 7968// method id "androidenterprise.grouplicenseusers.list": 7969 7970type GrouplicenseusersListCall struct { 7971 s *Service 7972 enterpriseId string 7973 groupLicenseId string 7974 urlParams_ gensupport.URLParams 7975 ifNoneMatch_ string 7976 ctx_ context.Context 7977 header_ http.Header 7978} 7979 7980// List: Retrieves the IDs of the users who have been granted 7981// entitlements under the license. 7982// 7983// - enterpriseId: The ID of the enterprise. 7984// - groupLicenseId: The ID of the product the group license is for, 7985// e.g. "app:com.google.android.gm". 7986func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall { 7987 c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7988 c.enterpriseId = enterpriseId 7989 c.groupLicenseId = groupLicenseId 7990 return c 7991} 7992 7993// Fields allows partial responses to be retrieved. See 7994// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7995// for more information. 7996func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall { 7997 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7998 return c 7999} 8000 8001// IfNoneMatch sets the optional parameter which makes the operation 8002// fail if the object's ETag matches the given value. This is useful for 8003// getting updates only after the object has changed since the last 8004// request. Use googleapi.IsNotModified to check whether the response 8005// error from Do is the result of In-None-Match. 8006func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall { 8007 c.ifNoneMatch_ = entityTag 8008 return c 8009} 8010 8011// Context sets the context to be used in this call's Do method. Any 8012// pending HTTP request will be aborted if the provided context is 8013// canceled. 8014func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall { 8015 c.ctx_ = ctx 8016 return c 8017} 8018 8019// Header returns an http.Header that can be modified by the caller to 8020// add HTTP headers to the request. 8021func (c *GrouplicenseusersListCall) Header() http.Header { 8022 if c.header_ == nil { 8023 c.header_ = make(http.Header) 8024 } 8025 return c.header_ 8026} 8027 8028func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) { 8029 reqHeaders := make(http.Header) 8030 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8031 for k, v := range c.header_ { 8032 reqHeaders[k] = v 8033 } 8034 reqHeaders.Set("User-Agent", c.s.userAgent()) 8035 if c.ifNoneMatch_ != "" { 8036 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8037 } 8038 var body io.Reader = nil 8039 c.urlParams_.Set("alt", alt) 8040 c.urlParams_.Set("prettyPrint", "false") 8041 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users") 8042 urls += "?" + c.urlParams_.Encode() 8043 req, err := http.NewRequest("GET", urls, body) 8044 if err != nil { 8045 return nil, err 8046 } 8047 req.Header = reqHeaders 8048 googleapi.Expand(req.URL, map[string]string{ 8049 "enterpriseId": c.enterpriseId, 8050 "groupLicenseId": c.groupLicenseId, 8051 }) 8052 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8053} 8054 8055// Do executes the "androidenterprise.grouplicenseusers.list" call. 8056// Exactly one of *GroupLicenseUsersListResponse or error will be 8057// non-nil. Any non-2xx status code is an error. Response headers are in 8058// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a 8059// response was returned at all) in error.(*googleapi.Error).Header. Use 8060// googleapi.IsNotModified to check whether the returned error was 8061// because http.StatusNotModified was returned. 8062func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) { 8063 gensupport.SetOptions(c.urlParams_, opts...) 8064 res, err := c.doRequest("json") 8065 if res != nil && res.StatusCode == http.StatusNotModified { 8066 if res.Body != nil { 8067 res.Body.Close() 8068 } 8069 return nil, &googleapi.Error{ 8070 Code: res.StatusCode, 8071 Header: res.Header, 8072 } 8073 } 8074 if err != nil { 8075 return nil, err 8076 } 8077 defer googleapi.CloseBody(res) 8078 if err := googleapi.CheckResponse(res); err != nil { 8079 return nil, err 8080 } 8081 ret := &GroupLicenseUsersListResponse{ 8082 ServerResponse: googleapi.ServerResponse{ 8083 Header: res.Header, 8084 HTTPStatusCode: res.StatusCode, 8085 }, 8086 } 8087 target := &ret 8088 if err := gensupport.DecodeResponse(target, res); err != nil { 8089 return nil, err 8090 } 8091 return ret, nil 8092 // { 8093 // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.", 8094 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", 8095 // "httpMethod": "GET", 8096 // "id": "androidenterprise.grouplicenseusers.list", 8097 // "parameterOrder": [ 8098 // "enterpriseId", 8099 // "groupLicenseId" 8100 // ], 8101 // "parameters": { 8102 // "enterpriseId": { 8103 // "description": "The ID of the enterprise.", 8104 // "location": "path", 8105 // "required": true, 8106 // "type": "string" 8107 // }, 8108 // "groupLicenseId": { 8109 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 8110 // "location": "path", 8111 // "required": true, 8112 // "type": "string" 8113 // } 8114 // }, 8115 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", 8116 // "response": { 8117 // "$ref": "GroupLicenseUsersListResponse" 8118 // }, 8119 // "scopes": [ 8120 // "https://www.googleapis.com/auth/androidenterprise" 8121 // ] 8122 // } 8123 8124} 8125 8126// method id "androidenterprise.installs.delete": 8127 8128type InstallsDeleteCall struct { 8129 s *Service 8130 enterpriseId string 8131 userId string 8132 deviceId string 8133 installId string 8134 urlParams_ gensupport.URLParams 8135 ctx_ context.Context 8136 header_ http.Header 8137} 8138 8139// Delete: Requests to remove an app from a device. A call to get or 8140// list will still show the app as installed on the device until it is 8141// actually removed. 8142// 8143// - deviceId: The Android ID of the device. 8144// - enterpriseId: The ID of the enterprise. 8145// - installId: The ID of the product represented by the install, e.g. 8146// "app:com.google.android.gm". 8147// - userId: The ID of the user. 8148func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall { 8149 c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8150 c.enterpriseId = enterpriseId 8151 c.userId = userId 8152 c.deviceId = deviceId 8153 c.installId = installId 8154 return c 8155} 8156 8157// Fields allows partial responses to be retrieved. See 8158// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8159// for more information. 8160func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall { 8161 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8162 return c 8163} 8164 8165// Context sets the context to be used in this call's Do method. Any 8166// pending HTTP request will be aborted if the provided context is 8167// canceled. 8168func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall { 8169 c.ctx_ = ctx 8170 return c 8171} 8172 8173// Header returns an http.Header that can be modified by the caller to 8174// add HTTP headers to the request. 8175func (c *InstallsDeleteCall) Header() http.Header { 8176 if c.header_ == nil { 8177 c.header_ = make(http.Header) 8178 } 8179 return c.header_ 8180} 8181 8182func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) { 8183 reqHeaders := make(http.Header) 8184 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8185 for k, v := range c.header_ { 8186 reqHeaders[k] = v 8187 } 8188 reqHeaders.Set("User-Agent", c.s.userAgent()) 8189 var body io.Reader = nil 8190 c.urlParams_.Set("alt", alt) 8191 c.urlParams_.Set("prettyPrint", "false") 8192 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8193 urls += "?" + c.urlParams_.Encode() 8194 req, err := http.NewRequest("DELETE", urls, body) 8195 if err != nil { 8196 return nil, err 8197 } 8198 req.Header = reqHeaders 8199 googleapi.Expand(req.URL, map[string]string{ 8200 "enterpriseId": c.enterpriseId, 8201 "userId": c.userId, 8202 "deviceId": c.deviceId, 8203 "installId": c.installId, 8204 }) 8205 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8206} 8207 8208// Do executes the "androidenterprise.installs.delete" call. 8209func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error { 8210 gensupport.SetOptions(c.urlParams_, opts...) 8211 res, err := c.doRequest("json") 8212 if err != nil { 8213 return err 8214 } 8215 defer googleapi.CloseBody(res) 8216 if err := googleapi.CheckResponse(res); err != nil { 8217 return err 8218 } 8219 return nil 8220 // { 8221 // "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.", 8222 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8223 // "httpMethod": "DELETE", 8224 // "id": "androidenterprise.installs.delete", 8225 // "parameterOrder": [ 8226 // "enterpriseId", 8227 // "userId", 8228 // "deviceId", 8229 // "installId" 8230 // ], 8231 // "parameters": { 8232 // "deviceId": { 8233 // "description": "The Android ID of the device.", 8234 // "location": "path", 8235 // "required": true, 8236 // "type": "string" 8237 // }, 8238 // "enterpriseId": { 8239 // "description": "The ID of the enterprise.", 8240 // "location": "path", 8241 // "required": true, 8242 // "type": "string" 8243 // }, 8244 // "installId": { 8245 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8246 // "location": "path", 8247 // "required": true, 8248 // "type": "string" 8249 // }, 8250 // "userId": { 8251 // "description": "The ID of the user.", 8252 // "location": "path", 8253 // "required": true, 8254 // "type": "string" 8255 // } 8256 // }, 8257 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8258 // "scopes": [ 8259 // "https://www.googleapis.com/auth/androidenterprise" 8260 // ] 8261 // } 8262 8263} 8264 8265// method id "androidenterprise.installs.get": 8266 8267type InstallsGetCall struct { 8268 s *Service 8269 enterpriseId string 8270 userId string 8271 deviceId string 8272 installId string 8273 urlParams_ gensupport.URLParams 8274 ifNoneMatch_ string 8275 ctx_ context.Context 8276 header_ http.Header 8277} 8278 8279// Get: Retrieves details of an installation of an app on a device. 8280// 8281// - deviceId: The Android ID of the device. 8282// - enterpriseId: The ID of the enterprise. 8283// - installId: The ID of the product represented by the install, e.g. 8284// "app:com.google.android.gm". 8285// - userId: The ID of the user. 8286func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall { 8287 c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8288 c.enterpriseId = enterpriseId 8289 c.userId = userId 8290 c.deviceId = deviceId 8291 c.installId = installId 8292 return c 8293} 8294 8295// Fields allows partial responses to be retrieved. See 8296// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8297// for more information. 8298func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall { 8299 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8300 return c 8301} 8302 8303// IfNoneMatch sets the optional parameter which makes the operation 8304// fail if the object's ETag matches the given value. This is useful for 8305// getting updates only after the object has changed since the last 8306// request. Use googleapi.IsNotModified to check whether the response 8307// error from Do is the result of In-None-Match. 8308func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall { 8309 c.ifNoneMatch_ = entityTag 8310 return c 8311} 8312 8313// Context sets the context to be used in this call's Do method. Any 8314// pending HTTP request will be aborted if the provided context is 8315// canceled. 8316func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall { 8317 c.ctx_ = ctx 8318 return c 8319} 8320 8321// Header returns an http.Header that can be modified by the caller to 8322// add HTTP headers to the request. 8323func (c *InstallsGetCall) Header() http.Header { 8324 if c.header_ == nil { 8325 c.header_ = make(http.Header) 8326 } 8327 return c.header_ 8328} 8329 8330func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) { 8331 reqHeaders := make(http.Header) 8332 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8333 for k, v := range c.header_ { 8334 reqHeaders[k] = v 8335 } 8336 reqHeaders.Set("User-Agent", c.s.userAgent()) 8337 if c.ifNoneMatch_ != "" { 8338 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8339 } 8340 var body io.Reader = nil 8341 c.urlParams_.Set("alt", alt) 8342 c.urlParams_.Set("prettyPrint", "false") 8343 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8344 urls += "?" + c.urlParams_.Encode() 8345 req, err := http.NewRequest("GET", urls, body) 8346 if err != nil { 8347 return nil, err 8348 } 8349 req.Header = reqHeaders 8350 googleapi.Expand(req.URL, map[string]string{ 8351 "enterpriseId": c.enterpriseId, 8352 "userId": c.userId, 8353 "deviceId": c.deviceId, 8354 "installId": c.installId, 8355 }) 8356 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8357} 8358 8359// Do executes the "androidenterprise.installs.get" call. 8360// Exactly one of *Install or error will be non-nil. Any non-2xx status 8361// code is an error. Response headers are in either 8362// *Install.ServerResponse.Header or (if a response was returned at all) 8363// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8364// check whether the returned error was because http.StatusNotModified 8365// was returned. 8366func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8367 gensupport.SetOptions(c.urlParams_, opts...) 8368 res, err := c.doRequest("json") 8369 if res != nil && res.StatusCode == http.StatusNotModified { 8370 if res.Body != nil { 8371 res.Body.Close() 8372 } 8373 return nil, &googleapi.Error{ 8374 Code: res.StatusCode, 8375 Header: res.Header, 8376 } 8377 } 8378 if err != nil { 8379 return nil, err 8380 } 8381 defer googleapi.CloseBody(res) 8382 if err := googleapi.CheckResponse(res); err != nil { 8383 return nil, err 8384 } 8385 ret := &Install{ 8386 ServerResponse: googleapi.ServerResponse{ 8387 Header: res.Header, 8388 HTTPStatusCode: res.StatusCode, 8389 }, 8390 } 8391 target := &ret 8392 if err := gensupport.DecodeResponse(target, res); err != nil { 8393 return nil, err 8394 } 8395 return ret, nil 8396 // { 8397 // "description": "Retrieves details of an installation of an app on a device.", 8398 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8399 // "httpMethod": "GET", 8400 // "id": "androidenterprise.installs.get", 8401 // "parameterOrder": [ 8402 // "enterpriseId", 8403 // "userId", 8404 // "deviceId", 8405 // "installId" 8406 // ], 8407 // "parameters": { 8408 // "deviceId": { 8409 // "description": "The Android ID of the device.", 8410 // "location": "path", 8411 // "required": true, 8412 // "type": "string" 8413 // }, 8414 // "enterpriseId": { 8415 // "description": "The ID of the enterprise.", 8416 // "location": "path", 8417 // "required": true, 8418 // "type": "string" 8419 // }, 8420 // "installId": { 8421 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8422 // "location": "path", 8423 // "required": true, 8424 // "type": "string" 8425 // }, 8426 // "userId": { 8427 // "description": "The ID of the user.", 8428 // "location": "path", 8429 // "required": true, 8430 // "type": "string" 8431 // } 8432 // }, 8433 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8434 // "response": { 8435 // "$ref": "Install" 8436 // }, 8437 // "scopes": [ 8438 // "https://www.googleapis.com/auth/androidenterprise" 8439 // ] 8440 // } 8441 8442} 8443 8444// method id "androidenterprise.installs.list": 8445 8446type InstallsListCall struct { 8447 s *Service 8448 enterpriseId string 8449 userId string 8450 deviceId string 8451 urlParams_ gensupport.URLParams 8452 ifNoneMatch_ string 8453 ctx_ context.Context 8454 header_ http.Header 8455} 8456 8457// List: Retrieves the details of all apps installed on the specified 8458// device. 8459// 8460// - deviceId: The Android ID of the device. 8461// - enterpriseId: The ID of the enterprise. 8462// - userId: The ID of the user. 8463func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall { 8464 c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8465 c.enterpriseId = enterpriseId 8466 c.userId = userId 8467 c.deviceId = deviceId 8468 return c 8469} 8470 8471// Fields allows partial responses to be retrieved. See 8472// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8473// for more information. 8474func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall { 8475 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8476 return c 8477} 8478 8479// IfNoneMatch sets the optional parameter which makes the operation 8480// fail if the object's ETag matches the given value. This is useful for 8481// getting updates only after the object has changed since the last 8482// request. Use googleapi.IsNotModified to check whether the response 8483// error from Do is the result of In-None-Match. 8484func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall { 8485 c.ifNoneMatch_ = entityTag 8486 return c 8487} 8488 8489// Context sets the context to be used in this call's Do method. Any 8490// pending HTTP request will be aborted if the provided context is 8491// canceled. 8492func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall { 8493 c.ctx_ = ctx 8494 return c 8495} 8496 8497// Header returns an http.Header that can be modified by the caller to 8498// add HTTP headers to the request. 8499func (c *InstallsListCall) Header() http.Header { 8500 if c.header_ == nil { 8501 c.header_ = make(http.Header) 8502 } 8503 return c.header_ 8504} 8505 8506func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) { 8507 reqHeaders := make(http.Header) 8508 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8509 for k, v := range c.header_ { 8510 reqHeaders[k] = v 8511 } 8512 reqHeaders.Set("User-Agent", c.s.userAgent()) 8513 if c.ifNoneMatch_ != "" { 8514 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8515 } 8516 var body io.Reader = nil 8517 c.urlParams_.Set("alt", alt) 8518 c.urlParams_.Set("prettyPrint", "false") 8519 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs") 8520 urls += "?" + c.urlParams_.Encode() 8521 req, err := http.NewRequest("GET", urls, body) 8522 if err != nil { 8523 return nil, err 8524 } 8525 req.Header = reqHeaders 8526 googleapi.Expand(req.URL, map[string]string{ 8527 "enterpriseId": c.enterpriseId, 8528 "userId": c.userId, 8529 "deviceId": c.deviceId, 8530 }) 8531 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8532} 8533 8534// Do executes the "androidenterprise.installs.list" call. 8535// Exactly one of *InstallsListResponse or error will be non-nil. Any 8536// non-2xx status code is an error. Response headers are in either 8537// *InstallsListResponse.ServerResponse.Header or (if a response was 8538// returned at all) in error.(*googleapi.Error).Header. Use 8539// googleapi.IsNotModified to check whether the returned error was 8540// because http.StatusNotModified was returned. 8541func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) { 8542 gensupport.SetOptions(c.urlParams_, opts...) 8543 res, err := c.doRequest("json") 8544 if res != nil && res.StatusCode == http.StatusNotModified { 8545 if res.Body != nil { 8546 res.Body.Close() 8547 } 8548 return nil, &googleapi.Error{ 8549 Code: res.StatusCode, 8550 Header: res.Header, 8551 } 8552 } 8553 if err != nil { 8554 return nil, err 8555 } 8556 defer googleapi.CloseBody(res) 8557 if err := googleapi.CheckResponse(res); err != nil { 8558 return nil, err 8559 } 8560 ret := &InstallsListResponse{ 8561 ServerResponse: googleapi.ServerResponse{ 8562 Header: res.Header, 8563 HTTPStatusCode: res.StatusCode, 8564 }, 8565 } 8566 target := &ret 8567 if err := gensupport.DecodeResponse(target, res); err != nil { 8568 return nil, err 8569 } 8570 return ret, nil 8571 // { 8572 // "description": "Retrieves the details of all apps installed on the specified device.", 8573 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", 8574 // "httpMethod": "GET", 8575 // "id": "androidenterprise.installs.list", 8576 // "parameterOrder": [ 8577 // "enterpriseId", 8578 // "userId", 8579 // "deviceId" 8580 // ], 8581 // "parameters": { 8582 // "deviceId": { 8583 // "description": "The Android ID of the device.", 8584 // "location": "path", 8585 // "required": true, 8586 // "type": "string" 8587 // }, 8588 // "enterpriseId": { 8589 // "description": "The ID of the enterprise.", 8590 // "location": "path", 8591 // "required": true, 8592 // "type": "string" 8593 // }, 8594 // "userId": { 8595 // "description": "The ID of the user.", 8596 // "location": "path", 8597 // "required": true, 8598 // "type": "string" 8599 // } 8600 // }, 8601 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", 8602 // "response": { 8603 // "$ref": "InstallsListResponse" 8604 // }, 8605 // "scopes": [ 8606 // "https://www.googleapis.com/auth/androidenterprise" 8607 // ] 8608 // } 8609 8610} 8611 8612// method id "androidenterprise.installs.update": 8613 8614type InstallsUpdateCall struct { 8615 s *Service 8616 enterpriseId string 8617 userId string 8618 deviceId string 8619 installId string 8620 install *Install 8621 urlParams_ gensupport.URLParams 8622 ctx_ context.Context 8623 header_ http.Header 8624} 8625 8626// Update: Requests to install the latest version of an app to a device. 8627// If the app is already installed, then it is updated to the latest 8628// version if necessary. 8629// 8630// - deviceId: The Android ID of the device. 8631// - enterpriseId: The ID of the enterprise. 8632// - installId: The ID of the product represented by the install, e.g. 8633// "app:com.google.android.gm". 8634// - userId: The ID of the user. 8635func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall { 8636 c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8637 c.enterpriseId = enterpriseId 8638 c.userId = userId 8639 c.deviceId = deviceId 8640 c.installId = installId 8641 c.install = install 8642 return c 8643} 8644 8645// Fields allows partial responses to be retrieved. See 8646// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8647// for more information. 8648func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall { 8649 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8650 return c 8651} 8652 8653// Context sets the context to be used in this call's Do method. Any 8654// pending HTTP request will be aborted if the provided context is 8655// canceled. 8656func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall { 8657 c.ctx_ = ctx 8658 return c 8659} 8660 8661// Header returns an http.Header that can be modified by the caller to 8662// add HTTP headers to the request. 8663func (c *InstallsUpdateCall) Header() http.Header { 8664 if c.header_ == nil { 8665 c.header_ = make(http.Header) 8666 } 8667 return c.header_ 8668} 8669 8670func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) { 8671 reqHeaders := make(http.Header) 8672 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8673 for k, v := range c.header_ { 8674 reqHeaders[k] = v 8675 } 8676 reqHeaders.Set("User-Agent", c.s.userAgent()) 8677 var body io.Reader = nil 8678 body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) 8679 if err != nil { 8680 return nil, err 8681 } 8682 reqHeaders.Set("Content-Type", "application/json") 8683 c.urlParams_.Set("alt", alt) 8684 c.urlParams_.Set("prettyPrint", "false") 8685 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8686 urls += "?" + c.urlParams_.Encode() 8687 req, err := http.NewRequest("PUT", urls, body) 8688 if err != nil { 8689 return nil, err 8690 } 8691 req.Header = reqHeaders 8692 googleapi.Expand(req.URL, map[string]string{ 8693 "enterpriseId": c.enterpriseId, 8694 "userId": c.userId, 8695 "deviceId": c.deviceId, 8696 "installId": c.installId, 8697 }) 8698 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8699} 8700 8701// Do executes the "androidenterprise.installs.update" call. 8702// Exactly one of *Install or error will be non-nil. Any non-2xx status 8703// code is an error. Response headers are in either 8704// *Install.ServerResponse.Header or (if a response was returned at all) 8705// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8706// check whether the returned error was because http.StatusNotModified 8707// was returned. 8708func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8709 gensupport.SetOptions(c.urlParams_, opts...) 8710 res, err := c.doRequest("json") 8711 if res != nil && res.StatusCode == http.StatusNotModified { 8712 if res.Body != nil { 8713 res.Body.Close() 8714 } 8715 return nil, &googleapi.Error{ 8716 Code: res.StatusCode, 8717 Header: res.Header, 8718 } 8719 } 8720 if err != nil { 8721 return nil, err 8722 } 8723 defer googleapi.CloseBody(res) 8724 if err := googleapi.CheckResponse(res); err != nil { 8725 return nil, err 8726 } 8727 ret := &Install{ 8728 ServerResponse: googleapi.ServerResponse{ 8729 Header: res.Header, 8730 HTTPStatusCode: res.StatusCode, 8731 }, 8732 } 8733 target := &ret 8734 if err := gensupport.DecodeResponse(target, res); err != nil { 8735 return nil, err 8736 } 8737 return ret, nil 8738 // { 8739 // "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.", 8740 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8741 // "httpMethod": "PUT", 8742 // "id": "androidenterprise.installs.update", 8743 // "parameterOrder": [ 8744 // "enterpriseId", 8745 // "userId", 8746 // "deviceId", 8747 // "installId" 8748 // ], 8749 // "parameters": { 8750 // "deviceId": { 8751 // "description": "The Android ID of the device.", 8752 // "location": "path", 8753 // "required": true, 8754 // "type": "string" 8755 // }, 8756 // "enterpriseId": { 8757 // "description": "The ID of the enterprise.", 8758 // "location": "path", 8759 // "required": true, 8760 // "type": "string" 8761 // }, 8762 // "installId": { 8763 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8764 // "location": "path", 8765 // "required": true, 8766 // "type": "string" 8767 // }, 8768 // "userId": { 8769 // "description": "The ID of the user.", 8770 // "location": "path", 8771 // "required": true, 8772 // "type": "string" 8773 // } 8774 // }, 8775 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8776 // "request": { 8777 // "$ref": "Install" 8778 // }, 8779 // "response": { 8780 // "$ref": "Install" 8781 // }, 8782 // "scopes": [ 8783 // "https://www.googleapis.com/auth/androidenterprise" 8784 // ] 8785 // } 8786 8787} 8788 8789// method id "androidenterprise.managedconfigurationsfordevice.delete": 8790 8791type ManagedconfigurationsfordeviceDeleteCall struct { 8792 s *Service 8793 enterpriseId string 8794 userId string 8795 deviceId string 8796 managedConfigurationForDeviceId string 8797 urlParams_ gensupport.URLParams 8798 ctx_ context.Context 8799 header_ http.Header 8800} 8801 8802// Delete: Removes a per-device managed configuration for an app for the 8803// specified device. 8804// 8805// - deviceId: The Android ID of the device. 8806// - enterpriseId: The ID of the enterprise. 8807// - managedConfigurationForDeviceId: The ID of the managed 8808// configuration (a product ID), e.g. "app:com.google.android.gm". 8809// - userId: The ID of the user. 8810func (r *ManagedconfigurationsfordeviceService) Delete(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceDeleteCall { 8811 c := &ManagedconfigurationsfordeviceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8812 c.enterpriseId = enterpriseId 8813 c.userId = userId 8814 c.deviceId = deviceId 8815 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8816 return c 8817} 8818 8819// Fields allows partial responses to be retrieved. See 8820// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8821// for more information. 8822func (c *ManagedconfigurationsfordeviceDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceDeleteCall { 8823 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8824 return c 8825} 8826 8827// Context sets the context to be used in this call's Do method. Any 8828// pending HTTP request will be aborted if the provided context is 8829// canceled. 8830func (c *ManagedconfigurationsfordeviceDeleteCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceDeleteCall { 8831 c.ctx_ = ctx 8832 return c 8833} 8834 8835// Header returns an http.Header that can be modified by the caller to 8836// add HTTP headers to the request. 8837func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header { 8838 if c.header_ == nil { 8839 c.header_ = make(http.Header) 8840 } 8841 return c.header_ 8842} 8843 8844func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) { 8845 reqHeaders := make(http.Header) 8846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8847 for k, v := range c.header_ { 8848 reqHeaders[k] = v 8849 } 8850 reqHeaders.Set("User-Agent", c.s.userAgent()) 8851 var body io.Reader = nil 8852 c.urlParams_.Set("alt", alt) 8853 c.urlParams_.Set("prettyPrint", "false") 8854 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 8855 urls += "?" + c.urlParams_.Encode() 8856 req, err := http.NewRequest("DELETE", urls, body) 8857 if err != nil { 8858 return nil, err 8859 } 8860 req.Header = reqHeaders 8861 googleapi.Expand(req.URL, map[string]string{ 8862 "enterpriseId": c.enterpriseId, 8863 "userId": c.userId, 8864 "deviceId": c.deviceId, 8865 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 8866 }) 8867 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8868} 8869 8870// Do executes the "androidenterprise.managedconfigurationsfordevice.delete" call. 8871func (c *ManagedconfigurationsfordeviceDeleteCall) Do(opts ...googleapi.CallOption) error { 8872 gensupport.SetOptions(c.urlParams_, opts...) 8873 res, err := c.doRequest("json") 8874 if err != nil { 8875 return err 8876 } 8877 defer googleapi.CloseBody(res) 8878 if err := googleapi.CheckResponse(res); err != nil { 8879 return err 8880 } 8881 return nil 8882 // { 8883 // "description": "Removes a per-device managed configuration for an app for the specified device.", 8884 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8885 // "httpMethod": "DELETE", 8886 // "id": "androidenterprise.managedconfigurationsfordevice.delete", 8887 // "parameterOrder": [ 8888 // "enterpriseId", 8889 // "userId", 8890 // "deviceId", 8891 // "managedConfigurationForDeviceId" 8892 // ], 8893 // "parameters": { 8894 // "deviceId": { 8895 // "description": "The Android ID of the device.", 8896 // "location": "path", 8897 // "required": true, 8898 // "type": "string" 8899 // }, 8900 // "enterpriseId": { 8901 // "description": "The ID of the enterprise.", 8902 // "location": "path", 8903 // "required": true, 8904 // "type": "string" 8905 // }, 8906 // "managedConfigurationForDeviceId": { 8907 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 8908 // "location": "path", 8909 // "required": true, 8910 // "type": "string" 8911 // }, 8912 // "userId": { 8913 // "description": "The ID of the user.", 8914 // "location": "path", 8915 // "required": true, 8916 // "type": "string" 8917 // } 8918 // }, 8919 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8920 // "scopes": [ 8921 // "https://www.googleapis.com/auth/androidenterprise" 8922 // ] 8923 // } 8924 8925} 8926 8927// method id "androidenterprise.managedconfigurationsfordevice.get": 8928 8929type ManagedconfigurationsfordeviceGetCall struct { 8930 s *Service 8931 enterpriseId string 8932 userId string 8933 deviceId string 8934 managedConfigurationForDeviceId string 8935 urlParams_ gensupport.URLParams 8936 ifNoneMatch_ string 8937 ctx_ context.Context 8938 header_ http.Header 8939} 8940 8941// Get: Retrieves details of a per-device managed configuration. 8942// 8943// - deviceId: The Android ID of the device. 8944// - enterpriseId: The ID of the enterprise. 8945// - managedConfigurationForDeviceId: The ID of the managed 8946// configuration (a product ID), e.g. "app:com.google.android.gm". 8947// - userId: The ID of the user. 8948func (r *ManagedconfigurationsfordeviceService) Get(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceGetCall { 8949 c := &ManagedconfigurationsfordeviceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8950 c.enterpriseId = enterpriseId 8951 c.userId = userId 8952 c.deviceId = deviceId 8953 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8954 return c 8955} 8956 8957// Fields allows partial responses to be retrieved. See 8958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8959// for more information. 8960func (c *ManagedconfigurationsfordeviceGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceGetCall { 8961 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8962 return c 8963} 8964 8965// IfNoneMatch sets the optional parameter which makes the operation 8966// fail if the object's ETag matches the given value. This is useful for 8967// getting updates only after the object has changed since the last 8968// request. Use googleapi.IsNotModified to check whether the response 8969// error from Do is the result of In-None-Match. 8970func (c *ManagedconfigurationsfordeviceGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceGetCall { 8971 c.ifNoneMatch_ = entityTag 8972 return c 8973} 8974 8975// Context sets the context to be used in this call's Do method. Any 8976// pending HTTP request will be aborted if the provided context is 8977// canceled. 8978func (c *ManagedconfigurationsfordeviceGetCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceGetCall { 8979 c.ctx_ = ctx 8980 return c 8981} 8982 8983// Header returns an http.Header that can be modified by the caller to 8984// add HTTP headers to the request. 8985func (c *ManagedconfigurationsfordeviceGetCall) Header() http.Header { 8986 if c.header_ == nil { 8987 c.header_ = make(http.Header) 8988 } 8989 return c.header_ 8990} 8991 8992func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Response, error) { 8993 reqHeaders := make(http.Header) 8994 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8995 for k, v := range c.header_ { 8996 reqHeaders[k] = v 8997 } 8998 reqHeaders.Set("User-Agent", c.s.userAgent()) 8999 if c.ifNoneMatch_ != "" { 9000 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9001 } 9002 var body io.Reader = nil 9003 c.urlParams_.Set("alt", alt) 9004 c.urlParams_.Set("prettyPrint", "false") 9005 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 9006 urls += "?" + c.urlParams_.Encode() 9007 req, err := http.NewRequest("GET", urls, body) 9008 if err != nil { 9009 return nil, err 9010 } 9011 req.Header = reqHeaders 9012 googleapi.Expand(req.URL, map[string]string{ 9013 "enterpriseId": c.enterpriseId, 9014 "userId": c.userId, 9015 "deviceId": c.deviceId, 9016 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 9017 }) 9018 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9019} 9020 9021// Do executes the "androidenterprise.managedconfigurationsfordevice.get" call. 9022// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9023// non-2xx status code is an error. Response headers are in either 9024// *ManagedConfiguration.ServerResponse.Header or (if a response was 9025// returned at all) in error.(*googleapi.Error).Header. Use 9026// googleapi.IsNotModified to check whether the returned error was 9027// because http.StatusNotModified was returned. 9028func (c *ManagedconfigurationsfordeviceGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9029 gensupport.SetOptions(c.urlParams_, opts...) 9030 res, err := c.doRequest("json") 9031 if res != nil && res.StatusCode == http.StatusNotModified { 9032 if res.Body != nil { 9033 res.Body.Close() 9034 } 9035 return nil, &googleapi.Error{ 9036 Code: res.StatusCode, 9037 Header: res.Header, 9038 } 9039 } 9040 if err != nil { 9041 return nil, err 9042 } 9043 defer googleapi.CloseBody(res) 9044 if err := googleapi.CheckResponse(res); err != nil { 9045 return nil, err 9046 } 9047 ret := &ManagedConfiguration{ 9048 ServerResponse: googleapi.ServerResponse{ 9049 Header: res.Header, 9050 HTTPStatusCode: res.StatusCode, 9051 }, 9052 } 9053 target := &ret 9054 if err := gensupport.DecodeResponse(target, res); err != nil { 9055 return nil, err 9056 } 9057 return ret, nil 9058 // { 9059 // "description": "Retrieves details of a per-device managed configuration.", 9060 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9061 // "httpMethod": "GET", 9062 // "id": "androidenterprise.managedconfigurationsfordevice.get", 9063 // "parameterOrder": [ 9064 // "enterpriseId", 9065 // "userId", 9066 // "deviceId", 9067 // "managedConfigurationForDeviceId" 9068 // ], 9069 // "parameters": { 9070 // "deviceId": { 9071 // "description": "The Android ID of the device.", 9072 // "location": "path", 9073 // "required": true, 9074 // "type": "string" 9075 // }, 9076 // "enterpriseId": { 9077 // "description": "The ID of the enterprise.", 9078 // "location": "path", 9079 // "required": true, 9080 // "type": "string" 9081 // }, 9082 // "managedConfigurationForDeviceId": { 9083 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9084 // "location": "path", 9085 // "required": true, 9086 // "type": "string" 9087 // }, 9088 // "userId": { 9089 // "description": "The ID of the user.", 9090 // "location": "path", 9091 // "required": true, 9092 // "type": "string" 9093 // } 9094 // }, 9095 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9096 // "response": { 9097 // "$ref": "ManagedConfiguration" 9098 // }, 9099 // "scopes": [ 9100 // "https://www.googleapis.com/auth/androidenterprise" 9101 // ] 9102 // } 9103 9104} 9105 9106// method id "androidenterprise.managedconfigurationsfordevice.list": 9107 9108type ManagedconfigurationsfordeviceListCall struct { 9109 s *Service 9110 enterpriseId string 9111 userId string 9112 deviceId string 9113 urlParams_ gensupport.URLParams 9114 ifNoneMatch_ string 9115 ctx_ context.Context 9116 header_ http.Header 9117} 9118 9119// List: Lists all the per-device managed configurations for the 9120// specified device. Only the ID is set. 9121// 9122// - deviceId: The Android ID of the device. 9123// - enterpriseId: The ID of the enterprise. 9124// - userId: The ID of the user. 9125func (r *ManagedconfigurationsfordeviceService) List(enterpriseId string, userId string, deviceId string) *ManagedconfigurationsfordeviceListCall { 9126 c := &ManagedconfigurationsfordeviceListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9127 c.enterpriseId = enterpriseId 9128 c.userId = userId 9129 c.deviceId = deviceId 9130 return c 9131} 9132 9133// Fields allows partial responses to be retrieved. See 9134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9135// for more information. 9136func (c *ManagedconfigurationsfordeviceListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceListCall { 9137 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9138 return c 9139} 9140 9141// IfNoneMatch sets the optional parameter which makes the operation 9142// fail if the object's ETag matches the given value. This is useful for 9143// getting updates only after the object has changed since the last 9144// request. Use googleapi.IsNotModified to check whether the response 9145// error from Do is the result of In-None-Match. 9146func (c *ManagedconfigurationsfordeviceListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceListCall { 9147 c.ifNoneMatch_ = entityTag 9148 return c 9149} 9150 9151// Context sets the context to be used in this call's Do method. Any 9152// pending HTTP request will be aborted if the provided context is 9153// canceled. 9154func (c *ManagedconfigurationsfordeviceListCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceListCall { 9155 c.ctx_ = ctx 9156 return c 9157} 9158 9159// Header returns an http.Header that can be modified by the caller to 9160// add HTTP headers to the request. 9161func (c *ManagedconfigurationsfordeviceListCall) Header() http.Header { 9162 if c.header_ == nil { 9163 c.header_ = make(http.Header) 9164 } 9165 return c.header_ 9166} 9167 9168func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Response, error) { 9169 reqHeaders := make(http.Header) 9170 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9171 for k, v := range c.header_ { 9172 reqHeaders[k] = v 9173 } 9174 reqHeaders.Set("User-Agent", c.s.userAgent()) 9175 if c.ifNoneMatch_ != "" { 9176 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9177 } 9178 var body io.Reader = nil 9179 c.urlParams_.Set("alt", alt) 9180 c.urlParams_.Set("prettyPrint", "false") 9181 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice") 9182 urls += "?" + c.urlParams_.Encode() 9183 req, err := http.NewRequest("GET", urls, body) 9184 if err != nil { 9185 return nil, err 9186 } 9187 req.Header = reqHeaders 9188 googleapi.Expand(req.URL, map[string]string{ 9189 "enterpriseId": c.enterpriseId, 9190 "userId": c.userId, 9191 "deviceId": c.deviceId, 9192 }) 9193 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9194} 9195 9196// Do executes the "androidenterprise.managedconfigurationsfordevice.list" call. 9197// Exactly one of *ManagedConfigurationsForDeviceListResponse or error 9198// will be non-nil. Any non-2xx status code is an error. Response 9199// headers are in either 9200// *ManagedConfigurationsForDeviceListResponse.ServerResponse.Header or 9201// (if a response was returned at all) in 9202// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9203// whether the returned error was because http.StatusNotModified was 9204// returned. 9205func (c *ManagedconfigurationsfordeviceListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForDeviceListResponse, error) { 9206 gensupport.SetOptions(c.urlParams_, opts...) 9207 res, err := c.doRequest("json") 9208 if res != nil && res.StatusCode == http.StatusNotModified { 9209 if res.Body != nil { 9210 res.Body.Close() 9211 } 9212 return nil, &googleapi.Error{ 9213 Code: res.StatusCode, 9214 Header: res.Header, 9215 } 9216 } 9217 if err != nil { 9218 return nil, err 9219 } 9220 defer googleapi.CloseBody(res) 9221 if err := googleapi.CheckResponse(res); err != nil { 9222 return nil, err 9223 } 9224 ret := &ManagedConfigurationsForDeviceListResponse{ 9225 ServerResponse: googleapi.ServerResponse{ 9226 Header: res.Header, 9227 HTTPStatusCode: res.StatusCode, 9228 }, 9229 } 9230 target := &ret 9231 if err := gensupport.DecodeResponse(target, res); err != nil { 9232 return nil, err 9233 } 9234 return ret, nil 9235 // { 9236 // "description": "Lists all the per-device managed configurations for the specified device. Only the ID is set.", 9237 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice", 9238 // "httpMethod": "GET", 9239 // "id": "androidenterprise.managedconfigurationsfordevice.list", 9240 // "parameterOrder": [ 9241 // "enterpriseId", 9242 // "userId", 9243 // "deviceId" 9244 // ], 9245 // "parameters": { 9246 // "deviceId": { 9247 // "description": "The Android ID of the device.", 9248 // "location": "path", 9249 // "required": true, 9250 // "type": "string" 9251 // }, 9252 // "enterpriseId": { 9253 // "description": "The ID of the enterprise.", 9254 // "location": "path", 9255 // "required": true, 9256 // "type": "string" 9257 // }, 9258 // "userId": { 9259 // "description": "The ID of the user.", 9260 // "location": "path", 9261 // "required": true, 9262 // "type": "string" 9263 // } 9264 // }, 9265 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice", 9266 // "response": { 9267 // "$ref": "ManagedConfigurationsForDeviceListResponse" 9268 // }, 9269 // "scopes": [ 9270 // "https://www.googleapis.com/auth/androidenterprise" 9271 // ] 9272 // } 9273 9274} 9275 9276// method id "androidenterprise.managedconfigurationsfordevice.update": 9277 9278type ManagedconfigurationsfordeviceUpdateCall struct { 9279 s *Service 9280 enterpriseId string 9281 userId string 9282 deviceId string 9283 managedConfigurationForDeviceId string 9284 managedconfiguration *ManagedConfiguration 9285 urlParams_ gensupport.URLParams 9286 ctx_ context.Context 9287 header_ http.Header 9288} 9289 9290// Update: Adds or updates a per-device managed configuration for an app 9291// for the specified device. 9292// 9293// - deviceId: The Android ID of the device. 9294// - enterpriseId: The ID of the enterprise. 9295// - managedConfigurationForDeviceId: The ID of the managed 9296// configuration (a product ID), e.g. "app:com.google.android.gm". 9297// - userId: The ID of the user. 9298func (r *ManagedconfigurationsfordeviceService) Update(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordeviceUpdateCall { 9299 c := &ManagedconfigurationsfordeviceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9300 c.enterpriseId = enterpriseId 9301 c.userId = userId 9302 c.deviceId = deviceId 9303 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 9304 c.managedconfiguration = managedconfiguration 9305 return c 9306} 9307 9308// Fields allows partial responses to be retrieved. See 9309// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9310// for more information. 9311func (c *ManagedconfigurationsfordeviceUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceUpdateCall { 9312 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9313 return c 9314} 9315 9316// Context sets the context to be used in this call's Do method. Any 9317// pending HTTP request will be aborted if the provided context is 9318// canceled. 9319func (c *ManagedconfigurationsfordeviceUpdateCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceUpdateCall { 9320 c.ctx_ = ctx 9321 return c 9322} 9323 9324// Header returns an http.Header that can be modified by the caller to 9325// add HTTP headers to the request. 9326func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header { 9327 if c.header_ == nil { 9328 c.header_ = make(http.Header) 9329 } 9330 return c.header_ 9331} 9332 9333func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) { 9334 reqHeaders := make(http.Header) 9335 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9336 for k, v := range c.header_ { 9337 reqHeaders[k] = v 9338 } 9339 reqHeaders.Set("User-Agent", c.s.userAgent()) 9340 var body io.Reader = nil 9341 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9342 if err != nil { 9343 return nil, err 9344 } 9345 reqHeaders.Set("Content-Type", "application/json") 9346 c.urlParams_.Set("alt", alt) 9347 c.urlParams_.Set("prettyPrint", "false") 9348 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 9349 urls += "?" + c.urlParams_.Encode() 9350 req, err := http.NewRequest("PUT", urls, body) 9351 if err != nil { 9352 return nil, err 9353 } 9354 req.Header = reqHeaders 9355 googleapi.Expand(req.URL, map[string]string{ 9356 "enterpriseId": c.enterpriseId, 9357 "userId": c.userId, 9358 "deviceId": c.deviceId, 9359 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 9360 }) 9361 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9362} 9363 9364// Do executes the "androidenterprise.managedconfigurationsfordevice.update" call. 9365// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9366// non-2xx status code is an error. Response headers are in either 9367// *ManagedConfiguration.ServerResponse.Header or (if a response was 9368// returned at all) in error.(*googleapi.Error).Header. Use 9369// googleapi.IsNotModified to check whether the returned error was 9370// because http.StatusNotModified was returned. 9371func (c *ManagedconfigurationsfordeviceUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9372 gensupport.SetOptions(c.urlParams_, opts...) 9373 res, err := c.doRequest("json") 9374 if res != nil && res.StatusCode == http.StatusNotModified { 9375 if res.Body != nil { 9376 res.Body.Close() 9377 } 9378 return nil, &googleapi.Error{ 9379 Code: res.StatusCode, 9380 Header: res.Header, 9381 } 9382 } 9383 if err != nil { 9384 return nil, err 9385 } 9386 defer googleapi.CloseBody(res) 9387 if err := googleapi.CheckResponse(res); err != nil { 9388 return nil, err 9389 } 9390 ret := &ManagedConfiguration{ 9391 ServerResponse: googleapi.ServerResponse{ 9392 Header: res.Header, 9393 HTTPStatusCode: res.StatusCode, 9394 }, 9395 } 9396 target := &ret 9397 if err := gensupport.DecodeResponse(target, res); err != nil { 9398 return nil, err 9399 } 9400 return ret, nil 9401 // { 9402 // "description": "Adds or updates a per-device managed configuration for an app for the specified device.", 9403 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9404 // "httpMethod": "PUT", 9405 // "id": "androidenterprise.managedconfigurationsfordevice.update", 9406 // "parameterOrder": [ 9407 // "enterpriseId", 9408 // "userId", 9409 // "deviceId", 9410 // "managedConfigurationForDeviceId" 9411 // ], 9412 // "parameters": { 9413 // "deviceId": { 9414 // "description": "The Android ID of the device.", 9415 // "location": "path", 9416 // "required": true, 9417 // "type": "string" 9418 // }, 9419 // "enterpriseId": { 9420 // "description": "The ID of the enterprise.", 9421 // "location": "path", 9422 // "required": true, 9423 // "type": "string" 9424 // }, 9425 // "managedConfigurationForDeviceId": { 9426 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9427 // "location": "path", 9428 // "required": true, 9429 // "type": "string" 9430 // }, 9431 // "userId": { 9432 // "description": "The ID of the user.", 9433 // "location": "path", 9434 // "required": true, 9435 // "type": "string" 9436 // } 9437 // }, 9438 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9439 // "request": { 9440 // "$ref": "ManagedConfiguration" 9441 // }, 9442 // "response": { 9443 // "$ref": "ManagedConfiguration" 9444 // }, 9445 // "scopes": [ 9446 // "https://www.googleapis.com/auth/androidenterprise" 9447 // ] 9448 // } 9449 9450} 9451 9452// method id "androidenterprise.managedconfigurationsforuser.delete": 9453 9454type ManagedconfigurationsforuserDeleteCall struct { 9455 s *Service 9456 enterpriseId string 9457 userId string 9458 managedConfigurationForUserId string 9459 urlParams_ gensupport.URLParams 9460 ctx_ context.Context 9461 header_ http.Header 9462} 9463 9464// Delete: Removes a per-user managed configuration for an app for the 9465// specified user. 9466// 9467// - enterpriseId: The ID of the enterprise. 9468// - managedConfigurationForUserId: The ID of the managed configuration 9469// (a product ID), e.g. "app:com.google.android.gm". 9470// - userId: The ID of the user. 9471func (r *ManagedconfigurationsforuserService) Delete(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserDeleteCall { 9472 c := &ManagedconfigurationsforuserDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9473 c.enterpriseId = enterpriseId 9474 c.userId = userId 9475 c.managedConfigurationForUserId = managedConfigurationForUserId 9476 return c 9477} 9478 9479// Fields allows partial responses to be retrieved. See 9480// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9481// for more information. 9482func (c *ManagedconfigurationsforuserDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserDeleteCall { 9483 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9484 return c 9485} 9486 9487// Context sets the context to be used in this call's Do method. Any 9488// pending HTTP request will be aborted if the provided context is 9489// canceled. 9490func (c *ManagedconfigurationsforuserDeleteCall) Context(ctx context.Context) *ManagedconfigurationsforuserDeleteCall { 9491 c.ctx_ = ctx 9492 return c 9493} 9494 9495// Header returns an http.Header that can be modified by the caller to 9496// add HTTP headers to the request. 9497func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header { 9498 if c.header_ == nil { 9499 c.header_ = make(http.Header) 9500 } 9501 return c.header_ 9502} 9503 9504func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) { 9505 reqHeaders := make(http.Header) 9506 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9507 for k, v := range c.header_ { 9508 reqHeaders[k] = v 9509 } 9510 reqHeaders.Set("User-Agent", c.s.userAgent()) 9511 var body io.Reader = nil 9512 c.urlParams_.Set("alt", alt) 9513 c.urlParams_.Set("prettyPrint", "false") 9514 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9515 urls += "?" + c.urlParams_.Encode() 9516 req, err := http.NewRequest("DELETE", urls, body) 9517 if err != nil { 9518 return nil, err 9519 } 9520 req.Header = reqHeaders 9521 googleapi.Expand(req.URL, map[string]string{ 9522 "enterpriseId": c.enterpriseId, 9523 "userId": c.userId, 9524 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9525 }) 9526 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9527} 9528 9529// Do executes the "androidenterprise.managedconfigurationsforuser.delete" call. 9530func (c *ManagedconfigurationsforuserDeleteCall) Do(opts ...googleapi.CallOption) error { 9531 gensupport.SetOptions(c.urlParams_, opts...) 9532 res, err := c.doRequest("json") 9533 if err != nil { 9534 return err 9535 } 9536 defer googleapi.CloseBody(res) 9537 if err := googleapi.CheckResponse(res); err != nil { 9538 return err 9539 } 9540 return nil 9541 // { 9542 // "description": "Removes a per-user managed configuration for an app for the specified user.", 9543 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9544 // "httpMethod": "DELETE", 9545 // "id": "androidenterprise.managedconfigurationsforuser.delete", 9546 // "parameterOrder": [ 9547 // "enterpriseId", 9548 // "userId", 9549 // "managedConfigurationForUserId" 9550 // ], 9551 // "parameters": { 9552 // "enterpriseId": { 9553 // "description": "The ID of the enterprise.", 9554 // "location": "path", 9555 // "required": true, 9556 // "type": "string" 9557 // }, 9558 // "managedConfigurationForUserId": { 9559 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9560 // "location": "path", 9561 // "required": true, 9562 // "type": "string" 9563 // }, 9564 // "userId": { 9565 // "description": "The ID of the user.", 9566 // "location": "path", 9567 // "required": true, 9568 // "type": "string" 9569 // } 9570 // }, 9571 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9572 // "scopes": [ 9573 // "https://www.googleapis.com/auth/androidenterprise" 9574 // ] 9575 // } 9576 9577} 9578 9579// method id "androidenterprise.managedconfigurationsforuser.get": 9580 9581type ManagedconfigurationsforuserGetCall struct { 9582 s *Service 9583 enterpriseId string 9584 userId string 9585 managedConfigurationForUserId string 9586 urlParams_ gensupport.URLParams 9587 ifNoneMatch_ string 9588 ctx_ context.Context 9589 header_ http.Header 9590} 9591 9592// Get: Retrieves details of a per-user managed configuration for an app 9593// for the specified user. 9594// 9595// - enterpriseId: The ID of the enterprise. 9596// - managedConfigurationForUserId: The ID of the managed configuration 9597// (a product ID), e.g. "app:com.google.android.gm". 9598// - userId: The ID of the user. 9599func (r *ManagedconfigurationsforuserService) Get(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserGetCall { 9600 c := &ManagedconfigurationsforuserGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9601 c.enterpriseId = enterpriseId 9602 c.userId = userId 9603 c.managedConfigurationForUserId = managedConfigurationForUserId 9604 return c 9605} 9606 9607// Fields allows partial responses to be retrieved. See 9608// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9609// for more information. 9610func (c *ManagedconfigurationsforuserGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserGetCall { 9611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9612 return c 9613} 9614 9615// IfNoneMatch sets the optional parameter which makes the operation 9616// fail if the object's ETag matches the given value. This is useful for 9617// getting updates only after the object has changed since the last 9618// request. Use googleapi.IsNotModified to check whether the response 9619// error from Do is the result of In-None-Match. 9620func (c *ManagedconfigurationsforuserGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserGetCall { 9621 c.ifNoneMatch_ = entityTag 9622 return c 9623} 9624 9625// Context sets the context to be used in this call's Do method. Any 9626// pending HTTP request will be aborted if the provided context is 9627// canceled. 9628func (c *ManagedconfigurationsforuserGetCall) Context(ctx context.Context) *ManagedconfigurationsforuserGetCall { 9629 c.ctx_ = ctx 9630 return c 9631} 9632 9633// Header returns an http.Header that can be modified by the caller to 9634// add HTTP headers to the request. 9635func (c *ManagedconfigurationsforuserGetCall) Header() http.Header { 9636 if c.header_ == nil { 9637 c.header_ = make(http.Header) 9638 } 9639 return c.header_ 9640} 9641 9642func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Response, error) { 9643 reqHeaders := make(http.Header) 9644 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9645 for k, v := range c.header_ { 9646 reqHeaders[k] = v 9647 } 9648 reqHeaders.Set("User-Agent", c.s.userAgent()) 9649 if c.ifNoneMatch_ != "" { 9650 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9651 } 9652 var body io.Reader = nil 9653 c.urlParams_.Set("alt", alt) 9654 c.urlParams_.Set("prettyPrint", "false") 9655 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9656 urls += "?" + c.urlParams_.Encode() 9657 req, err := http.NewRequest("GET", urls, body) 9658 if err != nil { 9659 return nil, err 9660 } 9661 req.Header = reqHeaders 9662 googleapi.Expand(req.URL, map[string]string{ 9663 "enterpriseId": c.enterpriseId, 9664 "userId": c.userId, 9665 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9666 }) 9667 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9668} 9669 9670// Do executes the "androidenterprise.managedconfigurationsforuser.get" call. 9671// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9672// non-2xx status code is an error. Response headers are in either 9673// *ManagedConfiguration.ServerResponse.Header or (if a response was 9674// returned at all) in error.(*googleapi.Error).Header. Use 9675// googleapi.IsNotModified to check whether the returned error was 9676// because http.StatusNotModified was returned. 9677func (c *ManagedconfigurationsforuserGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9678 gensupport.SetOptions(c.urlParams_, opts...) 9679 res, err := c.doRequest("json") 9680 if res != nil && res.StatusCode == http.StatusNotModified { 9681 if res.Body != nil { 9682 res.Body.Close() 9683 } 9684 return nil, &googleapi.Error{ 9685 Code: res.StatusCode, 9686 Header: res.Header, 9687 } 9688 } 9689 if err != nil { 9690 return nil, err 9691 } 9692 defer googleapi.CloseBody(res) 9693 if err := googleapi.CheckResponse(res); err != nil { 9694 return nil, err 9695 } 9696 ret := &ManagedConfiguration{ 9697 ServerResponse: googleapi.ServerResponse{ 9698 Header: res.Header, 9699 HTTPStatusCode: res.StatusCode, 9700 }, 9701 } 9702 target := &ret 9703 if err := gensupport.DecodeResponse(target, res); err != nil { 9704 return nil, err 9705 } 9706 return ret, nil 9707 // { 9708 // "description": "Retrieves details of a per-user managed configuration for an app for the specified user.", 9709 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9710 // "httpMethod": "GET", 9711 // "id": "androidenterprise.managedconfigurationsforuser.get", 9712 // "parameterOrder": [ 9713 // "enterpriseId", 9714 // "userId", 9715 // "managedConfigurationForUserId" 9716 // ], 9717 // "parameters": { 9718 // "enterpriseId": { 9719 // "description": "The ID of the enterprise.", 9720 // "location": "path", 9721 // "required": true, 9722 // "type": "string" 9723 // }, 9724 // "managedConfigurationForUserId": { 9725 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9726 // "location": "path", 9727 // "required": true, 9728 // "type": "string" 9729 // }, 9730 // "userId": { 9731 // "description": "The ID of the user.", 9732 // "location": "path", 9733 // "required": true, 9734 // "type": "string" 9735 // } 9736 // }, 9737 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9738 // "response": { 9739 // "$ref": "ManagedConfiguration" 9740 // }, 9741 // "scopes": [ 9742 // "https://www.googleapis.com/auth/androidenterprise" 9743 // ] 9744 // } 9745 9746} 9747 9748// method id "androidenterprise.managedconfigurationsforuser.list": 9749 9750type ManagedconfigurationsforuserListCall struct { 9751 s *Service 9752 enterpriseId string 9753 userId string 9754 urlParams_ gensupport.URLParams 9755 ifNoneMatch_ string 9756 ctx_ context.Context 9757 header_ http.Header 9758} 9759 9760// List: Lists all the per-user managed configurations for the specified 9761// user. Only the ID is set. 9762// 9763// - enterpriseId: The ID of the enterprise. 9764// - userId: The ID of the user. 9765func (r *ManagedconfigurationsforuserService) List(enterpriseId string, userId string) *ManagedconfigurationsforuserListCall { 9766 c := &ManagedconfigurationsforuserListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9767 c.enterpriseId = enterpriseId 9768 c.userId = userId 9769 return c 9770} 9771 9772// Fields allows partial responses to be retrieved. See 9773// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9774// for more information. 9775func (c *ManagedconfigurationsforuserListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserListCall { 9776 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9777 return c 9778} 9779 9780// IfNoneMatch sets the optional parameter which makes the operation 9781// fail if the object's ETag matches the given value. This is useful for 9782// getting updates only after the object has changed since the last 9783// request. Use googleapi.IsNotModified to check whether the response 9784// error from Do is the result of In-None-Match. 9785func (c *ManagedconfigurationsforuserListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserListCall { 9786 c.ifNoneMatch_ = entityTag 9787 return c 9788} 9789 9790// Context sets the context to be used in this call's Do method. Any 9791// pending HTTP request will be aborted if the provided context is 9792// canceled. 9793func (c *ManagedconfigurationsforuserListCall) Context(ctx context.Context) *ManagedconfigurationsforuserListCall { 9794 c.ctx_ = ctx 9795 return c 9796} 9797 9798// Header returns an http.Header that can be modified by the caller to 9799// add HTTP headers to the request. 9800func (c *ManagedconfigurationsforuserListCall) Header() http.Header { 9801 if c.header_ == nil { 9802 c.header_ = make(http.Header) 9803 } 9804 return c.header_ 9805} 9806 9807func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Response, error) { 9808 reqHeaders := make(http.Header) 9809 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9810 for k, v := range c.header_ { 9811 reqHeaders[k] = v 9812 } 9813 reqHeaders.Set("User-Agent", c.s.userAgent()) 9814 if c.ifNoneMatch_ != "" { 9815 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9816 } 9817 var body io.Reader = nil 9818 c.urlParams_.Set("alt", alt) 9819 c.urlParams_.Set("prettyPrint", "false") 9820 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser") 9821 urls += "?" + c.urlParams_.Encode() 9822 req, err := http.NewRequest("GET", urls, body) 9823 if err != nil { 9824 return nil, err 9825 } 9826 req.Header = reqHeaders 9827 googleapi.Expand(req.URL, map[string]string{ 9828 "enterpriseId": c.enterpriseId, 9829 "userId": c.userId, 9830 }) 9831 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9832} 9833 9834// Do executes the "androidenterprise.managedconfigurationsforuser.list" call. 9835// Exactly one of *ManagedConfigurationsForUserListResponse or error 9836// will be non-nil. Any non-2xx status code is an error. Response 9837// headers are in either 9838// *ManagedConfigurationsForUserListResponse.ServerResponse.Header or 9839// (if a response was returned at all) in 9840// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9841// whether the returned error was because http.StatusNotModified was 9842// returned. 9843func (c *ManagedconfigurationsforuserListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForUserListResponse, error) { 9844 gensupport.SetOptions(c.urlParams_, opts...) 9845 res, err := c.doRequest("json") 9846 if res != nil && res.StatusCode == http.StatusNotModified { 9847 if res.Body != nil { 9848 res.Body.Close() 9849 } 9850 return nil, &googleapi.Error{ 9851 Code: res.StatusCode, 9852 Header: res.Header, 9853 } 9854 } 9855 if err != nil { 9856 return nil, err 9857 } 9858 defer googleapi.CloseBody(res) 9859 if err := googleapi.CheckResponse(res); err != nil { 9860 return nil, err 9861 } 9862 ret := &ManagedConfigurationsForUserListResponse{ 9863 ServerResponse: googleapi.ServerResponse{ 9864 Header: res.Header, 9865 HTTPStatusCode: res.StatusCode, 9866 }, 9867 } 9868 target := &ret 9869 if err := gensupport.DecodeResponse(target, res); err != nil { 9870 return nil, err 9871 } 9872 return ret, nil 9873 // { 9874 // "description": "Lists all the per-user managed configurations for the specified user. Only the ID is set.", 9875 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser", 9876 // "httpMethod": "GET", 9877 // "id": "androidenterprise.managedconfigurationsforuser.list", 9878 // "parameterOrder": [ 9879 // "enterpriseId", 9880 // "userId" 9881 // ], 9882 // "parameters": { 9883 // "enterpriseId": { 9884 // "description": "The ID of the enterprise.", 9885 // "location": "path", 9886 // "required": true, 9887 // "type": "string" 9888 // }, 9889 // "userId": { 9890 // "description": "The ID of the user.", 9891 // "location": "path", 9892 // "required": true, 9893 // "type": "string" 9894 // } 9895 // }, 9896 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser", 9897 // "response": { 9898 // "$ref": "ManagedConfigurationsForUserListResponse" 9899 // }, 9900 // "scopes": [ 9901 // "https://www.googleapis.com/auth/androidenterprise" 9902 // ] 9903 // } 9904 9905} 9906 9907// method id "androidenterprise.managedconfigurationsforuser.update": 9908 9909type ManagedconfigurationsforuserUpdateCall struct { 9910 s *Service 9911 enterpriseId string 9912 userId string 9913 managedConfigurationForUserId string 9914 managedconfiguration *ManagedConfiguration 9915 urlParams_ gensupport.URLParams 9916 ctx_ context.Context 9917 header_ http.Header 9918} 9919 9920// Update: Adds or updates the managed configuration settings for an app 9921// for the specified user. If you support the Managed configurations 9922// iframe, you can apply managed configurations to a user by specifying 9923// an mcmId and its associated configuration variables (if any) in the 9924// request. Alternatively, all EMMs can apply managed configurations by 9925// passing a list of managed properties. 9926// 9927// - enterpriseId: The ID of the enterprise. 9928// - managedConfigurationForUserId: The ID of the managed configuration 9929// (a product ID), e.g. "app:com.google.android.gm". 9930// - userId: The ID of the user. 9931func (r *ManagedconfigurationsforuserService) Update(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserUpdateCall { 9932 c := &ManagedconfigurationsforuserUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9933 c.enterpriseId = enterpriseId 9934 c.userId = userId 9935 c.managedConfigurationForUserId = managedConfigurationForUserId 9936 c.managedconfiguration = managedconfiguration 9937 return c 9938} 9939 9940// Fields allows partial responses to be retrieved. See 9941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9942// for more information. 9943func (c *ManagedconfigurationsforuserUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserUpdateCall { 9944 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9945 return c 9946} 9947 9948// Context sets the context to be used in this call's Do method. Any 9949// pending HTTP request will be aborted if the provided context is 9950// canceled. 9951func (c *ManagedconfigurationsforuserUpdateCall) Context(ctx context.Context) *ManagedconfigurationsforuserUpdateCall { 9952 c.ctx_ = ctx 9953 return c 9954} 9955 9956// Header returns an http.Header that can be modified by the caller to 9957// add HTTP headers to the request. 9958func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header { 9959 if c.header_ == nil { 9960 c.header_ = make(http.Header) 9961 } 9962 return c.header_ 9963} 9964 9965func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) { 9966 reqHeaders := make(http.Header) 9967 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9968 for k, v := range c.header_ { 9969 reqHeaders[k] = v 9970 } 9971 reqHeaders.Set("User-Agent", c.s.userAgent()) 9972 var body io.Reader = nil 9973 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9974 if err != nil { 9975 return nil, err 9976 } 9977 reqHeaders.Set("Content-Type", "application/json") 9978 c.urlParams_.Set("alt", alt) 9979 c.urlParams_.Set("prettyPrint", "false") 9980 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9981 urls += "?" + c.urlParams_.Encode() 9982 req, err := http.NewRequest("PUT", urls, body) 9983 if err != nil { 9984 return nil, err 9985 } 9986 req.Header = reqHeaders 9987 googleapi.Expand(req.URL, map[string]string{ 9988 "enterpriseId": c.enterpriseId, 9989 "userId": c.userId, 9990 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9991 }) 9992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9993} 9994 9995// Do executes the "androidenterprise.managedconfigurationsforuser.update" call. 9996// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9997// non-2xx status code is an error. Response headers are in either 9998// *ManagedConfiguration.ServerResponse.Header or (if a response was 9999// returned at all) in error.(*googleapi.Error).Header. Use 10000// googleapi.IsNotModified to check whether the returned error was 10001// because http.StatusNotModified was returned. 10002func (c *ManagedconfigurationsforuserUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 10003 gensupport.SetOptions(c.urlParams_, opts...) 10004 res, err := c.doRequest("json") 10005 if res != nil && res.StatusCode == http.StatusNotModified { 10006 if res.Body != nil { 10007 res.Body.Close() 10008 } 10009 return nil, &googleapi.Error{ 10010 Code: res.StatusCode, 10011 Header: res.Header, 10012 } 10013 } 10014 if err != nil { 10015 return nil, err 10016 } 10017 defer googleapi.CloseBody(res) 10018 if err := googleapi.CheckResponse(res); err != nil { 10019 return nil, err 10020 } 10021 ret := &ManagedConfiguration{ 10022 ServerResponse: googleapi.ServerResponse{ 10023 Header: res.Header, 10024 HTTPStatusCode: res.StatusCode, 10025 }, 10026 } 10027 target := &ret 10028 if err := gensupport.DecodeResponse(target, res); err != nil { 10029 return nil, err 10030 } 10031 return ret, nil 10032 // { 10033 // "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.", 10034 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 10035 // "httpMethod": "PUT", 10036 // "id": "androidenterprise.managedconfigurationsforuser.update", 10037 // "parameterOrder": [ 10038 // "enterpriseId", 10039 // "userId", 10040 // "managedConfigurationForUserId" 10041 // ], 10042 // "parameters": { 10043 // "enterpriseId": { 10044 // "description": "The ID of the enterprise.", 10045 // "location": "path", 10046 // "required": true, 10047 // "type": "string" 10048 // }, 10049 // "managedConfigurationForUserId": { 10050 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 10051 // "location": "path", 10052 // "required": true, 10053 // "type": "string" 10054 // }, 10055 // "userId": { 10056 // "description": "The ID of the user.", 10057 // "location": "path", 10058 // "required": true, 10059 // "type": "string" 10060 // } 10061 // }, 10062 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 10063 // "request": { 10064 // "$ref": "ManagedConfiguration" 10065 // }, 10066 // "response": { 10067 // "$ref": "ManagedConfiguration" 10068 // }, 10069 // "scopes": [ 10070 // "https://www.googleapis.com/auth/androidenterprise" 10071 // ] 10072 // } 10073 10074} 10075 10076// method id "androidenterprise.managedconfigurationssettings.list": 10077 10078type ManagedconfigurationssettingsListCall struct { 10079 s *Service 10080 enterpriseId string 10081 productId string 10082 urlParams_ gensupport.URLParams 10083 ifNoneMatch_ string 10084 ctx_ context.Context 10085 header_ http.Header 10086} 10087 10088// List: Lists all the managed configurations settings for the specified 10089// app. 10090// 10091// - enterpriseId: The ID of the enterprise. 10092// - productId: The ID of the product for which the managed 10093// configurations settings applies to. 10094func (r *ManagedconfigurationssettingsService) List(enterpriseId string, productId string) *ManagedconfigurationssettingsListCall { 10095 c := &ManagedconfigurationssettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10096 c.enterpriseId = enterpriseId 10097 c.productId = productId 10098 return c 10099} 10100 10101// Fields allows partial responses to be retrieved. See 10102// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10103// for more information. 10104func (c *ManagedconfigurationssettingsListCall) Fields(s ...googleapi.Field) *ManagedconfigurationssettingsListCall { 10105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10106 return c 10107} 10108 10109// IfNoneMatch sets the optional parameter which makes the operation 10110// fail if the object's ETag matches the given value. This is useful for 10111// getting updates only after the object has changed since the last 10112// request. Use googleapi.IsNotModified to check whether the response 10113// error from Do is the result of In-None-Match. 10114func (c *ManagedconfigurationssettingsListCall) IfNoneMatch(entityTag string) *ManagedconfigurationssettingsListCall { 10115 c.ifNoneMatch_ = entityTag 10116 return c 10117} 10118 10119// Context sets the context to be used in this call's Do method. Any 10120// pending HTTP request will be aborted if the provided context is 10121// canceled. 10122func (c *ManagedconfigurationssettingsListCall) Context(ctx context.Context) *ManagedconfigurationssettingsListCall { 10123 c.ctx_ = ctx 10124 return c 10125} 10126 10127// Header returns an http.Header that can be modified by the caller to 10128// add HTTP headers to the request. 10129func (c *ManagedconfigurationssettingsListCall) Header() http.Header { 10130 if c.header_ == nil { 10131 c.header_ = make(http.Header) 10132 } 10133 return c.header_ 10134} 10135 10136func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Response, error) { 10137 reqHeaders := make(http.Header) 10138 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10139 for k, v := range c.header_ { 10140 reqHeaders[k] = v 10141 } 10142 reqHeaders.Set("User-Agent", c.s.userAgent()) 10143 if c.ifNoneMatch_ != "" { 10144 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10145 } 10146 var body io.Reader = nil 10147 c.urlParams_.Set("alt", alt) 10148 c.urlParams_.Set("prettyPrint", "false") 10149 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings") 10150 urls += "?" + c.urlParams_.Encode() 10151 req, err := http.NewRequest("GET", urls, body) 10152 if err != nil { 10153 return nil, err 10154 } 10155 req.Header = reqHeaders 10156 googleapi.Expand(req.URL, map[string]string{ 10157 "enterpriseId": c.enterpriseId, 10158 "productId": c.productId, 10159 }) 10160 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10161} 10162 10163// Do executes the "androidenterprise.managedconfigurationssettings.list" call. 10164// Exactly one of *ManagedConfigurationsSettingsListResponse or error 10165// will be non-nil. Any non-2xx status code is an error. Response 10166// headers are in either 10167// *ManagedConfigurationsSettingsListResponse.ServerResponse.Header or 10168// (if a response was returned at all) in 10169// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10170// whether the returned error was because http.StatusNotModified was 10171// returned. 10172func (c *ManagedconfigurationssettingsListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsSettingsListResponse, error) { 10173 gensupport.SetOptions(c.urlParams_, opts...) 10174 res, err := c.doRequest("json") 10175 if res != nil && res.StatusCode == http.StatusNotModified { 10176 if res.Body != nil { 10177 res.Body.Close() 10178 } 10179 return nil, &googleapi.Error{ 10180 Code: res.StatusCode, 10181 Header: res.Header, 10182 } 10183 } 10184 if err != nil { 10185 return nil, err 10186 } 10187 defer googleapi.CloseBody(res) 10188 if err := googleapi.CheckResponse(res); err != nil { 10189 return nil, err 10190 } 10191 ret := &ManagedConfigurationsSettingsListResponse{ 10192 ServerResponse: googleapi.ServerResponse{ 10193 Header: res.Header, 10194 HTTPStatusCode: res.StatusCode, 10195 }, 10196 } 10197 target := &ret 10198 if err := gensupport.DecodeResponse(target, res); err != nil { 10199 return nil, err 10200 } 10201 return ret, nil 10202 // { 10203 // "description": "Lists all the managed configurations settings for the specified app.", 10204 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", 10205 // "httpMethod": "GET", 10206 // "id": "androidenterprise.managedconfigurationssettings.list", 10207 // "parameterOrder": [ 10208 // "enterpriseId", 10209 // "productId" 10210 // ], 10211 // "parameters": { 10212 // "enterpriseId": { 10213 // "description": "The ID of the enterprise.", 10214 // "location": "path", 10215 // "required": true, 10216 // "type": "string" 10217 // }, 10218 // "productId": { 10219 // "description": "The ID of the product for which the managed configurations settings applies to.", 10220 // "location": "path", 10221 // "required": true, 10222 // "type": "string" 10223 // } 10224 // }, 10225 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", 10226 // "response": { 10227 // "$ref": "ManagedConfigurationsSettingsListResponse" 10228 // }, 10229 // "scopes": [ 10230 // "https://www.googleapis.com/auth/androidenterprise" 10231 // ] 10232 // } 10233 10234} 10235 10236// method id "androidenterprise.permissions.get": 10237 10238type PermissionsGetCall struct { 10239 s *Service 10240 permissionId string 10241 urlParams_ gensupport.URLParams 10242 ifNoneMatch_ string 10243 ctx_ context.Context 10244 header_ http.Header 10245} 10246 10247// Get: Retrieves details of an Android app permission for display to an 10248// enterprise admin. 10249// 10250// - permissionId: The ID of the permission. 10251func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall { 10252 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10253 c.permissionId = permissionId 10254 return c 10255} 10256 10257// Language sets the optional parameter "language": The BCP47 tag for 10258// the user's preferred language (e.g. "en-US", "de") 10259func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall { 10260 c.urlParams_.Set("language", language) 10261 return c 10262} 10263 10264// Fields allows partial responses to be retrieved. See 10265// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10266// for more information. 10267func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 10268 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10269 return c 10270} 10271 10272// IfNoneMatch sets the optional parameter which makes the operation 10273// fail if the object's ETag matches the given value. This is useful for 10274// getting updates only after the object has changed since the last 10275// request. Use googleapi.IsNotModified to check whether the response 10276// error from Do is the result of In-None-Match. 10277func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 10278 c.ifNoneMatch_ = entityTag 10279 return c 10280} 10281 10282// Context sets the context to be used in this call's Do method. Any 10283// pending HTTP request will be aborted if the provided context is 10284// canceled. 10285func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 10286 c.ctx_ = ctx 10287 return c 10288} 10289 10290// Header returns an http.Header that can be modified by the caller to 10291// add HTTP headers to the request. 10292func (c *PermissionsGetCall) Header() http.Header { 10293 if c.header_ == nil { 10294 c.header_ = make(http.Header) 10295 } 10296 return c.header_ 10297} 10298 10299func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 10300 reqHeaders := make(http.Header) 10301 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10302 for k, v := range c.header_ { 10303 reqHeaders[k] = v 10304 } 10305 reqHeaders.Set("User-Agent", c.s.userAgent()) 10306 if c.ifNoneMatch_ != "" { 10307 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10308 } 10309 var body io.Reader = nil 10310 c.urlParams_.Set("alt", alt) 10311 c.urlParams_.Set("prettyPrint", "false") 10312 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/permissions/{permissionId}") 10313 urls += "?" + c.urlParams_.Encode() 10314 req, err := http.NewRequest("GET", urls, body) 10315 if err != nil { 10316 return nil, err 10317 } 10318 req.Header = reqHeaders 10319 googleapi.Expand(req.URL, map[string]string{ 10320 "permissionId": c.permissionId, 10321 }) 10322 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10323} 10324 10325// Do executes the "androidenterprise.permissions.get" call. 10326// Exactly one of *Permission or error will be non-nil. Any non-2xx 10327// status code is an error. Response headers are in either 10328// *Permission.ServerResponse.Header or (if a response was returned at 10329// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10330// to check whether the returned error was because 10331// http.StatusNotModified was returned. 10332func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 10333 gensupport.SetOptions(c.urlParams_, opts...) 10334 res, err := c.doRequest("json") 10335 if res != nil && res.StatusCode == http.StatusNotModified { 10336 if res.Body != nil { 10337 res.Body.Close() 10338 } 10339 return nil, &googleapi.Error{ 10340 Code: res.StatusCode, 10341 Header: res.Header, 10342 } 10343 } 10344 if err != nil { 10345 return nil, err 10346 } 10347 defer googleapi.CloseBody(res) 10348 if err := googleapi.CheckResponse(res); err != nil { 10349 return nil, err 10350 } 10351 ret := &Permission{ 10352 ServerResponse: googleapi.ServerResponse{ 10353 Header: res.Header, 10354 HTTPStatusCode: res.StatusCode, 10355 }, 10356 } 10357 target := &ret 10358 if err := gensupport.DecodeResponse(target, res); err != nil { 10359 return nil, err 10360 } 10361 return ret, nil 10362 // { 10363 // "description": "Retrieves details of an Android app permission for display to an enterprise admin.", 10364 // "flatPath": "androidenterprise/v1/permissions/{permissionId}", 10365 // "httpMethod": "GET", 10366 // "id": "androidenterprise.permissions.get", 10367 // "parameterOrder": [ 10368 // "permissionId" 10369 // ], 10370 // "parameters": { 10371 // "language": { 10372 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")", 10373 // "location": "query", 10374 // "type": "string" 10375 // }, 10376 // "permissionId": { 10377 // "description": "The ID of the permission.", 10378 // "location": "path", 10379 // "required": true, 10380 // "type": "string" 10381 // } 10382 // }, 10383 // "path": "androidenterprise/v1/permissions/{permissionId}", 10384 // "response": { 10385 // "$ref": "Permission" 10386 // }, 10387 // "scopes": [ 10388 // "https://www.googleapis.com/auth/androidenterprise" 10389 // ] 10390 // } 10391 10392} 10393 10394// method id "androidenterprise.products.approve": 10395 10396type ProductsApproveCall struct { 10397 s *Service 10398 enterpriseId string 10399 productId string 10400 productsapproverequest *ProductsApproveRequest 10401 urlParams_ gensupport.URLParams 10402 ctx_ context.Context 10403 header_ http.Header 10404} 10405 10406// Approve: Approves the specified product and the relevant app 10407// permissions, if any. The maximum number of products that you can 10408// approve per enterprise customer is 1,000. To learn how to use managed 10409// Google Play to design and create a store layout to display approved 10410// products to your users, see Store Layout Design. 10411// 10412// - enterpriseId: The ID of the enterprise. 10413// - productId: The ID of the product. 10414func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall { 10415 c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10416 c.enterpriseId = enterpriseId 10417 c.productId = productId 10418 c.productsapproverequest = productsapproverequest 10419 return c 10420} 10421 10422// Fields allows partial responses to be retrieved. See 10423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10424// for more information. 10425func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall { 10426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10427 return c 10428} 10429 10430// Context sets the context to be used in this call's Do method. Any 10431// pending HTTP request will be aborted if the provided context is 10432// canceled. 10433func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall { 10434 c.ctx_ = ctx 10435 return c 10436} 10437 10438// Header returns an http.Header that can be modified by the caller to 10439// add HTTP headers to the request. 10440func (c *ProductsApproveCall) Header() http.Header { 10441 if c.header_ == nil { 10442 c.header_ = make(http.Header) 10443 } 10444 return c.header_ 10445} 10446 10447func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) { 10448 reqHeaders := make(http.Header) 10449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10450 for k, v := range c.header_ { 10451 reqHeaders[k] = v 10452 } 10453 reqHeaders.Set("User-Agent", c.s.userAgent()) 10454 var body io.Reader = nil 10455 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest) 10456 if err != nil { 10457 return nil, err 10458 } 10459 reqHeaders.Set("Content-Type", "application/json") 10460 c.urlParams_.Set("alt", alt) 10461 c.urlParams_.Set("prettyPrint", "false") 10462 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve") 10463 urls += "?" + c.urlParams_.Encode() 10464 req, err := http.NewRequest("POST", urls, body) 10465 if err != nil { 10466 return nil, err 10467 } 10468 req.Header = reqHeaders 10469 googleapi.Expand(req.URL, map[string]string{ 10470 "enterpriseId": c.enterpriseId, 10471 "productId": c.productId, 10472 }) 10473 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10474} 10475 10476// Do executes the "androidenterprise.products.approve" call. 10477func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error { 10478 gensupport.SetOptions(c.urlParams_, opts...) 10479 res, err := c.doRequest("json") 10480 if err != nil { 10481 return err 10482 } 10483 defer googleapi.CloseBody(res) 10484 if err := googleapi.CheckResponse(res); err != nil { 10485 return err 10486 } 10487 return nil 10488 // { 10489 // "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. ", 10490 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve", 10491 // "httpMethod": "POST", 10492 // "id": "androidenterprise.products.approve", 10493 // "parameterOrder": [ 10494 // "enterpriseId", 10495 // "productId" 10496 // ], 10497 // "parameters": { 10498 // "enterpriseId": { 10499 // "description": "The ID of the enterprise.", 10500 // "location": "path", 10501 // "required": true, 10502 // "type": "string" 10503 // }, 10504 // "productId": { 10505 // "description": "The ID of the product.", 10506 // "location": "path", 10507 // "required": true, 10508 // "type": "string" 10509 // } 10510 // }, 10511 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve", 10512 // "request": { 10513 // "$ref": "ProductsApproveRequest" 10514 // }, 10515 // "scopes": [ 10516 // "https://www.googleapis.com/auth/androidenterprise" 10517 // ] 10518 // } 10519 10520} 10521 10522// method id "androidenterprise.products.generateApprovalUrl": 10523 10524type ProductsGenerateApprovalUrlCall struct { 10525 s *Service 10526 enterpriseId string 10527 productId string 10528 urlParams_ gensupport.URLParams 10529 ctx_ context.Context 10530 header_ http.Header 10531} 10532 10533// GenerateApprovalUrl: Generates a URL that can be rendered in an 10534// iframe to display the permissions (if any) of a product. An 10535// enterprise admin must view these permissions and accept them on 10536// behalf of their organization in order to approve that product. Admins 10537// should accept the displayed permissions by interacting with a 10538// separate UI element in the EMM console, which in turn should trigger 10539// the use of this URL as the approvalUrlInfo.approvalUrl property in a 10540// Products.approve call to approve the product. This URL can only be 10541// used to display permissions for up to 1 day. 10542// 10543// - enterpriseId: The ID of the enterprise. 10544// - productId: The ID of the product. 10545func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall { 10546 c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10547 c.enterpriseId = enterpriseId 10548 c.productId = productId 10549 return c 10550} 10551 10552// LanguageCode sets the optional parameter "languageCode": The BCP 47 10553// language code used for permission names and descriptions in the 10554// returned iframe, for instance "en-US". 10555func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall { 10556 c.urlParams_.Set("languageCode", languageCode) 10557 return c 10558} 10559 10560// Fields allows partial responses to be retrieved. See 10561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10562// for more information. 10563func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall { 10564 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10565 return c 10566} 10567 10568// Context sets the context to be used in this call's Do method. Any 10569// pending HTTP request will be aborted if the provided context is 10570// canceled. 10571func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall { 10572 c.ctx_ = ctx 10573 return c 10574} 10575 10576// Header returns an http.Header that can be modified by the caller to 10577// add HTTP headers to the request. 10578func (c *ProductsGenerateApprovalUrlCall) Header() http.Header { 10579 if c.header_ == nil { 10580 c.header_ = make(http.Header) 10581 } 10582 return c.header_ 10583} 10584 10585func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) { 10586 reqHeaders := make(http.Header) 10587 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10588 for k, v := range c.header_ { 10589 reqHeaders[k] = v 10590 } 10591 reqHeaders.Set("User-Agent", c.s.userAgent()) 10592 var body io.Reader = nil 10593 c.urlParams_.Set("alt", alt) 10594 c.urlParams_.Set("prettyPrint", "false") 10595 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl") 10596 urls += "?" + c.urlParams_.Encode() 10597 req, err := http.NewRequest("POST", urls, body) 10598 if err != nil { 10599 return nil, err 10600 } 10601 req.Header = reqHeaders 10602 googleapi.Expand(req.URL, map[string]string{ 10603 "enterpriseId": c.enterpriseId, 10604 "productId": c.productId, 10605 }) 10606 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10607} 10608 10609// Do executes the "androidenterprise.products.generateApprovalUrl" call. 10610// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be 10611// non-nil. Any non-2xx status code is an error. Response headers are in 10612// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or 10613// (if a response was returned at all) in 10614// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10615// whether the returned error was because http.StatusNotModified was 10616// returned. 10617func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) { 10618 gensupport.SetOptions(c.urlParams_, opts...) 10619 res, err := c.doRequest("json") 10620 if res != nil && res.StatusCode == http.StatusNotModified { 10621 if res.Body != nil { 10622 res.Body.Close() 10623 } 10624 return nil, &googleapi.Error{ 10625 Code: res.StatusCode, 10626 Header: res.Header, 10627 } 10628 } 10629 if err != nil { 10630 return nil, err 10631 } 10632 defer googleapi.CloseBody(res) 10633 if err := googleapi.CheckResponse(res); err != nil { 10634 return nil, err 10635 } 10636 ret := &ProductsGenerateApprovalUrlResponse{ 10637 ServerResponse: googleapi.ServerResponse{ 10638 Header: res.Header, 10639 HTTPStatusCode: res.StatusCode, 10640 }, 10641 } 10642 target := &ret 10643 if err := gensupport.DecodeResponse(target, res); err != nil { 10644 return nil, err 10645 } 10646 return ret, nil 10647 // { 10648 // "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.", 10649 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", 10650 // "httpMethod": "POST", 10651 // "id": "androidenterprise.products.generateApprovalUrl", 10652 // "parameterOrder": [ 10653 // "enterpriseId", 10654 // "productId" 10655 // ], 10656 // "parameters": { 10657 // "enterpriseId": { 10658 // "description": "The ID of the enterprise.", 10659 // "location": "path", 10660 // "required": true, 10661 // "type": "string" 10662 // }, 10663 // "languageCode": { 10664 // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", 10665 // "location": "query", 10666 // "type": "string" 10667 // }, 10668 // "productId": { 10669 // "description": "The ID of the product.", 10670 // "location": "path", 10671 // "required": true, 10672 // "type": "string" 10673 // } 10674 // }, 10675 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", 10676 // "response": { 10677 // "$ref": "ProductsGenerateApprovalUrlResponse" 10678 // }, 10679 // "scopes": [ 10680 // "https://www.googleapis.com/auth/androidenterprise" 10681 // ] 10682 // } 10683 10684} 10685 10686// method id "androidenterprise.products.get": 10687 10688type ProductsGetCall struct { 10689 s *Service 10690 enterpriseId string 10691 productId string 10692 urlParams_ gensupport.URLParams 10693 ifNoneMatch_ string 10694 ctx_ context.Context 10695 header_ http.Header 10696} 10697 10698// Get: Retrieves details of a product for display to an enterprise 10699// admin. 10700// 10701// - enterpriseId: The ID of the enterprise. 10702// - productId: The ID of the product, e.g. "app:com.google.android.gm". 10703func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall { 10704 c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10705 c.enterpriseId = enterpriseId 10706 c.productId = productId 10707 return c 10708} 10709 10710// Language sets the optional parameter "language": The BCP47 tag for 10711// the user's preferred language (e.g. "en-US", "de"). 10712func (c *ProductsGetCall) Language(language string) *ProductsGetCall { 10713 c.urlParams_.Set("language", language) 10714 return c 10715} 10716 10717// Fields allows partial responses to be retrieved. See 10718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10719// for more information. 10720func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall { 10721 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10722 return c 10723} 10724 10725// IfNoneMatch sets the optional parameter which makes the operation 10726// fail if the object's ETag matches the given value. This is useful for 10727// getting updates only after the object has changed since the last 10728// request. Use googleapi.IsNotModified to check whether the response 10729// error from Do is the result of In-None-Match. 10730func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall { 10731 c.ifNoneMatch_ = entityTag 10732 return c 10733} 10734 10735// Context sets the context to be used in this call's Do method. Any 10736// pending HTTP request will be aborted if the provided context is 10737// canceled. 10738func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall { 10739 c.ctx_ = ctx 10740 return c 10741} 10742 10743// Header returns an http.Header that can be modified by the caller to 10744// add HTTP headers to the request. 10745func (c *ProductsGetCall) Header() http.Header { 10746 if c.header_ == nil { 10747 c.header_ = make(http.Header) 10748 } 10749 return c.header_ 10750} 10751 10752func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { 10753 reqHeaders := make(http.Header) 10754 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10755 for k, v := range c.header_ { 10756 reqHeaders[k] = v 10757 } 10758 reqHeaders.Set("User-Agent", c.s.userAgent()) 10759 if c.ifNoneMatch_ != "" { 10760 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10761 } 10762 var body io.Reader = nil 10763 c.urlParams_.Set("alt", alt) 10764 c.urlParams_.Set("prettyPrint", "false") 10765 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}") 10766 urls += "?" + c.urlParams_.Encode() 10767 req, err := http.NewRequest("GET", urls, body) 10768 if err != nil { 10769 return nil, err 10770 } 10771 req.Header = reqHeaders 10772 googleapi.Expand(req.URL, map[string]string{ 10773 "enterpriseId": c.enterpriseId, 10774 "productId": c.productId, 10775 }) 10776 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10777} 10778 10779// Do executes the "androidenterprise.products.get" call. 10780// Exactly one of *Product or error will be non-nil. Any non-2xx status 10781// code is an error. Response headers are in either 10782// *Product.ServerResponse.Header or (if a response was returned at all) 10783// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10784// check whether the returned error was because http.StatusNotModified 10785// was returned. 10786func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) { 10787 gensupport.SetOptions(c.urlParams_, opts...) 10788 res, err := c.doRequest("json") 10789 if res != nil && res.StatusCode == http.StatusNotModified { 10790 if res.Body != nil { 10791 res.Body.Close() 10792 } 10793 return nil, &googleapi.Error{ 10794 Code: res.StatusCode, 10795 Header: res.Header, 10796 } 10797 } 10798 if err != nil { 10799 return nil, err 10800 } 10801 defer googleapi.CloseBody(res) 10802 if err := googleapi.CheckResponse(res); err != nil { 10803 return nil, err 10804 } 10805 ret := &Product{ 10806 ServerResponse: googleapi.ServerResponse{ 10807 Header: res.Header, 10808 HTTPStatusCode: res.StatusCode, 10809 }, 10810 } 10811 target := &ret 10812 if err := gensupport.DecodeResponse(target, res); err != nil { 10813 return nil, err 10814 } 10815 return ret, nil 10816 // { 10817 // "description": "Retrieves details of a product for display to an enterprise admin.", 10818 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}", 10819 // "httpMethod": "GET", 10820 // "id": "androidenterprise.products.get", 10821 // "parameterOrder": [ 10822 // "enterpriseId", 10823 // "productId" 10824 // ], 10825 // "parameters": { 10826 // "enterpriseId": { 10827 // "description": "The ID of the enterprise.", 10828 // "location": "path", 10829 // "required": true, 10830 // "type": "string" 10831 // }, 10832 // "language": { 10833 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 10834 // "location": "query", 10835 // "type": "string" 10836 // }, 10837 // "productId": { 10838 // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".", 10839 // "location": "path", 10840 // "required": true, 10841 // "type": "string" 10842 // } 10843 // }, 10844 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}", 10845 // "response": { 10846 // "$ref": "Product" 10847 // }, 10848 // "scopes": [ 10849 // "https://www.googleapis.com/auth/androidenterprise" 10850 // ] 10851 // } 10852 10853} 10854 10855// method id "androidenterprise.products.getAppRestrictionsSchema": 10856 10857type ProductsGetAppRestrictionsSchemaCall struct { 10858 s *Service 10859 enterpriseId string 10860 productId string 10861 urlParams_ gensupport.URLParams 10862 ifNoneMatch_ string 10863 ctx_ context.Context 10864 header_ http.Header 10865} 10866 10867// GetAppRestrictionsSchema: Retrieves the schema that defines the 10868// configurable properties for this product. All products have a schema, 10869// but this schema may be empty if no managed configurations have been 10870// defined. This schema can be used to populate a UI that allows an 10871// admin to configure the product. To apply a managed configuration 10872// based on the schema obtained using this API, see Managed 10873// Configurations through Play. 10874// 10875// - enterpriseId: The ID of the enterprise. 10876// - productId: The ID of the product. 10877func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall { 10878 c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10879 c.enterpriseId = enterpriseId 10880 c.productId = productId 10881 return c 10882} 10883 10884// Language sets the optional parameter "language": The BCP47 tag for 10885// the user's preferred language (e.g. "en-US", "de"). 10886func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall { 10887 c.urlParams_.Set("language", language) 10888 return c 10889} 10890 10891// Fields allows partial responses to be retrieved. See 10892// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10893// for more information. 10894func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall { 10895 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10896 return c 10897} 10898 10899// IfNoneMatch sets the optional parameter which makes the operation 10900// fail if the object's ETag matches the given value. This is useful for 10901// getting updates only after the object has changed since the last 10902// request. Use googleapi.IsNotModified to check whether the response 10903// error from Do is the result of In-None-Match. 10904func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall { 10905 c.ifNoneMatch_ = entityTag 10906 return c 10907} 10908 10909// Context sets the context to be used in this call's Do method. Any 10910// pending HTTP request will be aborted if the provided context is 10911// canceled. 10912func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall { 10913 c.ctx_ = ctx 10914 return c 10915} 10916 10917// Header returns an http.Header that can be modified by the caller to 10918// add HTTP headers to the request. 10919func (c *ProductsGetAppRestrictionsSchemaCall) Header() http.Header { 10920 if c.header_ == nil { 10921 c.header_ = make(http.Header) 10922 } 10923 return c.header_ 10924} 10925 10926func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) { 10927 reqHeaders := make(http.Header) 10928 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10929 for k, v := range c.header_ { 10930 reqHeaders[k] = v 10931 } 10932 reqHeaders.Set("User-Agent", c.s.userAgent()) 10933 if c.ifNoneMatch_ != "" { 10934 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10935 } 10936 var body io.Reader = nil 10937 c.urlParams_.Set("alt", alt) 10938 c.urlParams_.Set("prettyPrint", "false") 10939 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema") 10940 urls += "?" + c.urlParams_.Encode() 10941 req, err := http.NewRequest("GET", urls, body) 10942 if err != nil { 10943 return nil, err 10944 } 10945 req.Header = reqHeaders 10946 googleapi.Expand(req.URL, map[string]string{ 10947 "enterpriseId": c.enterpriseId, 10948 "productId": c.productId, 10949 }) 10950 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10951} 10952 10953// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call. 10954// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any 10955// non-2xx status code is an error. Response headers are in either 10956// *AppRestrictionsSchema.ServerResponse.Header or (if a response was 10957// returned at all) in error.(*googleapi.Error).Header. Use 10958// googleapi.IsNotModified to check whether the returned error was 10959// because http.StatusNotModified was returned. 10960func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) { 10961 gensupport.SetOptions(c.urlParams_, opts...) 10962 res, err := c.doRequest("json") 10963 if res != nil && res.StatusCode == http.StatusNotModified { 10964 if res.Body != nil { 10965 res.Body.Close() 10966 } 10967 return nil, &googleapi.Error{ 10968 Code: res.StatusCode, 10969 Header: res.Header, 10970 } 10971 } 10972 if err != nil { 10973 return nil, err 10974 } 10975 defer googleapi.CloseBody(res) 10976 if err := googleapi.CheckResponse(res); err != nil { 10977 return nil, err 10978 } 10979 ret := &AppRestrictionsSchema{ 10980 ServerResponse: googleapi.ServerResponse{ 10981 Header: res.Header, 10982 HTTPStatusCode: res.StatusCode, 10983 }, 10984 } 10985 target := &ret 10986 if err := gensupport.DecodeResponse(target, res); err != nil { 10987 return nil, err 10988 } 10989 return ret, nil 10990 // { 10991 // "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.", 10992 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", 10993 // "httpMethod": "GET", 10994 // "id": "androidenterprise.products.getAppRestrictionsSchema", 10995 // "parameterOrder": [ 10996 // "enterpriseId", 10997 // "productId" 10998 // ], 10999 // "parameters": { 11000 // "enterpriseId": { 11001 // "description": "The ID of the enterprise.", 11002 // "location": "path", 11003 // "required": true, 11004 // "type": "string" 11005 // }, 11006 // "language": { 11007 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 11008 // "location": "query", 11009 // "type": "string" 11010 // }, 11011 // "productId": { 11012 // "description": "The ID of the product.", 11013 // "location": "path", 11014 // "required": true, 11015 // "type": "string" 11016 // } 11017 // }, 11018 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", 11019 // "response": { 11020 // "$ref": "AppRestrictionsSchema" 11021 // }, 11022 // "scopes": [ 11023 // "https://www.googleapis.com/auth/androidenterprise" 11024 // ] 11025 // } 11026 11027} 11028 11029// method id "androidenterprise.products.getPermissions": 11030 11031type ProductsGetPermissionsCall struct { 11032 s *Service 11033 enterpriseId string 11034 productId string 11035 urlParams_ gensupport.URLParams 11036 ifNoneMatch_ string 11037 ctx_ context.Context 11038 header_ http.Header 11039} 11040 11041// GetPermissions: Retrieves the Android app permissions required by 11042// this app. 11043// 11044// - enterpriseId: The ID of the enterprise. 11045// - productId: The ID of the product. 11046func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall { 11047 c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11048 c.enterpriseId = enterpriseId 11049 c.productId = productId 11050 return c 11051} 11052 11053// Fields allows partial responses to be retrieved. See 11054// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11055// for more information. 11056func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall { 11057 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11058 return c 11059} 11060 11061// IfNoneMatch sets the optional parameter which makes the operation 11062// fail if the object's ETag matches the given value. This is useful for 11063// getting updates only after the object has changed since the last 11064// request. Use googleapi.IsNotModified to check whether the response 11065// error from Do is the result of In-None-Match. 11066func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall { 11067 c.ifNoneMatch_ = entityTag 11068 return c 11069} 11070 11071// Context sets the context to be used in this call's Do method. Any 11072// pending HTTP request will be aborted if the provided context is 11073// canceled. 11074func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall { 11075 c.ctx_ = ctx 11076 return c 11077} 11078 11079// Header returns an http.Header that can be modified by the caller to 11080// add HTTP headers to the request. 11081func (c *ProductsGetPermissionsCall) Header() http.Header { 11082 if c.header_ == nil { 11083 c.header_ = make(http.Header) 11084 } 11085 return c.header_ 11086} 11087 11088func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) { 11089 reqHeaders := make(http.Header) 11090 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11091 for k, v := range c.header_ { 11092 reqHeaders[k] = v 11093 } 11094 reqHeaders.Set("User-Agent", c.s.userAgent()) 11095 if c.ifNoneMatch_ != "" { 11096 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11097 } 11098 var body io.Reader = nil 11099 c.urlParams_.Set("alt", alt) 11100 c.urlParams_.Set("prettyPrint", "false") 11101 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions") 11102 urls += "?" + c.urlParams_.Encode() 11103 req, err := http.NewRequest("GET", urls, body) 11104 if err != nil { 11105 return nil, err 11106 } 11107 req.Header = reqHeaders 11108 googleapi.Expand(req.URL, map[string]string{ 11109 "enterpriseId": c.enterpriseId, 11110 "productId": c.productId, 11111 }) 11112 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11113} 11114 11115// Do executes the "androidenterprise.products.getPermissions" call. 11116// Exactly one of *ProductPermissions or error will be non-nil. Any 11117// non-2xx status code is an error. Response headers are in either 11118// *ProductPermissions.ServerResponse.Header or (if a response was 11119// returned at all) in error.(*googleapi.Error).Header. Use 11120// googleapi.IsNotModified to check whether the returned error was 11121// because http.StatusNotModified was returned. 11122func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) { 11123 gensupport.SetOptions(c.urlParams_, opts...) 11124 res, err := c.doRequest("json") 11125 if res != nil && res.StatusCode == http.StatusNotModified { 11126 if res.Body != nil { 11127 res.Body.Close() 11128 } 11129 return nil, &googleapi.Error{ 11130 Code: res.StatusCode, 11131 Header: res.Header, 11132 } 11133 } 11134 if err != nil { 11135 return nil, err 11136 } 11137 defer googleapi.CloseBody(res) 11138 if err := googleapi.CheckResponse(res); err != nil { 11139 return nil, err 11140 } 11141 ret := &ProductPermissions{ 11142 ServerResponse: googleapi.ServerResponse{ 11143 Header: res.Header, 11144 HTTPStatusCode: res.StatusCode, 11145 }, 11146 } 11147 target := &ret 11148 if err := gensupport.DecodeResponse(target, res); err != nil { 11149 return nil, err 11150 } 11151 return ret, nil 11152 // { 11153 // "description": "Retrieves the Android app permissions required by this app.", 11154 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions", 11155 // "httpMethod": "GET", 11156 // "id": "androidenterprise.products.getPermissions", 11157 // "parameterOrder": [ 11158 // "enterpriseId", 11159 // "productId" 11160 // ], 11161 // "parameters": { 11162 // "enterpriseId": { 11163 // "description": "The ID of the enterprise.", 11164 // "location": "path", 11165 // "required": true, 11166 // "type": "string" 11167 // }, 11168 // "productId": { 11169 // "description": "The ID of the product.", 11170 // "location": "path", 11171 // "required": true, 11172 // "type": "string" 11173 // } 11174 // }, 11175 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions", 11176 // "response": { 11177 // "$ref": "ProductPermissions" 11178 // }, 11179 // "scopes": [ 11180 // "https://www.googleapis.com/auth/androidenterprise" 11181 // ] 11182 // } 11183 11184} 11185 11186// method id "androidenterprise.products.list": 11187 11188type ProductsListCall struct { 11189 s *Service 11190 enterpriseId string 11191 urlParams_ gensupport.URLParams 11192 ifNoneMatch_ string 11193 ctx_ context.Context 11194 header_ http.Header 11195} 11196 11197// List: Finds approved products that match a query, or all approved 11198// products if there is no query. 11199// 11200// - enterpriseId: The ID of the enterprise. 11201func (r *ProductsService) List(enterpriseId string) *ProductsListCall { 11202 c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11203 c.enterpriseId = enterpriseId 11204 return c 11205} 11206 11207// Approved sets the optional parameter "approved": Specifies whether to 11208// search among all products (false) or among only products that have 11209// been approved (true). Only "true" is supported, and should be 11210// specified. 11211func (c *ProductsListCall) Approved(approved bool) *ProductsListCall { 11212 c.urlParams_.Set("approved", fmt.Sprint(approved)) 11213 return c 11214} 11215 11216// Language sets the optional parameter "language": The BCP47 tag for 11217// the user's preferred language (e.g. "en-US", "de"). Results are 11218// returned in the language best matching the preferred language. 11219func (c *ProductsListCall) Language(language string) *ProductsListCall { 11220 c.urlParams_.Set("language", language) 11221 return c 11222} 11223 11224// MaxResults sets the optional parameter "maxResults": Defines how many 11225// results the list operation should return. The default number depends 11226// on the resource collection. 11227func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall { 11228 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11229 return c 11230} 11231 11232// Query sets the optional parameter "query": The search query as typed 11233// in the Google Play store search box. If omitted, all approved apps 11234// will be returned (using the pagination parameters), including apps 11235// that are not available in the store (e.g. unpublished apps). 11236func (c *ProductsListCall) Query(query string) *ProductsListCall { 11237 c.urlParams_.Set("query", query) 11238 return c 11239} 11240 11241// Token sets the optional parameter "token": Defines the token of the 11242// page to return, usually taken from TokenPagination. This can only be 11243// used if token paging is enabled. 11244func (c *ProductsListCall) Token(token string) *ProductsListCall { 11245 c.urlParams_.Set("token", token) 11246 return c 11247} 11248 11249// Fields allows partial responses to be retrieved. See 11250// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11251// for more information. 11252func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall { 11253 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11254 return c 11255} 11256 11257// IfNoneMatch sets the optional parameter which makes the operation 11258// fail if the object's ETag matches the given value. This is useful for 11259// getting updates only after the object has changed since the last 11260// request. Use googleapi.IsNotModified to check whether the response 11261// error from Do is the result of In-None-Match. 11262func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall { 11263 c.ifNoneMatch_ = entityTag 11264 return c 11265} 11266 11267// Context sets the context to be used in this call's Do method. Any 11268// pending HTTP request will be aborted if the provided context is 11269// canceled. 11270func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall { 11271 c.ctx_ = ctx 11272 return c 11273} 11274 11275// Header returns an http.Header that can be modified by the caller to 11276// add HTTP headers to the request. 11277func (c *ProductsListCall) Header() http.Header { 11278 if c.header_ == nil { 11279 c.header_ = make(http.Header) 11280 } 11281 return c.header_ 11282} 11283 11284func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { 11285 reqHeaders := make(http.Header) 11286 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11287 for k, v := range c.header_ { 11288 reqHeaders[k] = v 11289 } 11290 reqHeaders.Set("User-Agent", c.s.userAgent()) 11291 if c.ifNoneMatch_ != "" { 11292 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11293 } 11294 var body io.Reader = nil 11295 c.urlParams_.Set("alt", alt) 11296 c.urlParams_.Set("prettyPrint", "false") 11297 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products") 11298 urls += "?" + c.urlParams_.Encode() 11299 req, err := http.NewRequest("GET", urls, body) 11300 if err != nil { 11301 return nil, err 11302 } 11303 req.Header = reqHeaders 11304 googleapi.Expand(req.URL, map[string]string{ 11305 "enterpriseId": c.enterpriseId, 11306 }) 11307 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11308} 11309 11310// Do executes the "androidenterprise.products.list" call. 11311// Exactly one of *ProductsListResponse or error will be non-nil. Any 11312// non-2xx status code is an error. Response headers are in either 11313// *ProductsListResponse.ServerResponse.Header or (if a response was 11314// returned at all) in error.(*googleapi.Error).Header. Use 11315// googleapi.IsNotModified to check whether the returned error was 11316// because http.StatusNotModified was returned. 11317func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) { 11318 gensupport.SetOptions(c.urlParams_, opts...) 11319 res, err := c.doRequest("json") 11320 if res != nil && res.StatusCode == http.StatusNotModified { 11321 if res.Body != nil { 11322 res.Body.Close() 11323 } 11324 return nil, &googleapi.Error{ 11325 Code: res.StatusCode, 11326 Header: res.Header, 11327 } 11328 } 11329 if err != nil { 11330 return nil, err 11331 } 11332 defer googleapi.CloseBody(res) 11333 if err := googleapi.CheckResponse(res); err != nil { 11334 return nil, err 11335 } 11336 ret := &ProductsListResponse{ 11337 ServerResponse: googleapi.ServerResponse{ 11338 Header: res.Header, 11339 HTTPStatusCode: res.StatusCode, 11340 }, 11341 } 11342 target := &ret 11343 if err := gensupport.DecodeResponse(target, res); err != nil { 11344 return nil, err 11345 } 11346 return ret, nil 11347 // { 11348 // "description": "Finds approved products that match a query, or all approved products if there is no query.", 11349 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products", 11350 // "httpMethod": "GET", 11351 // "id": "androidenterprise.products.list", 11352 // "parameterOrder": [ 11353 // "enterpriseId" 11354 // ], 11355 // "parameters": { 11356 // "approved": { 11357 // "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.", 11358 // "location": "query", 11359 // "type": "boolean" 11360 // }, 11361 // "enterpriseId": { 11362 // "description": "The ID of the enterprise.", 11363 // "location": "path", 11364 // "required": true, 11365 // "type": "string" 11366 // }, 11367 // "language": { 11368 // "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.", 11369 // "location": "query", 11370 // "type": "string" 11371 // }, 11372 // "maxResults": { 11373 // "description": "Defines how many results the list operation should return. The default number depends on the resource collection.", 11374 // "format": "uint32", 11375 // "location": "query", 11376 // "type": "integer" 11377 // }, 11378 // "query": { 11379 // "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).", 11380 // "location": "query", 11381 // "type": "string" 11382 // }, 11383 // "token": { 11384 // "description": "Defines the token of the page to return, usually taken from TokenPagination. This can only be used if token paging is enabled.", 11385 // "location": "query", 11386 // "type": "string" 11387 // } 11388 // }, 11389 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products", 11390 // "response": { 11391 // "$ref": "ProductsListResponse" 11392 // }, 11393 // "scopes": [ 11394 // "https://www.googleapis.com/auth/androidenterprise" 11395 // ] 11396 // } 11397 11398} 11399 11400// method id "androidenterprise.products.unapprove": 11401 11402type ProductsUnapproveCall struct { 11403 s *Service 11404 enterpriseId string 11405 productId string 11406 urlParams_ gensupport.URLParams 11407 ctx_ context.Context 11408 header_ http.Header 11409} 11410 11411// Unapprove: Unapproves the specified product (and the relevant app 11412// permissions, if any) 11413// 11414// - enterpriseId: The ID of the enterprise. 11415// - productId: The ID of the product. 11416func (r *ProductsService) Unapprove(enterpriseId string, productId string) *ProductsUnapproveCall { 11417 c := &ProductsUnapproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11418 c.enterpriseId = enterpriseId 11419 c.productId = productId 11420 return c 11421} 11422 11423// Fields allows partial responses to be retrieved. See 11424// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11425// for more information. 11426func (c *ProductsUnapproveCall) Fields(s ...googleapi.Field) *ProductsUnapproveCall { 11427 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11428 return c 11429} 11430 11431// Context sets the context to be used in this call's Do method. Any 11432// pending HTTP request will be aborted if the provided context is 11433// canceled. 11434func (c *ProductsUnapproveCall) Context(ctx context.Context) *ProductsUnapproveCall { 11435 c.ctx_ = ctx 11436 return c 11437} 11438 11439// Header returns an http.Header that can be modified by the caller to 11440// add HTTP headers to the request. 11441func (c *ProductsUnapproveCall) Header() http.Header { 11442 if c.header_ == nil { 11443 c.header_ = make(http.Header) 11444 } 11445 return c.header_ 11446} 11447 11448func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) { 11449 reqHeaders := make(http.Header) 11450 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11451 for k, v := range c.header_ { 11452 reqHeaders[k] = v 11453 } 11454 reqHeaders.Set("User-Agent", c.s.userAgent()) 11455 var body io.Reader = nil 11456 c.urlParams_.Set("alt", alt) 11457 c.urlParams_.Set("prettyPrint", "false") 11458 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove") 11459 urls += "?" + c.urlParams_.Encode() 11460 req, err := http.NewRequest("POST", urls, body) 11461 if err != nil { 11462 return nil, err 11463 } 11464 req.Header = reqHeaders 11465 googleapi.Expand(req.URL, map[string]string{ 11466 "enterpriseId": c.enterpriseId, 11467 "productId": c.productId, 11468 }) 11469 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11470} 11471 11472// Do executes the "androidenterprise.products.unapprove" call. 11473func (c *ProductsUnapproveCall) Do(opts ...googleapi.CallOption) error { 11474 gensupport.SetOptions(c.urlParams_, opts...) 11475 res, err := c.doRequest("json") 11476 if err != nil { 11477 return err 11478 } 11479 defer googleapi.CloseBody(res) 11480 if err := googleapi.CheckResponse(res); err != nil { 11481 return err 11482 } 11483 return nil 11484 // { 11485 // "description": "Unapproves the specified product (and the relevant app permissions, if any)", 11486 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove", 11487 // "httpMethod": "POST", 11488 // "id": "androidenterprise.products.unapprove", 11489 // "parameterOrder": [ 11490 // "enterpriseId", 11491 // "productId" 11492 // ], 11493 // "parameters": { 11494 // "enterpriseId": { 11495 // "description": "The ID of the enterprise.", 11496 // "location": "path", 11497 // "required": true, 11498 // "type": "string" 11499 // }, 11500 // "productId": { 11501 // "description": "The ID of the product.", 11502 // "location": "path", 11503 // "required": true, 11504 // "type": "string" 11505 // } 11506 // }, 11507 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove", 11508 // "scopes": [ 11509 // "https://www.googleapis.com/auth/androidenterprise" 11510 // ] 11511 // } 11512 11513} 11514 11515// method id "androidenterprise.serviceaccountkeys.delete": 11516 11517type ServiceaccountkeysDeleteCall struct { 11518 s *Service 11519 enterpriseId string 11520 keyId string 11521 urlParams_ gensupport.URLParams 11522 ctx_ context.Context 11523 header_ http.Header 11524} 11525 11526// Delete: Removes and invalidates the specified credentials for the 11527// service account associated with this enterprise. The calling service 11528// account must have been retrieved by calling 11529// Enterprises.GetServiceAccount and must have been set as the 11530// enterprise service account by calling Enterprises.SetAccount. 11531// 11532// - enterpriseId: The ID of the enterprise. 11533// - keyId: The ID of the key. 11534func (r *ServiceaccountkeysService) Delete(enterpriseId string, keyId string) *ServiceaccountkeysDeleteCall { 11535 c := &ServiceaccountkeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11536 c.enterpriseId = enterpriseId 11537 c.keyId = keyId 11538 return c 11539} 11540 11541// Fields allows partial responses to be retrieved. See 11542// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11543// for more information. 11544func (c *ServiceaccountkeysDeleteCall) Fields(s ...googleapi.Field) *ServiceaccountkeysDeleteCall { 11545 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11546 return c 11547} 11548 11549// Context sets the context to be used in this call's Do method. Any 11550// pending HTTP request will be aborted if the provided context is 11551// canceled. 11552func (c *ServiceaccountkeysDeleteCall) Context(ctx context.Context) *ServiceaccountkeysDeleteCall { 11553 c.ctx_ = ctx 11554 return c 11555} 11556 11557// Header returns an http.Header that can be modified by the caller to 11558// add HTTP headers to the request. 11559func (c *ServiceaccountkeysDeleteCall) Header() http.Header { 11560 if c.header_ == nil { 11561 c.header_ = make(http.Header) 11562 } 11563 return c.header_ 11564} 11565 11566func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) { 11567 reqHeaders := make(http.Header) 11568 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11569 for k, v := range c.header_ { 11570 reqHeaders[k] = v 11571 } 11572 reqHeaders.Set("User-Agent", c.s.userAgent()) 11573 var body io.Reader = nil 11574 c.urlParams_.Set("alt", alt) 11575 c.urlParams_.Set("prettyPrint", "false") 11576 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}") 11577 urls += "?" + c.urlParams_.Encode() 11578 req, err := http.NewRequest("DELETE", urls, body) 11579 if err != nil { 11580 return nil, err 11581 } 11582 req.Header = reqHeaders 11583 googleapi.Expand(req.URL, map[string]string{ 11584 "enterpriseId": c.enterpriseId, 11585 "keyId": c.keyId, 11586 }) 11587 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11588} 11589 11590// Do executes the "androidenterprise.serviceaccountkeys.delete" call. 11591func (c *ServiceaccountkeysDeleteCall) Do(opts ...googleapi.CallOption) error { 11592 gensupport.SetOptions(c.urlParams_, opts...) 11593 res, err := c.doRequest("json") 11594 if err != nil { 11595 return err 11596 } 11597 defer googleapi.CloseBody(res) 11598 if err := googleapi.CheckResponse(res); err != nil { 11599 return err 11600 } 11601 return nil 11602 // { 11603 // "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.", 11604 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}", 11605 // "httpMethod": "DELETE", 11606 // "id": "androidenterprise.serviceaccountkeys.delete", 11607 // "parameterOrder": [ 11608 // "enterpriseId", 11609 // "keyId" 11610 // ], 11611 // "parameters": { 11612 // "enterpriseId": { 11613 // "description": "The ID of the enterprise.", 11614 // "location": "path", 11615 // "required": true, 11616 // "type": "string" 11617 // }, 11618 // "keyId": { 11619 // "description": "The ID of the key.", 11620 // "location": "path", 11621 // "required": true, 11622 // "type": "string" 11623 // } 11624 // }, 11625 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}", 11626 // "scopes": [ 11627 // "https://www.googleapis.com/auth/androidenterprise" 11628 // ] 11629 // } 11630 11631} 11632 11633// method id "androidenterprise.serviceaccountkeys.insert": 11634 11635type ServiceaccountkeysInsertCall struct { 11636 s *Service 11637 enterpriseId string 11638 serviceaccountkey *ServiceAccountKey 11639 urlParams_ gensupport.URLParams 11640 ctx_ context.Context 11641 header_ http.Header 11642} 11643 11644// Insert: Generates new credentials for the service account associated 11645// with this enterprise. The calling service account must have been 11646// retrieved by calling Enterprises.GetServiceAccount and must have been 11647// set as the enterprise service account by calling 11648// Enterprises.SetAccount. Only the type of the key should be populated 11649// in the resource to be inserted. 11650// 11651// - enterpriseId: The ID of the enterprise. 11652func (r *ServiceaccountkeysService) Insert(enterpriseId string, serviceaccountkey *ServiceAccountKey) *ServiceaccountkeysInsertCall { 11653 c := &ServiceaccountkeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11654 c.enterpriseId = enterpriseId 11655 c.serviceaccountkey = serviceaccountkey 11656 return c 11657} 11658 11659// Fields allows partial responses to be retrieved. See 11660// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11661// for more information. 11662func (c *ServiceaccountkeysInsertCall) Fields(s ...googleapi.Field) *ServiceaccountkeysInsertCall { 11663 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11664 return c 11665} 11666 11667// Context sets the context to be used in this call's Do method. Any 11668// pending HTTP request will be aborted if the provided context is 11669// canceled. 11670func (c *ServiceaccountkeysInsertCall) Context(ctx context.Context) *ServiceaccountkeysInsertCall { 11671 c.ctx_ = ctx 11672 return c 11673} 11674 11675// Header returns an http.Header that can be modified by the caller to 11676// add HTTP headers to the request. 11677func (c *ServiceaccountkeysInsertCall) Header() http.Header { 11678 if c.header_ == nil { 11679 c.header_ = make(http.Header) 11680 } 11681 return c.header_ 11682} 11683 11684func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) { 11685 reqHeaders := make(http.Header) 11686 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11687 for k, v := range c.header_ { 11688 reqHeaders[k] = v 11689 } 11690 reqHeaders.Set("User-Agent", c.s.userAgent()) 11691 var body io.Reader = nil 11692 body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey) 11693 if err != nil { 11694 return nil, err 11695 } 11696 reqHeaders.Set("Content-Type", "application/json") 11697 c.urlParams_.Set("alt", alt) 11698 c.urlParams_.Set("prettyPrint", "false") 11699 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys") 11700 urls += "?" + c.urlParams_.Encode() 11701 req, err := http.NewRequest("POST", urls, body) 11702 if err != nil { 11703 return nil, err 11704 } 11705 req.Header = reqHeaders 11706 googleapi.Expand(req.URL, map[string]string{ 11707 "enterpriseId": c.enterpriseId, 11708 }) 11709 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11710} 11711 11712// Do executes the "androidenterprise.serviceaccountkeys.insert" call. 11713// Exactly one of *ServiceAccountKey or error will be non-nil. Any 11714// non-2xx status code is an error. Response headers are in either 11715// *ServiceAccountKey.ServerResponse.Header or (if a response was 11716// returned at all) in error.(*googleapi.Error).Header. Use 11717// googleapi.IsNotModified to check whether the returned error was 11718// because http.StatusNotModified was returned. 11719func (c *ServiceaccountkeysInsertCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKey, error) { 11720 gensupport.SetOptions(c.urlParams_, opts...) 11721 res, err := c.doRequest("json") 11722 if res != nil && res.StatusCode == http.StatusNotModified { 11723 if res.Body != nil { 11724 res.Body.Close() 11725 } 11726 return nil, &googleapi.Error{ 11727 Code: res.StatusCode, 11728 Header: res.Header, 11729 } 11730 } 11731 if err != nil { 11732 return nil, err 11733 } 11734 defer googleapi.CloseBody(res) 11735 if err := googleapi.CheckResponse(res); err != nil { 11736 return nil, err 11737 } 11738 ret := &ServiceAccountKey{ 11739 ServerResponse: googleapi.ServerResponse{ 11740 Header: res.Header, 11741 HTTPStatusCode: res.StatusCode, 11742 }, 11743 } 11744 target := &ret 11745 if err := gensupport.DecodeResponse(target, res); err != nil { 11746 return nil, err 11747 } 11748 return ret, nil 11749 // { 11750 // "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.", 11751 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11752 // "httpMethod": "POST", 11753 // "id": "androidenterprise.serviceaccountkeys.insert", 11754 // "parameterOrder": [ 11755 // "enterpriseId" 11756 // ], 11757 // "parameters": { 11758 // "enterpriseId": { 11759 // "description": "The ID of the enterprise.", 11760 // "location": "path", 11761 // "required": true, 11762 // "type": "string" 11763 // } 11764 // }, 11765 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11766 // "request": { 11767 // "$ref": "ServiceAccountKey" 11768 // }, 11769 // "response": { 11770 // "$ref": "ServiceAccountKey" 11771 // }, 11772 // "scopes": [ 11773 // "https://www.googleapis.com/auth/androidenterprise" 11774 // ] 11775 // } 11776 11777} 11778 11779// method id "androidenterprise.serviceaccountkeys.list": 11780 11781type ServiceaccountkeysListCall struct { 11782 s *Service 11783 enterpriseId string 11784 urlParams_ gensupport.URLParams 11785 ifNoneMatch_ string 11786 ctx_ context.Context 11787 header_ http.Header 11788} 11789 11790// List: Lists all active credentials for the service account associated 11791// with this enterprise. Only the ID and key type are returned. The 11792// calling service account must have been retrieved by calling 11793// Enterprises.GetServiceAccount and must have been set as the 11794// enterprise service account by calling Enterprises.SetAccount. 11795// 11796// - enterpriseId: The ID of the enterprise. 11797func (r *ServiceaccountkeysService) List(enterpriseId string) *ServiceaccountkeysListCall { 11798 c := &ServiceaccountkeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11799 c.enterpriseId = enterpriseId 11800 return c 11801} 11802 11803// Fields allows partial responses to be retrieved. See 11804// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11805// for more information. 11806func (c *ServiceaccountkeysListCall) Fields(s ...googleapi.Field) *ServiceaccountkeysListCall { 11807 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11808 return c 11809} 11810 11811// IfNoneMatch sets the optional parameter which makes the operation 11812// fail if the object's ETag matches the given value. This is useful for 11813// getting updates only after the object has changed since the last 11814// request. Use googleapi.IsNotModified to check whether the response 11815// error from Do is the result of In-None-Match. 11816func (c *ServiceaccountkeysListCall) IfNoneMatch(entityTag string) *ServiceaccountkeysListCall { 11817 c.ifNoneMatch_ = entityTag 11818 return c 11819} 11820 11821// Context sets the context to be used in this call's Do method. Any 11822// pending HTTP request will be aborted if the provided context is 11823// canceled. 11824func (c *ServiceaccountkeysListCall) Context(ctx context.Context) *ServiceaccountkeysListCall { 11825 c.ctx_ = ctx 11826 return c 11827} 11828 11829// Header returns an http.Header that can be modified by the caller to 11830// add HTTP headers to the request. 11831func (c *ServiceaccountkeysListCall) Header() http.Header { 11832 if c.header_ == nil { 11833 c.header_ = make(http.Header) 11834 } 11835 return c.header_ 11836} 11837 11838func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, error) { 11839 reqHeaders := make(http.Header) 11840 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11841 for k, v := range c.header_ { 11842 reqHeaders[k] = v 11843 } 11844 reqHeaders.Set("User-Agent", c.s.userAgent()) 11845 if c.ifNoneMatch_ != "" { 11846 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11847 } 11848 var body io.Reader = nil 11849 c.urlParams_.Set("alt", alt) 11850 c.urlParams_.Set("prettyPrint", "false") 11851 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys") 11852 urls += "?" + c.urlParams_.Encode() 11853 req, err := http.NewRequest("GET", urls, body) 11854 if err != nil { 11855 return nil, err 11856 } 11857 req.Header = reqHeaders 11858 googleapi.Expand(req.URL, map[string]string{ 11859 "enterpriseId": c.enterpriseId, 11860 }) 11861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11862} 11863 11864// Do executes the "androidenterprise.serviceaccountkeys.list" call. 11865// Exactly one of *ServiceAccountKeysListResponse or error will be 11866// non-nil. Any non-2xx status code is an error. Response headers are in 11867// either *ServiceAccountKeysListResponse.ServerResponse.Header or (if a 11868// response was returned at all) in error.(*googleapi.Error).Header. Use 11869// googleapi.IsNotModified to check whether the returned error was 11870// because http.StatusNotModified was returned. 11871func (c *ServiceaccountkeysListCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKeysListResponse, error) { 11872 gensupport.SetOptions(c.urlParams_, opts...) 11873 res, err := c.doRequest("json") 11874 if res != nil && res.StatusCode == http.StatusNotModified { 11875 if res.Body != nil { 11876 res.Body.Close() 11877 } 11878 return nil, &googleapi.Error{ 11879 Code: res.StatusCode, 11880 Header: res.Header, 11881 } 11882 } 11883 if err != nil { 11884 return nil, err 11885 } 11886 defer googleapi.CloseBody(res) 11887 if err := googleapi.CheckResponse(res); err != nil { 11888 return nil, err 11889 } 11890 ret := &ServiceAccountKeysListResponse{ 11891 ServerResponse: googleapi.ServerResponse{ 11892 Header: res.Header, 11893 HTTPStatusCode: res.StatusCode, 11894 }, 11895 } 11896 target := &ret 11897 if err := gensupport.DecodeResponse(target, res); err != nil { 11898 return nil, err 11899 } 11900 return ret, nil 11901 // { 11902 // "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.", 11903 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11904 // "httpMethod": "GET", 11905 // "id": "androidenterprise.serviceaccountkeys.list", 11906 // "parameterOrder": [ 11907 // "enterpriseId" 11908 // ], 11909 // "parameters": { 11910 // "enterpriseId": { 11911 // "description": "The ID of the enterprise.", 11912 // "location": "path", 11913 // "required": true, 11914 // "type": "string" 11915 // } 11916 // }, 11917 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys", 11918 // "response": { 11919 // "$ref": "ServiceAccountKeysListResponse" 11920 // }, 11921 // "scopes": [ 11922 // "https://www.googleapis.com/auth/androidenterprise" 11923 // ] 11924 // } 11925 11926} 11927 11928// method id "androidenterprise.storelayoutclusters.delete": 11929 11930type StorelayoutclustersDeleteCall struct { 11931 s *Service 11932 enterpriseId string 11933 pageId string 11934 clusterId string 11935 urlParams_ gensupport.URLParams 11936 ctx_ context.Context 11937 header_ http.Header 11938} 11939 11940// Delete: Deletes a cluster. 11941// 11942// - clusterId: The ID of the cluster. 11943// - enterpriseId: The ID of the enterprise. 11944// - pageId: The ID of the page. 11945func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall { 11946 c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11947 c.enterpriseId = enterpriseId 11948 c.pageId = pageId 11949 c.clusterId = clusterId 11950 return c 11951} 11952 11953// Fields allows partial responses to be retrieved. See 11954// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11955// for more information. 11956func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall { 11957 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11958 return c 11959} 11960 11961// Context sets the context to be used in this call's Do method. Any 11962// pending HTTP request will be aborted if the provided context is 11963// canceled. 11964func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall { 11965 c.ctx_ = ctx 11966 return c 11967} 11968 11969// Header returns an http.Header that can be modified by the caller to 11970// add HTTP headers to the request. 11971func (c *StorelayoutclustersDeleteCall) Header() http.Header { 11972 if c.header_ == nil { 11973 c.header_ = make(http.Header) 11974 } 11975 return c.header_ 11976} 11977 11978func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) { 11979 reqHeaders := make(http.Header) 11980 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11981 for k, v := range c.header_ { 11982 reqHeaders[k] = v 11983 } 11984 reqHeaders.Set("User-Agent", c.s.userAgent()) 11985 var body io.Reader = nil 11986 c.urlParams_.Set("alt", alt) 11987 c.urlParams_.Set("prettyPrint", "false") 11988 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 11989 urls += "?" + c.urlParams_.Encode() 11990 req, err := http.NewRequest("DELETE", urls, body) 11991 if err != nil { 11992 return nil, err 11993 } 11994 req.Header = reqHeaders 11995 googleapi.Expand(req.URL, map[string]string{ 11996 "enterpriseId": c.enterpriseId, 11997 "pageId": c.pageId, 11998 "clusterId": c.clusterId, 11999 }) 12000 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12001} 12002 12003// Do executes the "androidenterprise.storelayoutclusters.delete" call. 12004func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error { 12005 gensupport.SetOptions(c.urlParams_, opts...) 12006 res, err := c.doRequest("json") 12007 if err != nil { 12008 return err 12009 } 12010 defer googleapi.CloseBody(res) 12011 if err := googleapi.CheckResponse(res); err != nil { 12012 return err 12013 } 12014 return nil 12015 // { 12016 // "description": "Deletes a cluster.", 12017 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12018 // "httpMethod": "DELETE", 12019 // "id": "androidenterprise.storelayoutclusters.delete", 12020 // "parameterOrder": [ 12021 // "enterpriseId", 12022 // "pageId", 12023 // "clusterId" 12024 // ], 12025 // "parameters": { 12026 // "clusterId": { 12027 // "description": "The ID of the cluster.", 12028 // "location": "path", 12029 // "required": true, 12030 // "type": "string" 12031 // }, 12032 // "enterpriseId": { 12033 // "description": "The ID of the enterprise.", 12034 // "location": "path", 12035 // "required": true, 12036 // "type": "string" 12037 // }, 12038 // "pageId": { 12039 // "description": "The ID of the page.", 12040 // "location": "path", 12041 // "required": true, 12042 // "type": "string" 12043 // } 12044 // }, 12045 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12046 // "scopes": [ 12047 // "https://www.googleapis.com/auth/androidenterprise" 12048 // ] 12049 // } 12050 12051} 12052 12053// method id "androidenterprise.storelayoutclusters.get": 12054 12055type StorelayoutclustersGetCall struct { 12056 s *Service 12057 enterpriseId string 12058 pageId string 12059 clusterId string 12060 urlParams_ gensupport.URLParams 12061 ifNoneMatch_ string 12062 ctx_ context.Context 12063 header_ http.Header 12064} 12065 12066// Get: Retrieves details of a cluster. 12067// 12068// - clusterId: The ID of the cluster. 12069// - enterpriseId: The ID of the enterprise. 12070// - pageId: The ID of the page. 12071func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall { 12072 c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12073 c.enterpriseId = enterpriseId 12074 c.pageId = pageId 12075 c.clusterId = clusterId 12076 return c 12077} 12078 12079// Fields allows partial responses to be retrieved. See 12080// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12081// for more information. 12082func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall { 12083 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12084 return c 12085} 12086 12087// IfNoneMatch sets the optional parameter which makes the operation 12088// fail if the object's ETag matches the given value. This is useful for 12089// getting updates only after the object has changed since the last 12090// request. Use googleapi.IsNotModified to check whether the response 12091// error from Do is the result of In-None-Match. 12092func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall { 12093 c.ifNoneMatch_ = entityTag 12094 return c 12095} 12096 12097// Context sets the context to be used in this call's Do method. Any 12098// pending HTTP request will be aborted if the provided context is 12099// canceled. 12100func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall { 12101 c.ctx_ = ctx 12102 return c 12103} 12104 12105// Header returns an http.Header that can be modified by the caller to 12106// add HTTP headers to the request. 12107func (c *StorelayoutclustersGetCall) Header() http.Header { 12108 if c.header_ == nil { 12109 c.header_ = make(http.Header) 12110 } 12111 return c.header_ 12112} 12113 12114func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) { 12115 reqHeaders := make(http.Header) 12116 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12117 for k, v := range c.header_ { 12118 reqHeaders[k] = v 12119 } 12120 reqHeaders.Set("User-Agent", c.s.userAgent()) 12121 if c.ifNoneMatch_ != "" { 12122 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12123 } 12124 var body io.Reader = nil 12125 c.urlParams_.Set("alt", alt) 12126 c.urlParams_.Set("prettyPrint", "false") 12127 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 12128 urls += "?" + c.urlParams_.Encode() 12129 req, err := http.NewRequest("GET", urls, body) 12130 if err != nil { 12131 return nil, err 12132 } 12133 req.Header = reqHeaders 12134 googleapi.Expand(req.URL, map[string]string{ 12135 "enterpriseId": c.enterpriseId, 12136 "pageId": c.pageId, 12137 "clusterId": c.clusterId, 12138 }) 12139 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12140} 12141 12142// Do executes the "androidenterprise.storelayoutclusters.get" call. 12143// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12144// status code is an error. Response headers are in either 12145// *StoreCluster.ServerResponse.Header or (if a response was returned at 12146// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12147// to check whether the returned error was because 12148// http.StatusNotModified was returned. 12149func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12150 gensupport.SetOptions(c.urlParams_, opts...) 12151 res, err := c.doRequest("json") 12152 if res != nil && res.StatusCode == http.StatusNotModified { 12153 if res.Body != nil { 12154 res.Body.Close() 12155 } 12156 return nil, &googleapi.Error{ 12157 Code: res.StatusCode, 12158 Header: res.Header, 12159 } 12160 } 12161 if err != nil { 12162 return nil, err 12163 } 12164 defer googleapi.CloseBody(res) 12165 if err := googleapi.CheckResponse(res); err != nil { 12166 return nil, err 12167 } 12168 ret := &StoreCluster{ 12169 ServerResponse: googleapi.ServerResponse{ 12170 Header: res.Header, 12171 HTTPStatusCode: res.StatusCode, 12172 }, 12173 } 12174 target := &ret 12175 if err := gensupport.DecodeResponse(target, res); err != nil { 12176 return nil, err 12177 } 12178 return ret, nil 12179 // { 12180 // "description": "Retrieves details of a cluster.", 12181 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12182 // "httpMethod": "GET", 12183 // "id": "androidenterprise.storelayoutclusters.get", 12184 // "parameterOrder": [ 12185 // "enterpriseId", 12186 // "pageId", 12187 // "clusterId" 12188 // ], 12189 // "parameters": { 12190 // "clusterId": { 12191 // "description": "The ID of the cluster.", 12192 // "location": "path", 12193 // "required": true, 12194 // "type": "string" 12195 // }, 12196 // "enterpriseId": { 12197 // "description": "The ID of the enterprise.", 12198 // "location": "path", 12199 // "required": true, 12200 // "type": "string" 12201 // }, 12202 // "pageId": { 12203 // "description": "The ID of the page.", 12204 // "location": "path", 12205 // "required": true, 12206 // "type": "string" 12207 // } 12208 // }, 12209 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12210 // "response": { 12211 // "$ref": "StoreCluster" 12212 // }, 12213 // "scopes": [ 12214 // "https://www.googleapis.com/auth/androidenterprise" 12215 // ] 12216 // } 12217 12218} 12219 12220// method id "androidenterprise.storelayoutclusters.insert": 12221 12222type StorelayoutclustersInsertCall struct { 12223 s *Service 12224 enterpriseId string 12225 pageId string 12226 storecluster *StoreCluster 12227 urlParams_ gensupport.URLParams 12228 ctx_ context.Context 12229 header_ http.Header 12230} 12231 12232// Insert: Inserts a new cluster in a page. 12233// 12234// - enterpriseId: The ID of the enterprise. 12235// - pageId: The ID of the page. 12236func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall { 12237 c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12238 c.enterpriseId = enterpriseId 12239 c.pageId = pageId 12240 c.storecluster = storecluster 12241 return c 12242} 12243 12244// Fields allows partial responses to be retrieved. See 12245// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12246// for more information. 12247func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall { 12248 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12249 return c 12250} 12251 12252// Context sets the context to be used in this call's Do method. Any 12253// pending HTTP request will be aborted if the provided context is 12254// canceled. 12255func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall { 12256 c.ctx_ = ctx 12257 return c 12258} 12259 12260// Header returns an http.Header that can be modified by the caller to 12261// add HTTP headers to the request. 12262func (c *StorelayoutclustersInsertCall) Header() http.Header { 12263 if c.header_ == nil { 12264 c.header_ = make(http.Header) 12265 } 12266 return c.header_ 12267} 12268 12269func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) { 12270 reqHeaders := make(http.Header) 12271 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12272 for k, v := range c.header_ { 12273 reqHeaders[k] = v 12274 } 12275 reqHeaders.Set("User-Agent", c.s.userAgent()) 12276 var body io.Reader = nil 12277 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 12278 if err != nil { 12279 return nil, err 12280 } 12281 reqHeaders.Set("Content-Type", "application/json") 12282 c.urlParams_.Set("alt", alt) 12283 c.urlParams_.Set("prettyPrint", "false") 12284 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 12285 urls += "?" + c.urlParams_.Encode() 12286 req, err := http.NewRequest("POST", urls, body) 12287 if err != nil { 12288 return nil, err 12289 } 12290 req.Header = reqHeaders 12291 googleapi.Expand(req.URL, map[string]string{ 12292 "enterpriseId": c.enterpriseId, 12293 "pageId": c.pageId, 12294 }) 12295 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12296} 12297 12298// Do executes the "androidenterprise.storelayoutclusters.insert" call. 12299// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12300// status code is an error. Response headers are in either 12301// *StoreCluster.ServerResponse.Header or (if a response was returned at 12302// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12303// to check whether the returned error was because 12304// http.StatusNotModified was returned. 12305func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12306 gensupport.SetOptions(c.urlParams_, opts...) 12307 res, err := c.doRequest("json") 12308 if res != nil && res.StatusCode == http.StatusNotModified { 12309 if res.Body != nil { 12310 res.Body.Close() 12311 } 12312 return nil, &googleapi.Error{ 12313 Code: res.StatusCode, 12314 Header: res.Header, 12315 } 12316 } 12317 if err != nil { 12318 return nil, err 12319 } 12320 defer googleapi.CloseBody(res) 12321 if err := googleapi.CheckResponse(res); err != nil { 12322 return nil, err 12323 } 12324 ret := &StoreCluster{ 12325 ServerResponse: googleapi.ServerResponse{ 12326 Header: res.Header, 12327 HTTPStatusCode: res.StatusCode, 12328 }, 12329 } 12330 target := &ret 12331 if err := gensupport.DecodeResponse(target, res); err != nil { 12332 return nil, err 12333 } 12334 return ret, nil 12335 // { 12336 // "description": "Inserts a new cluster in a page.", 12337 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12338 // "httpMethod": "POST", 12339 // "id": "androidenterprise.storelayoutclusters.insert", 12340 // "parameterOrder": [ 12341 // "enterpriseId", 12342 // "pageId" 12343 // ], 12344 // "parameters": { 12345 // "enterpriseId": { 12346 // "description": "The ID of the enterprise.", 12347 // "location": "path", 12348 // "required": true, 12349 // "type": "string" 12350 // }, 12351 // "pageId": { 12352 // "description": "The ID of the page.", 12353 // "location": "path", 12354 // "required": true, 12355 // "type": "string" 12356 // } 12357 // }, 12358 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12359 // "request": { 12360 // "$ref": "StoreCluster" 12361 // }, 12362 // "response": { 12363 // "$ref": "StoreCluster" 12364 // }, 12365 // "scopes": [ 12366 // "https://www.googleapis.com/auth/androidenterprise" 12367 // ] 12368 // } 12369 12370} 12371 12372// method id "androidenterprise.storelayoutclusters.list": 12373 12374type StorelayoutclustersListCall struct { 12375 s *Service 12376 enterpriseId string 12377 pageId string 12378 urlParams_ gensupport.URLParams 12379 ifNoneMatch_ string 12380 ctx_ context.Context 12381 header_ http.Header 12382} 12383 12384// List: Retrieves the details of all clusters on the specified page. 12385// 12386// - enterpriseId: The ID of the enterprise. 12387// - pageId: The ID of the page. 12388func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall { 12389 c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12390 c.enterpriseId = enterpriseId 12391 c.pageId = pageId 12392 return c 12393} 12394 12395// Fields allows partial responses to be retrieved. See 12396// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12397// for more information. 12398func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall { 12399 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12400 return c 12401} 12402 12403// IfNoneMatch sets the optional parameter which makes the operation 12404// fail if the object's ETag matches the given value. This is useful for 12405// getting updates only after the object has changed since the last 12406// request. Use googleapi.IsNotModified to check whether the response 12407// error from Do is the result of In-None-Match. 12408func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall { 12409 c.ifNoneMatch_ = entityTag 12410 return c 12411} 12412 12413// Context sets the context to be used in this call's Do method. Any 12414// pending HTTP request will be aborted if the provided context is 12415// canceled. 12416func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall { 12417 c.ctx_ = ctx 12418 return c 12419} 12420 12421// Header returns an http.Header that can be modified by the caller to 12422// add HTTP headers to the request. 12423func (c *StorelayoutclustersListCall) Header() http.Header { 12424 if c.header_ == nil { 12425 c.header_ = make(http.Header) 12426 } 12427 return c.header_ 12428} 12429 12430func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) { 12431 reqHeaders := make(http.Header) 12432 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12433 for k, v := range c.header_ { 12434 reqHeaders[k] = v 12435 } 12436 reqHeaders.Set("User-Agent", c.s.userAgent()) 12437 if c.ifNoneMatch_ != "" { 12438 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12439 } 12440 var body io.Reader = nil 12441 c.urlParams_.Set("alt", alt) 12442 c.urlParams_.Set("prettyPrint", "false") 12443 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 12444 urls += "?" + c.urlParams_.Encode() 12445 req, err := http.NewRequest("GET", urls, body) 12446 if err != nil { 12447 return nil, err 12448 } 12449 req.Header = reqHeaders 12450 googleapi.Expand(req.URL, map[string]string{ 12451 "enterpriseId": c.enterpriseId, 12452 "pageId": c.pageId, 12453 }) 12454 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12455} 12456 12457// Do executes the "androidenterprise.storelayoutclusters.list" call. 12458// Exactly one of *StoreLayoutClustersListResponse or error will be 12459// non-nil. Any non-2xx status code is an error. Response headers are in 12460// either *StoreLayoutClustersListResponse.ServerResponse.Header or (if 12461// a response was returned at all) in error.(*googleapi.Error).Header. 12462// Use googleapi.IsNotModified to check whether the returned error was 12463// because http.StatusNotModified was returned. 12464func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) { 12465 gensupport.SetOptions(c.urlParams_, opts...) 12466 res, err := c.doRequest("json") 12467 if res != nil && res.StatusCode == http.StatusNotModified { 12468 if res.Body != nil { 12469 res.Body.Close() 12470 } 12471 return nil, &googleapi.Error{ 12472 Code: res.StatusCode, 12473 Header: res.Header, 12474 } 12475 } 12476 if err != nil { 12477 return nil, err 12478 } 12479 defer googleapi.CloseBody(res) 12480 if err := googleapi.CheckResponse(res); err != nil { 12481 return nil, err 12482 } 12483 ret := &StoreLayoutClustersListResponse{ 12484 ServerResponse: googleapi.ServerResponse{ 12485 Header: res.Header, 12486 HTTPStatusCode: res.StatusCode, 12487 }, 12488 } 12489 target := &ret 12490 if err := gensupport.DecodeResponse(target, res); err != nil { 12491 return nil, err 12492 } 12493 return ret, nil 12494 // { 12495 // "description": "Retrieves the details of all clusters on the specified page.", 12496 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12497 // "httpMethod": "GET", 12498 // "id": "androidenterprise.storelayoutclusters.list", 12499 // "parameterOrder": [ 12500 // "enterpriseId", 12501 // "pageId" 12502 // ], 12503 // "parameters": { 12504 // "enterpriseId": { 12505 // "description": "The ID of the enterprise.", 12506 // "location": "path", 12507 // "required": true, 12508 // "type": "string" 12509 // }, 12510 // "pageId": { 12511 // "description": "The ID of the page.", 12512 // "location": "path", 12513 // "required": true, 12514 // "type": "string" 12515 // } 12516 // }, 12517 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12518 // "response": { 12519 // "$ref": "StoreLayoutClustersListResponse" 12520 // }, 12521 // "scopes": [ 12522 // "https://www.googleapis.com/auth/androidenterprise" 12523 // ] 12524 // } 12525 12526} 12527 12528// method id "androidenterprise.storelayoutclusters.update": 12529 12530type StorelayoutclustersUpdateCall struct { 12531 s *Service 12532 enterpriseId string 12533 pageId string 12534 clusterId string 12535 storecluster *StoreCluster 12536 urlParams_ gensupport.URLParams 12537 ctx_ context.Context 12538 header_ http.Header 12539} 12540 12541// Update: Updates a cluster. 12542// 12543// - clusterId: The ID of the cluster. 12544// - enterpriseId: The ID of the enterprise. 12545// - pageId: The ID of the page. 12546func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall { 12547 c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12548 c.enterpriseId = enterpriseId 12549 c.pageId = pageId 12550 c.clusterId = clusterId 12551 c.storecluster = storecluster 12552 return c 12553} 12554 12555// Fields allows partial responses to be retrieved. See 12556// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12557// for more information. 12558func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall { 12559 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12560 return c 12561} 12562 12563// Context sets the context to be used in this call's Do method. Any 12564// pending HTTP request will be aborted if the provided context is 12565// canceled. 12566func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall { 12567 c.ctx_ = ctx 12568 return c 12569} 12570 12571// Header returns an http.Header that can be modified by the caller to 12572// add HTTP headers to the request. 12573func (c *StorelayoutclustersUpdateCall) Header() http.Header { 12574 if c.header_ == nil { 12575 c.header_ = make(http.Header) 12576 } 12577 return c.header_ 12578} 12579 12580func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) { 12581 reqHeaders := make(http.Header) 12582 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12583 for k, v := range c.header_ { 12584 reqHeaders[k] = v 12585 } 12586 reqHeaders.Set("User-Agent", c.s.userAgent()) 12587 var body io.Reader = nil 12588 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 12589 if err != nil { 12590 return nil, err 12591 } 12592 reqHeaders.Set("Content-Type", "application/json") 12593 c.urlParams_.Set("alt", alt) 12594 c.urlParams_.Set("prettyPrint", "false") 12595 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 12596 urls += "?" + c.urlParams_.Encode() 12597 req, err := http.NewRequest("PUT", urls, body) 12598 if err != nil { 12599 return nil, err 12600 } 12601 req.Header = reqHeaders 12602 googleapi.Expand(req.URL, map[string]string{ 12603 "enterpriseId": c.enterpriseId, 12604 "pageId": c.pageId, 12605 "clusterId": c.clusterId, 12606 }) 12607 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12608} 12609 12610// Do executes the "androidenterprise.storelayoutclusters.update" call. 12611// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12612// status code is an error. Response headers are in either 12613// *StoreCluster.ServerResponse.Header or (if a response was returned at 12614// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12615// to check whether the returned error was because 12616// http.StatusNotModified was returned. 12617func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12618 gensupport.SetOptions(c.urlParams_, opts...) 12619 res, err := c.doRequest("json") 12620 if res != nil && res.StatusCode == http.StatusNotModified { 12621 if res.Body != nil { 12622 res.Body.Close() 12623 } 12624 return nil, &googleapi.Error{ 12625 Code: res.StatusCode, 12626 Header: res.Header, 12627 } 12628 } 12629 if err != nil { 12630 return nil, err 12631 } 12632 defer googleapi.CloseBody(res) 12633 if err := googleapi.CheckResponse(res); err != nil { 12634 return nil, err 12635 } 12636 ret := &StoreCluster{ 12637 ServerResponse: googleapi.ServerResponse{ 12638 Header: res.Header, 12639 HTTPStatusCode: res.StatusCode, 12640 }, 12641 } 12642 target := &ret 12643 if err := gensupport.DecodeResponse(target, res); err != nil { 12644 return nil, err 12645 } 12646 return ret, nil 12647 // { 12648 // "description": "Updates a cluster.", 12649 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12650 // "httpMethod": "PUT", 12651 // "id": "androidenterprise.storelayoutclusters.update", 12652 // "parameterOrder": [ 12653 // "enterpriseId", 12654 // "pageId", 12655 // "clusterId" 12656 // ], 12657 // "parameters": { 12658 // "clusterId": { 12659 // "description": "The ID of the cluster.", 12660 // "location": "path", 12661 // "required": true, 12662 // "type": "string" 12663 // }, 12664 // "enterpriseId": { 12665 // "description": "The ID of the enterprise.", 12666 // "location": "path", 12667 // "required": true, 12668 // "type": "string" 12669 // }, 12670 // "pageId": { 12671 // "description": "The ID of the page.", 12672 // "location": "path", 12673 // "required": true, 12674 // "type": "string" 12675 // } 12676 // }, 12677 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12678 // "request": { 12679 // "$ref": "StoreCluster" 12680 // }, 12681 // "response": { 12682 // "$ref": "StoreCluster" 12683 // }, 12684 // "scopes": [ 12685 // "https://www.googleapis.com/auth/androidenterprise" 12686 // ] 12687 // } 12688 12689} 12690 12691// method id "androidenterprise.storelayoutpages.delete": 12692 12693type StorelayoutpagesDeleteCall struct { 12694 s *Service 12695 enterpriseId string 12696 pageId string 12697 urlParams_ gensupport.URLParams 12698 ctx_ context.Context 12699 header_ http.Header 12700} 12701 12702// Delete: Deletes a store page. 12703// 12704// - enterpriseId: The ID of the enterprise. 12705// - pageId: The ID of the page. 12706func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall { 12707 c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12708 c.enterpriseId = enterpriseId 12709 c.pageId = pageId 12710 return c 12711} 12712 12713// Fields allows partial responses to be retrieved. See 12714// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12715// for more information. 12716func (c *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall { 12717 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12718 return c 12719} 12720 12721// Context sets the context to be used in this call's Do method. Any 12722// pending HTTP request will be aborted if the provided context is 12723// canceled. 12724func (c *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall { 12725 c.ctx_ = ctx 12726 return c 12727} 12728 12729// Header returns an http.Header that can be modified by the caller to 12730// add HTTP headers to the request. 12731func (c *StorelayoutpagesDeleteCall) Header() http.Header { 12732 if c.header_ == nil { 12733 c.header_ = make(http.Header) 12734 } 12735 return c.header_ 12736} 12737 12738func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) { 12739 reqHeaders := make(http.Header) 12740 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12741 for k, v := range c.header_ { 12742 reqHeaders[k] = v 12743 } 12744 reqHeaders.Set("User-Agent", c.s.userAgent()) 12745 var body io.Reader = nil 12746 c.urlParams_.Set("alt", alt) 12747 c.urlParams_.Set("prettyPrint", "false") 12748 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12749 urls += "?" + c.urlParams_.Encode() 12750 req, err := http.NewRequest("DELETE", urls, body) 12751 if err != nil { 12752 return nil, err 12753 } 12754 req.Header = reqHeaders 12755 googleapi.Expand(req.URL, map[string]string{ 12756 "enterpriseId": c.enterpriseId, 12757 "pageId": c.pageId, 12758 }) 12759 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12760} 12761 12762// Do executes the "androidenterprise.storelayoutpages.delete" call. 12763func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error { 12764 gensupport.SetOptions(c.urlParams_, opts...) 12765 res, err := c.doRequest("json") 12766 if err != nil { 12767 return err 12768 } 12769 defer googleapi.CloseBody(res) 12770 if err := googleapi.CheckResponse(res); err != nil { 12771 return err 12772 } 12773 return nil 12774 // { 12775 // "description": "Deletes a store page.", 12776 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12777 // "httpMethod": "DELETE", 12778 // "id": "androidenterprise.storelayoutpages.delete", 12779 // "parameterOrder": [ 12780 // "enterpriseId", 12781 // "pageId" 12782 // ], 12783 // "parameters": { 12784 // "enterpriseId": { 12785 // "description": "The ID of the enterprise.", 12786 // "location": "path", 12787 // "required": true, 12788 // "type": "string" 12789 // }, 12790 // "pageId": { 12791 // "description": "The ID of the page.", 12792 // "location": "path", 12793 // "required": true, 12794 // "type": "string" 12795 // } 12796 // }, 12797 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12798 // "scopes": [ 12799 // "https://www.googleapis.com/auth/androidenterprise" 12800 // ] 12801 // } 12802 12803} 12804 12805// method id "androidenterprise.storelayoutpages.get": 12806 12807type StorelayoutpagesGetCall struct { 12808 s *Service 12809 enterpriseId string 12810 pageId string 12811 urlParams_ gensupport.URLParams 12812 ifNoneMatch_ string 12813 ctx_ context.Context 12814 header_ http.Header 12815} 12816 12817// Get: Retrieves details of a store page. 12818// 12819// - enterpriseId: The ID of the enterprise. 12820// - pageId: The ID of the page. 12821func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall { 12822 c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12823 c.enterpriseId = enterpriseId 12824 c.pageId = pageId 12825 return c 12826} 12827 12828// Fields allows partial responses to be retrieved. See 12829// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12830// for more information. 12831func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall { 12832 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12833 return c 12834} 12835 12836// IfNoneMatch sets the optional parameter which makes the operation 12837// fail if the object's ETag matches the given value. This is useful for 12838// getting updates only after the object has changed since the last 12839// request. Use googleapi.IsNotModified to check whether the response 12840// error from Do is the result of In-None-Match. 12841func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall { 12842 c.ifNoneMatch_ = entityTag 12843 return c 12844} 12845 12846// Context sets the context to be used in this call's Do method. Any 12847// pending HTTP request will be aborted if the provided context is 12848// canceled. 12849func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall { 12850 c.ctx_ = ctx 12851 return c 12852} 12853 12854// Header returns an http.Header that can be modified by the caller to 12855// add HTTP headers to the request. 12856func (c *StorelayoutpagesGetCall) Header() http.Header { 12857 if c.header_ == nil { 12858 c.header_ = make(http.Header) 12859 } 12860 return c.header_ 12861} 12862 12863func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) { 12864 reqHeaders := make(http.Header) 12865 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12866 for k, v := range c.header_ { 12867 reqHeaders[k] = v 12868 } 12869 reqHeaders.Set("User-Agent", c.s.userAgent()) 12870 if c.ifNoneMatch_ != "" { 12871 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12872 } 12873 var body io.Reader = nil 12874 c.urlParams_.Set("alt", alt) 12875 c.urlParams_.Set("prettyPrint", "false") 12876 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12877 urls += "?" + c.urlParams_.Encode() 12878 req, err := http.NewRequest("GET", urls, body) 12879 if err != nil { 12880 return nil, err 12881 } 12882 req.Header = reqHeaders 12883 googleapi.Expand(req.URL, map[string]string{ 12884 "enterpriseId": c.enterpriseId, 12885 "pageId": c.pageId, 12886 }) 12887 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12888} 12889 12890// Do executes the "androidenterprise.storelayoutpages.get" call. 12891// Exactly one of *StorePage or error will be non-nil. Any non-2xx 12892// status code is an error. Response headers are in either 12893// *StorePage.ServerResponse.Header or (if a response was returned at 12894// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12895// to check whether the returned error was because 12896// http.StatusNotModified was returned. 12897func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 12898 gensupport.SetOptions(c.urlParams_, opts...) 12899 res, err := c.doRequest("json") 12900 if res != nil && res.StatusCode == http.StatusNotModified { 12901 if res.Body != nil { 12902 res.Body.Close() 12903 } 12904 return nil, &googleapi.Error{ 12905 Code: res.StatusCode, 12906 Header: res.Header, 12907 } 12908 } 12909 if err != nil { 12910 return nil, err 12911 } 12912 defer googleapi.CloseBody(res) 12913 if err := googleapi.CheckResponse(res); err != nil { 12914 return nil, err 12915 } 12916 ret := &StorePage{ 12917 ServerResponse: googleapi.ServerResponse{ 12918 Header: res.Header, 12919 HTTPStatusCode: res.StatusCode, 12920 }, 12921 } 12922 target := &ret 12923 if err := gensupport.DecodeResponse(target, res); err != nil { 12924 return nil, err 12925 } 12926 return ret, nil 12927 // { 12928 // "description": "Retrieves details of a store page.", 12929 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12930 // "httpMethod": "GET", 12931 // "id": "androidenterprise.storelayoutpages.get", 12932 // "parameterOrder": [ 12933 // "enterpriseId", 12934 // "pageId" 12935 // ], 12936 // "parameters": { 12937 // "enterpriseId": { 12938 // "description": "The ID of the enterprise.", 12939 // "location": "path", 12940 // "required": true, 12941 // "type": "string" 12942 // }, 12943 // "pageId": { 12944 // "description": "The ID of the page.", 12945 // "location": "path", 12946 // "required": true, 12947 // "type": "string" 12948 // } 12949 // }, 12950 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12951 // "response": { 12952 // "$ref": "StorePage" 12953 // }, 12954 // "scopes": [ 12955 // "https://www.googleapis.com/auth/androidenterprise" 12956 // ] 12957 // } 12958 12959} 12960 12961// method id "androidenterprise.storelayoutpages.insert": 12962 12963type StorelayoutpagesInsertCall struct { 12964 s *Service 12965 enterpriseId string 12966 storepage *StorePage 12967 urlParams_ gensupport.URLParams 12968 ctx_ context.Context 12969 header_ http.Header 12970} 12971 12972// Insert: Inserts a new store page. 12973// 12974// - enterpriseId: The ID of the enterprise. 12975func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall { 12976 c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12977 c.enterpriseId = enterpriseId 12978 c.storepage = storepage 12979 return c 12980} 12981 12982// Fields allows partial responses to be retrieved. See 12983// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12984// for more information. 12985func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall { 12986 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12987 return c 12988} 12989 12990// Context sets the context to be used in this call's Do method. Any 12991// pending HTTP request will be aborted if the provided context is 12992// canceled. 12993func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall { 12994 c.ctx_ = ctx 12995 return c 12996} 12997 12998// Header returns an http.Header that can be modified by the caller to 12999// add HTTP headers to the request. 13000func (c *StorelayoutpagesInsertCall) Header() http.Header { 13001 if c.header_ == nil { 13002 c.header_ = make(http.Header) 13003 } 13004 return c.header_ 13005} 13006 13007func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) { 13008 reqHeaders := make(http.Header) 13009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13010 for k, v := range c.header_ { 13011 reqHeaders[k] = v 13012 } 13013 reqHeaders.Set("User-Agent", c.s.userAgent()) 13014 var body io.Reader = nil 13015 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 13016 if err != nil { 13017 return nil, err 13018 } 13019 reqHeaders.Set("Content-Type", "application/json") 13020 c.urlParams_.Set("alt", alt) 13021 c.urlParams_.Set("prettyPrint", "false") 13022 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages") 13023 urls += "?" + c.urlParams_.Encode() 13024 req, err := http.NewRequest("POST", urls, body) 13025 if err != nil { 13026 return nil, err 13027 } 13028 req.Header = reqHeaders 13029 googleapi.Expand(req.URL, map[string]string{ 13030 "enterpriseId": c.enterpriseId, 13031 }) 13032 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13033} 13034 13035// Do executes the "androidenterprise.storelayoutpages.insert" call. 13036// Exactly one of *StorePage or error will be non-nil. Any non-2xx 13037// status code is an error. Response headers are in either 13038// *StorePage.ServerResponse.Header or (if a response was returned at 13039// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13040// to check whether the returned error was because 13041// http.StatusNotModified was returned. 13042func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 13043 gensupport.SetOptions(c.urlParams_, opts...) 13044 res, err := c.doRequest("json") 13045 if res != nil && res.StatusCode == http.StatusNotModified { 13046 if res.Body != nil { 13047 res.Body.Close() 13048 } 13049 return nil, &googleapi.Error{ 13050 Code: res.StatusCode, 13051 Header: res.Header, 13052 } 13053 } 13054 if err != nil { 13055 return nil, err 13056 } 13057 defer googleapi.CloseBody(res) 13058 if err := googleapi.CheckResponse(res); err != nil { 13059 return nil, err 13060 } 13061 ret := &StorePage{ 13062 ServerResponse: googleapi.ServerResponse{ 13063 Header: res.Header, 13064 HTTPStatusCode: res.StatusCode, 13065 }, 13066 } 13067 target := &ret 13068 if err := gensupport.DecodeResponse(target, res); err != nil { 13069 return nil, err 13070 } 13071 return ret, nil 13072 // { 13073 // "description": "Inserts a new store page.", 13074 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13075 // "httpMethod": "POST", 13076 // "id": "androidenterprise.storelayoutpages.insert", 13077 // "parameterOrder": [ 13078 // "enterpriseId" 13079 // ], 13080 // "parameters": { 13081 // "enterpriseId": { 13082 // "description": "The ID of the enterprise.", 13083 // "location": "path", 13084 // "required": true, 13085 // "type": "string" 13086 // } 13087 // }, 13088 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13089 // "request": { 13090 // "$ref": "StorePage" 13091 // }, 13092 // "response": { 13093 // "$ref": "StorePage" 13094 // }, 13095 // "scopes": [ 13096 // "https://www.googleapis.com/auth/androidenterprise" 13097 // ] 13098 // } 13099 13100} 13101 13102// method id "androidenterprise.storelayoutpages.list": 13103 13104type StorelayoutpagesListCall struct { 13105 s *Service 13106 enterpriseId string 13107 urlParams_ gensupport.URLParams 13108 ifNoneMatch_ string 13109 ctx_ context.Context 13110 header_ http.Header 13111} 13112 13113// List: Retrieves the details of all pages in the store. 13114// 13115// - enterpriseId: The ID of the enterprise. 13116func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall { 13117 c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13118 c.enterpriseId = enterpriseId 13119 return c 13120} 13121 13122// Fields allows partial responses to be retrieved. See 13123// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13124// for more information. 13125func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall { 13126 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13127 return c 13128} 13129 13130// IfNoneMatch sets the optional parameter which makes the operation 13131// fail if the object's ETag matches the given value. This is useful for 13132// getting updates only after the object has changed since the last 13133// request. Use googleapi.IsNotModified to check whether the response 13134// error from Do is the result of In-None-Match. 13135func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall { 13136 c.ifNoneMatch_ = entityTag 13137 return c 13138} 13139 13140// Context sets the context to be used in this call's Do method. Any 13141// pending HTTP request will be aborted if the provided context is 13142// canceled. 13143func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall { 13144 c.ctx_ = ctx 13145 return c 13146} 13147 13148// Header returns an http.Header that can be modified by the caller to 13149// add HTTP headers to the request. 13150func (c *StorelayoutpagesListCall) Header() http.Header { 13151 if c.header_ == nil { 13152 c.header_ = make(http.Header) 13153 } 13154 return c.header_ 13155} 13156 13157func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) { 13158 reqHeaders := make(http.Header) 13159 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13160 for k, v := range c.header_ { 13161 reqHeaders[k] = v 13162 } 13163 reqHeaders.Set("User-Agent", c.s.userAgent()) 13164 if c.ifNoneMatch_ != "" { 13165 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13166 } 13167 var body io.Reader = nil 13168 c.urlParams_.Set("alt", alt) 13169 c.urlParams_.Set("prettyPrint", "false") 13170 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages") 13171 urls += "?" + c.urlParams_.Encode() 13172 req, err := http.NewRequest("GET", urls, body) 13173 if err != nil { 13174 return nil, err 13175 } 13176 req.Header = reqHeaders 13177 googleapi.Expand(req.URL, map[string]string{ 13178 "enterpriseId": c.enterpriseId, 13179 }) 13180 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13181} 13182 13183// Do executes the "androidenterprise.storelayoutpages.list" call. 13184// Exactly one of *StoreLayoutPagesListResponse or error will be 13185// non-nil. Any non-2xx status code is an error. Response headers are in 13186// either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a 13187// response was returned at all) in error.(*googleapi.Error).Header. Use 13188// googleapi.IsNotModified to check whether the returned error was 13189// because http.StatusNotModified was returned. 13190func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) { 13191 gensupport.SetOptions(c.urlParams_, opts...) 13192 res, err := c.doRequest("json") 13193 if res != nil && res.StatusCode == http.StatusNotModified { 13194 if res.Body != nil { 13195 res.Body.Close() 13196 } 13197 return nil, &googleapi.Error{ 13198 Code: res.StatusCode, 13199 Header: res.Header, 13200 } 13201 } 13202 if err != nil { 13203 return nil, err 13204 } 13205 defer googleapi.CloseBody(res) 13206 if err := googleapi.CheckResponse(res); err != nil { 13207 return nil, err 13208 } 13209 ret := &StoreLayoutPagesListResponse{ 13210 ServerResponse: googleapi.ServerResponse{ 13211 Header: res.Header, 13212 HTTPStatusCode: res.StatusCode, 13213 }, 13214 } 13215 target := &ret 13216 if err := gensupport.DecodeResponse(target, res); err != nil { 13217 return nil, err 13218 } 13219 return ret, nil 13220 // { 13221 // "description": "Retrieves the details of all pages in the store.", 13222 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13223 // "httpMethod": "GET", 13224 // "id": "androidenterprise.storelayoutpages.list", 13225 // "parameterOrder": [ 13226 // "enterpriseId" 13227 // ], 13228 // "parameters": { 13229 // "enterpriseId": { 13230 // "description": "The ID of the enterprise.", 13231 // "location": "path", 13232 // "required": true, 13233 // "type": "string" 13234 // } 13235 // }, 13236 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages", 13237 // "response": { 13238 // "$ref": "StoreLayoutPagesListResponse" 13239 // }, 13240 // "scopes": [ 13241 // "https://www.googleapis.com/auth/androidenterprise" 13242 // ] 13243 // } 13244 13245} 13246 13247// method id "androidenterprise.storelayoutpages.update": 13248 13249type StorelayoutpagesUpdateCall struct { 13250 s *Service 13251 enterpriseId string 13252 pageId string 13253 storepage *StorePage 13254 urlParams_ gensupport.URLParams 13255 ctx_ context.Context 13256 header_ http.Header 13257} 13258 13259// Update: Updates the content of a store page. 13260// 13261// - enterpriseId: The ID of the enterprise. 13262// - pageId: The ID of the page. 13263func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall { 13264 c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13265 c.enterpriseId = enterpriseId 13266 c.pageId = pageId 13267 c.storepage = storepage 13268 return c 13269} 13270 13271// Fields allows partial responses to be retrieved. See 13272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13273// for more information. 13274func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall { 13275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13276 return c 13277} 13278 13279// Context sets the context to be used in this call's Do method. Any 13280// pending HTTP request will be aborted if the provided context is 13281// canceled. 13282func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall { 13283 c.ctx_ = ctx 13284 return c 13285} 13286 13287// Header returns an http.Header that can be modified by the caller to 13288// add HTTP headers to the request. 13289func (c *StorelayoutpagesUpdateCall) Header() http.Header { 13290 if c.header_ == nil { 13291 c.header_ = make(http.Header) 13292 } 13293 return c.header_ 13294} 13295 13296func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) { 13297 reqHeaders := make(http.Header) 13298 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13299 for k, v := range c.header_ { 13300 reqHeaders[k] = v 13301 } 13302 reqHeaders.Set("User-Agent", c.s.userAgent()) 13303 var body io.Reader = nil 13304 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 13305 if err != nil { 13306 return nil, err 13307 } 13308 reqHeaders.Set("Content-Type", "application/json") 13309 c.urlParams_.Set("alt", alt) 13310 c.urlParams_.Set("prettyPrint", "false") 13311 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 13312 urls += "?" + c.urlParams_.Encode() 13313 req, err := http.NewRequest("PUT", urls, body) 13314 if err != nil { 13315 return nil, err 13316 } 13317 req.Header = reqHeaders 13318 googleapi.Expand(req.URL, map[string]string{ 13319 "enterpriseId": c.enterpriseId, 13320 "pageId": c.pageId, 13321 }) 13322 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13323} 13324 13325// Do executes the "androidenterprise.storelayoutpages.update" call. 13326// Exactly one of *StorePage or error will be non-nil. Any non-2xx 13327// status code is an error. Response headers are in either 13328// *StorePage.ServerResponse.Header or (if a response was returned at 13329// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13330// to check whether the returned error was because 13331// http.StatusNotModified was returned. 13332func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 13333 gensupport.SetOptions(c.urlParams_, opts...) 13334 res, err := c.doRequest("json") 13335 if res != nil && res.StatusCode == http.StatusNotModified { 13336 if res.Body != nil { 13337 res.Body.Close() 13338 } 13339 return nil, &googleapi.Error{ 13340 Code: res.StatusCode, 13341 Header: res.Header, 13342 } 13343 } 13344 if err != nil { 13345 return nil, err 13346 } 13347 defer googleapi.CloseBody(res) 13348 if err := googleapi.CheckResponse(res); err != nil { 13349 return nil, err 13350 } 13351 ret := &StorePage{ 13352 ServerResponse: googleapi.ServerResponse{ 13353 Header: res.Header, 13354 HTTPStatusCode: res.StatusCode, 13355 }, 13356 } 13357 target := &ret 13358 if err := gensupport.DecodeResponse(target, res); err != nil { 13359 return nil, err 13360 } 13361 return ret, nil 13362 // { 13363 // "description": "Updates the content of a store page.", 13364 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 13365 // "httpMethod": "PUT", 13366 // "id": "androidenterprise.storelayoutpages.update", 13367 // "parameterOrder": [ 13368 // "enterpriseId", 13369 // "pageId" 13370 // ], 13371 // "parameters": { 13372 // "enterpriseId": { 13373 // "description": "The ID of the enterprise.", 13374 // "location": "path", 13375 // "required": true, 13376 // "type": "string" 13377 // }, 13378 // "pageId": { 13379 // "description": "The ID of the page.", 13380 // "location": "path", 13381 // "required": true, 13382 // "type": "string" 13383 // } 13384 // }, 13385 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 13386 // "request": { 13387 // "$ref": "StorePage" 13388 // }, 13389 // "response": { 13390 // "$ref": "StorePage" 13391 // }, 13392 // "scopes": [ 13393 // "https://www.googleapis.com/auth/androidenterprise" 13394 // ] 13395 // } 13396 13397} 13398 13399// method id "androidenterprise.users.delete": 13400 13401type UsersDeleteCall struct { 13402 s *Service 13403 enterpriseId string 13404 userId string 13405 urlParams_ gensupport.URLParams 13406 ctx_ context.Context 13407 header_ http.Header 13408} 13409 13410// Delete: Deleted an EMM-managed user. 13411// 13412// - enterpriseId: The ID of the enterprise. 13413// - userId: The ID of the user. 13414func (r *UsersService) Delete(enterpriseId string, userId string) *UsersDeleteCall { 13415 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13416 c.enterpriseId = enterpriseId 13417 c.userId = userId 13418 return c 13419} 13420 13421// Fields allows partial responses to be retrieved. See 13422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13423// for more information. 13424func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 13425 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13426 return c 13427} 13428 13429// Context sets the context to be used in this call's Do method. Any 13430// pending HTTP request will be aborted if the provided context is 13431// canceled. 13432func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 13433 c.ctx_ = ctx 13434 return c 13435} 13436 13437// Header returns an http.Header that can be modified by the caller to 13438// add HTTP headers to the request. 13439func (c *UsersDeleteCall) Header() http.Header { 13440 if c.header_ == nil { 13441 c.header_ = make(http.Header) 13442 } 13443 return c.header_ 13444} 13445 13446func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 13447 reqHeaders := make(http.Header) 13448 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13449 for k, v := range c.header_ { 13450 reqHeaders[k] = v 13451 } 13452 reqHeaders.Set("User-Agent", c.s.userAgent()) 13453 var body io.Reader = nil 13454 c.urlParams_.Set("alt", alt) 13455 c.urlParams_.Set("prettyPrint", "false") 13456 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 13457 urls += "?" + c.urlParams_.Encode() 13458 req, err := http.NewRequest("DELETE", urls, body) 13459 if err != nil { 13460 return nil, err 13461 } 13462 req.Header = reqHeaders 13463 googleapi.Expand(req.URL, map[string]string{ 13464 "enterpriseId": c.enterpriseId, 13465 "userId": c.userId, 13466 }) 13467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13468} 13469 13470// Do executes the "androidenterprise.users.delete" call. 13471func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { 13472 gensupport.SetOptions(c.urlParams_, opts...) 13473 res, err := c.doRequest("json") 13474 if err != nil { 13475 return err 13476 } 13477 defer googleapi.CloseBody(res) 13478 if err := googleapi.CheckResponse(res); err != nil { 13479 return err 13480 } 13481 return nil 13482 // { 13483 // "description": "Deleted an EMM-managed user.", 13484 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13485 // "httpMethod": "DELETE", 13486 // "id": "androidenterprise.users.delete", 13487 // "parameterOrder": [ 13488 // "enterpriseId", 13489 // "userId" 13490 // ], 13491 // "parameters": { 13492 // "enterpriseId": { 13493 // "description": "The ID of the enterprise.", 13494 // "location": "path", 13495 // "required": true, 13496 // "type": "string" 13497 // }, 13498 // "userId": { 13499 // "description": "The ID of the user.", 13500 // "location": "path", 13501 // "required": true, 13502 // "type": "string" 13503 // } 13504 // }, 13505 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13506 // "scopes": [ 13507 // "https://www.googleapis.com/auth/androidenterprise" 13508 // ] 13509 // } 13510 13511} 13512 13513// method id "androidenterprise.users.generateAuthenticationToken": 13514 13515type UsersGenerateAuthenticationTokenCall struct { 13516 s *Service 13517 enterpriseId string 13518 userId string 13519 urlParams_ gensupport.URLParams 13520 ctx_ context.Context 13521 header_ http.Header 13522} 13523 13524// GenerateAuthenticationToken: Generates an authentication token which 13525// the device policy client can use to provision the given EMM-managed 13526// user account on a device. The generated token is single-use and 13527// expires after a few minutes. You can provision a maximum of 10 13528// devices per user. This call only works with EMM-managed accounts. 13529// 13530// - enterpriseId: The ID of the enterprise. 13531// - userId: The ID of the user. 13532func (r *UsersService) GenerateAuthenticationToken(enterpriseId string, userId string) *UsersGenerateAuthenticationTokenCall { 13533 c := &UsersGenerateAuthenticationTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13534 c.enterpriseId = enterpriseId 13535 c.userId = userId 13536 return c 13537} 13538 13539// Fields allows partial responses to be retrieved. See 13540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13541// for more information. 13542func (c *UsersGenerateAuthenticationTokenCall) Fields(s ...googleapi.Field) *UsersGenerateAuthenticationTokenCall { 13543 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13544 return c 13545} 13546 13547// Context sets the context to be used in this call's Do method. Any 13548// pending HTTP request will be aborted if the provided context is 13549// canceled. 13550func (c *UsersGenerateAuthenticationTokenCall) Context(ctx context.Context) *UsersGenerateAuthenticationTokenCall { 13551 c.ctx_ = ctx 13552 return c 13553} 13554 13555// Header returns an http.Header that can be modified by the caller to 13556// add HTTP headers to the request. 13557func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header { 13558 if c.header_ == nil { 13559 c.header_ = make(http.Header) 13560 } 13561 return c.header_ 13562} 13563 13564func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) { 13565 reqHeaders := make(http.Header) 13566 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13567 for k, v := range c.header_ { 13568 reqHeaders[k] = v 13569 } 13570 reqHeaders.Set("User-Agent", c.s.userAgent()) 13571 var body io.Reader = nil 13572 c.urlParams_.Set("alt", alt) 13573 c.urlParams_.Set("prettyPrint", "false") 13574 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken") 13575 urls += "?" + c.urlParams_.Encode() 13576 req, err := http.NewRequest("POST", urls, body) 13577 if err != nil { 13578 return nil, err 13579 } 13580 req.Header = reqHeaders 13581 googleapi.Expand(req.URL, map[string]string{ 13582 "enterpriseId": c.enterpriseId, 13583 "userId": c.userId, 13584 }) 13585 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13586} 13587 13588// Do executes the "androidenterprise.users.generateAuthenticationToken" call. 13589// Exactly one of *AuthenticationToken or error will be non-nil. Any 13590// non-2xx status code is an error. Response headers are in either 13591// *AuthenticationToken.ServerResponse.Header or (if a response was 13592// returned at all) in error.(*googleapi.Error).Header. Use 13593// googleapi.IsNotModified to check whether the returned error was 13594// because http.StatusNotModified was returned. 13595func (c *UsersGenerateAuthenticationTokenCall) Do(opts ...googleapi.CallOption) (*AuthenticationToken, error) { 13596 gensupport.SetOptions(c.urlParams_, opts...) 13597 res, err := c.doRequest("json") 13598 if res != nil && res.StatusCode == http.StatusNotModified { 13599 if res.Body != nil { 13600 res.Body.Close() 13601 } 13602 return nil, &googleapi.Error{ 13603 Code: res.StatusCode, 13604 Header: res.Header, 13605 } 13606 } 13607 if err != nil { 13608 return nil, err 13609 } 13610 defer googleapi.CloseBody(res) 13611 if err := googleapi.CheckResponse(res); err != nil { 13612 return nil, err 13613 } 13614 ret := &AuthenticationToken{ 13615 ServerResponse: googleapi.ServerResponse{ 13616 Header: res.Header, 13617 HTTPStatusCode: res.StatusCode, 13618 }, 13619 } 13620 target := &ret 13621 if err := gensupport.DecodeResponse(target, res); err != nil { 13622 return nil, err 13623 } 13624 return ret, nil 13625 // { 13626 // "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.", 13627 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken", 13628 // "httpMethod": "POST", 13629 // "id": "androidenterprise.users.generateAuthenticationToken", 13630 // "parameterOrder": [ 13631 // "enterpriseId", 13632 // "userId" 13633 // ], 13634 // "parameters": { 13635 // "enterpriseId": { 13636 // "description": "The ID of the enterprise.", 13637 // "location": "path", 13638 // "required": true, 13639 // "type": "string" 13640 // }, 13641 // "userId": { 13642 // "description": "The ID of the user.", 13643 // "location": "path", 13644 // "required": true, 13645 // "type": "string" 13646 // } 13647 // }, 13648 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken", 13649 // "response": { 13650 // "$ref": "AuthenticationToken" 13651 // }, 13652 // "scopes": [ 13653 // "https://www.googleapis.com/auth/androidenterprise" 13654 // ] 13655 // } 13656 13657} 13658 13659// method id "androidenterprise.users.get": 13660 13661type UsersGetCall struct { 13662 s *Service 13663 enterpriseId string 13664 userId string 13665 urlParams_ gensupport.URLParams 13666 ifNoneMatch_ string 13667 ctx_ context.Context 13668 header_ http.Header 13669} 13670 13671// Get: Retrieves a user's details. 13672// 13673// - enterpriseId: The ID of the enterprise. 13674// - userId: The ID of the user. 13675func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall { 13676 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13677 c.enterpriseId = enterpriseId 13678 c.userId = userId 13679 return c 13680} 13681 13682// Fields allows partial responses to be retrieved. See 13683// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13684// for more information. 13685func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 13686 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13687 return c 13688} 13689 13690// IfNoneMatch sets the optional parameter which makes the operation 13691// fail if the object's ETag matches the given value. This is useful for 13692// getting updates only after the object has changed since the last 13693// request. Use googleapi.IsNotModified to check whether the response 13694// error from Do is the result of In-None-Match. 13695func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 13696 c.ifNoneMatch_ = entityTag 13697 return c 13698} 13699 13700// Context sets the context to be used in this call's Do method. Any 13701// pending HTTP request will be aborted if the provided context is 13702// canceled. 13703func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 13704 c.ctx_ = ctx 13705 return c 13706} 13707 13708// Header returns an http.Header that can be modified by the caller to 13709// add HTTP headers to the request. 13710func (c *UsersGetCall) Header() http.Header { 13711 if c.header_ == nil { 13712 c.header_ = make(http.Header) 13713 } 13714 return c.header_ 13715} 13716 13717func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 13718 reqHeaders := make(http.Header) 13719 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13720 for k, v := range c.header_ { 13721 reqHeaders[k] = v 13722 } 13723 reqHeaders.Set("User-Agent", c.s.userAgent()) 13724 if c.ifNoneMatch_ != "" { 13725 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13726 } 13727 var body io.Reader = nil 13728 c.urlParams_.Set("alt", alt) 13729 c.urlParams_.Set("prettyPrint", "false") 13730 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 13731 urls += "?" + c.urlParams_.Encode() 13732 req, err := http.NewRequest("GET", urls, body) 13733 if err != nil { 13734 return nil, err 13735 } 13736 req.Header = reqHeaders 13737 googleapi.Expand(req.URL, map[string]string{ 13738 "enterpriseId": c.enterpriseId, 13739 "userId": c.userId, 13740 }) 13741 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13742} 13743 13744// Do executes the "androidenterprise.users.get" call. 13745// Exactly one of *User or error will be non-nil. Any non-2xx status 13746// code is an error. Response headers are in either 13747// *User.ServerResponse.Header or (if a response was returned at all) in 13748// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13749// whether the returned error was because http.StatusNotModified was 13750// returned. 13751func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 13752 gensupport.SetOptions(c.urlParams_, opts...) 13753 res, err := c.doRequest("json") 13754 if res != nil && res.StatusCode == http.StatusNotModified { 13755 if res.Body != nil { 13756 res.Body.Close() 13757 } 13758 return nil, &googleapi.Error{ 13759 Code: res.StatusCode, 13760 Header: res.Header, 13761 } 13762 } 13763 if err != nil { 13764 return nil, err 13765 } 13766 defer googleapi.CloseBody(res) 13767 if err := googleapi.CheckResponse(res); err != nil { 13768 return nil, err 13769 } 13770 ret := &User{ 13771 ServerResponse: googleapi.ServerResponse{ 13772 Header: res.Header, 13773 HTTPStatusCode: res.StatusCode, 13774 }, 13775 } 13776 target := &ret 13777 if err := gensupport.DecodeResponse(target, res); err != nil { 13778 return nil, err 13779 } 13780 return ret, nil 13781 // { 13782 // "description": "Retrieves a user's details.", 13783 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13784 // "httpMethod": "GET", 13785 // "id": "androidenterprise.users.get", 13786 // "parameterOrder": [ 13787 // "enterpriseId", 13788 // "userId" 13789 // ], 13790 // "parameters": { 13791 // "enterpriseId": { 13792 // "description": "The ID of the enterprise.", 13793 // "location": "path", 13794 // "required": true, 13795 // "type": "string" 13796 // }, 13797 // "userId": { 13798 // "description": "The ID of the user.", 13799 // "location": "path", 13800 // "required": true, 13801 // "type": "string" 13802 // } 13803 // }, 13804 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 13805 // "response": { 13806 // "$ref": "User" 13807 // }, 13808 // "scopes": [ 13809 // "https://www.googleapis.com/auth/androidenterprise" 13810 // ] 13811 // } 13812 13813} 13814 13815// method id "androidenterprise.users.getAvailableProductSet": 13816 13817type UsersGetAvailableProductSetCall struct { 13818 s *Service 13819 enterpriseId string 13820 userId string 13821 urlParams_ gensupport.URLParams 13822 ifNoneMatch_ string 13823 ctx_ context.Context 13824 header_ http.Header 13825} 13826 13827// GetAvailableProductSet: Retrieves the set of products a user is 13828// entitled to access. 13829// 13830// - enterpriseId: The ID of the enterprise. 13831// - userId: The ID of the user. 13832func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall { 13833 c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13834 c.enterpriseId = enterpriseId 13835 c.userId = userId 13836 return c 13837} 13838 13839// Fields allows partial responses to be retrieved. See 13840// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13841// for more information. 13842func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall { 13843 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13844 return c 13845} 13846 13847// IfNoneMatch sets the optional parameter which makes the operation 13848// fail if the object's ETag matches the given value. This is useful for 13849// getting updates only after the object has changed since the last 13850// request. Use googleapi.IsNotModified to check whether the response 13851// error from Do is the result of In-None-Match. 13852func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall { 13853 c.ifNoneMatch_ = entityTag 13854 return c 13855} 13856 13857// Context sets the context to be used in this call's Do method. Any 13858// pending HTTP request will be aborted if the provided context is 13859// canceled. 13860func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall { 13861 c.ctx_ = ctx 13862 return c 13863} 13864 13865// Header returns an http.Header that can be modified by the caller to 13866// add HTTP headers to the request. 13867func (c *UsersGetAvailableProductSetCall) Header() http.Header { 13868 if c.header_ == nil { 13869 c.header_ = make(http.Header) 13870 } 13871 return c.header_ 13872} 13873 13874func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 13875 reqHeaders := make(http.Header) 13876 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13877 for k, v := range c.header_ { 13878 reqHeaders[k] = v 13879 } 13880 reqHeaders.Set("User-Agent", c.s.userAgent()) 13881 if c.ifNoneMatch_ != "" { 13882 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13883 } 13884 var body io.Reader = nil 13885 c.urlParams_.Set("alt", alt) 13886 c.urlParams_.Set("prettyPrint", "false") 13887 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet") 13888 urls += "?" + c.urlParams_.Encode() 13889 req, err := http.NewRequest("GET", urls, body) 13890 if err != nil { 13891 return nil, err 13892 } 13893 req.Header = reqHeaders 13894 googleapi.Expand(req.URL, map[string]string{ 13895 "enterpriseId": c.enterpriseId, 13896 "userId": c.userId, 13897 }) 13898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13899} 13900 13901// Do executes the "androidenterprise.users.getAvailableProductSet" call. 13902// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 13903// status code is an error. Response headers are in either 13904// *ProductSet.ServerResponse.Header or (if a response was returned at 13905// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13906// to check whether the returned error was because 13907// http.StatusNotModified was returned. 13908func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 13909 gensupport.SetOptions(c.urlParams_, opts...) 13910 res, err := c.doRequest("json") 13911 if res != nil && res.StatusCode == http.StatusNotModified { 13912 if res.Body != nil { 13913 res.Body.Close() 13914 } 13915 return nil, &googleapi.Error{ 13916 Code: res.StatusCode, 13917 Header: res.Header, 13918 } 13919 } 13920 if err != nil { 13921 return nil, err 13922 } 13923 defer googleapi.CloseBody(res) 13924 if err := googleapi.CheckResponse(res); err != nil { 13925 return nil, err 13926 } 13927 ret := &ProductSet{ 13928 ServerResponse: googleapi.ServerResponse{ 13929 Header: res.Header, 13930 HTTPStatusCode: res.StatusCode, 13931 }, 13932 } 13933 target := &ret 13934 if err := gensupport.DecodeResponse(target, res); err != nil { 13935 return nil, err 13936 } 13937 return ret, nil 13938 // { 13939 // "description": "Retrieves the set of products a user is entitled to access.", 13940 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 13941 // "httpMethod": "GET", 13942 // "id": "androidenterprise.users.getAvailableProductSet", 13943 // "parameterOrder": [ 13944 // "enterpriseId", 13945 // "userId" 13946 // ], 13947 // "parameters": { 13948 // "enterpriseId": { 13949 // "description": "The ID of the enterprise.", 13950 // "location": "path", 13951 // "required": true, 13952 // "type": "string" 13953 // }, 13954 // "userId": { 13955 // "description": "The ID of the user.", 13956 // "location": "path", 13957 // "required": true, 13958 // "type": "string" 13959 // } 13960 // }, 13961 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 13962 // "response": { 13963 // "$ref": "ProductSet" 13964 // }, 13965 // "scopes": [ 13966 // "https://www.googleapis.com/auth/androidenterprise" 13967 // ] 13968 // } 13969 13970} 13971 13972// method id "androidenterprise.users.insert": 13973 13974type UsersInsertCall struct { 13975 s *Service 13976 enterpriseId string 13977 user *User 13978 urlParams_ gensupport.URLParams 13979 ctx_ context.Context 13980 header_ http.Header 13981} 13982 13983// Insert: Creates a new EMM-managed user. The Users resource passed in 13984// the body of the request should include an accountIdentifier and an 13985// accountType. If a corresponding user already exists with the same 13986// account identifier, the user will be updated with the resource. In 13987// this case only the displayName field can be changed. 13988// 13989// - enterpriseId: The ID of the enterprise. 13990func (r *UsersService) Insert(enterpriseId string, user *User) *UsersInsertCall { 13991 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13992 c.enterpriseId = enterpriseId 13993 c.user = user 13994 return c 13995} 13996 13997// Fields allows partial responses to be retrieved. See 13998// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13999// for more information. 14000func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 14001 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14002 return c 14003} 14004 14005// Context sets the context to be used in this call's Do method. Any 14006// pending HTTP request will be aborted if the provided context is 14007// canceled. 14008func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 14009 c.ctx_ = ctx 14010 return c 14011} 14012 14013// Header returns an http.Header that can be modified by the caller to 14014// add HTTP headers to the request. 14015func (c *UsersInsertCall) Header() http.Header { 14016 if c.header_ == nil { 14017 c.header_ = make(http.Header) 14018 } 14019 return c.header_ 14020} 14021 14022func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 14023 reqHeaders := make(http.Header) 14024 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14025 for k, v := range c.header_ { 14026 reqHeaders[k] = v 14027 } 14028 reqHeaders.Set("User-Agent", c.s.userAgent()) 14029 var body io.Reader = nil 14030 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 14031 if err != nil { 14032 return nil, err 14033 } 14034 reqHeaders.Set("Content-Type", "application/json") 14035 c.urlParams_.Set("alt", alt) 14036 c.urlParams_.Set("prettyPrint", "false") 14037 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users") 14038 urls += "?" + c.urlParams_.Encode() 14039 req, err := http.NewRequest("POST", urls, body) 14040 if err != nil { 14041 return nil, err 14042 } 14043 req.Header = reqHeaders 14044 googleapi.Expand(req.URL, map[string]string{ 14045 "enterpriseId": c.enterpriseId, 14046 }) 14047 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14048} 14049 14050// Do executes the "androidenterprise.users.insert" call. 14051// Exactly one of *User or error will be non-nil. Any non-2xx status 14052// code is an error. Response headers are in either 14053// *User.ServerResponse.Header or (if a response was returned at all) in 14054// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14055// whether the returned error was because http.StatusNotModified was 14056// returned. 14057func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) { 14058 gensupport.SetOptions(c.urlParams_, opts...) 14059 res, err := c.doRequest("json") 14060 if res != nil && res.StatusCode == http.StatusNotModified { 14061 if res.Body != nil { 14062 res.Body.Close() 14063 } 14064 return nil, &googleapi.Error{ 14065 Code: res.StatusCode, 14066 Header: res.Header, 14067 } 14068 } 14069 if err != nil { 14070 return nil, err 14071 } 14072 defer googleapi.CloseBody(res) 14073 if err := googleapi.CheckResponse(res); err != nil { 14074 return nil, err 14075 } 14076 ret := &User{ 14077 ServerResponse: googleapi.ServerResponse{ 14078 Header: res.Header, 14079 HTTPStatusCode: res.StatusCode, 14080 }, 14081 } 14082 target := &ret 14083 if err := gensupport.DecodeResponse(target, res); err != nil { 14084 return nil, err 14085 } 14086 return ret, nil 14087 // { 14088 // "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.", 14089 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14090 // "httpMethod": "POST", 14091 // "id": "androidenterprise.users.insert", 14092 // "parameterOrder": [ 14093 // "enterpriseId" 14094 // ], 14095 // "parameters": { 14096 // "enterpriseId": { 14097 // "description": "The ID of the enterprise.", 14098 // "location": "path", 14099 // "required": true, 14100 // "type": "string" 14101 // } 14102 // }, 14103 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14104 // "request": { 14105 // "$ref": "User" 14106 // }, 14107 // "response": { 14108 // "$ref": "User" 14109 // }, 14110 // "scopes": [ 14111 // "https://www.googleapis.com/auth/androidenterprise" 14112 // ] 14113 // } 14114 14115} 14116 14117// method id "androidenterprise.users.list": 14118 14119type UsersListCall struct { 14120 s *Service 14121 enterpriseId string 14122 urlParams_ gensupport.URLParams 14123 ifNoneMatch_ string 14124 ctx_ context.Context 14125 header_ http.Header 14126} 14127 14128// List: Looks up a user by primary email address. This is only 14129// supported for Google-managed users. Lookup of the id is not needed 14130// for EMM-managed users because the id is already returned in the 14131// result of the Users.insert call. 14132// 14133// - email: The exact primary email address of the user to look up. 14134// - enterpriseId: The ID of the enterprise. 14135func (r *UsersService) List(enterpriseId string, email string) *UsersListCall { 14136 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14137 c.enterpriseId = enterpriseId 14138 c.urlParams_.Set("email", email) 14139 return c 14140} 14141 14142// Fields allows partial responses to be retrieved. See 14143// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14144// for more information. 14145func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 14146 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14147 return c 14148} 14149 14150// IfNoneMatch sets the optional parameter which makes the operation 14151// fail if the object's ETag matches the given value. This is useful for 14152// getting updates only after the object has changed since the last 14153// request. Use googleapi.IsNotModified to check whether the response 14154// error from Do is the result of In-None-Match. 14155func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 14156 c.ifNoneMatch_ = entityTag 14157 return c 14158} 14159 14160// Context sets the context to be used in this call's Do method. Any 14161// pending HTTP request will be aborted if the provided context is 14162// canceled. 14163func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 14164 c.ctx_ = ctx 14165 return c 14166} 14167 14168// Header returns an http.Header that can be modified by the caller to 14169// add HTTP headers to the request. 14170func (c *UsersListCall) Header() http.Header { 14171 if c.header_ == nil { 14172 c.header_ = make(http.Header) 14173 } 14174 return c.header_ 14175} 14176 14177func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 14178 reqHeaders := make(http.Header) 14179 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14180 for k, v := range c.header_ { 14181 reqHeaders[k] = v 14182 } 14183 reqHeaders.Set("User-Agent", c.s.userAgent()) 14184 if c.ifNoneMatch_ != "" { 14185 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14186 } 14187 var body io.Reader = nil 14188 c.urlParams_.Set("alt", alt) 14189 c.urlParams_.Set("prettyPrint", "false") 14190 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users") 14191 urls += "?" + c.urlParams_.Encode() 14192 req, err := http.NewRequest("GET", urls, body) 14193 if err != nil { 14194 return nil, err 14195 } 14196 req.Header = reqHeaders 14197 googleapi.Expand(req.URL, map[string]string{ 14198 "enterpriseId": c.enterpriseId, 14199 }) 14200 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14201} 14202 14203// Do executes the "androidenterprise.users.list" call. 14204// Exactly one of *UsersListResponse or error will be non-nil. Any 14205// non-2xx status code is an error. Response headers are in either 14206// *UsersListResponse.ServerResponse.Header or (if a response was 14207// returned at all) in error.(*googleapi.Error).Header. Use 14208// googleapi.IsNotModified to check whether the returned error was 14209// because http.StatusNotModified was returned. 14210func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 14211 gensupport.SetOptions(c.urlParams_, opts...) 14212 res, err := c.doRequest("json") 14213 if res != nil && res.StatusCode == http.StatusNotModified { 14214 if res.Body != nil { 14215 res.Body.Close() 14216 } 14217 return nil, &googleapi.Error{ 14218 Code: res.StatusCode, 14219 Header: res.Header, 14220 } 14221 } 14222 if err != nil { 14223 return nil, err 14224 } 14225 defer googleapi.CloseBody(res) 14226 if err := googleapi.CheckResponse(res); err != nil { 14227 return nil, err 14228 } 14229 ret := &UsersListResponse{ 14230 ServerResponse: googleapi.ServerResponse{ 14231 Header: res.Header, 14232 HTTPStatusCode: res.StatusCode, 14233 }, 14234 } 14235 target := &ret 14236 if err := gensupport.DecodeResponse(target, res); err != nil { 14237 return nil, err 14238 } 14239 return ret, nil 14240 // { 14241 // "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.", 14242 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14243 // "httpMethod": "GET", 14244 // "id": "androidenterprise.users.list", 14245 // "parameterOrder": [ 14246 // "enterpriseId", 14247 // "email" 14248 // ], 14249 // "parameters": { 14250 // "email": { 14251 // "description": "Required. The exact primary email address of the user to look up.", 14252 // "location": "query", 14253 // "required": true, 14254 // "type": "string" 14255 // }, 14256 // "enterpriseId": { 14257 // "description": "The ID of the enterprise.", 14258 // "location": "path", 14259 // "required": true, 14260 // "type": "string" 14261 // } 14262 // }, 14263 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users", 14264 // "response": { 14265 // "$ref": "UsersListResponse" 14266 // }, 14267 // "scopes": [ 14268 // "https://www.googleapis.com/auth/androidenterprise" 14269 // ] 14270 // } 14271 14272} 14273 14274// method id "androidenterprise.users.revokeDeviceAccess": 14275 14276type UsersRevokeDeviceAccessCall struct { 14277 s *Service 14278 enterpriseId string 14279 userId string 14280 urlParams_ gensupport.URLParams 14281 ctx_ context.Context 14282 header_ http.Header 14283} 14284 14285// RevokeDeviceAccess: Revokes access to all devices currently 14286// provisioned to the user. The user will no longer be able to use the 14287// managed Play store on any of their managed devices. This call only 14288// works with EMM-managed accounts. 14289// 14290// - enterpriseId: The ID of the enterprise. 14291// - userId: The ID of the user. 14292func (r *UsersService) RevokeDeviceAccess(enterpriseId string, userId string) *UsersRevokeDeviceAccessCall { 14293 c := &UsersRevokeDeviceAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14294 c.enterpriseId = enterpriseId 14295 c.userId = userId 14296 return c 14297} 14298 14299// Fields allows partial responses to be retrieved. See 14300// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14301// for more information. 14302func (c *UsersRevokeDeviceAccessCall) Fields(s ...googleapi.Field) *UsersRevokeDeviceAccessCall { 14303 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14304 return c 14305} 14306 14307// Context sets the context to be used in this call's Do method. Any 14308// pending HTTP request will be aborted if the provided context is 14309// canceled. 14310func (c *UsersRevokeDeviceAccessCall) Context(ctx context.Context) *UsersRevokeDeviceAccessCall { 14311 c.ctx_ = ctx 14312 return c 14313} 14314 14315// Header returns an http.Header that can be modified by the caller to 14316// add HTTP headers to the request. 14317func (c *UsersRevokeDeviceAccessCall) Header() http.Header { 14318 if c.header_ == nil { 14319 c.header_ = make(http.Header) 14320 } 14321 return c.header_ 14322} 14323 14324func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) { 14325 reqHeaders := make(http.Header) 14326 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14327 for k, v := range c.header_ { 14328 reqHeaders[k] = v 14329 } 14330 reqHeaders.Set("User-Agent", c.s.userAgent()) 14331 var body io.Reader = nil 14332 c.urlParams_.Set("alt", alt) 14333 c.urlParams_.Set("prettyPrint", "false") 14334 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess") 14335 urls += "?" + c.urlParams_.Encode() 14336 req, err := http.NewRequest("DELETE", urls, body) 14337 if err != nil { 14338 return nil, err 14339 } 14340 req.Header = reqHeaders 14341 googleapi.Expand(req.URL, map[string]string{ 14342 "enterpriseId": c.enterpriseId, 14343 "userId": c.userId, 14344 }) 14345 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14346} 14347 14348// Do executes the "androidenterprise.users.revokeDeviceAccess" call. 14349func (c *UsersRevokeDeviceAccessCall) Do(opts ...googleapi.CallOption) error { 14350 gensupport.SetOptions(c.urlParams_, opts...) 14351 res, err := c.doRequest("json") 14352 if err != nil { 14353 return err 14354 } 14355 defer googleapi.CloseBody(res) 14356 if err := googleapi.CheckResponse(res); err != nil { 14357 return err 14358 } 14359 return nil 14360 // { 14361 // "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.", 14362 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess", 14363 // "httpMethod": "DELETE", 14364 // "id": "androidenterprise.users.revokeDeviceAccess", 14365 // "parameterOrder": [ 14366 // "enterpriseId", 14367 // "userId" 14368 // ], 14369 // "parameters": { 14370 // "enterpriseId": { 14371 // "description": "The ID of the enterprise.", 14372 // "location": "path", 14373 // "required": true, 14374 // "type": "string" 14375 // }, 14376 // "userId": { 14377 // "description": "The ID of the user.", 14378 // "location": "path", 14379 // "required": true, 14380 // "type": "string" 14381 // } 14382 // }, 14383 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess", 14384 // "scopes": [ 14385 // "https://www.googleapis.com/auth/androidenterprise" 14386 // ] 14387 // } 14388 14389} 14390 14391// method id "androidenterprise.users.setAvailableProductSet": 14392 14393type UsersSetAvailableProductSetCall struct { 14394 s *Service 14395 enterpriseId string 14396 userId string 14397 productset *ProductSet 14398 urlParams_ gensupport.URLParams 14399 ctx_ context.Context 14400 header_ http.Header 14401} 14402 14403// SetAvailableProductSet: Modifies the set of products that a user is 14404// entitled to access (referred to as *whitelisted* products). Only 14405// products that are approved or products that were previously approved 14406// (products with revoked approval) can be whitelisted. 14407// 14408// - enterpriseId: The ID of the enterprise. 14409// - userId: The ID of the user. 14410func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall { 14411 c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14412 c.enterpriseId = enterpriseId 14413 c.userId = userId 14414 c.productset = productset 14415 return c 14416} 14417 14418// Fields allows partial responses to be retrieved. See 14419// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14420// for more information. 14421func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall { 14422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14423 return c 14424} 14425 14426// Context sets the context to be used in this call's Do method. Any 14427// pending HTTP request will be aborted if the provided context is 14428// canceled. 14429func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall { 14430 c.ctx_ = ctx 14431 return c 14432} 14433 14434// Header returns an http.Header that can be modified by the caller to 14435// add HTTP headers to the request. 14436func (c *UsersSetAvailableProductSetCall) Header() http.Header { 14437 if c.header_ == nil { 14438 c.header_ = make(http.Header) 14439 } 14440 return c.header_ 14441} 14442 14443func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 14444 reqHeaders := make(http.Header) 14445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14446 for k, v := range c.header_ { 14447 reqHeaders[k] = v 14448 } 14449 reqHeaders.Set("User-Agent", c.s.userAgent()) 14450 var body io.Reader = nil 14451 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 14452 if err != nil { 14453 return nil, err 14454 } 14455 reqHeaders.Set("Content-Type", "application/json") 14456 c.urlParams_.Set("alt", alt) 14457 c.urlParams_.Set("prettyPrint", "false") 14458 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet") 14459 urls += "?" + c.urlParams_.Encode() 14460 req, err := http.NewRequest("PUT", urls, body) 14461 if err != nil { 14462 return nil, err 14463 } 14464 req.Header = reqHeaders 14465 googleapi.Expand(req.URL, map[string]string{ 14466 "enterpriseId": c.enterpriseId, 14467 "userId": c.userId, 14468 }) 14469 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14470} 14471 14472// Do executes the "androidenterprise.users.setAvailableProductSet" call. 14473// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 14474// status code is an error. Response headers are in either 14475// *ProductSet.ServerResponse.Header or (if a response was returned at 14476// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14477// to check whether the returned error was because 14478// http.StatusNotModified was returned. 14479func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 14480 gensupport.SetOptions(c.urlParams_, opts...) 14481 res, err := c.doRequest("json") 14482 if res != nil && res.StatusCode == http.StatusNotModified { 14483 if res.Body != nil { 14484 res.Body.Close() 14485 } 14486 return nil, &googleapi.Error{ 14487 Code: res.StatusCode, 14488 Header: res.Header, 14489 } 14490 } 14491 if err != nil { 14492 return nil, err 14493 } 14494 defer googleapi.CloseBody(res) 14495 if err := googleapi.CheckResponse(res); err != nil { 14496 return nil, err 14497 } 14498 ret := &ProductSet{ 14499 ServerResponse: googleapi.ServerResponse{ 14500 Header: res.Header, 14501 HTTPStatusCode: res.StatusCode, 14502 }, 14503 } 14504 target := &ret 14505 if err := gensupport.DecodeResponse(target, res); err != nil { 14506 return nil, err 14507 } 14508 return ret, nil 14509 // { 14510 // "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.", 14511 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 14512 // "httpMethod": "PUT", 14513 // "id": "androidenterprise.users.setAvailableProductSet", 14514 // "parameterOrder": [ 14515 // "enterpriseId", 14516 // "userId" 14517 // ], 14518 // "parameters": { 14519 // "enterpriseId": { 14520 // "description": "The ID of the enterprise.", 14521 // "location": "path", 14522 // "required": true, 14523 // "type": "string" 14524 // }, 14525 // "userId": { 14526 // "description": "The ID of the user.", 14527 // "location": "path", 14528 // "required": true, 14529 // "type": "string" 14530 // } 14531 // }, 14532 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet", 14533 // "request": { 14534 // "$ref": "ProductSet" 14535 // }, 14536 // "response": { 14537 // "$ref": "ProductSet" 14538 // }, 14539 // "scopes": [ 14540 // "https://www.googleapis.com/auth/androidenterprise" 14541 // ] 14542 // } 14543 14544} 14545 14546// method id "androidenterprise.users.update": 14547 14548type UsersUpdateCall struct { 14549 s *Service 14550 enterpriseId string 14551 userId string 14552 user *User 14553 urlParams_ gensupport.URLParams 14554 ctx_ context.Context 14555 header_ http.Header 14556} 14557 14558// Update: Updates the details of an EMM-managed user. Can be used with 14559// EMM-managed users only (not Google managed users). Pass the new 14560// details in the Users resource in the request body. Only the 14561// displayName field can be changed. Other fields must either be unset 14562// or have the currently active value. 14563// 14564// - enterpriseId: The ID of the enterprise. 14565// - userId: The ID of the user. 14566func (r *UsersService) Update(enterpriseId string, userId string, user *User) *UsersUpdateCall { 14567 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14568 c.enterpriseId = enterpriseId 14569 c.userId = userId 14570 c.user = user 14571 return c 14572} 14573 14574// Fields allows partial responses to be retrieved. See 14575// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14576// for more information. 14577func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 14578 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14579 return c 14580} 14581 14582// Context sets the context to be used in this call's Do method. Any 14583// pending HTTP request will be aborted if the provided context is 14584// canceled. 14585func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 14586 c.ctx_ = ctx 14587 return c 14588} 14589 14590// Header returns an http.Header that can be modified by the caller to 14591// add HTTP headers to the request. 14592func (c *UsersUpdateCall) Header() http.Header { 14593 if c.header_ == nil { 14594 c.header_ = make(http.Header) 14595 } 14596 return c.header_ 14597} 14598 14599func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 14600 reqHeaders := make(http.Header) 14601 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14602 for k, v := range c.header_ { 14603 reqHeaders[k] = v 14604 } 14605 reqHeaders.Set("User-Agent", c.s.userAgent()) 14606 var body io.Reader = nil 14607 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 14608 if err != nil { 14609 return nil, err 14610 } 14611 reqHeaders.Set("Content-Type", "application/json") 14612 c.urlParams_.Set("alt", alt) 14613 c.urlParams_.Set("prettyPrint", "false") 14614 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}") 14615 urls += "?" + c.urlParams_.Encode() 14616 req, err := http.NewRequest("PUT", urls, body) 14617 if err != nil { 14618 return nil, err 14619 } 14620 req.Header = reqHeaders 14621 googleapi.Expand(req.URL, map[string]string{ 14622 "enterpriseId": c.enterpriseId, 14623 "userId": c.userId, 14624 }) 14625 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14626} 14627 14628// Do executes the "androidenterprise.users.update" call. 14629// Exactly one of *User or error will be non-nil. Any non-2xx status 14630// code is an error. Response headers are in either 14631// *User.ServerResponse.Header or (if a response was returned at all) in 14632// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14633// whether the returned error was because http.StatusNotModified was 14634// returned. 14635func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) { 14636 gensupport.SetOptions(c.urlParams_, opts...) 14637 res, err := c.doRequest("json") 14638 if res != nil && res.StatusCode == http.StatusNotModified { 14639 if res.Body != nil { 14640 res.Body.Close() 14641 } 14642 return nil, &googleapi.Error{ 14643 Code: res.StatusCode, 14644 Header: res.Header, 14645 } 14646 } 14647 if err != nil { 14648 return nil, err 14649 } 14650 defer googleapi.CloseBody(res) 14651 if err := googleapi.CheckResponse(res); err != nil { 14652 return nil, err 14653 } 14654 ret := &User{ 14655 ServerResponse: googleapi.ServerResponse{ 14656 Header: res.Header, 14657 HTTPStatusCode: res.StatusCode, 14658 }, 14659 } 14660 target := &ret 14661 if err := gensupport.DecodeResponse(target, res); err != nil { 14662 return nil, err 14663 } 14664 return ret, nil 14665 // { 14666 // "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.", 14667 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 14668 // "httpMethod": "PUT", 14669 // "id": "androidenterprise.users.update", 14670 // "parameterOrder": [ 14671 // "enterpriseId", 14672 // "userId" 14673 // ], 14674 // "parameters": { 14675 // "enterpriseId": { 14676 // "description": "The ID of the enterprise.", 14677 // "location": "path", 14678 // "required": true, 14679 // "type": "string" 14680 // }, 14681 // "userId": { 14682 // "description": "The ID of the user.", 14683 // "location": "path", 14684 // "required": true, 14685 // "type": "string" 14686 // } 14687 // }, 14688 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}", 14689 // "request": { 14690 // "$ref": "User" 14691 // }, 14692 // "response": { 14693 // "$ref": "User" 14694 // }, 14695 // "scopes": [ 14696 // "https://www.googleapis.com/auth/androidenterprise" 14697 // ] 14698 // } 14699 14700} 14701 14702// method id "androidenterprise.webapps.delete": 14703 14704type WebappsDeleteCall struct { 14705 s *Service 14706 enterpriseId string 14707 webAppId string 14708 urlParams_ gensupport.URLParams 14709 ctx_ context.Context 14710 header_ http.Header 14711} 14712 14713// Delete: Deletes an existing web app. 14714// 14715// - enterpriseId: The ID of the enterprise. 14716// - webAppId: The ID of the web app. 14717func (r *WebappsService) Delete(enterpriseId string, webAppId string) *WebappsDeleteCall { 14718 c := &WebappsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14719 c.enterpriseId = enterpriseId 14720 c.webAppId = webAppId 14721 return c 14722} 14723 14724// Fields allows partial responses to be retrieved. See 14725// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14726// for more information. 14727func (c *WebappsDeleteCall) Fields(s ...googleapi.Field) *WebappsDeleteCall { 14728 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14729 return c 14730} 14731 14732// Context sets the context to be used in this call's Do method. Any 14733// pending HTTP request will be aborted if the provided context is 14734// canceled. 14735func (c *WebappsDeleteCall) Context(ctx context.Context) *WebappsDeleteCall { 14736 c.ctx_ = ctx 14737 return c 14738} 14739 14740// Header returns an http.Header that can be modified by the caller to 14741// add HTTP headers to the request. 14742func (c *WebappsDeleteCall) Header() http.Header { 14743 if c.header_ == nil { 14744 c.header_ = make(http.Header) 14745 } 14746 return c.header_ 14747} 14748 14749func (c *WebappsDeleteCall) doRequest(alt string) (*http.Response, error) { 14750 reqHeaders := make(http.Header) 14751 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14752 for k, v := range c.header_ { 14753 reqHeaders[k] = v 14754 } 14755 reqHeaders.Set("User-Agent", c.s.userAgent()) 14756 var body io.Reader = nil 14757 c.urlParams_.Set("alt", alt) 14758 c.urlParams_.Set("prettyPrint", "false") 14759 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 14760 urls += "?" + c.urlParams_.Encode() 14761 req, err := http.NewRequest("DELETE", urls, body) 14762 if err != nil { 14763 return nil, err 14764 } 14765 req.Header = reqHeaders 14766 googleapi.Expand(req.URL, map[string]string{ 14767 "enterpriseId": c.enterpriseId, 14768 "webAppId": c.webAppId, 14769 }) 14770 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14771} 14772 14773// Do executes the "androidenterprise.webapps.delete" call. 14774func (c *WebappsDeleteCall) Do(opts ...googleapi.CallOption) error { 14775 gensupport.SetOptions(c.urlParams_, opts...) 14776 res, err := c.doRequest("json") 14777 if err != nil { 14778 return err 14779 } 14780 defer googleapi.CloseBody(res) 14781 if err := googleapi.CheckResponse(res); err != nil { 14782 return err 14783 } 14784 return nil 14785 // { 14786 // "description": "Deletes an existing web app.", 14787 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14788 // "httpMethod": "DELETE", 14789 // "id": "androidenterprise.webapps.delete", 14790 // "parameterOrder": [ 14791 // "enterpriseId", 14792 // "webAppId" 14793 // ], 14794 // "parameters": { 14795 // "enterpriseId": { 14796 // "description": "The ID of the enterprise.", 14797 // "location": "path", 14798 // "required": true, 14799 // "type": "string" 14800 // }, 14801 // "webAppId": { 14802 // "description": "The ID of the web app.", 14803 // "location": "path", 14804 // "required": true, 14805 // "type": "string" 14806 // } 14807 // }, 14808 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14809 // "scopes": [ 14810 // "https://www.googleapis.com/auth/androidenterprise" 14811 // ] 14812 // } 14813 14814} 14815 14816// method id "androidenterprise.webapps.get": 14817 14818type WebappsGetCall struct { 14819 s *Service 14820 enterpriseId string 14821 webAppId string 14822 urlParams_ gensupport.URLParams 14823 ifNoneMatch_ string 14824 ctx_ context.Context 14825 header_ http.Header 14826} 14827 14828// Get: Gets an existing web app. 14829// 14830// - enterpriseId: The ID of the enterprise. 14831// - webAppId: The ID of the web app. 14832func (r *WebappsService) Get(enterpriseId string, webAppId string) *WebappsGetCall { 14833 c := &WebappsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14834 c.enterpriseId = enterpriseId 14835 c.webAppId = webAppId 14836 return c 14837} 14838 14839// Fields allows partial responses to be retrieved. See 14840// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14841// for more information. 14842func (c *WebappsGetCall) Fields(s ...googleapi.Field) *WebappsGetCall { 14843 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14844 return c 14845} 14846 14847// IfNoneMatch sets the optional parameter which makes the operation 14848// fail if the object's ETag matches the given value. This is useful for 14849// getting updates only after the object has changed since the last 14850// request. Use googleapi.IsNotModified to check whether the response 14851// error from Do is the result of In-None-Match. 14852func (c *WebappsGetCall) IfNoneMatch(entityTag string) *WebappsGetCall { 14853 c.ifNoneMatch_ = entityTag 14854 return c 14855} 14856 14857// Context sets the context to be used in this call's Do method. Any 14858// pending HTTP request will be aborted if the provided context is 14859// canceled. 14860func (c *WebappsGetCall) Context(ctx context.Context) *WebappsGetCall { 14861 c.ctx_ = ctx 14862 return c 14863} 14864 14865// Header returns an http.Header that can be modified by the caller to 14866// add HTTP headers to the request. 14867func (c *WebappsGetCall) Header() http.Header { 14868 if c.header_ == nil { 14869 c.header_ = make(http.Header) 14870 } 14871 return c.header_ 14872} 14873 14874func (c *WebappsGetCall) doRequest(alt string) (*http.Response, error) { 14875 reqHeaders := make(http.Header) 14876 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14877 for k, v := range c.header_ { 14878 reqHeaders[k] = v 14879 } 14880 reqHeaders.Set("User-Agent", c.s.userAgent()) 14881 if c.ifNoneMatch_ != "" { 14882 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14883 } 14884 var body io.Reader = nil 14885 c.urlParams_.Set("alt", alt) 14886 c.urlParams_.Set("prettyPrint", "false") 14887 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 14888 urls += "?" + c.urlParams_.Encode() 14889 req, err := http.NewRequest("GET", urls, body) 14890 if err != nil { 14891 return nil, err 14892 } 14893 req.Header = reqHeaders 14894 googleapi.Expand(req.URL, map[string]string{ 14895 "enterpriseId": c.enterpriseId, 14896 "webAppId": c.webAppId, 14897 }) 14898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14899} 14900 14901// Do executes the "androidenterprise.webapps.get" call. 14902// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 14903// code is an error. Response headers are in either 14904// *WebApp.ServerResponse.Header or (if a response was returned at all) 14905// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14906// check whether the returned error was because http.StatusNotModified 14907// was returned. 14908func (c *WebappsGetCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 14909 gensupport.SetOptions(c.urlParams_, opts...) 14910 res, err := c.doRequest("json") 14911 if res != nil && res.StatusCode == http.StatusNotModified { 14912 if res.Body != nil { 14913 res.Body.Close() 14914 } 14915 return nil, &googleapi.Error{ 14916 Code: res.StatusCode, 14917 Header: res.Header, 14918 } 14919 } 14920 if err != nil { 14921 return nil, err 14922 } 14923 defer googleapi.CloseBody(res) 14924 if err := googleapi.CheckResponse(res); err != nil { 14925 return nil, err 14926 } 14927 ret := &WebApp{ 14928 ServerResponse: googleapi.ServerResponse{ 14929 Header: res.Header, 14930 HTTPStatusCode: res.StatusCode, 14931 }, 14932 } 14933 target := &ret 14934 if err := gensupport.DecodeResponse(target, res); err != nil { 14935 return nil, err 14936 } 14937 return ret, nil 14938 // { 14939 // "description": "Gets an existing web app.", 14940 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14941 // "httpMethod": "GET", 14942 // "id": "androidenterprise.webapps.get", 14943 // "parameterOrder": [ 14944 // "enterpriseId", 14945 // "webAppId" 14946 // ], 14947 // "parameters": { 14948 // "enterpriseId": { 14949 // "description": "The ID of the enterprise.", 14950 // "location": "path", 14951 // "required": true, 14952 // "type": "string" 14953 // }, 14954 // "webAppId": { 14955 // "description": "The ID of the web app.", 14956 // "location": "path", 14957 // "required": true, 14958 // "type": "string" 14959 // } 14960 // }, 14961 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 14962 // "response": { 14963 // "$ref": "WebApp" 14964 // }, 14965 // "scopes": [ 14966 // "https://www.googleapis.com/auth/androidenterprise" 14967 // ] 14968 // } 14969 14970} 14971 14972// method id "androidenterprise.webapps.insert": 14973 14974type WebappsInsertCall struct { 14975 s *Service 14976 enterpriseId string 14977 webapp *WebApp 14978 urlParams_ gensupport.URLParams 14979 ctx_ context.Context 14980 header_ http.Header 14981} 14982 14983// Insert: Creates a new web app for the enterprise. 14984// 14985// - enterpriseId: The ID of the enterprise. 14986func (r *WebappsService) Insert(enterpriseId string, webapp *WebApp) *WebappsInsertCall { 14987 c := &WebappsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14988 c.enterpriseId = enterpriseId 14989 c.webapp = webapp 14990 return c 14991} 14992 14993// Fields allows partial responses to be retrieved. See 14994// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14995// for more information. 14996func (c *WebappsInsertCall) Fields(s ...googleapi.Field) *WebappsInsertCall { 14997 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14998 return c 14999} 15000 15001// Context sets the context to be used in this call's Do method. Any 15002// pending HTTP request will be aborted if the provided context is 15003// canceled. 15004func (c *WebappsInsertCall) Context(ctx context.Context) *WebappsInsertCall { 15005 c.ctx_ = ctx 15006 return c 15007} 15008 15009// Header returns an http.Header that can be modified by the caller to 15010// add HTTP headers to the request. 15011func (c *WebappsInsertCall) Header() http.Header { 15012 if c.header_ == nil { 15013 c.header_ = make(http.Header) 15014 } 15015 return c.header_ 15016} 15017 15018func (c *WebappsInsertCall) doRequest(alt string) (*http.Response, error) { 15019 reqHeaders := make(http.Header) 15020 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 15021 for k, v := range c.header_ { 15022 reqHeaders[k] = v 15023 } 15024 reqHeaders.Set("User-Agent", c.s.userAgent()) 15025 var body io.Reader = nil 15026 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 15027 if err != nil { 15028 return nil, err 15029 } 15030 reqHeaders.Set("Content-Type", "application/json") 15031 c.urlParams_.Set("alt", alt) 15032 c.urlParams_.Set("prettyPrint", "false") 15033 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps") 15034 urls += "?" + c.urlParams_.Encode() 15035 req, err := http.NewRequest("POST", urls, body) 15036 if err != nil { 15037 return nil, err 15038 } 15039 req.Header = reqHeaders 15040 googleapi.Expand(req.URL, map[string]string{ 15041 "enterpriseId": c.enterpriseId, 15042 }) 15043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15044} 15045 15046// Do executes the "androidenterprise.webapps.insert" call. 15047// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 15048// code is an error. Response headers are in either 15049// *WebApp.ServerResponse.Header or (if a response was returned at all) 15050// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15051// check whether the returned error was because http.StatusNotModified 15052// was returned. 15053func (c *WebappsInsertCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 15054 gensupport.SetOptions(c.urlParams_, opts...) 15055 res, err := c.doRequest("json") 15056 if res != nil && res.StatusCode == http.StatusNotModified { 15057 if res.Body != nil { 15058 res.Body.Close() 15059 } 15060 return nil, &googleapi.Error{ 15061 Code: res.StatusCode, 15062 Header: res.Header, 15063 } 15064 } 15065 if err != nil { 15066 return nil, err 15067 } 15068 defer googleapi.CloseBody(res) 15069 if err := googleapi.CheckResponse(res); err != nil { 15070 return nil, err 15071 } 15072 ret := &WebApp{ 15073 ServerResponse: googleapi.ServerResponse{ 15074 Header: res.Header, 15075 HTTPStatusCode: res.StatusCode, 15076 }, 15077 } 15078 target := &ret 15079 if err := gensupport.DecodeResponse(target, res); err != nil { 15080 return nil, err 15081 } 15082 return ret, nil 15083 // { 15084 // "description": "Creates a new web app for the enterprise.", 15085 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15086 // "httpMethod": "POST", 15087 // "id": "androidenterprise.webapps.insert", 15088 // "parameterOrder": [ 15089 // "enterpriseId" 15090 // ], 15091 // "parameters": { 15092 // "enterpriseId": { 15093 // "description": "The ID of the enterprise.", 15094 // "location": "path", 15095 // "required": true, 15096 // "type": "string" 15097 // } 15098 // }, 15099 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15100 // "request": { 15101 // "$ref": "WebApp" 15102 // }, 15103 // "response": { 15104 // "$ref": "WebApp" 15105 // }, 15106 // "scopes": [ 15107 // "https://www.googleapis.com/auth/androidenterprise" 15108 // ] 15109 // } 15110 15111} 15112 15113// method id "androidenterprise.webapps.list": 15114 15115type WebappsListCall struct { 15116 s *Service 15117 enterpriseId string 15118 urlParams_ gensupport.URLParams 15119 ifNoneMatch_ string 15120 ctx_ context.Context 15121 header_ http.Header 15122} 15123 15124// List: Retrieves the details of all web apps for a given enterprise. 15125// 15126// - enterpriseId: The ID of the enterprise. 15127func (r *WebappsService) List(enterpriseId string) *WebappsListCall { 15128 c := &WebappsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15129 c.enterpriseId = enterpriseId 15130 return c 15131} 15132 15133// Fields allows partial responses to be retrieved. See 15134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15135// for more information. 15136func (c *WebappsListCall) Fields(s ...googleapi.Field) *WebappsListCall { 15137 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15138 return c 15139} 15140 15141// IfNoneMatch sets the optional parameter which makes the operation 15142// fail if the object's ETag matches the given value. This is useful for 15143// getting updates only after the object has changed since the last 15144// request. Use googleapi.IsNotModified to check whether the response 15145// error from Do is the result of In-None-Match. 15146func (c *WebappsListCall) IfNoneMatch(entityTag string) *WebappsListCall { 15147 c.ifNoneMatch_ = entityTag 15148 return c 15149} 15150 15151// Context sets the context to be used in this call's Do method. Any 15152// pending HTTP request will be aborted if the provided context is 15153// canceled. 15154func (c *WebappsListCall) Context(ctx context.Context) *WebappsListCall { 15155 c.ctx_ = ctx 15156 return c 15157} 15158 15159// Header returns an http.Header that can be modified by the caller to 15160// add HTTP headers to the request. 15161func (c *WebappsListCall) Header() http.Header { 15162 if c.header_ == nil { 15163 c.header_ = make(http.Header) 15164 } 15165 return c.header_ 15166} 15167 15168func (c *WebappsListCall) doRequest(alt string) (*http.Response, error) { 15169 reqHeaders := make(http.Header) 15170 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 15171 for k, v := range c.header_ { 15172 reqHeaders[k] = v 15173 } 15174 reqHeaders.Set("User-Agent", c.s.userAgent()) 15175 if c.ifNoneMatch_ != "" { 15176 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15177 } 15178 var body io.Reader = nil 15179 c.urlParams_.Set("alt", alt) 15180 c.urlParams_.Set("prettyPrint", "false") 15181 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps") 15182 urls += "?" + c.urlParams_.Encode() 15183 req, err := http.NewRequest("GET", urls, body) 15184 if err != nil { 15185 return nil, err 15186 } 15187 req.Header = reqHeaders 15188 googleapi.Expand(req.URL, map[string]string{ 15189 "enterpriseId": c.enterpriseId, 15190 }) 15191 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15192} 15193 15194// Do executes the "androidenterprise.webapps.list" call. 15195// Exactly one of *WebAppsListResponse or error will be non-nil. Any 15196// non-2xx status code is an error. Response headers are in either 15197// *WebAppsListResponse.ServerResponse.Header or (if a response was 15198// returned at all) in error.(*googleapi.Error).Header. Use 15199// googleapi.IsNotModified to check whether the returned error was 15200// because http.StatusNotModified was returned. 15201func (c *WebappsListCall) Do(opts ...googleapi.CallOption) (*WebAppsListResponse, error) { 15202 gensupport.SetOptions(c.urlParams_, opts...) 15203 res, err := c.doRequest("json") 15204 if res != nil && res.StatusCode == http.StatusNotModified { 15205 if res.Body != nil { 15206 res.Body.Close() 15207 } 15208 return nil, &googleapi.Error{ 15209 Code: res.StatusCode, 15210 Header: res.Header, 15211 } 15212 } 15213 if err != nil { 15214 return nil, err 15215 } 15216 defer googleapi.CloseBody(res) 15217 if err := googleapi.CheckResponse(res); err != nil { 15218 return nil, err 15219 } 15220 ret := &WebAppsListResponse{ 15221 ServerResponse: googleapi.ServerResponse{ 15222 Header: res.Header, 15223 HTTPStatusCode: res.StatusCode, 15224 }, 15225 } 15226 target := &ret 15227 if err := gensupport.DecodeResponse(target, res); err != nil { 15228 return nil, err 15229 } 15230 return ret, nil 15231 // { 15232 // "description": "Retrieves the details of all web apps for a given enterprise.", 15233 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15234 // "httpMethod": "GET", 15235 // "id": "androidenterprise.webapps.list", 15236 // "parameterOrder": [ 15237 // "enterpriseId" 15238 // ], 15239 // "parameters": { 15240 // "enterpriseId": { 15241 // "description": "The ID of the enterprise.", 15242 // "location": "path", 15243 // "required": true, 15244 // "type": "string" 15245 // } 15246 // }, 15247 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps", 15248 // "response": { 15249 // "$ref": "WebAppsListResponse" 15250 // }, 15251 // "scopes": [ 15252 // "https://www.googleapis.com/auth/androidenterprise" 15253 // ] 15254 // } 15255 15256} 15257 15258// method id "androidenterprise.webapps.update": 15259 15260type WebappsUpdateCall struct { 15261 s *Service 15262 enterpriseId string 15263 webAppId string 15264 webapp *WebApp 15265 urlParams_ gensupport.URLParams 15266 ctx_ context.Context 15267 header_ http.Header 15268} 15269 15270// Update: Updates an existing web app. 15271// 15272// - enterpriseId: The ID of the enterprise. 15273// - webAppId: The ID of the web app. 15274func (r *WebappsService) Update(enterpriseId string, webAppId string, webapp *WebApp) *WebappsUpdateCall { 15275 c := &WebappsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15276 c.enterpriseId = enterpriseId 15277 c.webAppId = webAppId 15278 c.webapp = webapp 15279 return c 15280} 15281 15282// Fields allows partial responses to be retrieved. See 15283// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15284// for more information. 15285func (c *WebappsUpdateCall) Fields(s ...googleapi.Field) *WebappsUpdateCall { 15286 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15287 return c 15288} 15289 15290// Context sets the context to be used in this call's Do method. Any 15291// pending HTTP request will be aborted if the provided context is 15292// canceled. 15293func (c *WebappsUpdateCall) Context(ctx context.Context) *WebappsUpdateCall { 15294 c.ctx_ = ctx 15295 return c 15296} 15297 15298// Header returns an http.Header that can be modified by the caller to 15299// add HTTP headers to the request. 15300func (c *WebappsUpdateCall) Header() http.Header { 15301 if c.header_ == nil { 15302 c.header_ = make(http.Header) 15303 } 15304 return c.header_ 15305} 15306 15307func (c *WebappsUpdateCall) doRequest(alt string) (*http.Response, error) { 15308 reqHeaders := make(http.Header) 15309 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 15310 for k, v := range c.header_ { 15311 reqHeaders[k] = v 15312 } 15313 reqHeaders.Set("User-Agent", c.s.userAgent()) 15314 var body io.Reader = nil 15315 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 15316 if err != nil { 15317 return nil, err 15318 } 15319 reqHeaders.Set("Content-Type", "application/json") 15320 c.urlParams_.Set("alt", alt) 15321 c.urlParams_.Set("prettyPrint", "false") 15322 urls := googleapi.ResolveRelative(c.s.BasePath, "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}") 15323 urls += "?" + c.urlParams_.Encode() 15324 req, err := http.NewRequest("PUT", urls, body) 15325 if err != nil { 15326 return nil, err 15327 } 15328 req.Header = reqHeaders 15329 googleapi.Expand(req.URL, map[string]string{ 15330 "enterpriseId": c.enterpriseId, 15331 "webAppId": c.webAppId, 15332 }) 15333 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15334} 15335 15336// Do executes the "androidenterprise.webapps.update" call. 15337// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 15338// code is an error. Response headers are in either 15339// *WebApp.ServerResponse.Header or (if a response was returned at all) 15340// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15341// check whether the returned error was because http.StatusNotModified 15342// was returned. 15343func (c *WebappsUpdateCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 15344 gensupport.SetOptions(c.urlParams_, opts...) 15345 res, err := c.doRequest("json") 15346 if res != nil && res.StatusCode == http.StatusNotModified { 15347 if res.Body != nil { 15348 res.Body.Close() 15349 } 15350 return nil, &googleapi.Error{ 15351 Code: res.StatusCode, 15352 Header: res.Header, 15353 } 15354 } 15355 if err != nil { 15356 return nil, err 15357 } 15358 defer googleapi.CloseBody(res) 15359 if err := googleapi.CheckResponse(res); err != nil { 15360 return nil, err 15361 } 15362 ret := &WebApp{ 15363 ServerResponse: googleapi.ServerResponse{ 15364 Header: res.Header, 15365 HTTPStatusCode: res.StatusCode, 15366 }, 15367 } 15368 target := &ret 15369 if err := gensupport.DecodeResponse(target, res); err != nil { 15370 return nil, err 15371 } 15372 return ret, nil 15373 // { 15374 // "description": "Updates an existing web app.", 15375 // "flatPath": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 15376 // "httpMethod": "PUT", 15377 // "id": "androidenterprise.webapps.update", 15378 // "parameterOrder": [ 15379 // "enterpriseId", 15380 // "webAppId" 15381 // ], 15382 // "parameters": { 15383 // "enterpriseId": { 15384 // "description": "The ID of the enterprise.", 15385 // "location": "path", 15386 // "required": true, 15387 // "type": "string" 15388 // }, 15389 // "webAppId": { 15390 // "description": "The ID of the web app.", 15391 // "location": "path", 15392 // "required": true, 15393 // "type": "string" 15394 // } 15395 // }, 15396 // "path": "androidenterprise/v1/enterprises/{enterpriseId}/webApps/{webAppId}", 15397 // "request": { 15398 // "$ref": "WebApp" 15399 // }, 15400 // "response": { 15401 // "$ref": "WebApp" 15402 // }, 15403 // "scopes": [ 15404 // "https://www.googleapis.com/auth/androidenterprise" 15405 // ] 15406 // } 15407 15408} 15409