1// Copyright 2020 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://www.googleapis.com/androidenterprise/v1/" 78 79// OAuth2 scopes used by this API. 80const ( 81 // Manage corporate Android devices 82 AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise" 83) 84 85// NewService creates a new Service. 86func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 87 scopesOption := option.WithScopes( 88 "https://www.googleapis.com/auth/androidenterprise", 89 ) 90 // NOTE: prepend, so we don't override user-specified scopes. 91 opts = append([]option.ClientOption{scopesOption}, opts...) 92 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 93 client, endpoint, err := htransport.NewClient(ctx, opts...) 94 if err != nil { 95 return nil, err 96 } 97 s, err := New(client) 98 if err != nil { 99 return nil, err 100 } 101 if endpoint != "" { 102 s.BasePath = endpoint 103 } 104 return s, nil 105} 106 107// New creates a new Service. It uses the provided http.Client for requests. 108// 109// Deprecated: please use NewService instead. 110// To provide a custom HTTP client, use option.WithHTTPClient. 111// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 112func New(client *http.Client) (*Service, error) { 113 if client == nil { 114 return nil, errors.New("client is nil") 115 } 116 s := &Service{client: client, BasePath: basePath} 117 s.Devices = NewDevicesService(s) 118 s.Enterprises = NewEnterprisesService(s) 119 s.Entitlements = NewEntitlementsService(s) 120 s.Grouplicenses = NewGrouplicensesService(s) 121 s.Grouplicenseusers = NewGrouplicenseusersService(s) 122 s.Installs = NewInstallsService(s) 123 s.Managedconfigurationsfordevice = NewManagedconfigurationsfordeviceService(s) 124 s.Managedconfigurationsforuser = NewManagedconfigurationsforuserService(s) 125 s.Managedconfigurationssettings = NewManagedconfigurationssettingsService(s) 126 s.Permissions = NewPermissionsService(s) 127 s.Products = NewProductsService(s) 128 s.Serviceaccountkeys = NewServiceaccountkeysService(s) 129 s.Storelayoutclusters = NewStorelayoutclustersService(s) 130 s.Storelayoutpages = NewStorelayoutpagesService(s) 131 s.Users = NewUsersService(s) 132 s.Webapps = NewWebappsService(s) 133 return s, nil 134} 135 136type Service struct { 137 client *http.Client 138 BasePath string // API endpoint base URL 139 UserAgent string // optional additional User-Agent fragment 140 141 Devices *DevicesService 142 143 Enterprises *EnterprisesService 144 145 Entitlements *EntitlementsService 146 147 Grouplicenses *GrouplicensesService 148 149 Grouplicenseusers *GrouplicenseusersService 150 151 Installs *InstallsService 152 153 Managedconfigurationsfordevice *ManagedconfigurationsfordeviceService 154 155 Managedconfigurationsforuser *ManagedconfigurationsforuserService 156 157 Managedconfigurationssettings *ManagedconfigurationssettingsService 158 159 Permissions *PermissionsService 160 161 Products *ProductsService 162 163 Serviceaccountkeys *ServiceaccountkeysService 164 165 Storelayoutclusters *StorelayoutclustersService 166 167 Storelayoutpages *StorelayoutpagesService 168 169 Users *UsersService 170 171 Webapps *WebappsService 172} 173 174func (s *Service) userAgent() string { 175 if s.UserAgent == "" { 176 return googleapi.UserAgent 177 } 178 return googleapi.UserAgent + " " + s.UserAgent 179} 180 181func NewDevicesService(s *Service) *DevicesService { 182 rs := &DevicesService{s: s} 183 return rs 184} 185 186type DevicesService struct { 187 s *Service 188} 189 190func NewEnterprisesService(s *Service) *EnterprisesService { 191 rs := &EnterprisesService{s: s} 192 return rs 193} 194 195type EnterprisesService struct { 196 s *Service 197} 198 199func NewEntitlementsService(s *Service) *EntitlementsService { 200 rs := &EntitlementsService{s: s} 201 return rs 202} 203 204type EntitlementsService struct { 205 s *Service 206} 207 208func NewGrouplicensesService(s *Service) *GrouplicensesService { 209 rs := &GrouplicensesService{s: s} 210 return rs 211} 212 213type GrouplicensesService struct { 214 s *Service 215} 216 217func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService { 218 rs := &GrouplicenseusersService{s: s} 219 return rs 220} 221 222type GrouplicenseusersService struct { 223 s *Service 224} 225 226func NewInstallsService(s *Service) *InstallsService { 227 rs := &InstallsService{s: s} 228 return rs 229} 230 231type InstallsService struct { 232 s *Service 233} 234 235func NewManagedconfigurationsfordeviceService(s *Service) *ManagedconfigurationsfordeviceService { 236 rs := &ManagedconfigurationsfordeviceService{s: s} 237 return rs 238} 239 240type ManagedconfigurationsfordeviceService struct { 241 s *Service 242} 243 244func NewManagedconfigurationsforuserService(s *Service) *ManagedconfigurationsforuserService { 245 rs := &ManagedconfigurationsforuserService{s: s} 246 return rs 247} 248 249type ManagedconfigurationsforuserService struct { 250 s *Service 251} 252 253func NewManagedconfigurationssettingsService(s *Service) *ManagedconfigurationssettingsService { 254 rs := &ManagedconfigurationssettingsService{s: s} 255 return rs 256} 257 258type ManagedconfigurationssettingsService struct { 259 s *Service 260} 261 262func NewPermissionsService(s *Service) *PermissionsService { 263 rs := &PermissionsService{s: s} 264 return rs 265} 266 267type PermissionsService struct { 268 s *Service 269} 270 271func NewProductsService(s *Service) *ProductsService { 272 rs := &ProductsService{s: s} 273 return rs 274} 275 276type ProductsService struct { 277 s *Service 278} 279 280func NewServiceaccountkeysService(s *Service) *ServiceaccountkeysService { 281 rs := &ServiceaccountkeysService{s: s} 282 return rs 283} 284 285type ServiceaccountkeysService struct { 286 s *Service 287} 288 289func NewStorelayoutclustersService(s *Service) *StorelayoutclustersService { 290 rs := &StorelayoutclustersService{s: s} 291 return rs 292} 293 294type StorelayoutclustersService struct { 295 s *Service 296} 297 298func NewStorelayoutpagesService(s *Service) *StorelayoutpagesService { 299 rs := &StorelayoutpagesService{s: s} 300 return rs 301} 302 303type StorelayoutpagesService struct { 304 s *Service 305} 306 307func NewUsersService(s *Service) *UsersService { 308 rs := &UsersService{s: s} 309 return rs 310} 311 312type UsersService struct { 313 s *Service 314} 315 316func NewWebappsService(s *Service) *WebappsService { 317 rs := &WebappsService{s: s} 318 return rs 319} 320 321type WebappsService struct { 322 s *Service 323} 324 325// Administrator: This represents an enterprise admin who can manage the 326// enterprise in the managed Google Play store. 327type Administrator struct { 328 // Email: The admin's email address. 329 Email string `json:"email,omitempty"` 330 331 // ForceSendFields is a list of field names (e.g. "Email") to 332 // unconditionally include in API requests. By default, fields with 333 // empty values are omitted from API requests. However, any non-pointer, 334 // non-interface field appearing in ForceSendFields will be sent to the 335 // server regardless of whether the field is empty or not. This may be 336 // used to include empty fields in Patch requests. 337 ForceSendFields []string `json:"-"` 338 339 // NullFields is a list of field names (e.g. "Email") to include in API 340 // requests with the JSON null value. By default, fields with empty 341 // values are omitted from API requests. However, any field with an 342 // empty value appearing in NullFields will be sent to the server as 343 // null. It is an error if a field in this list has a non-empty value. 344 // This may be used to include null fields in Patch requests. 345 NullFields []string `json:"-"` 346} 347 348func (s *Administrator) MarshalJSON() ([]byte, error) { 349 type NoMethod Administrator 350 raw := NoMethod(*s) 351 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 352} 353 354// AdministratorWebToken: A token authorizing an admin to access an 355// iframe. 356type AdministratorWebToken struct { 357 Kind string `json:"kind,omitempty"` 358 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. "Kind") 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. "Kind") 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 Kind string `json:"kind,omitempty"` 395 396 // ManagedConfigurations: Options for displaying the Managed 397 // Configuration page. 398 ManagedConfigurations *AdministratorWebTokenSpecManagedConfigurations `json:"managedConfigurations,omitempty"` 399 400 // Parent: The URI of the parent frame hosting the iframe. To prevent 401 // XSS, the iframe may not be hosted at other URIs. This URI must be 402 // https. Use whitespaces to separate multiple parent URIs. 403 Parent string `json:"parent,omitempty"` 404 405 // Permission: Deprecated. Use PlaySearch.approveApps. 406 Permission []string `json:"permission,omitempty"` 407 408 // PlaySearch: Options for displaying the managed Play Search apps page. 409 PlaySearch *AdministratorWebTokenSpecPlaySearch `json:"playSearch,omitempty"` 410 411 // PrivateApps: Options for displaying the Private Apps page. 412 PrivateApps *AdministratorWebTokenSpecPrivateApps `json:"privateApps,omitempty"` 413 414 // StoreBuilder: Options for displaying the Organize apps page. 415 StoreBuilder *AdministratorWebTokenSpecStoreBuilder `json:"storeBuilder,omitempty"` 416 417 // WebApps: Options for displaying the Web Apps page. 418 WebApps *AdministratorWebTokenSpecWebApps `json:"webApps,omitempty"` 419 420 // ForceSendFields is a list of field names (e.g. "Kind") to 421 // unconditionally include in API requests. By default, fields with 422 // empty values are omitted from API requests. However, any non-pointer, 423 // non-interface field appearing in ForceSendFields will be sent to the 424 // server regardless of whether the field is empty or not. This may be 425 // used to include empty fields in Patch requests. 426 ForceSendFields []string `json:"-"` 427 428 // NullFields is a list of field names (e.g. "Kind") to include in API 429 // requests with the JSON null value. By default, fields with empty 430 // values are omitted from API requests. However, any field with an 431 // empty value appearing in NullFields will be sent to the server as 432 // null. It is an error if a field in this list has a non-empty value. 433 // This may be used to include null fields in Patch requests. 434 NullFields []string `json:"-"` 435} 436 437func (s *AdministratorWebTokenSpec) MarshalJSON() ([]byte, error) { 438 type NoMethod AdministratorWebTokenSpec 439 raw := NoMethod(*s) 440 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 441} 442 443type AdministratorWebTokenSpecManagedConfigurations struct { 444 // Enabled: Whether the Managed Configuration page is displayed. Default 445 // is true. 446 Enabled bool `json:"enabled,omitempty"` 447 448 // ForceSendFields is a list of field names (e.g. "Enabled") to 449 // unconditionally include in API requests. By default, fields with 450 // empty values are omitted from API requests. However, any non-pointer, 451 // non-interface field appearing in ForceSendFields will be sent to the 452 // server regardless of whether the field is empty or not. This may be 453 // used to include empty fields in Patch requests. 454 ForceSendFields []string `json:"-"` 455 456 // NullFields is a list of field names (e.g. "Enabled") to include in 457 // API requests with the JSON null value. By default, fields with empty 458 // values are omitted from API requests. However, any field with an 459 // empty value appearing in NullFields will be sent to the server as 460 // null. It is an error if a field in this list has a non-empty value. 461 // This may be used to include null fields in Patch requests. 462 NullFields []string `json:"-"` 463} 464 465func (s *AdministratorWebTokenSpecManagedConfigurations) MarshalJSON() ([]byte, error) { 466 type NoMethod AdministratorWebTokenSpecManagedConfigurations 467 raw := NoMethod(*s) 468 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 469} 470 471type AdministratorWebTokenSpecPlaySearch struct { 472 // ApproveApps: Allow access to the iframe in approve mode. Default is 473 // false. 474 ApproveApps bool `json:"approveApps,omitempty"` 475 476 // Enabled: Whether the managed Play Search apps page is displayed. 477 // Default is true. 478 Enabled bool `json:"enabled,omitempty"` 479 480 // ForceSendFields is a list of field names (e.g. "ApproveApps") to 481 // unconditionally include in API requests. By default, fields with 482 // empty values are omitted from API requests. However, any non-pointer, 483 // non-interface field appearing in ForceSendFields will be sent to the 484 // server regardless of whether the field is empty or not. This may be 485 // used to include empty fields in Patch requests. 486 ForceSendFields []string `json:"-"` 487 488 // NullFields is a list of field names (e.g. "ApproveApps") to include 489 // in API requests with the JSON null value. By default, fields with 490 // empty values are omitted from API requests. However, any field with 491 // an empty value appearing in NullFields will be sent to the server as 492 // null. It is an error if a field in this list has a non-empty value. 493 // This may be used to include null fields in Patch requests. 494 NullFields []string `json:"-"` 495} 496 497func (s *AdministratorWebTokenSpecPlaySearch) MarshalJSON() ([]byte, error) { 498 type NoMethod AdministratorWebTokenSpecPlaySearch 499 raw := NoMethod(*s) 500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 501} 502 503type AdministratorWebTokenSpecPrivateApps struct { 504 // Enabled: Whether the Private Apps page is displayed. Default is true. 505 Enabled bool `json:"enabled,omitempty"` 506 507 // ForceSendFields is a list of field names (e.g. "Enabled") to 508 // unconditionally include in API requests. By default, fields with 509 // empty values are omitted from API requests. However, any non-pointer, 510 // non-interface field appearing in ForceSendFields will be sent to the 511 // server regardless of whether the field is empty or not. This may be 512 // used to include empty fields in Patch requests. 513 ForceSendFields []string `json:"-"` 514 515 // NullFields is a list of field names (e.g. "Enabled") to include in 516 // API requests with the JSON null value. By default, fields with empty 517 // values are omitted from API requests. However, any field with an 518 // empty value appearing in NullFields will be sent to the server as 519 // null. It is an error if a field in this list has a non-empty value. 520 // This may be used to include null fields in Patch requests. 521 NullFields []string `json:"-"` 522} 523 524func (s *AdministratorWebTokenSpecPrivateApps) MarshalJSON() ([]byte, error) { 525 type NoMethod AdministratorWebTokenSpecPrivateApps 526 raw := NoMethod(*s) 527 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 528} 529 530type AdministratorWebTokenSpecStoreBuilder struct { 531 // Enabled: Whether the Organize apps page is displayed. Default is 532 // true. 533 Enabled bool `json:"enabled,omitempty"` 534 535 // ForceSendFields is a list of field names (e.g. "Enabled") to 536 // unconditionally include in API requests. By default, fields with 537 // empty values are omitted from API requests. However, any non-pointer, 538 // non-interface field appearing in ForceSendFields will be sent to the 539 // server regardless of whether the field is empty or not. This may be 540 // used to include empty fields in Patch requests. 541 ForceSendFields []string `json:"-"` 542 543 // NullFields is a list of field names (e.g. "Enabled") to include in 544 // API requests with the JSON null value. By default, fields with empty 545 // values are omitted from API requests. However, any field with an 546 // empty value appearing in NullFields will be sent to the server as 547 // null. It is an error if a field in this list has a non-empty value. 548 // This may be used to include null fields in Patch requests. 549 NullFields []string `json:"-"` 550} 551 552func (s *AdministratorWebTokenSpecStoreBuilder) MarshalJSON() ([]byte, error) { 553 type NoMethod AdministratorWebTokenSpecStoreBuilder 554 raw := NoMethod(*s) 555 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 556} 557 558type AdministratorWebTokenSpecWebApps struct { 559 // Enabled: Whether the Web Apps page is displayed. Default is true. 560 Enabled bool `json:"enabled,omitempty"` 561 562 // ForceSendFields is a list of field names (e.g. "Enabled") to 563 // unconditionally include in API requests. By default, fields with 564 // empty values are omitted from API requests. However, any non-pointer, 565 // non-interface field appearing in ForceSendFields will be sent to the 566 // server regardless of whether the field is empty or not. This may be 567 // used to include empty fields in Patch requests. 568 ForceSendFields []string `json:"-"` 569 570 // NullFields is a list of field names (e.g. "Enabled") to include in 571 // API requests with the JSON null value. By default, fields with empty 572 // values are omitted from API requests. However, any field with an 573 // empty value appearing in NullFields will be sent to the server as 574 // null. It is an error if a field in this list has a non-empty value. 575 // This may be used to include null fields in Patch requests. 576 NullFields []string `json:"-"` 577} 578 579func (s *AdministratorWebTokenSpecWebApps) MarshalJSON() ([]byte, error) { 580 type NoMethod AdministratorWebTokenSpecWebApps 581 raw := NoMethod(*s) 582 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 583} 584 585// AppRestrictionsSchema: Represents the list of app restrictions 586// available to be pre-configured for the product. 587type AppRestrictionsSchema struct { 588 Kind string `json:"kind,omitempty"` 589 590 // Restrictions: The set of restrictions that make up this schema. 591 Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"` 592 593 // ServerResponse contains the HTTP response code and headers from the 594 // server. 595 googleapi.ServerResponse `json:"-"` 596 597 // ForceSendFields is a list of field names (e.g. "Kind") to 598 // unconditionally include in API requests. By default, fields with 599 // empty values are omitted from API requests. However, any non-pointer, 600 // non-interface field appearing in ForceSendFields will be sent to the 601 // server regardless of whether the field is empty or not. This may be 602 // used to include empty fields in Patch requests. 603 ForceSendFields []string `json:"-"` 604 605 // NullFields is a list of field names (e.g. "Kind") to include in API 606 // requests with the JSON null value. By default, fields with empty 607 // values are omitted from API requests. However, any field with an 608 // empty value appearing in NullFields will be sent to the server as 609 // null. It is an error if a field in this list has a non-empty value. 610 // This may be used to include null fields in Patch requests. 611 NullFields []string `json:"-"` 612} 613 614func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) { 615 type NoMethod AppRestrictionsSchema 616 raw := NoMethod(*s) 617 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 618} 619 620// AppRestrictionsSchemaChangeEvent: An event generated when a new app 621// version is uploaded to Google Play and its app restrictions schema 622// changed. To fetch the app restrictions schema for an app, use 623// Products.getAppRestrictionsSchema on the EMM API. 624type AppRestrictionsSchemaChangeEvent struct { 625 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 626 // for which the app restriction schema changed. This field will always 627 // be present. 628 ProductId string `json:"productId,omitempty"` 629 630 // ForceSendFields is a list of field names (e.g. "ProductId") to 631 // unconditionally include in API requests. By default, fields with 632 // empty values are omitted from API requests. However, any non-pointer, 633 // non-interface field appearing in ForceSendFields will be sent to the 634 // server regardless of whether the field is empty or not. This may be 635 // used to include empty fields in Patch requests. 636 ForceSendFields []string `json:"-"` 637 638 // NullFields is a list of field names (e.g. "ProductId") to include in 639 // API requests with the JSON null value. By default, fields with empty 640 // values are omitted from API requests. However, any field with an 641 // empty value appearing in NullFields will be sent to the server as 642 // null. It is an error if a field in this list has a non-empty value. 643 // This may be used to include null fields in Patch requests. 644 NullFields []string `json:"-"` 645} 646 647func (s *AppRestrictionsSchemaChangeEvent) MarshalJSON() ([]byte, error) { 648 type NoMethod AppRestrictionsSchemaChangeEvent 649 raw := NoMethod(*s) 650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 651} 652 653// AppRestrictionsSchemaRestriction: A restriction in the App 654// Restriction Schema represents a piece of configuration that may be 655// pre-applied. 656type AppRestrictionsSchemaRestriction struct { 657 // DefaultValue: The default value of the restriction. bundle and 658 // bundleArray restrictions never have a default value. 659 DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"` 660 661 // Description: A longer description of the restriction, giving more 662 // detail of what it affects. 663 Description string `json:"description,omitempty"` 664 665 // Entry: For choice or multiselect restrictions, the list of possible 666 // entries' human-readable names. 667 Entry []string `json:"entry,omitempty"` 668 669 // EntryValue: For choice or multiselect restrictions, the list of 670 // possible entries' machine-readable values. These values should be 671 // used in the configuration, either as a single string value for a 672 // choice restriction or in a stringArray for a multiselect restriction. 673 EntryValue []string `json:"entryValue,omitempty"` 674 675 // Key: The unique key that the product uses to identify the 676 // restriction, e.g. "com.google.android.gm.fieldname". 677 Key string `json:"key,omitempty"` 678 679 // NestedRestriction: For bundle or bundleArray restrictions, the list 680 // of nested restrictions. A bundle restriction is always nested within 681 // a bundleArray restriction, and a bundleArray restriction is at most 682 // two levels deep. 683 NestedRestriction []*AppRestrictionsSchemaRestriction `json:"nestedRestriction,omitempty"` 684 685 // RestrictionType: The type of the restriction. 686 RestrictionType string `json:"restrictionType,omitempty"` 687 688 // Title: The name of the restriction. 689 Title string `json:"title,omitempty"` 690 691 // ForceSendFields is a list of field names (e.g. "DefaultValue") to 692 // unconditionally include in API requests. By default, fields with 693 // empty values are omitted from API requests. However, any non-pointer, 694 // non-interface field appearing in ForceSendFields will be sent to the 695 // server regardless of whether the field is empty or not. This may be 696 // used to include empty fields in Patch requests. 697 ForceSendFields []string `json:"-"` 698 699 // NullFields is a list of field names (e.g. "DefaultValue") to include 700 // in API requests with the JSON null value. By default, fields with 701 // empty values are omitted from API requests. However, any field with 702 // an empty value appearing in NullFields will be sent to the server as 703 // null. It is an error if a field in this list has a non-empty value. 704 // This may be used to include null fields in Patch requests. 705 NullFields []string `json:"-"` 706} 707 708func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) { 709 type NoMethod AppRestrictionsSchemaRestriction 710 raw := NoMethod(*s) 711 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 712} 713 714// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for 715// the restriction. 716type AppRestrictionsSchemaRestrictionRestrictionValue struct { 717 // Type: The type of the value being provided. 718 Type string `json:"type,omitempty"` 719 720 // ValueBool: The boolean value - this will only be present if type is 721 // bool. 722 ValueBool bool `json:"valueBool,omitempty"` 723 724 // ValueInteger: The integer value - this will only be present if type 725 // is integer. 726 ValueInteger int64 `json:"valueInteger,omitempty"` 727 728 // ValueMultiselect: The list of string values - this will only be 729 // present if type is multiselect. 730 ValueMultiselect []string `json:"valueMultiselect,omitempty"` 731 732 // ValueString: The string value - this will be present for types 733 // string, choice and hidden. 734 ValueString string `json:"valueString,omitempty"` 735 736 // ForceSendFields is a list of field names (e.g. "Type") to 737 // unconditionally include in API requests. By default, fields with 738 // empty values are omitted from API requests. However, any non-pointer, 739 // non-interface field appearing in ForceSendFields will be sent to the 740 // server regardless of whether the field is empty or not. This may be 741 // used to include empty fields in Patch requests. 742 ForceSendFields []string `json:"-"` 743 744 // NullFields is a list of field names (e.g. "Type") to include in API 745 // requests with the JSON null value. By default, fields with empty 746 // values are omitted from API requests. However, any field with an 747 // empty value appearing in NullFields will be sent to the server as 748 // null. It is an error if a field in this list has a non-empty value. 749 // This may be used to include null fields in Patch requests. 750 NullFields []string `json:"-"` 751} 752 753func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) { 754 type NoMethod AppRestrictionsSchemaRestrictionRestrictionValue 755 raw := NoMethod(*s) 756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 757} 758 759// AppState: List of states set by the app. 760type AppState struct { 761 // KeyedAppState: List of keyed app states. This field will always be 762 // present. 763 KeyedAppState []*KeyedAppState `json:"keyedAppState,omitempty"` 764 765 // PackageName: The package name of the app. This field will always be 766 // present. 767 PackageName string `json:"packageName,omitempty"` 768 769 // ForceSendFields is a list of field names (e.g. "KeyedAppState") to 770 // unconditionally include in API requests. By default, fields with 771 // empty values are omitted from API requests. However, any non-pointer, 772 // non-interface field appearing in ForceSendFields will be sent to the 773 // server regardless of whether the field is empty or not. This may be 774 // used to include empty fields in Patch requests. 775 ForceSendFields []string `json:"-"` 776 777 // NullFields is a list of field names (e.g. "KeyedAppState") to include 778 // in API requests with the JSON null value. By default, fields with 779 // empty values are omitted from API requests. However, any field with 780 // an empty value appearing in NullFields will be sent to the server as 781 // null. It is an error if a field in this list has a non-empty value. 782 // This may be used to include null fields in Patch requests. 783 NullFields []string `json:"-"` 784} 785 786func (s *AppState) MarshalJSON() ([]byte, error) { 787 type NoMethod AppState 788 raw := NoMethod(*s) 789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 790} 791 792// AppUpdateEvent: An event generated when a new version of an app is 793// uploaded to Google Play. Notifications are sent for new public 794// versions only: alpha, beta, or canary versions do not generate this 795// event. To fetch up-to-date version history for an app, use 796// Products.Get on the EMM API. 797type AppUpdateEvent struct { 798 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 799 // that was updated. This field will always be present. 800 ProductId string `json:"productId,omitempty"` 801 802 // ForceSendFields is a list of field names (e.g. "ProductId") to 803 // unconditionally include in API requests. By default, fields with 804 // empty values are omitted from API requests. However, any non-pointer, 805 // non-interface field appearing in ForceSendFields will be sent to the 806 // server regardless of whether the field is empty or not. This may be 807 // used to include empty fields in Patch requests. 808 ForceSendFields []string `json:"-"` 809 810 // NullFields is a list of field names (e.g. "ProductId") to include in 811 // API requests with the JSON null value. By default, fields with empty 812 // values are omitted from API requests. However, any field with an 813 // empty value appearing in NullFields will be sent to the server as 814 // null. It is an error if a field in this list has a non-empty value. 815 // This may be used to include null fields in Patch requests. 816 NullFields []string `json:"-"` 817} 818 819func (s *AppUpdateEvent) MarshalJSON() ([]byte, error) { 820 type NoMethod AppUpdateEvent 821 raw := NoMethod(*s) 822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 823} 824 825// AppVersion: This represents a single version of the app. 826type AppVersion struct { 827 // IsProduction: True if this version is a production APK. 828 IsProduction bool `json:"isProduction,omitempty"` 829 830 // Track: Deprecated, use trackId instead. 831 Track string `json:"track,omitempty"` 832 833 // TrackId: Track ids that the app version is published in. Replaces the 834 // track field (deprecated), but doesn't include the production track 835 // (see isProduction instead). 836 TrackId []string `json:"trackId,omitempty"` 837 838 // VersionCode: Unique increasing identifier for the app version. 839 VersionCode int64 `json:"versionCode,omitempty"` 840 841 // VersionString: The string used in the Play store by the app developer 842 // to identify the version. The string is not necessarily unique or 843 // localized (for example, the string could be "1.4"). 844 VersionString string `json:"versionString,omitempty"` 845 846 // ForceSendFields is a list of field names (e.g. "IsProduction") to 847 // unconditionally include in API requests. By default, fields with 848 // empty values are omitted from API requests. However, any non-pointer, 849 // non-interface field appearing in ForceSendFields will be sent to the 850 // server regardless of whether the field is empty or not. This may be 851 // used to include empty fields in Patch requests. 852 ForceSendFields []string `json:"-"` 853 854 // NullFields is a list of field names (e.g. "IsProduction") to include 855 // in API requests with the JSON null value. By default, fields with 856 // empty values are omitted from API requests. However, any field with 857 // an empty value appearing in NullFields will be sent to the server as 858 // null. It is an error if a field in this list has a non-empty value. 859 // This may be used to include null fields in Patch requests. 860 NullFields []string `json:"-"` 861} 862 863func (s *AppVersion) MarshalJSON() ([]byte, error) { 864 type NoMethod AppVersion 865 raw := NoMethod(*s) 866 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 867} 868 869// ApprovalUrlInfo: Information on an approval URL. 870type ApprovalUrlInfo struct { 871 // ApprovalUrl: A URL that displays a product's permissions and that can 872 // also be used to approve the product with the Products.approve call. 873 ApprovalUrl string `json:"approvalUrl,omitempty"` 874 875 Kind string `json:"kind,omitempty"` 876 877 // ForceSendFields is a list of field names (e.g. "ApprovalUrl") to 878 // unconditionally include in API requests. By default, fields with 879 // empty values are omitted from API requests. However, any non-pointer, 880 // non-interface field appearing in ForceSendFields will be sent to the 881 // server regardless of whether the field is empty or not. This may be 882 // used to include empty fields in Patch requests. 883 ForceSendFields []string `json:"-"` 884 885 // NullFields is a list of field names (e.g. "ApprovalUrl") to include 886 // in API requests with the JSON null value. By default, fields with 887 // empty values are omitted from API requests. However, any field with 888 // an empty value appearing in NullFields will be sent to the server as 889 // null. It is an error if a field in this list has a non-empty value. 890 // This may be used to include null fields in Patch requests. 891 NullFields []string `json:"-"` 892} 893 894func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) { 895 type NoMethod ApprovalUrlInfo 896 raw := NoMethod(*s) 897 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 898} 899 900// AuthenticationToken: An AuthenticationToken is used by the EMM's 901// device policy client on a device to provision the given EMM-managed 902// user on that device. 903type AuthenticationToken struct { 904 Kind string `json:"kind,omitempty"` 905 906 // Token: The authentication token to be passed to the device policy 907 // client on the device where it can be used to provision the account 908 // for which this token was generated. 909 Token string `json:"token,omitempty"` 910 911 // ServerResponse contains the HTTP response code and headers from the 912 // server. 913 googleapi.ServerResponse `json:"-"` 914 915 // ForceSendFields is a list of field names (e.g. "Kind") to 916 // unconditionally include in API requests. By default, fields with 917 // empty values are omitted from API requests. However, any non-pointer, 918 // non-interface field appearing in ForceSendFields will be sent to the 919 // server regardless of whether the field is empty or not. This may be 920 // used to include empty fields in Patch requests. 921 ForceSendFields []string `json:"-"` 922 923 // NullFields is a list of field names (e.g. "Kind") to include in API 924 // requests with the JSON null value. By default, fields with empty 925 // values are omitted from API requests. However, any field with an 926 // empty value appearing in NullFields will be sent to the server as 927 // null. It is an error if a field in this list has a non-empty value. 928 // This may be used to include null fields in Patch requests. 929 NullFields []string `json:"-"` 930} 931 932func (s *AuthenticationToken) MarshalJSON() ([]byte, error) { 933 type NoMethod AuthenticationToken 934 raw := NoMethod(*s) 935 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 936} 937 938// AutoInstallConstraint: The auto-install constraint. Defines a set of 939// restrictions for installation. At least one of the fields must be 940// set. 941type AutoInstallConstraint struct { 942 // ChargingStateConstraint: Charging state constraint. 943 ChargingStateConstraint string `json:"chargingStateConstraint,omitempty"` 944 945 // DeviceIdleStateConstraint: Device idle state constraint. 946 DeviceIdleStateConstraint string `json:"deviceIdleStateConstraint,omitempty"` 947 948 // NetworkTypeConstraint: Network type constraint. 949 NetworkTypeConstraint string `json:"networkTypeConstraint,omitempty"` 950 951 // ForceSendFields is a list of field names (e.g. 952 // "ChargingStateConstraint") to unconditionally include in API 953 // requests. By default, fields with empty values are omitted from API 954 // requests. However, any non-pointer, non-interface field appearing in 955 // ForceSendFields will be sent to the server regardless of whether the 956 // field is empty or not. This may be used to include empty fields in 957 // Patch requests. 958 ForceSendFields []string `json:"-"` 959 960 // NullFields is a list of field names (e.g. "ChargingStateConstraint") 961 // to include in API requests with the JSON null value. By default, 962 // fields with empty values are omitted from API requests. However, any 963 // field with an empty value appearing in NullFields will be sent to the 964 // server as null. It is an error if a field in this list has a 965 // non-empty value. This may be used to include null fields in Patch 966 // requests. 967 NullFields []string `json:"-"` 968} 969 970func (s *AutoInstallConstraint) MarshalJSON() ([]byte, error) { 971 type NoMethod AutoInstallConstraint 972 raw := NoMethod(*s) 973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 974} 975 976type AutoInstallPolicy struct { 977 // AutoInstallConstraint: The constraints for auto-installing the app. 978 // You can specify a maximum of one constraint. 979 AutoInstallConstraint []*AutoInstallConstraint `json:"autoInstallConstraint,omitempty"` 980 981 // AutoInstallMode: The auto-install mode. If unset defaults to 982 // "doNotAutoInstall". 983 AutoInstallMode string `json:"autoInstallMode,omitempty"` 984 985 // AutoInstallPriority: The priority of the install, as an unsigned 986 // integer. A lower number means higher priority. 987 AutoInstallPriority int64 `json:"autoInstallPriority,omitempty"` 988 989 // MinimumVersionCode: The minimum version of the app. If a lower 990 // version of the app is installed, then the app will be auto-updated 991 // according to the auto-install constraints, instead of waiting for the 992 // regular auto-update. You can set a minimum version code for at most 993 // 20 apps per device. 994 MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"` 995 996 // ForceSendFields is a list of field names (e.g. 997 // "AutoInstallConstraint") to unconditionally include in API requests. 998 // By default, fields with empty values are omitted from API requests. 999 // However, any non-pointer, non-interface field appearing in 1000 // ForceSendFields will be sent to the server regardless of whether the 1001 // field is empty or not. This may be used to include empty fields in 1002 // Patch requests. 1003 ForceSendFields []string `json:"-"` 1004 1005 // NullFields is a list of field names (e.g. "AutoInstallConstraint") to 1006 // include in API requests with the JSON null value. By default, fields 1007 // with empty values are omitted from API requests. However, any field 1008 // with an empty value appearing in NullFields will be sent to the 1009 // server as null. It is an error if a field in this list has a 1010 // non-empty value. This may be used to include null fields in Patch 1011 // requests. 1012 NullFields []string `json:"-"` 1013} 1014 1015func (s *AutoInstallPolicy) MarshalJSON() ([]byte, error) { 1016 type NoMethod AutoInstallPolicy 1017 raw := NoMethod(*s) 1018 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1019} 1020 1021// ConfigurationVariables: A configuration variables resource contains 1022// the managed configuration settings ID to be applied to a single user, 1023// as well as the variable set that is attributed to the user. The 1024// variable set will be used to replace placeholders in the managed 1025// configuration settings. 1026type ConfigurationVariables struct { 1027 Kind string `json:"kind,omitempty"` 1028 1029 // McmId: The ID of the managed configurations settings. 1030 McmId string `json:"mcmId,omitempty"` 1031 1032 // VariableSet: The variable set that is attributed to the user. 1033 VariableSet []*VariableSet `json:"variableSet,omitempty"` 1034 1035 // ForceSendFields is a list of field names (e.g. "Kind") to 1036 // unconditionally include in API requests. By default, fields with 1037 // empty values are omitted from API requests. However, any non-pointer, 1038 // non-interface field appearing in ForceSendFields will be sent to the 1039 // server regardless of whether the field is empty or not. This may be 1040 // used to include empty fields in Patch requests. 1041 ForceSendFields []string `json:"-"` 1042 1043 // NullFields is a list of field names (e.g. "Kind") to include in API 1044 // requests with the JSON null value. By default, fields with empty 1045 // values are omitted from API requests. However, any field with an 1046 // empty value appearing in NullFields will be sent to the server as 1047 // null. It is an error if a field in this list has a non-empty value. 1048 // This may be used to include null fields in Patch requests. 1049 NullFields []string `json:"-"` 1050} 1051 1052func (s *ConfigurationVariables) MarshalJSON() ([]byte, error) { 1053 type NoMethod ConfigurationVariables 1054 raw := NoMethod(*s) 1055 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1056} 1057 1058// Device: A Devices resource represents a mobile device managed by the 1059// EMM and belonging to a specific enterprise user. 1060type Device struct { 1061 // AndroidId: The Google Play Services Android ID for the device encoded 1062 // as a lowercase hex string. For example, "123456789abcdef0". 1063 AndroidId string `json:"androidId,omitempty"` 1064 1065 Kind string `json:"kind,omitempty"` 1066 1067 // ManagementType: Identifies the extent to which the device is 1068 // controlled by a managed Google Play EMM in various deployment 1069 // configurations. 1070 // 1071 // Possible values include: 1072 // - "managedDevice", a device that has the EMM's device policy 1073 // controller (DPC) as the device owner. 1074 // - "managedProfile", a device that has a profile managed by the DPC 1075 // (DPC is profile owner) in addition to a separate, personal profile 1076 // that is unavailable to the DPC. 1077 // - "containerApp", no longer used (deprecated). 1078 // - "unmanagedProfile", a device that has been allowed (by the domain's 1079 // admin, using the Admin Console to enable the privilege) to use 1080 // managed Google Play, but the profile is itself not owned by a DPC. 1081 ManagementType string `json:"managementType,omitempty"` 1082 1083 // Policy: The policy enforced on the device. 1084 Policy *Policy `json:"policy,omitempty"` 1085 1086 // Report: The device report updated with the latest app states. 1087 Report *DeviceReport `json:"report,omitempty"` 1088 1089 // ServerResponse contains the HTTP response code and headers from the 1090 // server. 1091 googleapi.ServerResponse `json:"-"` 1092 1093 // ForceSendFields is a list of field names (e.g. "AndroidId") to 1094 // unconditionally include in API requests. By default, fields with 1095 // empty values are omitted from API requests. However, any non-pointer, 1096 // non-interface field appearing in ForceSendFields will be sent to the 1097 // server regardless of whether the field is empty or not. This may be 1098 // used to include empty fields in Patch requests. 1099 ForceSendFields []string `json:"-"` 1100 1101 // NullFields is a list of field names (e.g. "AndroidId") to include in 1102 // API requests with the JSON null value. By default, fields with empty 1103 // values are omitted from API requests. However, any field with an 1104 // empty value appearing in NullFields will be sent to the server as 1105 // null. It is an error if a field in this list has a non-empty value. 1106 // This may be used to include null fields in Patch requests. 1107 NullFields []string `json:"-"` 1108} 1109 1110func (s *Device) MarshalJSON() ([]byte, error) { 1111 type NoMethod Device 1112 raw := NoMethod(*s) 1113 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1114} 1115 1116// DeviceReport: Device report updated with the latest app states for 1117// managed apps on the device. 1118type DeviceReport struct { 1119 // AppState: List of app states set by managed apps on the device. App 1120 // states are defined by the app's developers. This field will always be 1121 // present. 1122 AppState []*AppState `json:"appState,omitempty"` 1123 1124 // LastUpdatedTimestampMillis: The timestamp of the last report update 1125 // in milliseconds since epoch. This field will always be present. 1126 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 1127 1128 // ForceSendFields is a list of field names (e.g. "AppState") to 1129 // unconditionally include in API requests. By default, fields with 1130 // empty values are omitted from API requests. However, any non-pointer, 1131 // non-interface field appearing in ForceSendFields will be sent to the 1132 // server regardless of whether the field is empty or not. This may be 1133 // used to include empty fields in Patch requests. 1134 ForceSendFields []string `json:"-"` 1135 1136 // NullFields is a list of field names (e.g. "AppState") to include in 1137 // API requests with the JSON null value. By default, fields with empty 1138 // values are omitted from API requests. However, any field with an 1139 // empty value appearing in NullFields will be sent to the server as 1140 // null. It is an error if a field in this list has a non-empty value. 1141 // This may be used to include null fields in Patch requests. 1142 NullFields []string `json:"-"` 1143} 1144 1145func (s *DeviceReport) MarshalJSON() ([]byte, error) { 1146 type NoMethod DeviceReport 1147 raw := NoMethod(*s) 1148 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1149} 1150 1151// DeviceReportUpdateEvent: An event generated when an updated device 1152// report is available. 1153type DeviceReportUpdateEvent struct { 1154 // DeviceId: The Android ID of the device. This field will always be 1155 // present. 1156 DeviceId string `json:"deviceId,omitempty"` 1157 1158 // Report: The device report updated with the latest app states. This 1159 // field will always be present. 1160 Report *DeviceReport `json:"report,omitempty"` 1161 1162 // UserId: The ID of the user. This field will always be present. 1163 UserId string `json:"userId,omitempty"` 1164 1165 // ForceSendFields is a list of field names (e.g. "DeviceId") to 1166 // unconditionally include in API requests. By default, fields with 1167 // empty values are omitted from API requests. However, any non-pointer, 1168 // non-interface field appearing in ForceSendFields will be sent to the 1169 // server regardless of whether the field is empty or not. This may be 1170 // used to include empty fields in Patch requests. 1171 ForceSendFields []string `json:"-"` 1172 1173 // NullFields is a list of field names (e.g. "DeviceId") to include in 1174 // API requests with the JSON null value. By default, fields with empty 1175 // values are omitted from API requests. However, any field with an 1176 // empty value appearing in NullFields will be sent to the server as 1177 // null. It is an error if a field in this list has a non-empty value. 1178 // This may be used to include null fields in Patch requests. 1179 NullFields []string `json:"-"` 1180} 1181 1182func (s *DeviceReportUpdateEvent) MarshalJSON() ([]byte, error) { 1183 type NoMethod DeviceReportUpdateEvent 1184 raw := NoMethod(*s) 1185 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1186} 1187 1188// DeviceState: The state of a user's device, as accessed by the 1189// getState and setState methods on device resources. 1190type DeviceState struct { 1191 // AccountState: The state of the Google account on the device. 1192 // "enabled" indicates that the Google account on the device can be used 1193 // to access Google services (including Google Play), while "disabled" 1194 // means that it cannot. A new device is initially in the "disabled" 1195 // state. 1196 AccountState string `json:"accountState,omitempty"` 1197 1198 Kind string `json:"kind,omitempty"` 1199 1200 // ServerResponse contains the HTTP response code and headers from the 1201 // server. 1202 googleapi.ServerResponse `json:"-"` 1203 1204 // ForceSendFields is a list of field names (e.g. "AccountState") to 1205 // unconditionally include in API requests. By default, fields with 1206 // empty values are omitted from API requests. However, any non-pointer, 1207 // non-interface field appearing in ForceSendFields will be sent to the 1208 // server regardless of whether the field is empty or not. This may be 1209 // used to include empty fields in Patch requests. 1210 ForceSendFields []string `json:"-"` 1211 1212 // NullFields is a list of field names (e.g. "AccountState") to include 1213 // in API requests with the JSON null value. By default, fields with 1214 // empty values are omitted from API requests. However, any field with 1215 // an empty value appearing in NullFields will be sent to the server as 1216 // null. It is an error if a field in this list has a non-empty value. 1217 // This may be used to include null fields in Patch requests. 1218 NullFields []string `json:"-"` 1219} 1220 1221func (s *DeviceState) MarshalJSON() ([]byte, error) { 1222 type NoMethod DeviceState 1223 raw := NoMethod(*s) 1224 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1225} 1226 1227// DevicesListResponse: The device resources for the user. 1228type DevicesListResponse struct { 1229 // Device: A managed device. 1230 Device []*Device `json:"device,omitempty"` 1231 1232 // Kind: Identifies what kind of resource this is. Value: the fixed 1233 // string "androidenterprise#devicesListResponse". 1234 Kind string `json:"kind,omitempty"` 1235 1236 // ServerResponse contains the HTTP response code and headers from the 1237 // server. 1238 googleapi.ServerResponse `json:"-"` 1239 1240 // ForceSendFields is a list of field names (e.g. "Device") to 1241 // unconditionally include in API requests. By default, fields with 1242 // empty values are omitted from API requests. However, any non-pointer, 1243 // non-interface field appearing in ForceSendFields will be sent to the 1244 // server regardless of whether the field is empty or not. This may be 1245 // used to include empty fields in Patch requests. 1246 ForceSendFields []string `json:"-"` 1247 1248 // NullFields is a list of field names (e.g. "Device") to include in API 1249 // requests with the JSON null value. By default, fields with empty 1250 // values are omitted from API requests. However, any field with an 1251 // empty value appearing in NullFields will be sent to the server as 1252 // null. It is an error if a field in this list has a non-empty value. 1253 // This may be used to include null fields in Patch requests. 1254 NullFields []string `json:"-"` 1255} 1256 1257func (s *DevicesListResponse) MarshalJSON() ([]byte, error) { 1258 type NoMethod DevicesListResponse 1259 raw := NoMethod(*s) 1260 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1261} 1262 1263// Enterprise: An Enterprises resource represents the binding between an 1264// EMM and a specific organization. That binding can be instantiated in 1265// one of two different ways using this API as follows: 1266// - For Google managed domain customers, the process involves using 1267// Enterprises.enroll and Enterprises.setAccount (in conjunction with 1268// artifacts obtained from the Admin console and the Google API Console) 1269// and submitted to the EMM through a more-or-less manual process. 1270// - For managed Google Play Accounts customers, the process involves 1271// using Enterprises.generateSignupUrl and Enterprises.completeSignup in 1272// conjunction with the managed Google Play sign-up UI (Google-provided 1273// mechanism) to create the binding without manual steps. As an EMM, you 1274// can support either or both approaches in your EMM console. See Create 1275// an Enterprise for details. 1276type Enterprise struct { 1277 // Administrator: Admins of the enterprise. This is only supported for 1278 // enterprises created via the EMM-initiated flow. 1279 Administrator []*Administrator `json:"administrator,omitempty"` 1280 1281 // Id: The unique ID for the enterprise. 1282 Id string `json:"id,omitempty"` 1283 1284 Kind string `json:"kind,omitempty"` 1285 1286 // Name: The name of the enterprise, for example, "Example, Inc". 1287 Name string `json:"name,omitempty"` 1288 1289 // PrimaryDomain: The enterprise's primary domain, such as 1290 // "example.com". 1291 PrimaryDomain string `json:"primaryDomain,omitempty"` 1292 1293 // ServerResponse contains the HTTP response code and headers from the 1294 // server. 1295 googleapi.ServerResponse `json:"-"` 1296 1297 // ForceSendFields is a list of field names (e.g. "Administrator") to 1298 // unconditionally include in API requests. By default, fields with 1299 // empty values are omitted from API requests. However, any non-pointer, 1300 // non-interface field appearing in ForceSendFields will be sent to the 1301 // server regardless of whether the field is empty or not. This may be 1302 // used to include empty fields in Patch requests. 1303 ForceSendFields []string `json:"-"` 1304 1305 // NullFields is a list of field names (e.g. "Administrator") to include 1306 // in API requests with the JSON null value. By default, fields with 1307 // empty values are omitted from API requests. However, any field with 1308 // an empty value appearing in NullFields will be sent to the server as 1309 // null. It is an error if a field in this list has a non-empty value. 1310 // This may be used to include null fields in Patch requests. 1311 NullFields []string `json:"-"` 1312} 1313 1314func (s *Enterprise) MarshalJSON() ([]byte, error) { 1315 type NoMethod Enterprise 1316 raw := NoMethod(*s) 1317 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1318} 1319 1320// EnterpriseAccount: A service account that can be used to authenticate 1321// as the enterprise to API calls that require such authentication. 1322type EnterpriseAccount struct { 1323 // AccountEmail: The email address of the service account. 1324 AccountEmail string `json:"accountEmail,omitempty"` 1325 1326 Kind string `json:"kind,omitempty"` 1327 1328 // ServerResponse contains the HTTP response code and headers from the 1329 // server. 1330 googleapi.ServerResponse `json:"-"` 1331 1332 // ForceSendFields is a list of field names (e.g. "AccountEmail") to 1333 // unconditionally include in API requests. By default, fields with 1334 // empty values are omitted from API requests. However, any non-pointer, 1335 // non-interface field appearing in ForceSendFields will be sent to the 1336 // server regardless of whether the field is empty or not. This may be 1337 // used to include empty fields in Patch requests. 1338 ForceSendFields []string `json:"-"` 1339 1340 // NullFields is a list of field names (e.g. "AccountEmail") to include 1341 // in API requests with the JSON null value. By default, fields with 1342 // empty values are omitted from API requests. However, any field with 1343 // an empty value appearing in NullFields will be sent to the server as 1344 // null. It is an error if a field in this list has a non-empty value. 1345 // This may be used to include null fields in Patch requests. 1346 NullFields []string `json:"-"` 1347} 1348 1349func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) { 1350 type NoMethod EnterpriseAccount 1351 raw := NoMethod(*s) 1352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1353} 1354 1355// EnterprisesListResponse: The matching enterprise resources. 1356type EnterprisesListResponse struct { 1357 // Enterprise: An enterprise. 1358 Enterprise []*Enterprise `json:"enterprise,omitempty"` 1359 1360 // Kind: Identifies what kind of resource this is. Value: the fixed 1361 // string "androidenterprise#enterprisesListResponse". 1362 Kind string `json:"kind,omitempty"` 1363 1364 // ServerResponse contains the HTTP response code and headers from the 1365 // server. 1366 googleapi.ServerResponse `json:"-"` 1367 1368 // ForceSendFields is a list of field names (e.g. "Enterprise") to 1369 // unconditionally include in API requests. By default, fields with 1370 // empty values are omitted from API requests. However, any non-pointer, 1371 // non-interface field appearing in ForceSendFields will be sent to the 1372 // server regardless of whether the field is empty or not. This may be 1373 // used to include empty fields in Patch requests. 1374 ForceSendFields []string `json:"-"` 1375 1376 // NullFields is a list of field names (e.g. "Enterprise") to include in 1377 // API requests with the JSON null value. By default, fields with empty 1378 // values are omitted from API requests. However, any field with an 1379 // empty value appearing in NullFields will be sent to the server as 1380 // null. It is an error if a field in this list has a non-empty value. 1381 // This may be used to include null fields in Patch requests. 1382 NullFields []string `json:"-"` 1383} 1384 1385func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) { 1386 type NoMethod EnterprisesListResponse 1387 raw := NoMethod(*s) 1388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1389} 1390 1391type EnterprisesSendTestPushNotificationResponse struct { 1392 // MessageId: The message ID of the test push notification that was 1393 // sent. 1394 MessageId string `json:"messageId,omitempty"` 1395 1396 // TopicName: The name of the Cloud Pub/Sub topic to which notifications 1397 // for this enterprise's enrolled account will be sent. 1398 TopicName string `json:"topicName,omitempty"` 1399 1400 // ServerResponse contains the HTTP response code and headers from the 1401 // server. 1402 googleapi.ServerResponse `json:"-"` 1403 1404 // ForceSendFields is a list of field names (e.g. "MessageId") to 1405 // unconditionally include in API requests. By default, fields with 1406 // empty values are omitted from API requests. However, any non-pointer, 1407 // non-interface field appearing in ForceSendFields will be sent to the 1408 // server regardless of whether the field is empty or not. This may be 1409 // used to include empty fields in Patch requests. 1410 ForceSendFields []string `json:"-"` 1411 1412 // NullFields is a list of field names (e.g. "MessageId") to include in 1413 // API requests with the JSON null value. By default, fields with empty 1414 // values are omitted from API requests. However, any field with an 1415 // empty value appearing in NullFields will be sent to the server as 1416 // null. It is an error if a field in this list has a non-empty value. 1417 // This may be used to include null fields in Patch requests. 1418 NullFields []string `json:"-"` 1419} 1420 1421func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) { 1422 type NoMethod EnterprisesSendTestPushNotificationResponse 1423 raw := NoMethod(*s) 1424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1425} 1426 1427// Entitlement: The presence of an Entitlements resource indicates that 1428// a user has the right to use a particular app. Entitlements are user 1429// specific, not device specific. This allows a user with an entitlement 1430// to an app to install the app on all their devices. It's also possible 1431// for a user to hold an entitlement to an app without installing the 1432// app on any device. 1433// 1434// The API can be used to create an entitlement. As an option, you can 1435// also use the API to trigger the installation of an app on all a 1436// user's managed devices at the same time the entitlement is 1437// created. 1438// 1439// If the app is free, creating the entitlement also creates a group 1440// license for that app. For paid apps, creating the entitlement 1441// consumes one license, and that license remains consumed until the 1442// entitlement is removed. If the enterprise hasn't purchased enough 1443// licenses, then no entitlement is created and the installation fails. 1444// An entitlement is also not created for an app if the app requires 1445// permissions that the enterprise hasn't accepted. 1446// 1447// If an entitlement is deleted, the app may be uninstalled from a 1448// user's device. As a best practice, uninstall the app by calling 1449// Installs.delete() before deleting the entitlement. 1450// 1451// Entitlements for apps that a user pays for on an unmanaged profile 1452// have "userPurchase" as the entitlement reason. These entitlements 1453// cannot be removed via the API. 1454type Entitlement struct { 1455 Kind string `json:"kind,omitempty"` 1456 1457 // ProductId: The ID of the product that the entitlement is for. For 1458 // example, "app:com.google.android.gm". 1459 ProductId string `json:"productId,omitempty"` 1460 1461 // Reason: The reason for the entitlement. For example, "free" for free 1462 // apps. This property is temporary: it will be replaced by the 1463 // acquisition kind field of group licenses. 1464 Reason string `json:"reason,omitempty"` 1465 1466 // ServerResponse contains the HTTP response code and headers from the 1467 // server. 1468 googleapi.ServerResponse `json:"-"` 1469 1470 // ForceSendFields is a list of field names (e.g. "Kind") to 1471 // unconditionally include in API requests. By default, fields with 1472 // empty values are omitted from API requests. However, any non-pointer, 1473 // non-interface field appearing in ForceSendFields will be sent to the 1474 // server regardless of whether the field is empty or not. This may be 1475 // used to include empty fields in Patch requests. 1476 ForceSendFields []string `json:"-"` 1477 1478 // NullFields is a list of field names (e.g. "Kind") to include in API 1479 // requests with the JSON null value. By default, fields with empty 1480 // values are omitted from API requests. However, any field with an 1481 // empty value appearing in NullFields will be sent to the server as 1482 // null. It is an error if a field in this list has a non-empty value. 1483 // This may be used to include null fields in Patch requests. 1484 NullFields []string `json:"-"` 1485} 1486 1487func (s *Entitlement) MarshalJSON() ([]byte, error) { 1488 type NoMethod Entitlement 1489 raw := NoMethod(*s) 1490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1491} 1492 1493// EntitlementsListResponse: The entitlement resources for the user. 1494type EntitlementsListResponse struct { 1495 // Entitlement: An entitlement of a user to a product (e.g. an app). For 1496 // example, a free app that they have installed, or a paid app that they 1497 // have been allocated a license to. 1498 Entitlement []*Entitlement `json:"entitlement,omitempty"` 1499 1500 // Kind: Identifies what kind of resource this is. Value: the fixed 1501 // string "androidenterprise#entitlementsListResponse". 1502 Kind string `json:"kind,omitempty"` 1503 1504 // ServerResponse contains the HTTP response code and headers from the 1505 // server. 1506 googleapi.ServerResponse `json:"-"` 1507 1508 // ForceSendFields is a list of field names (e.g. "Entitlement") to 1509 // unconditionally include in API requests. By default, fields with 1510 // empty values are omitted from API requests. However, any non-pointer, 1511 // non-interface field appearing in ForceSendFields will be sent to the 1512 // server regardless of whether the field is empty or not. This may be 1513 // used to include empty fields in Patch requests. 1514 ForceSendFields []string `json:"-"` 1515 1516 // NullFields is a list of field names (e.g. "Entitlement") to include 1517 // in API requests with the JSON null value. By default, fields with 1518 // empty values are omitted from API requests. However, any field with 1519 // an empty value appearing in NullFields will be sent to the server as 1520 // null. It is an error if a field in this list has a non-empty value. 1521 // This may be used to include null fields in Patch requests. 1522 NullFields []string `json:"-"` 1523} 1524 1525func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) { 1526 type NoMethod EntitlementsListResponse 1527 raw := NoMethod(*s) 1528 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1529} 1530 1531// GroupLicense: Group license objects allow you to keep track of 1532// licenses (called entitlements) for both free and paid apps. For a 1533// free app, a group license is created when an enterprise admin first 1534// approves the product in Google Play or when the first entitlement for 1535// the product is created for a user via the API. For a paid app, a 1536// group license object is only created when an enterprise admin 1537// purchases the product in Google Play for the first time. 1538// 1539// Use the API to query group licenses. A Grouplicenses resource 1540// includes the total number of licenses purchased (paid apps only) and 1541// the total number of licenses currently in use. In other words, the 1542// total number of Entitlements that exist for the product. 1543// 1544// Only one group license object is created per product and group 1545// license objects are never deleted. If a product is unapproved, its 1546// group license remains. This allows enterprise admins to keep track of 1547// any remaining entitlements for the product. 1548type GroupLicense struct { 1549 // AcquisitionKind: How this group license was acquired. "bulkPurchase" 1550 // means that this Grouplicenses resource was created because the 1551 // enterprise purchased licenses for this product; otherwise, the value 1552 // is "free" (for free products). 1553 AcquisitionKind string `json:"acquisitionKind,omitempty"` 1554 1555 // Approval: Whether the product to which this group license relates is 1556 // currently approved by the enterprise. Products are approved when a 1557 // group license is first created, but this approval may be revoked by 1558 // an enterprise admin via Google Play. Unapproved products will not be 1559 // visible to end users in collections, and new entitlements to them 1560 // should not normally be created. 1561 Approval string `json:"approval,omitempty"` 1562 1563 Kind string `json:"kind,omitempty"` 1564 1565 // NumProvisioned: The total number of provisioned licenses for this 1566 // product. Returned by read operations, but ignored in write 1567 // operations. 1568 NumProvisioned int64 `json:"numProvisioned,omitempty"` 1569 1570 // NumPurchased: The number of purchased licenses (possibly in multiple 1571 // purchases). If this field is omitted, then there is no limit on the 1572 // number of licenses that can be provisioned (for example, if the 1573 // acquisition kind is "free"). 1574 NumPurchased int64 `json:"numPurchased,omitempty"` 1575 1576 // Permissions: The permission approval status of the product. This 1577 // field is only set if the product is approved. Possible states are: 1578 // - "currentApproved", the current set of permissions is approved, but 1579 // additional permissions will require the administrator to reapprove 1580 // the product (If the product was approved without specifying the 1581 // approved permissions setting, then this is the default behavior.), 1582 // - "needsReapproval", the product has unapproved permissions. No 1583 // additional product licenses can be assigned until the product is 1584 // reapproved, 1585 // - "allCurrentAndFutureApproved", the current permissions are approved 1586 // and any future permission updates will be automatically approved 1587 // without administrator review. 1588 Permissions string `json:"permissions,omitempty"` 1589 1590 // ProductId: The ID of the product that the license is for. For 1591 // example, "app:com.google.android.gm". 1592 ProductId string `json:"productId,omitempty"` 1593 1594 // ServerResponse contains the HTTP response code and headers from the 1595 // server. 1596 googleapi.ServerResponse `json:"-"` 1597 1598 // ForceSendFields is a list of field names (e.g. "AcquisitionKind") to 1599 // unconditionally include in API requests. By default, fields with 1600 // empty values are omitted from API requests. However, any non-pointer, 1601 // non-interface field appearing in ForceSendFields will be sent to the 1602 // server regardless of whether the field is empty or not. This may be 1603 // used to include empty fields in Patch requests. 1604 ForceSendFields []string `json:"-"` 1605 1606 // NullFields is a list of field names (e.g. "AcquisitionKind") to 1607 // include in API requests with the JSON null value. By default, fields 1608 // with empty values are omitted from API requests. However, any field 1609 // with an empty value appearing in NullFields will be sent to the 1610 // server as null. It is an error if a field in this list has a 1611 // non-empty value. This may be used to include null fields in Patch 1612 // requests. 1613 NullFields []string `json:"-"` 1614} 1615 1616func (s *GroupLicense) MarshalJSON() ([]byte, error) { 1617 type NoMethod GroupLicense 1618 raw := NoMethod(*s) 1619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1620} 1621 1622// GroupLicenseUsersListResponse: The user resources for the group 1623// license. 1624type GroupLicenseUsersListResponse struct { 1625 // Kind: Identifies what kind of resource this is. Value: the fixed 1626 // string "androidenterprise#groupLicenseUsersListResponse". 1627 Kind string `json:"kind,omitempty"` 1628 1629 // User: A user of an enterprise. 1630 User []*User `json:"user,omitempty"` 1631 1632 // ServerResponse contains the HTTP response code and headers from the 1633 // server. 1634 googleapi.ServerResponse `json:"-"` 1635 1636 // ForceSendFields is a list of field names (e.g. "Kind") to 1637 // unconditionally include in API requests. By default, fields with 1638 // empty values are omitted from API requests. However, any non-pointer, 1639 // non-interface field appearing in ForceSendFields will be sent to the 1640 // server regardless of whether the field is empty or not. This may be 1641 // used to include empty fields in Patch requests. 1642 ForceSendFields []string `json:"-"` 1643 1644 // NullFields is a list of field names (e.g. "Kind") to include in API 1645 // requests with the JSON null value. By default, fields with empty 1646 // values are omitted from API requests. However, any field with an 1647 // empty value appearing in NullFields will be sent to the server as 1648 // null. It is an error if a field in this list has a non-empty value. 1649 // This may be used to include null fields in Patch requests. 1650 NullFields []string `json:"-"` 1651} 1652 1653func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) { 1654 type NoMethod GroupLicenseUsersListResponse 1655 raw := NoMethod(*s) 1656 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1657} 1658 1659// GroupLicensesListResponse: The grouplicense resources for the 1660// enterprise. 1661type GroupLicensesListResponse struct { 1662 // GroupLicense: A group license for a product approved for use in the 1663 // enterprise. 1664 GroupLicense []*GroupLicense `json:"groupLicense,omitempty"` 1665 1666 // Kind: Identifies what kind of resource this is. Value: the fixed 1667 // string "androidenterprise#groupLicensesListResponse". 1668 Kind string `json:"kind,omitempty"` 1669 1670 // ServerResponse contains the HTTP response code and headers from the 1671 // server. 1672 googleapi.ServerResponse `json:"-"` 1673 1674 // ForceSendFields is a list of field names (e.g. "GroupLicense") to 1675 // unconditionally include in API requests. By default, fields with 1676 // empty values are omitted from API requests. However, any non-pointer, 1677 // non-interface field appearing in ForceSendFields will be sent to the 1678 // server regardless of whether the field is empty or not. This may be 1679 // used to include empty fields in Patch requests. 1680 ForceSendFields []string `json:"-"` 1681 1682 // NullFields is a list of field names (e.g. "GroupLicense") to include 1683 // in API requests with the JSON null value. By default, fields with 1684 // empty values are omitted from API requests. However, any field with 1685 // an empty value appearing in NullFields will be sent to the server as 1686 // null. It is an error if a field in this list has a non-empty value. 1687 // This may be used to include null fields in Patch requests. 1688 NullFields []string `json:"-"` 1689} 1690 1691func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) { 1692 type NoMethod GroupLicensesListResponse 1693 raw := NoMethod(*s) 1694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1695} 1696 1697// Install: The existence of an Installs resource indicates that an app 1698// is installed on a particular device (or that an install is 1699// pending). 1700// 1701// The API can be used to create an install resource using the update 1702// method. This triggers the actual install of the app on the device. If 1703// the user does not already have an entitlement for the app, then an 1704// attempt is made to create one. If this fails (for example, because 1705// the app is not free and there is no available license), then the 1706// creation of the install fails. 1707// 1708// The API can also be used to update an installed app. If 1709// the update method is used on an existing install, then the app will 1710// be updated to the latest available version. 1711// 1712// Note that it is not possible to force the installation of a specific 1713// version of an app: the version code is read-only. 1714// 1715// If a user installs an app themselves (as permitted by the 1716// enterprise), then again an install resource and possibly an 1717// entitlement resource are automatically created. 1718// 1719// The API can also be used to delete an install resource, which 1720// triggers the removal of the app from the device. Note that deleting 1721// an install does not automatically remove the corresponding 1722// entitlement, even if there are no remaining installs. The install 1723// resource will also be deleted if the user uninstalls the app 1724// themselves. 1725type Install struct { 1726 // InstallState: Install state. The state "installPending" means that an 1727 // install request has recently been made and download to the device is 1728 // in progress. The state "installed" means that the app has been 1729 // installed. This field is read-only. 1730 InstallState string `json:"installState,omitempty"` 1731 1732 Kind string `json:"kind,omitempty"` 1733 1734 // ProductId: The ID of the product that the install is for. For 1735 // example, "app:com.google.android.gm". 1736 ProductId string `json:"productId,omitempty"` 1737 1738 // VersionCode: The version of the installed product. Guaranteed to be 1739 // set only if the install state is "installed". 1740 VersionCode int64 `json:"versionCode,omitempty"` 1741 1742 // ServerResponse contains the HTTP response code and headers from the 1743 // server. 1744 googleapi.ServerResponse `json:"-"` 1745 1746 // ForceSendFields is a list of field names (e.g. "InstallState") to 1747 // unconditionally include in API requests. By default, fields with 1748 // empty values are omitted from API requests. However, any non-pointer, 1749 // non-interface field appearing in ForceSendFields will be sent to the 1750 // server regardless of whether the field is empty or not. This may be 1751 // used to include empty fields in Patch requests. 1752 ForceSendFields []string `json:"-"` 1753 1754 // NullFields is a list of field names (e.g. "InstallState") to include 1755 // in API requests with the JSON null value. By default, fields with 1756 // empty values are omitted from API requests. However, any field with 1757 // an empty value appearing in NullFields will be sent to the server as 1758 // null. It is an error if a field in this list has a non-empty value. 1759 // This may be used to include null fields in Patch requests. 1760 NullFields []string `json:"-"` 1761} 1762 1763func (s *Install) MarshalJSON() ([]byte, error) { 1764 type NoMethod Install 1765 raw := NoMethod(*s) 1766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1767} 1768 1769// InstallFailureEvent: An event generated when an app installation 1770// failed on a device 1771type InstallFailureEvent struct { 1772 // DeviceId: The Android ID of the device. This field will always be 1773 // present. 1774 DeviceId string `json:"deviceId,omitempty"` 1775 1776 // FailureDetails: Additional details on the failure if applicable. 1777 FailureDetails string `json:"failureDetails,omitempty"` 1778 1779 // FailureReason: The reason for the installation failure. This field 1780 // will always be present. 1781 FailureReason string `json:"failureReason,omitempty"` 1782 1783 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 1784 // for which the install failure event occured. This field will always 1785 // be present. 1786 ProductId string `json:"productId,omitempty"` 1787 1788 // UserId: The ID of the user. This field will always be present. 1789 UserId string `json:"userId,omitempty"` 1790 1791 // ForceSendFields is a list of field names (e.g. "DeviceId") to 1792 // unconditionally include in API requests. By default, fields with 1793 // empty values are omitted from API requests. However, any non-pointer, 1794 // non-interface field appearing in ForceSendFields will be sent to the 1795 // server regardless of whether the field is empty or not. This may be 1796 // used to include empty fields in Patch requests. 1797 ForceSendFields []string `json:"-"` 1798 1799 // NullFields is a list of field names (e.g. "DeviceId") to include in 1800 // API requests with the JSON null value. By default, fields with empty 1801 // values are omitted from API requests. However, any field with an 1802 // empty value appearing in NullFields will be sent to the server as 1803 // null. It is an error if a field in this list has a non-empty value. 1804 // This may be used to include null fields in Patch requests. 1805 NullFields []string `json:"-"` 1806} 1807 1808func (s *InstallFailureEvent) MarshalJSON() ([]byte, error) { 1809 type NoMethod InstallFailureEvent 1810 raw := NoMethod(*s) 1811 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1812} 1813 1814// InstallsListResponse: The install resources for the device. 1815type InstallsListResponse struct { 1816 // Install: An installation of an app for a user on a specific device. 1817 // The existence of an install implies that the user must have an 1818 // entitlement to the app. 1819 Install []*Install `json:"install,omitempty"` 1820 1821 // Kind: Identifies what kind of resource this is. Value: the fixed 1822 // string "androidenterprise#installsListResponse". 1823 Kind string `json:"kind,omitempty"` 1824 1825 // ServerResponse contains the HTTP response code and headers from the 1826 // server. 1827 googleapi.ServerResponse `json:"-"` 1828 1829 // ForceSendFields is a list of field names (e.g. "Install") to 1830 // unconditionally include in API requests. By default, fields with 1831 // empty values are omitted from API requests. However, any non-pointer, 1832 // non-interface field appearing in ForceSendFields will be sent to the 1833 // server regardless of whether the field is empty or not. This may be 1834 // used to include empty fields in Patch requests. 1835 ForceSendFields []string `json:"-"` 1836 1837 // NullFields is a list of field names (e.g. "Install") to include in 1838 // API requests with the JSON null value. By default, fields with empty 1839 // values are omitted from API requests. However, any field with an 1840 // empty value appearing in NullFields will be sent to the server as 1841 // null. It is an error if a field in this list has a non-empty value. 1842 // This may be used to include null fields in Patch requests. 1843 NullFields []string `json:"-"` 1844} 1845 1846func (s *InstallsListResponse) MarshalJSON() ([]byte, error) { 1847 type NoMethod InstallsListResponse 1848 raw := NoMethod(*s) 1849 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1850} 1851 1852// KeyedAppState: Represents a keyed app state containing a key, 1853// timestamp, severity level, optional description, and optional data. 1854type KeyedAppState struct { 1855 // Data: Additional field intended for machine-readable data. For 1856 // example, a number or JSON object. To prevent XSS, we recommend 1857 // removing any HTML from the data before displaying it. 1858 Data string `json:"data,omitempty"` 1859 1860 // Key: Key indicating what the app is providing a state for. The 1861 // content of the key is set by the app's developer. To prevent XSS, we 1862 // recommend removing any HTML from the key before displaying it. This 1863 // field will always be present. 1864 Key string `json:"key,omitempty"` 1865 1866 // Message: Free-form, human-readable message describing the app state. 1867 // For example, an error message. To prevent XSS, we recommend removing 1868 // any HTML from the message before displaying it. 1869 Message string `json:"message,omitempty"` 1870 1871 // Severity: Severity of the app state. This field will always be 1872 // present. 1873 Severity string `json:"severity,omitempty"` 1874 1875 // StateTimestampMillis: Timestamp of when the app set the state in 1876 // milliseconds since epoch. This field will always be present. 1877 StateTimestampMillis int64 `json:"stateTimestampMillis,omitempty,string"` 1878 1879 // ForceSendFields is a list of field names (e.g. "Data") to 1880 // unconditionally include in API requests. By default, fields with 1881 // empty values are omitted from API requests. However, any non-pointer, 1882 // non-interface field appearing in ForceSendFields will be sent to the 1883 // server regardless of whether the field is empty or not. This may be 1884 // used to include empty fields in Patch requests. 1885 ForceSendFields []string `json:"-"` 1886 1887 // NullFields is a list of field names (e.g. "Data") to include in API 1888 // requests with the JSON null value. By default, fields with empty 1889 // values are omitted from API requests. However, any field with an 1890 // empty value appearing in NullFields will be sent to the server as 1891 // null. It is an error if a field in this list has a non-empty value. 1892 // This may be used to include null fields in Patch requests. 1893 NullFields []string `json:"-"` 1894} 1895 1896func (s *KeyedAppState) MarshalJSON() ([]byte, error) { 1897 type NoMethod KeyedAppState 1898 raw := NoMethod(*s) 1899 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1900} 1901 1902// LocalizedText: A localized string with its locale. 1903type LocalizedText struct { 1904 // Locale: The BCP47 tag for a locale. (e.g. "en-US", "de"). 1905 Locale string `json:"locale,omitempty"` 1906 1907 // Text: The text localized in the associated locale. 1908 Text string `json:"text,omitempty"` 1909 1910 // ForceSendFields is a list of field names (e.g. "Locale") to 1911 // unconditionally include in API requests. By default, fields with 1912 // empty values are omitted from API requests. However, any non-pointer, 1913 // non-interface field appearing in ForceSendFields will be sent to the 1914 // server regardless of whether the field is empty or not. This may be 1915 // used to include empty fields in Patch requests. 1916 ForceSendFields []string `json:"-"` 1917 1918 // NullFields is a list of field names (e.g. "Locale") to include in API 1919 // requests with the JSON null value. By default, fields with empty 1920 // values are omitted from API requests. However, any field with an 1921 // empty value appearing in NullFields will be sent to the server as 1922 // null. It is an error if a field in this list has a non-empty value. 1923 // This may be used to include null fields in Patch requests. 1924 NullFields []string `json:"-"` 1925} 1926 1927func (s *LocalizedText) MarshalJSON() ([]byte, error) { 1928 type NoMethod LocalizedText 1929 raw := NoMethod(*s) 1930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1931} 1932 1933// MaintenanceWindow: Maintenance window for managed Google Play 1934// Accounts. This allows Play store to update the apps on the foreground 1935// in the designated window. 1936type MaintenanceWindow struct { 1937 // DurationMs: Duration of the maintenance window, in milliseconds. The 1938 // duration must be between 30 minutes and 24 hours (inclusive). 1939 DurationMs int64 `json:"durationMs,omitempty,string"` 1940 1941 // StartTimeAfterMidnightMs: Start time of the maintenance window, in 1942 // milliseconds after midnight on the device. Windows can span midnight. 1943 StartTimeAfterMidnightMs int64 `json:"startTimeAfterMidnightMs,omitempty,string"` 1944 1945 // ForceSendFields is a list of field names (e.g. "DurationMs") to 1946 // unconditionally include in API requests. By default, fields with 1947 // empty values are omitted from API requests. However, any non-pointer, 1948 // non-interface field appearing in ForceSendFields will be sent to the 1949 // server regardless of whether the field is empty or not. This may be 1950 // used to include empty fields in Patch requests. 1951 ForceSendFields []string `json:"-"` 1952 1953 // NullFields is a list of field names (e.g. "DurationMs") to include in 1954 // API requests with the JSON null value. By default, fields with empty 1955 // values are omitted from API requests. However, any field with an 1956 // empty value appearing in NullFields will be sent to the server as 1957 // null. It is an error if a field in this list has a non-empty value. 1958 // This may be used to include null fields in Patch requests. 1959 NullFields []string `json:"-"` 1960} 1961 1962func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 1963 type NoMethod MaintenanceWindow 1964 raw := NoMethod(*s) 1965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1966} 1967 1968// ManagedConfiguration: A managed configuration resource contains the 1969// set of managed properties defined by the app developer in the app's 1970// managed configurations schema, as well as any configuration variables 1971// defined for the user. 1972type ManagedConfiguration struct { 1973 // ConfigurationVariables: Contains the ID of the managed configuration 1974 // profile and the set of configuration variables (if any) defined for 1975 // the user. 1976 ConfigurationVariables *ConfigurationVariables `json:"configurationVariables,omitempty"` 1977 1978 // Kind: Deprecated. 1979 Kind string `json:"kind,omitempty"` 1980 1981 // ManagedProperty: The set of managed properties for this 1982 // configuration. 1983 ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"` 1984 1985 // ProductId: The ID of the product that the managed configuration is 1986 // for, e.g. "app:com.google.android.gm". 1987 ProductId string `json:"productId,omitempty"` 1988 1989 // ServerResponse contains the HTTP response code and headers from the 1990 // server. 1991 googleapi.ServerResponse `json:"-"` 1992 1993 // ForceSendFields is a list of field names (e.g. 1994 // "ConfigurationVariables") to unconditionally include in API requests. 1995 // By default, fields with empty values are omitted from API requests. 1996 // However, any non-pointer, non-interface field appearing in 1997 // ForceSendFields will be sent to the server regardless of whether the 1998 // field is empty or not. This may be used to include empty fields in 1999 // Patch requests. 2000 ForceSendFields []string `json:"-"` 2001 2002 // NullFields is a list of field names (e.g. "ConfigurationVariables") 2003 // to include in API requests with the JSON null value. By default, 2004 // fields with empty values are omitted from API requests. However, any 2005 // field with an empty value appearing in NullFields will be sent to the 2006 // server as null. It is an error if a field in this list has a 2007 // non-empty value. This may be used to include null fields in Patch 2008 // requests. 2009 NullFields []string `json:"-"` 2010} 2011 2012func (s *ManagedConfiguration) MarshalJSON() ([]byte, error) { 2013 type NoMethod ManagedConfiguration 2014 raw := NoMethod(*s) 2015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2016} 2017 2018// ManagedConfigurationsForDeviceListResponse: The managed configuration 2019// resources for the device. 2020type ManagedConfigurationsForDeviceListResponse struct { 2021 // Kind: Identifies what kind of resource this is. Value: the fixed 2022 // string 2023 // "androidenterprise#managedConfigurationsForDeviceListResponse". 2024 Kind string `json:"kind,omitempty"` 2025 2026 // ManagedConfigurationForDevice: A managed configuration for an app on 2027 // a specific device. 2028 ManagedConfigurationForDevice []*ManagedConfiguration `json:"managedConfigurationForDevice,omitempty"` 2029 2030 // ServerResponse contains the HTTP response code and headers from the 2031 // server. 2032 googleapi.ServerResponse `json:"-"` 2033 2034 // ForceSendFields is a list of field names (e.g. "Kind") to 2035 // unconditionally include in API requests. By default, fields with 2036 // empty values are omitted from API requests. However, any non-pointer, 2037 // non-interface field appearing in ForceSendFields will be sent to the 2038 // server regardless of whether the field is empty or not. This may be 2039 // used to include empty fields in Patch requests. 2040 ForceSendFields []string `json:"-"` 2041 2042 // NullFields is a list of field names (e.g. "Kind") to include in API 2043 // requests with the JSON null value. By default, fields with empty 2044 // values are omitted from API requests. However, any field with an 2045 // empty value appearing in NullFields will be sent to the server as 2046 // null. It is an error if a field in this list has a non-empty value. 2047 // This may be used to include null fields in Patch requests. 2048 NullFields []string `json:"-"` 2049} 2050 2051func (s *ManagedConfigurationsForDeviceListResponse) MarshalJSON() ([]byte, error) { 2052 type NoMethod ManagedConfigurationsForDeviceListResponse 2053 raw := NoMethod(*s) 2054 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2055} 2056 2057// ManagedConfigurationsForUserListResponse: The managed configuration 2058// resources for the user. 2059type ManagedConfigurationsForUserListResponse struct { 2060 // Kind: Identifies what kind of resource this is. Value: the fixed 2061 // string "androidenterprise#managedConfigurationsForUserListResponse". 2062 Kind string `json:"kind,omitempty"` 2063 2064 // ManagedConfigurationForUser: A managed configuration for an app for a 2065 // specific user. 2066 ManagedConfigurationForUser []*ManagedConfiguration `json:"managedConfigurationForUser,omitempty"` 2067 2068 // ServerResponse contains the HTTP response code and headers from the 2069 // server. 2070 googleapi.ServerResponse `json:"-"` 2071 2072 // ForceSendFields is a list of field names (e.g. "Kind") to 2073 // unconditionally include in API requests. By default, fields with 2074 // empty values are omitted from API requests. However, any non-pointer, 2075 // non-interface field appearing in ForceSendFields will be sent to the 2076 // server regardless of whether the field is empty or not. This may be 2077 // used to include empty fields in Patch requests. 2078 ForceSendFields []string `json:"-"` 2079 2080 // NullFields is a list of field names (e.g. "Kind") to include in API 2081 // requests with the JSON null value. By default, fields with empty 2082 // values are omitted from API requests. However, any field with an 2083 // empty value appearing in NullFields will be sent to the server as 2084 // null. It is an error if a field in this list has a non-empty value. 2085 // This may be used to include null fields in Patch requests. 2086 NullFields []string `json:"-"` 2087} 2088 2089func (s *ManagedConfigurationsForUserListResponse) MarshalJSON() ([]byte, error) { 2090 type NoMethod ManagedConfigurationsForUserListResponse 2091 raw := NoMethod(*s) 2092 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2093} 2094 2095// ManagedConfigurationsSettings: A managed configurations settings 2096// resource contains the set of managed properties that have been 2097// configured for an Android app to be applied to a set of users. The 2098// app's developer would have defined configurable properties in the 2099// managed configurations schema. 2100type ManagedConfigurationsSettings struct { 2101 Kind string `json:"kind,omitempty"` 2102 2103 // LastUpdatedTimestampMillis: The last updated time of the managed 2104 // configuration settings in milliseconds since 1970-01-01T00:00:00Z. 2105 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 2106 2107 // McmId: The ID of the managed configurations settings. 2108 McmId string `json:"mcmId,omitempty"` 2109 2110 // Name: The name of the managed configurations settings. 2111 Name string `json:"name,omitempty"` 2112 2113 // ForceSendFields is a list of field names (e.g. "Kind") to 2114 // unconditionally include in API requests. By default, fields with 2115 // empty values are omitted from API requests. However, any non-pointer, 2116 // non-interface field appearing in ForceSendFields will be sent to the 2117 // server regardless of whether the field is empty or not. This may be 2118 // used to include empty fields in Patch requests. 2119 ForceSendFields []string `json:"-"` 2120 2121 // NullFields is a list of field names (e.g. "Kind") to include in API 2122 // requests with the JSON null value. By default, fields with empty 2123 // values are omitted from API requests. However, any field with an 2124 // empty value appearing in NullFields will be sent to the server as 2125 // null. It is an error if a field in this list has a non-empty value. 2126 // This may be used to include null fields in Patch requests. 2127 NullFields []string `json:"-"` 2128} 2129 2130func (s *ManagedConfigurationsSettings) MarshalJSON() ([]byte, error) { 2131 type NoMethod ManagedConfigurationsSettings 2132 raw := NoMethod(*s) 2133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2134} 2135 2136// ManagedConfigurationsSettingsListResponse: The managed configurations 2137// settings for a product. 2138type ManagedConfigurationsSettingsListResponse struct { 2139 // Kind: Identifies what kind of resource this is. Value: the fixed 2140 // string "androidenterprise#managedConfigurationsSettingsListResponse". 2141 Kind string `json:"kind,omitempty"` 2142 2143 // ManagedConfigurationsSettings: A managed configurations settings for 2144 // an app that may be assigned to a group of users in an enterprise. 2145 ManagedConfigurationsSettings []*ManagedConfigurationsSettings `json:"managedConfigurationsSettings,omitempty"` 2146 2147 // ServerResponse contains the HTTP response code and headers from the 2148 // server. 2149 googleapi.ServerResponse `json:"-"` 2150 2151 // ForceSendFields is a list of field names (e.g. "Kind") to 2152 // unconditionally include in API requests. By default, fields with 2153 // empty values are omitted from API requests. However, any non-pointer, 2154 // non-interface field appearing in ForceSendFields will be sent to the 2155 // server regardless of whether the field is empty or not. This may be 2156 // used to include empty fields in Patch requests. 2157 ForceSendFields []string `json:"-"` 2158 2159 // NullFields is a list of field names (e.g. "Kind") to include in API 2160 // requests with the JSON null value. By default, fields with empty 2161 // values are omitted from API requests. However, any field with an 2162 // empty value appearing in NullFields will be sent to the server as 2163 // null. It is an error if a field in this list has a non-empty value. 2164 // This may be used to include null fields in Patch requests. 2165 NullFields []string `json:"-"` 2166} 2167 2168func (s *ManagedConfigurationsSettingsListResponse) MarshalJSON() ([]byte, error) { 2169 type NoMethod ManagedConfigurationsSettingsListResponse 2170 raw := NoMethod(*s) 2171 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2172} 2173 2174// ManagedProperty: A managed property of a managed configuration. The 2175// property must match one of the properties in the app restrictions 2176// schema of the product. Exactly one of the value fields must be 2177// populated, and it must match the property's type in the app 2178// restrictions schema. 2179type ManagedProperty struct { 2180 // Key: The unique key that identifies the property. 2181 Key string `json:"key,omitempty"` 2182 2183 // ValueBool: The boolean value - this will only be present if type of 2184 // the property is bool. 2185 ValueBool bool `json:"valueBool,omitempty"` 2186 2187 // ValueBundle: The bundle of managed properties - this will only be 2188 // present if type of the property is bundle. 2189 ValueBundle *ManagedPropertyBundle `json:"valueBundle,omitempty"` 2190 2191 // ValueBundleArray: The list of bundles of properties - this will only 2192 // be present if type of the property is bundle_array. 2193 ValueBundleArray []*ManagedPropertyBundle `json:"valueBundleArray,omitempty"` 2194 2195 // ValueInteger: The integer value - this will only be present if type 2196 // of the property is integer. 2197 ValueInteger int64 `json:"valueInteger,omitempty"` 2198 2199 // ValueString: The string value - this will only be present if type of 2200 // the property is string, choice or hidden. 2201 ValueString string `json:"valueString,omitempty"` 2202 2203 // ValueStringArray: The list of string values - this will only be 2204 // present if type of the property is multiselect. 2205 ValueStringArray []string `json:"valueStringArray,omitempty"` 2206 2207 // ForceSendFields is a list of field names (e.g. "Key") to 2208 // unconditionally include in API requests. By default, fields with 2209 // empty values are omitted from API requests. However, any non-pointer, 2210 // non-interface field appearing in ForceSendFields will be sent to the 2211 // server regardless of whether the field is empty or not. This may be 2212 // used to include empty fields in Patch requests. 2213 ForceSendFields []string `json:"-"` 2214 2215 // NullFields is a list of field names (e.g. "Key") to include in API 2216 // requests with the JSON null value. By default, fields with empty 2217 // values are omitted from API requests. However, any field with an 2218 // empty value appearing in NullFields will be sent to the server as 2219 // null. It is an error if a field in this list has a non-empty value. 2220 // This may be used to include null fields in Patch requests. 2221 NullFields []string `json:"-"` 2222} 2223 2224func (s *ManagedProperty) MarshalJSON() ([]byte, error) { 2225 type NoMethod ManagedProperty 2226 raw := NoMethod(*s) 2227 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2228} 2229 2230// ManagedPropertyBundle: A bundle of managed properties. 2231type ManagedPropertyBundle struct { 2232 // ManagedProperty: The list of managed properties. 2233 ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"` 2234 2235 // ForceSendFields is a list of field names (e.g. "ManagedProperty") to 2236 // unconditionally include in API requests. By default, fields with 2237 // empty values are omitted from API requests. However, any non-pointer, 2238 // non-interface field appearing in ForceSendFields will be sent to the 2239 // server regardless of whether the field is empty or not. This may be 2240 // used to include empty fields in Patch requests. 2241 ForceSendFields []string `json:"-"` 2242 2243 // NullFields is a list of field names (e.g. "ManagedProperty") to 2244 // include in API requests with the JSON null value. By default, fields 2245 // with empty values are omitted from API requests. However, any field 2246 // with an empty value appearing in NullFields will be sent to the 2247 // server as null. It is an error if a field in this list has a 2248 // non-empty value. This may be used to include null fields in Patch 2249 // requests. 2250 NullFields []string `json:"-"` 2251} 2252 2253func (s *ManagedPropertyBundle) MarshalJSON() ([]byte, error) { 2254 type NoMethod ManagedPropertyBundle 2255 raw := NoMethod(*s) 2256 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2257} 2258 2259// NewDeviceEvent: An event generated when a new device is ready to be 2260// managed. 2261type NewDeviceEvent struct { 2262 // DeviceId: The Android ID of the device. This field will always be 2263 // present. 2264 DeviceId string `json:"deviceId,omitempty"` 2265 2266 // DpcPackageName: Policy app on the device. 2267 DpcPackageName string `json:"dpcPackageName,omitempty"` 2268 2269 // ManagementType: Identifies the extent to which the device is 2270 // controlled by an Android EMM in various deployment 2271 // configurations. 2272 // 2273 // Possible values include: 2274 // - "managedDevice", a device where the DPC is set as device owner, 2275 // - "managedProfile", a device where the DPC is set as profile owner. 2276 ManagementType string `json:"managementType,omitempty"` 2277 2278 // UserId: The ID of the user. This field will always be present. 2279 UserId string `json:"userId,omitempty"` 2280 2281 // ForceSendFields is a list of field names (e.g. "DeviceId") to 2282 // unconditionally include in API requests. By default, fields with 2283 // empty values are omitted from API requests. However, any non-pointer, 2284 // non-interface field appearing in ForceSendFields will be sent to the 2285 // server regardless of whether the field is empty or not. This may be 2286 // used to include empty fields in Patch requests. 2287 ForceSendFields []string `json:"-"` 2288 2289 // NullFields is a list of field names (e.g. "DeviceId") to include in 2290 // API requests with the JSON null value. By default, fields with empty 2291 // values are omitted from API requests. However, any field with an 2292 // empty value appearing in NullFields will be sent to the server as 2293 // null. It is an error if a field in this list has a non-empty value. 2294 // This may be used to include null fields in Patch requests. 2295 NullFields []string `json:"-"` 2296} 2297 2298func (s *NewDeviceEvent) MarshalJSON() ([]byte, error) { 2299 type NoMethod NewDeviceEvent 2300 raw := NoMethod(*s) 2301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2302} 2303 2304// NewPermissionsEvent: An event generated when new permissions are 2305// added to an app. 2306type NewPermissionsEvent struct { 2307 // ApprovedPermissions: The set of permissions that the enterprise admin 2308 // has already approved for this application. Use Permissions.Get on the 2309 // EMM API to retrieve details about these permissions. 2310 ApprovedPermissions []string `json:"approvedPermissions,omitempty"` 2311 2312 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2313 // for which new permissions were added. This field will always be 2314 // present. 2315 ProductId string `json:"productId,omitempty"` 2316 2317 // RequestedPermissions: The set of permissions that the app is 2318 // currently requesting. Use Permissions.Get on the EMM API to retrieve 2319 // details about these permissions. 2320 RequestedPermissions []string `json:"requestedPermissions,omitempty"` 2321 2322 // ForceSendFields is a list of field names (e.g. "ApprovedPermissions") 2323 // to unconditionally include in API requests. By default, fields with 2324 // empty values are omitted from API requests. However, any non-pointer, 2325 // non-interface field appearing in ForceSendFields will be sent to the 2326 // server regardless of whether the field is empty or not. This may be 2327 // used to include empty fields in Patch requests. 2328 ForceSendFields []string `json:"-"` 2329 2330 // NullFields is a list of field names (e.g. "ApprovedPermissions") to 2331 // include in API requests with the JSON null value. By default, fields 2332 // with empty values are omitted from API requests. However, any field 2333 // with an empty value appearing in NullFields will be sent to the 2334 // server as null. It is an error if a field in this list has a 2335 // non-empty value. This may be used to include null fields in Patch 2336 // requests. 2337 NullFields []string `json:"-"` 2338} 2339 2340func (s *NewPermissionsEvent) MarshalJSON() ([]byte, error) { 2341 type NoMethod NewPermissionsEvent 2342 raw := NoMethod(*s) 2343 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2344} 2345 2346// Notification: A notification of one event relating to an enterprise. 2347type Notification struct { 2348 // AppRestrictionsSchemaChangeEvent: Notifications about new app 2349 // restrictions schema changes. 2350 AppRestrictionsSchemaChangeEvent *AppRestrictionsSchemaChangeEvent `json:"appRestrictionsSchemaChangeEvent,omitempty"` 2351 2352 // AppUpdateEvent: Notifications about app updates. 2353 AppUpdateEvent *AppUpdateEvent `json:"appUpdateEvent,omitempty"` 2354 2355 // DeviceReportUpdateEvent: Notifications about device report updates. 2356 DeviceReportUpdateEvent *DeviceReportUpdateEvent `json:"deviceReportUpdateEvent,omitempty"` 2357 2358 // EnterpriseId: The ID of the enterprise for which the notification is 2359 // sent. This will always be present. 2360 EnterpriseId string `json:"enterpriseId,omitempty"` 2361 2362 // InstallFailureEvent: Notifications about an app installation failure. 2363 InstallFailureEvent *InstallFailureEvent `json:"installFailureEvent,omitempty"` 2364 2365 // NewDeviceEvent: Notifications about new devices. 2366 NewDeviceEvent *NewDeviceEvent `json:"newDeviceEvent,omitempty"` 2367 2368 // NewPermissionsEvent: Notifications about new app permissions. 2369 NewPermissionsEvent *NewPermissionsEvent `json:"newPermissionsEvent,omitempty"` 2370 2371 // NotificationType: Type of the notification. 2372 NotificationType string `json:"notificationType,omitempty"` 2373 2374 // ProductApprovalEvent: Notifications about changes to a product's 2375 // approval status. 2376 ProductApprovalEvent *ProductApprovalEvent `json:"productApprovalEvent,omitempty"` 2377 2378 // ProductAvailabilityChangeEvent: Notifications about product 2379 // availability changes. 2380 ProductAvailabilityChangeEvent *ProductAvailabilityChangeEvent `json:"productAvailabilityChangeEvent,omitempty"` 2381 2382 // TimestampMillis: The time when the notification was published in 2383 // milliseconds since 1970-01-01T00:00:00Z. This will always be present. 2384 TimestampMillis int64 `json:"timestampMillis,omitempty,string"` 2385 2386 // ForceSendFields is a list of field names (e.g. 2387 // "AppRestrictionsSchemaChangeEvent") to unconditionally include in API 2388 // requests. By default, fields with empty values are omitted from API 2389 // requests. However, any non-pointer, non-interface field appearing in 2390 // ForceSendFields will be sent to the server regardless of whether the 2391 // field is empty or not. This may be used to include empty fields in 2392 // Patch requests. 2393 ForceSendFields []string `json:"-"` 2394 2395 // NullFields is a list of field names (e.g. 2396 // "AppRestrictionsSchemaChangeEvent") to include in API requests with 2397 // the JSON null value. By default, fields with empty values are omitted 2398 // from API requests. However, any field with an empty value appearing 2399 // in NullFields will be sent to the server as null. It is an error if a 2400 // field in this list has a non-empty value. This may be used to include 2401 // null fields in Patch requests. 2402 NullFields []string `json:"-"` 2403} 2404 2405func (s *Notification) MarshalJSON() ([]byte, error) { 2406 type NoMethod Notification 2407 raw := NoMethod(*s) 2408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2409} 2410 2411// NotificationSet: A resource returned by the PullNotificationSet API, 2412// which contains a collection of notifications for enterprises 2413// associated with the service account authenticated for the request. 2414type NotificationSet struct { 2415 Kind string `json:"kind,omitempty"` 2416 2417 // Notification: The notifications received, or empty if no 2418 // notifications are present. 2419 Notification []*Notification `json:"notification,omitempty"` 2420 2421 // NotificationSetId: The notification set ID, required to mark the 2422 // notification as received with the Enterprises.AcknowledgeNotification 2423 // API. This will be omitted if no notifications are present. 2424 NotificationSetId string `json:"notificationSetId,omitempty"` 2425 2426 // ServerResponse contains the HTTP response code and headers from the 2427 // server. 2428 googleapi.ServerResponse `json:"-"` 2429 2430 // ForceSendFields is a list of field names (e.g. "Kind") to 2431 // unconditionally include in API requests. By default, fields with 2432 // empty values are omitted from API requests. However, any non-pointer, 2433 // non-interface field appearing in ForceSendFields will be sent to the 2434 // server regardless of whether the field is empty or not. This may be 2435 // used to include empty fields in Patch requests. 2436 ForceSendFields []string `json:"-"` 2437 2438 // NullFields is a list of field names (e.g. "Kind") to include in API 2439 // requests with the JSON null value. By default, fields with empty 2440 // values are omitted from API requests. However, any field with an 2441 // empty value appearing in NullFields will be sent to the server as 2442 // null. It is an error if a field in this list has a non-empty value. 2443 // This may be used to include null fields in Patch requests. 2444 NullFields []string `json:"-"` 2445} 2446 2447func (s *NotificationSet) MarshalJSON() ([]byte, error) { 2448 type NoMethod NotificationSet 2449 raw := NoMethod(*s) 2450 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2451} 2452 2453type PageInfo struct { 2454 ResultPerPage int64 `json:"resultPerPage,omitempty"` 2455 2456 StartIndex int64 `json:"startIndex,omitempty"` 2457 2458 TotalResults int64 `json:"totalResults,omitempty"` 2459 2460 // ForceSendFields is a list of field names (e.g. "ResultPerPage") to 2461 // unconditionally include in API requests. By default, fields with 2462 // empty values are omitted from API requests. However, any non-pointer, 2463 // non-interface field appearing in ForceSendFields will be sent to the 2464 // server regardless of whether the field is empty or not. This may be 2465 // used to include empty fields in Patch requests. 2466 ForceSendFields []string `json:"-"` 2467 2468 // NullFields is a list of field names (e.g. "ResultPerPage") to include 2469 // in API requests with the JSON null value. By default, fields with 2470 // empty values are omitted from API requests. However, any field with 2471 // an empty value appearing in NullFields will be sent to the server as 2472 // null. It is an error if a field in this list has a non-empty value. 2473 // This may be used to include null fields in Patch requests. 2474 NullFields []string `json:"-"` 2475} 2476 2477func (s *PageInfo) MarshalJSON() ([]byte, error) { 2478 type NoMethod PageInfo 2479 raw := NoMethod(*s) 2480 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2481} 2482 2483// Permission: A Permissions resource represents some extra capability, 2484// to be granted to an Android app, which requires explicit consent. An 2485// enterprise admin must consent to these permissions on behalf of their 2486// users before an entitlement for the app can be created. 2487// 2488// The permissions collection is read-only. The information provided for 2489// each permission (localized name and description) is intended to be 2490// used in the MDM user interface when obtaining consent from the 2491// enterprise. 2492type Permission struct { 2493 // Description: A longer description of the Permissions resource, giving 2494 // more details of what it affects. 2495 Description string `json:"description,omitempty"` 2496 2497 Kind string `json:"kind,omitempty"` 2498 2499 // Name: The name of the permission. 2500 Name string `json:"name,omitempty"` 2501 2502 // PermissionId: An opaque string uniquely identifying the permission. 2503 PermissionId string `json:"permissionId,omitempty"` 2504 2505 // ServerResponse contains the HTTP response code and headers from the 2506 // server. 2507 googleapi.ServerResponse `json:"-"` 2508 2509 // ForceSendFields is a list of field names (e.g. "Description") to 2510 // unconditionally include in API requests. By default, fields with 2511 // empty values are omitted from API requests. However, any non-pointer, 2512 // non-interface field appearing in ForceSendFields will be sent to the 2513 // server regardless of whether the field is empty or not. This may be 2514 // used to include empty fields in Patch requests. 2515 ForceSendFields []string `json:"-"` 2516 2517 // NullFields is a list of field names (e.g. "Description") to include 2518 // in API requests with the JSON null value. By default, fields with 2519 // empty values are omitted from API requests. However, any field with 2520 // an empty value appearing in NullFields will be sent to the server as 2521 // null. It is an error if a field in this list has a non-empty value. 2522 // This may be used to include null fields in Patch requests. 2523 NullFields []string `json:"-"` 2524} 2525 2526func (s *Permission) MarshalJSON() ([]byte, error) { 2527 type NoMethod Permission 2528 raw := NoMethod(*s) 2529 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2530} 2531 2532// Policy: The device policy for a given managed device. 2533type Policy struct { 2534 // AutoUpdatePolicy: The auto-update policy for apps installed on the 2535 // device. "choiceToTheUser" allows the device's user to configure the 2536 // app update policy. "always" enables auto updates. "never" disables 2537 // auto updates. "wifiOnly" enables auto updates only when the device is 2538 // connected to wifi. 2539 AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"` 2540 2541 // DeviceReportPolicy: Whether the device reports app states to the EMM. 2542 // The default value is "deviceReportDisabled". 2543 DeviceReportPolicy string `json:"deviceReportPolicy,omitempty"` 2544 2545 // MaintenanceWindow: The maintenance window defining when apps running 2546 // in the foreground should be updated. 2547 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 2548 2549 // ProductAvailabilityPolicy: The availability granted to the device for 2550 // the specified products. "all" gives the device access to all 2551 // products, regardless of approval status. "all" does not enable 2552 // automatic visibility of "alpha" or "beta" tracks. "whitelist" grants 2553 // the device access the products specified in productPolicy[]. Only 2554 // products that are approved or products that were previously approved 2555 // (products with revoked approval) by the enterprise can be 2556 // whitelisted. If no value is provided, the availability set at the 2557 // user level is applied by default. 2558 ProductAvailabilityPolicy string `json:"productAvailabilityPolicy,omitempty"` 2559 2560 // ProductPolicy: The list of product policies. 2561 ProductPolicy []*ProductPolicy `json:"productPolicy,omitempty"` 2562 2563 // ForceSendFields is a list of field names (e.g. "AutoUpdatePolicy") to 2564 // unconditionally include in API requests. By default, fields with 2565 // empty values are omitted from API requests. However, any non-pointer, 2566 // non-interface field appearing in ForceSendFields will be sent to the 2567 // server regardless of whether the field is empty or not. This may be 2568 // used to include empty fields in Patch requests. 2569 ForceSendFields []string `json:"-"` 2570 2571 // NullFields is a list of field names (e.g. "AutoUpdatePolicy") to 2572 // include in API requests with the JSON null value. By default, fields 2573 // with empty values are omitted from API requests. However, any field 2574 // with an empty value appearing in NullFields will be sent to the 2575 // server as null. It is an error if a field in this list has a 2576 // non-empty value. This may be used to include null fields in Patch 2577 // requests. 2578 NullFields []string `json:"-"` 2579} 2580 2581func (s *Policy) MarshalJSON() ([]byte, error) { 2582 type NoMethod Policy 2583 raw := NoMethod(*s) 2584 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2585} 2586 2587// Product: A Products resource represents an app in the Google Play 2588// store that is available to at least some users in the enterprise. 2589// (Some apps are restricted to a single enterprise, and no information 2590// about them is made available outside that enterprise.) 2591// 2592// The information provided for each product (localized name, icon, link 2593// to the full Google Play details page) is intended to allow a basic 2594// representation of the product within an EMM user interface. 2595type Product struct { 2596 // AppTracks: The tracks visible to the enterprise. 2597 AppTracks []*TrackInfo `json:"appTracks,omitempty"` 2598 2599 // AppVersion: App versions currently available for this product. 2600 AppVersion []*AppVersion `json:"appVersion,omitempty"` 2601 2602 // AuthorName: The name of the author of the product (for example, the 2603 // app developer). 2604 AuthorName string `json:"authorName,omitempty"` 2605 2606 // AvailableCountries: The countries which this app is available in. 2607 AvailableCountries []string `json:"availableCountries,omitempty"` 2608 2609 // AvailableTracks: Deprecated, use appTracks instead. 2610 AvailableTracks []string `json:"availableTracks,omitempty"` 2611 2612 // Category: The app category (e.g. RACING, SOCIAL, etc.) 2613 Category string `json:"category,omitempty"` 2614 2615 // ContentRating: The content rating for this app. 2616 ContentRating string `json:"contentRating,omitempty"` 2617 2618 // Description: The localized promotional description, if available. 2619 Description string `json:"description,omitempty"` 2620 2621 // DetailsUrl: A link to the (consumer) Google Play details page for the 2622 // product. 2623 DetailsUrl string `json:"detailsUrl,omitempty"` 2624 2625 // DistributionChannel: How and to whom the package is made available. 2626 // The value publicGoogleHosted means that the package is available 2627 // through the Play store and not restricted to a specific enterprise. 2628 // The value privateGoogleHosted means that the package is a private app 2629 // (restricted to an enterprise) but hosted by Google. The value 2630 // privateSelfHosted means that the package is a private app (restricted 2631 // to an enterprise) and is privately hosted. 2632 DistributionChannel string `json:"distributionChannel,omitempty"` 2633 2634 // Features: Noteworthy features (if any) of this product. 2635 Features []string `json:"features,omitempty"` 2636 2637 // IconUrl: A link to an image that can be used as an icon for the 2638 // product. This image is suitable for use at up to 512px x 512px. 2639 IconUrl string `json:"iconUrl,omitempty"` 2640 2641 Kind string `json:"kind,omitempty"` 2642 2643 // LastUpdatedTimestampMillis: The approximate time (within 7 days) the 2644 // app was last published, expressed in milliseconds since epoch. 2645 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 2646 2647 // MinAndroidSdkVersion: The minimum Android SDK necessary to run the 2648 // app. 2649 MinAndroidSdkVersion int64 `json:"minAndroidSdkVersion,omitempty"` 2650 2651 // Permissions: A list of permissions required by the app. 2652 Permissions []*ProductPermission `json:"permissions,omitempty"` 2653 2654 // ProductId: A string of the form app:<package name>. For example, 2655 // app:com.google.android.gm represents the Gmail app. 2656 ProductId string `json:"productId,omitempty"` 2657 2658 // ProductPricing: Whether this product is free, free with in-app 2659 // purchases, or paid. If the pricing is unknown, this means the product 2660 // is not generally available anymore (even though it might still be 2661 // available to people who own it). 2662 ProductPricing string `json:"productPricing,omitempty"` 2663 2664 // RecentChanges: A description of the recent changes made to the app. 2665 RecentChanges string `json:"recentChanges,omitempty"` 2666 2667 // RequiresContainerApp: Deprecated. 2668 RequiresContainerApp bool `json:"requiresContainerApp,omitempty"` 2669 2670 // ScreenshotUrls: A list of screenshot links representing the app. 2671 ScreenshotUrls []string `json:"screenshotUrls,omitempty"` 2672 2673 // SigningCertificate: The certificate used to sign this product. 2674 SigningCertificate *ProductSigningCertificate `json:"signingCertificate,omitempty"` 2675 2676 // SmallIconUrl: A link to a smaller image that can be used as an icon 2677 // for the product. This image is suitable for use at up to 128px x 2678 // 128px. 2679 SmallIconUrl string `json:"smallIconUrl,omitempty"` 2680 2681 // Title: The name of the product. 2682 Title string `json:"title,omitempty"` 2683 2684 // WorkDetailsUrl: A link to the managed Google Play details page for 2685 // the product, for use by an Enterprise admin. 2686 WorkDetailsUrl string `json:"workDetailsUrl,omitempty"` 2687 2688 // ServerResponse contains the HTTP response code and headers from the 2689 // server. 2690 googleapi.ServerResponse `json:"-"` 2691 2692 // ForceSendFields is a list of field names (e.g. "AppTracks") to 2693 // unconditionally include in API requests. By default, fields with 2694 // empty values are omitted from API requests. However, any non-pointer, 2695 // non-interface field appearing in ForceSendFields will be sent to the 2696 // server regardless of whether the field is empty or not. This may be 2697 // used to include empty fields in Patch requests. 2698 ForceSendFields []string `json:"-"` 2699 2700 // NullFields is a list of field names (e.g. "AppTracks") to include in 2701 // API requests with the JSON null value. By default, fields with empty 2702 // values are omitted from API requests. However, any field with an 2703 // empty value appearing in NullFields will be sent to the server as 2704 // null. It is an error if a field in this list has a non-empty value. 2705 // This may be used to include null fields in Patch requests. 2706 NullFields []string `json:"-"` 2707} 2708 2709func (s *Product) MarshalJSON() ([]byte, error) { 2710 type NoMethod Product 2711 raw := NoMethod(*s) 2712 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2713} 2714 2715// ProductApprovalEvent: An event generated when a product's approval 2716// status is changed. 2717type ProductApprovalEvent struct { 2718 // Approved: Whether the product was approved or unapproved. This field 2719 // will always be present. 2720 Approved string `json:"approved,omitempty"` 2721 2722 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2723 // for which the approval status has changed. This field will always be 2724 // present. 2725 ProductId string `json:"productId,omitempty"` 2726 2727 // ForceSendFields is a list of field names (e.g. "Approved") to 2728 // unconditionally include in API requests. By default, fields with 2729 // empty values are omitted from API requests. However, any non-pointer, 2730 // non-interface field appearing in ForceSendFields will be sent to the 2731 // server regardless of whether the field is empty or not. This may be 2732 // used to include empty fields in Patch requests. 2733 ForceSendFields []string `json:"-"` 2734 2735 // NullFields is a list of field names (e.g. "Approved") to include in 2736 // API requests with the JSON null value. By default, fields with empty 2737 // values are omitted from API requests. However, any field with an 2738 // empty value appearing in NullFields will be sent to the server as 2739 // null. It is an error if a field in this list has a non-empty value. 2740 // This may be used to include null fields in Patch requests. 2741 NullFields []string `json:"-"` 2742} 2743 2744func (s *ProductApprovalEvent) MarshalJSON() ([]byte, error) { 2745 type NoMethod ProductApprovalEvent 2746 raw := NoMethod(*s) 2747 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2748} 2749 2750// ProductAvailabilityChangeEvent: An event generated whenever a 2751// product's availability changes. 2752type ProductAvailabilityChangeEvent struct { 2753 // AvailabilityStatus: The new state of the product. This field will 2754 // always be present. 2755 AvailabilityStatus string `json:"availabilityStatus,omitempty"` 2756 2757 // ProductId: The id of the product (e.g. "app:com.google.android.gm") 2758 // for which the product availability changed. This field will always be 2759 // present. 2760 ProductId string `json:"productId,omitempty"` 2761 2762 // ForceSendFields is a list of field names (e.g. "AvailabilityStatus") 2763 // to unconditionally include in API requests. By default, fields with 2764 // empty values are omitted from API requests. However, any non-pointer, 2765 // non-interface field appearing in ForceSendFields will be sent to the 2766 // server regardless of whether the field is empty or not. This may be 2767 // used to include empty fields in Patch requests. 2768 ForceSendFields []string `json:"-"` 2769 2770 // NullFields is a list of field names (e.g. "AvailabilityStatus") to 2771 // include in API requests with the JSON null value. By default, fields 2772 // with empty values are omitted from API requests. However, any field 2773 // with an empty value appearing in NullFields will be sent to the 2774 // server as null. It is an error if a field in this list has a 2775 // non-empty value. This may be used to include null fields in Patch 2776 // requests. 2777 NullFields []string `json:"-"` 2778} 2779 2780func (s *ProductAvailabilityChangeEvent) MarshalJSON() ([]byte, error) { 2781 type NoMethod ProductAvailabilityChangeEvent 2782 raw := NoMethod(*s) 2783 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2784} 2785 2786// ProductPermission: A product permissions resource represents the set 2787// of permissions required by a specific app and whether or not they 2788// have been accepted by an enterprise admin. 2789// 2790// The API can be used to read the set of permissions, and also to 2791// update the set to indicate that permissions have been accepted. 2792type ProductPermission struct { 2793 // PermissionId: An opaque string uniquely identifying the permission. 2794 PermissionId string `json:"permissionId,omitempty"` 2795 2796 // State: Whether the permission has been accepted or not. 2797 State string `json:"state,omitempty"` 2798 2799 // ForceSendFields is a list of field names (e.g. "PermissionId") to 2800 // unconditionally include in API requests. By default, fields with 2801 // empty values are omitted from API requests. However, any non-pointer, 2802 // non-interface field appearing in ForceSendFields will be sent to the 2803 // server regardless of whether the field is empty or not. This may be 2804 // used to include empty fields in Patch requests. 2805 ForceSendFields []string `json:"-"` 2806 2807 // NullFields is a list of field names (e.g. "PermissionId") to include 2808 // in API requests with the JSON null value. By default, fields with 2809 // empty values are omitted from API requests. However, any field with 2810 // an empty value appearing in NullFields will be sent to the server as 2811 // null. It is an error if a field in this list has a non-empty value. 2812 // This may be used to include null fields in Patch requests. 2813 NullFields []string `json:"-"` 2814} 2815 2816func (s *ProductPermission) MarshalJSON() ([]byte, error) { 2817 type NoMethod ProductPermission 2818 raw := NoMethod(*s) 2819 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2820} 2821 2822// ProductPermissions: Information about the permissions required by a 2823// specific app and whether they have been accepted by the enterprise. 2824type ProductPermissions struct { 2825 Kind string `json:"kind,omitempty"` 2826 2827 // Permission: The permissions required by the app. 2828 Permission []*ProductPermission `json:"permission,omitempty"` 2829 2830 // ProductId: The ID of the app that the permissions relate to, e.g. 2831 // "app:com.google.android.gm". 2832 ProductId string `json:"productId,omitempty"` 2833 2834 // ServerResponse contains the HTTP response code and headers from the 2835 // server. 2836 googleapi.ServerResponse `json:"-"` 2837 2838 // ForceSendFields is a list of field names (e.g. "Kind") to 2839 // unconditionally include in API requests. By default, fields with 2840 // empty values are omitted from API requests. However, any non-pointer, 2841 // non-interface field appearing in ForceSendFields will be sent to the 2842 // server regardless of whether the field is empty or not. This may be 2843 // used to include empty fields in Patch requests. 2844 ForceSendFields []string `json:"-"` 2845 2846 // NullFields is a list of field names (e.g. "Kind") to include in API 2847 // requests with the JSON null value. By default, fields with empty 2848 // values are omitted from API requests. However, any field with an 2849 // empty value appearing in NullFields will be sent to the server as 2850 // null. It is an error if a field in this list has a non-empty value. 2851 // This may be used to include null fields in Patch requests. 2852 NullFields []string `json:"-"` 2853} 2854 2855func (s *ProductPermissions) MarshalJSON() ([]byte, error) { 2856 type NoMethod ProductPermissions 2857 raw := NoMethod(*s) 2858 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2859} 2860 2861// ProductPolicy: The policy for a product. 2862type ProductPolicy struct { 2863 // AutoInstallPolicy: The auto-install policy for the product. 2864 AutoInstallPolicy *AutoInstallPolicy `json:"autoInstallPolicy,omitempty"` 2865 2866 // ManagedConfiguration: The managed configuration for the product. 2867 ManagedConfiguration *ManagedConfiguration `json:"managedConfiguration,omitempty"` 2868 2869 // ProductId: The ID of the product. For example, 2870 // "app:com.google.android.gm". 2871 ProductId string `json:"productId,omitempty"` 2872 2873 // TrackIds: Grants the device visibility to the specified product 2874 // release track(s), identified by trackIds. The list of release tracks 2875 // of a product can be obtained by calling Products.Get. 2876 TrackIds []string `json:"trackIds,omitempty"` 2877 2878 // Tracks: Deprecated. Use trackIds instead. 2879 Tracks []string `json:"tracks,omitempty"` 2880 2881 // ForceSendFields is a list of field names (e.g. "AutoInstallPolicy") 2882 // to unconditionally include in API requests. By default, fields with 2883 // empty values are omitted from API requests. However, any non-pointer, 2884 // non-interface field appearing in ForceSendFields will be sent to the 2885 // server regardless of whether the field is empty or not. This may be 2886 // used to include empty fields in Patch requests. 2887 ForceSendFields []string `json:"-"` 2888 2889 // NullFields is a list of field names (e.g. "AutoInstallPolicy") to 2890 // include in API requests with the JSON null value. By default, fields 2891 // with empty values are omitted from API requests. However, any field 2892 // with an empty value appearing in NullFields will be sent to the 2893 // server as null. It is an error if a field in this list has a 2894 // non-empty value. This may be used to include null fields in Patch 2895 // requests. 2896 NullFields []string `json:"-"` 2897} 2898 2899func (s *ProductPolicy) MarshalJSON() ([]byte, error) { 2900 type NoMethod ProductPolicy 2901 raw := NoMethod(*s) 2902 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2903} 2904 2905// ProductSet: A set of products. 2906type ProductSet struct { 2907 Kind string `json:"kind,omitempty"` 2908 2909 // ProductId: The list of product IDs making up the set of products. 2910 ProductId []string `json:"productId,omitempty"` 2911 2912 // ProductSetBehavior: The interpretation of this product set. "unknown" 2913 // should never be sent and is ignored if received. "whitelist" means 2914 // that the user is entitled to access the product set. "includeAll" 2915 // means that all products are accessible, including products that are 2916 // approved, products with revoked approval, and products that have 2917 // never been approved. "allApproved" means that the user is entitled to 2918 // access all products that are approved for the enterprise. If the 2919 // value is "allApproved" or "includeAll", the productId field is 2920 // ignored. If no value is provided, it is interpreted as "whitelist" 2921 // for backwards compatibility. Further "allApproved" or "includeAll" 2922 // does not enable automatic visibility of "alpha" or "beta" tracks for 2923 // Android app. Use ProductVisibility to enable "alpha" or "beta" tracks 2924 // per user. 2925 ProductSetBehavior string `json:"productSetBehavior,omitempty"` 2926 2927 // ProductVisibility: Additional list of product IDs making up the 2928 // product set. Unlike the productID array, in this list It's possible 2929 // to specify which tracks (alpha, beta, production) of a product are 2930 // visible to the user. See ProductVisibility and its fields for more 2931 // information. Specifying the same product ID both here and in the 2932 // productId array is not allowed and it will result in an error. 2933 ProductVisibility []*ProductVisibility `json:"productVisibility,omitempty"` 2934 2935 // ServerResponse contains the HTTP response code and headers from the 2936 // server. 2937 googleapi.ServerResponse `json:"-"` 2938 2939 // ForceSendFields is a list of field names (e.g. "Kind") to 2940 // unconditionally include in API requests. By default, fields with 2941 // empty values are omitted from API requests. However, any non-pointer, 2942 // non-interface field appearing in ForceSendFields will be sent to the 2943 // server regardless of whether the field is empty or not. This may be 2944 // used to include empty fields in Patch requests. 2945 ForceSendFields []string `json:"-"` 2946 2947 // NullFields is a list of field names (e.g. "Kind") to include in API 2948 // requests with the JSON null value. By default, fields with empty 2949 // values are omitted from API requests. However, any field with an 2950 // empty value appearing in NullFields will be sent to the server as 2951 // null. It is an error if a field in this list has a non-empty value. 2952 // This may be used to include null fields in Patch requests. 2953 NullFields []string `json:"-"` 2954} 2955 2956func (s *ProductSet) MarshalJSON() ([]byte, error) { 2957 type NoMethod ProductSet 2958 raw := NoMethod(*s) 2959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2960} 2961 2962type ProductSigningCertificate struct { 2963 // CertificateHashSha1: The base64 urlsafe encoded SHA1 hash of the 2964 // certificate. (This field is deprecated in favor of SHA2-256. It 2965 // should not be used and may be removed at any time.) 2966 CertificateHashSha1 string `json:"certificateHashSha1,omitempty"` 2967 2968 // CertificateHashSha256: The base64 urlsafe encoded SHA2-256 hash of 2969 // the certificate. 2970 CertificateHashSha256 string `json:"certificateHashSha256,omitempty"` 2971 2972 // ForceSendFields is a list of field names (e.g. "CertificateHashSha1") 2973 // to unconditionally include in API requests. By default, fields with 2974 // empty values are omitted from API requests. However, any non-pointer, 2975 // non-interface field appearing in ForceSendFields will be sent to the 2976 // server regardless of whether the field is empty or not. This may be 2977 // used to include empty fields in Patch requests. 2978 ForceSendFields []string `json:"-"` 2979 2980 // NullFields is a list of field names (e.g. "CertificateHashSha1") to 2981 // include in API requests with the JSON null value. By default, fields 2982 // with empty values are omitted from API requests. However, any field 2983 // with an empty value appearing in NullFields will be sent to the 2984 // server as null. It is an error if a field in this list has a 2985 // non-empty value. This may be used to include null fields in Patch 2986 // requests. 2987 NullFields []string `json:"-"` 2988} 2989 2990func (s *ProductSigningCertificate) MarshalJSON() ([]byte, error) { 2991 type NoMethod ProductSigningCertificate 2992 raw := NoMethod(*s) 2993 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2994} 2995 2996// ProductVisibility: A product to be made visible to a user. 2997type ProductVisibility struct { 2998 // ProductId: The product ID to make visible to the user. Required for 2999 // each item in the productVisibility list. 3000 ProductId string `json:"productId,omitempty"` 3001 3002 // TrackIds: Grants the user visibility to the specified product 3003 // track(s), identified by trackIds. 3004 TrackIds []string `json:"trackIds,omitempty"` 3005 3006 // Tracks: Deprecated. Use trackIds instead. 3007 Tracks []string `json:"tracks,omitempty"` 3008 3009 // ForceSendFields is a list of field names (e.g. "ProductId") to 3010 // unconditionally include in API requests. By default, fields with 3011 // empty values are omitted from API requests. However, any non-pointer, 3012 // non-interface field appearing in ForceSendFields will be sent to the 3013 // server regardless of whether the field is empty or not. This may be 3014 // used to include empty fields in Patch requests. 3015 ForceSendFields []string `json:"-"` 3016 3017 // NullFields is a list of field names (e.g. "ProductId") to include in 3018 // API requests with the JSON null value. By default, fields with empty 3019 // values are omitted from API requests. However, any field with an 3020 // empty value appearing in NullFields will be sent to the server as 3021 // null. It is an error if a field in this list has a non-empty value. 3022 // This may be used to include null fields in Patch requests. 3023 NullFields []string `json:"-"` 3024} 3025 3026func (s *ProductVisibility) MarshalJSON() ([]byte, error) { 3027 type NoMethod ProductVisibility 3028 raw := NoMethod(*s) 3029 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3030} 3031 3032type ProductsApproveRequest struct { 3033 // ApprovalUrlInfo: The approval URL that was shown to the user. Only 3034 // the permissions shown to the user with that URL will be accepted, 3035 // which may not be the product's entire set of permissions. For 3036 // example, the URL may only display new permissions from an update 3037 // after the product was approved, or not include new permissions if the 3038 // product was updated since the URL was generated. 3039 ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"` 3040 3041 // ApprovedPermissions: Sets how new permission requests for the product 3042 // are handled. "allPermissions" automatically approves all current and 3043 // future permissions for the product. "currentPermissionsOnly" approves 3044 // the current set of permissions for the product, but any future 3045 // permissions added through updates will require manual reapproval. If 3046 // not specified, only the current set of permissions will be approved. 3047 ApprovedPermissions string `json:"approvedPermissions,omitempty"` 3048 3049 // ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to 3050 // unconditionally include in API requests. By default, fields with 3051 // empty values are omitted from API requests. However, any non-pointer, 3052 // non-interface field appearing in ForceSendFields will be sent to the 3053 // server regardless of whether the field is empty or not. This may be 3054 // used to include empty fields in Patch requests. 3055 ForceSendFields []string `json:"-"` 3056 3057 // NullFields is a list of field names (e.g. "ApprovalUrlInfo") to 3058 // include in API requests with the JSON null value. By default, fields 3059 // with empty values are omitted from API requests. However, any field 3060 // with an empty value appearing in NullFields will be sent to the 3061 // server as null. It is an error if a field in this list has a 3062 // non-empty value. This may be used to include null fields in Patch 3063 // requests. 3064 NullFields []string `json:"-"` 3065} 3066 3067func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) { 3068 type NoMethod ProductsApproveRequest 3069 raw := NoMethod(*s) 3070 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3071} 3072 3073type ProductsGenerateApprovalUrlResponse struct { 3074 // Url: A URL that can be rendered in an iframe to display the 3075 // permissions (if any) of a product. This URL can be used to approve 3076 // the product only once and only within 24 hours of being generated, 3077 // using the Products.approve call. If the product is currently 3078 // unapproved and has no permissions, this URL will point to an empty 3079 // page. If the product is currently approved, a URL will only be 3080 // generated if that product has added permissions since it was last 3081 // approved, and the URL will only display those new permissions that 3082 // have not yet been accepted. 3083 Url string `json:"url,omitempty"` 3084 3085 // ServerResponse contains the HTTP response code and headers from the 3086 // server. 3087 googleapi.ServerResponse `json:"-"` 3088 3089 // ForceSendFields is a list of field names (e.g. "Url") to 3090 // unconditionally include in API requests. By default, fields with 3091 // empty values are omitted from API requests. However, any non-pointer, 3092 // non-interface field appearing in ForceSendFields will be sent to the 3093 // server regardless of whether the field is empty or not. This may be 3094 // used to include empty fields in Patch requests. 3095 ForceSendFields []string `json:"-"` 3096 3097 // NullFields is a list of field names (e.g. "Url") to include in API 3098 // requests with the JSON null value. By default, fields with empty 3099 // values are omitted from API requests. However, any field with an 3100 // empty value appearing in NullFields will be sent to the server as 3101 // null. It is an error if a field in this list has a non-empty value. 3102 // This may be used to include null fields in Patch requests. 3103 NullFields []string `json:"-"` 3104} 3105 3106func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) { 3107 type NoMethod ProductsGenerateApprovalUrlResponse 3108 raw := NoMethod(*s) 3109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3110} 3111 3112// ProductsListResponse: The matching products. 3113type ProductsListResponse struct { 3114 // Kind: Identifies what kind of resource this is. Value: the fixed 3115 // string "androidenterprise#productsListResponse". 3116 Kind string `json:"kind,omitempty"` 3117 3118 // PageInfo: General pagination information. 3119 PageInfo *PageInfo `json:"pageInfo,omitempty"` 3120 3121 // Product: Information about a product (e.g. an app) in the Google Play 3122 // store, for display to an enterprise admin. 3123 Product []*Product `json:"product,omitempty"` 3124 3125 // TokenPagination: Pagination information for token pagination. 3126 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` 3127 3128 // ServerResponse contains the HTTP response code and headers from the 3129 // server. 3130 googleapi.ServerResponse `json:"-"` 3131 3132 // ForceSendFields is a list of field names (e.g. "Kind") to 3133 // unconditionally include in API requests. By default, fields with 3134 // empty values are omitted from API requests. However, any non-pointer, 3135 // non-interface field appearing in ForceSendFields will be sent to the 3136 // server regardless of whether the field is empty or not. This may be 3137 // used to include empty fields in Patch requests. 3138 ForceSendFields []string `json:"-"` 3139 3140 // NullFields is a list of field names (e.g. "Kind") to include in API 3141 // requests with the JSON null value. By default, fields with empty 3142 // values are omitted from API requests. However, any field with an 3143 // empty value appearing in NullFields will be sent to the server as 3144 // null. It is an error if a field in this list has a non-empty value. 3145 // This may be used to include null fields in Patch requests. 3146 NullFields []string `json:"-"` 3147} 3148 3149func (s *ProductsListResponse) MarshalJSON() ([]byte, error) { 3150 type NoMethod ProductsListResponse 3151 raw := NoMethod(*s) 3152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3153} 3154 3155// ServiceAccount: A service account identity, including the name and 3156// credentials that can be used to authenticate as the service account. 3157type ServiceAccount struct { 3158 // Key: Credentials that can be used to authenticate as this 3159 // ServiceAccount. 3160 Key *ServiceAccountKey `json:"key,omitempty"` 3161 3162 Kind string `json:"kind,omitempty"` 3163 3164 // Name: The account name of the service account, in the form of an 3165 // email address. Assigned by the server. 3166 Name string `json:"name,omitempty"` 3167 3168 // ServerResponse contains the HTTP response code and headers from the 3169 // server. 3170 googleapi.ServerResponse `json:"-"` 3171 3172 // ForceSendFields is a list of field names (e.g. "Key") to 3173 // unconditionally include in API requests. By default, fields with 3174 // empty values are omitted from API requests. However, any non-pointer, 3175 // non-interface field appearing in ForceSendFields will be sent to the 3176 // server regardless of whether the field is empty or not. This may be 3177 // used to include empty fields in Patch requests. 3178 ForceSendFields []string `json:"-"` 3179 3180 // NullFields is a list of field names (e.g. "Key") to include in API 3181 // requests with the JSON null value. By default, fields with empty 3182 // values are omitted from API requests. However, any field with an 3183 // empty value appearing in NullFields will be sent to the server as 3184 // null. It is an error if a field in this list has a non-empty value. 3185 // This may be used to include null fields in Patch requests. 3186 NullFields []string `json:"-"` 3187} 3188 3189func (s *ServiceAccount) MarshalJSON() ([]byte, error) { 3190 type NoMethod ServiceAccount 3191 raw := NoMethod(*s) 3192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3193} 3194 3195// ServiceAccountKey: Credentials that can be used to authenticate as a 3196// service account. 3197type ServiceAccountKey struct { 3198 // Data: The body of the private key credentials file, in string format. 3199 // This is only populated when the ServiceAccountKey is created, and is 3200 // not stored by Google. 3201 Data string `json:"data,omitempty"` 3202 3203 // Id: An opaque, unique identifier for this ServiceAccountKey. Assigned 3204 // by the server. 3205 Id string `json:"id,omitempty"` 3206 3207 Kind string `json:"kind,omitempty"` 3208 3209 // PublicData: Public key data for the credentials file. This is an 3210 // X.509 cert. If you are using the googleCredentials key type, this is 3211 // identical to the cert that can be retrieved by using the X.509 cert 3212 // url inside of the credentials file. 3213 PublicData string `json:"publicData,omitempty"` 3214 3215 // Type: The file format of the generated key data. 3216 Type string `json:"type,omitempty"` 3217 3218 // ServerResponse contains the HTTP response code and headers from the 3219 // server. 3220 googleapi.ServerResponse `json:"-"` 3221 3222 // ForceSendFields is a list of field names (e.g. "Data") to 3223 // unconditionally include in API requests. By default, fields with 3224 // empty values are omitted from API requests. However, any non-pointer, 3225 // non-interface field appearing in ForceSendFields will be sent to the 3226 // server regardless of whether the field is empty or not. This may be 3227 // used to include empty fields in Patch requests. 3228 ForceSendFields []string `json:"-"` 3229 3230 // NullFields is a list of field names (e.g. "Data") to include in API 3231 // requests with the JSON null value. By default, fields with empty 3232 // values are omitted from API requests. However, any field with an 3233 // empty value appearing in NullFields will be sent to the server as 3234 // null. It is an error if a field in this list has a non-empty value. 3235 // This may be used to include null fields in Patch requests. 3236 NullFields []string `json:"-"` 3237} 3238 3239func (s *ServiceAccountKey) MarshalJSON() ([]byte, error) { 3240 type NoMethod ServiceAccountKey 3241 raw := NoMethod(*s) 3242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3243} 3244 3245type ServiceAccountKeysListResponse struct { 3246 // ServiceAccountKey: The service account credentials. 3247 ServiceAccountKey []*ServiceAccountKey `json:"serviceAccountKey,omitempty"` 3248 3249 // ServerResponse contains the HTTP response code and headers from the 3250 // server. 3251 googleapi.ServerResponse `json:"-"` 3252 3253 // ForceSendFields is a list of field names (e.g. "ServiceAccountKey") 3254 // to unconditionally include in API requests. By default, fields with 3255 // empty values are omitted from API requests. However, any non-pointer, 3256 // non-interface field appearing in ForceSendFields will be sent to the 3257 // server regardless of whether the field is empty or not. This may be 3258 // used to include empty fields in Patch requests. 3259 ForceSendFields []string `json:"-"` 3260 3261 // NullFields is a list of field names (e.g. "ServiceAccountKey") to 3262 // include in API requests with the JSON null value. By default, fields 3263 // with empty values are omitted from API requests. However, any field 3264 // with an empty value appearing in NullFields will be sent to the 3265 // server as null. It is an error if a field in this list has a 3266 // non-empty value. This may be used to include null fields in Patch 3267 // requests. 3268 NullFields []string `json:"-"` 3269} 3270 3271func (s *ServiceAccountKeysListResponse) MarshalJSON() ([]byte, error) { 3272 type NoMethod ServiceAccountKeysListResponse 3273 raw := NoMethod(*s) 3274 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3275} 3276 3277// SignupInfo: A resource returned by the GenerateSignupUrl API, which 3278// contains the Signup URL and Completion Token. 3279type SignupInfo struct { 3280 // CompletionToken: An opaque token that will be required, along with 3281 // the Enterprise Token, for obtaining the enterprise resource from 3282 // CompleteSignup. 3283 CompletionToken string `json:"completionToken,omitempty"` 3284 3285 Kind string `json:"kind,omitempty"` 3286 3287 // Url: A URL under which the Admin can sign up for an enterprise. The 3288 // page pointed to cannot be rendered in an iframe. 3289 Url string `json:"url,omitempty"` 3290 3291 // ServerResponse contains the HTTP response code and headers from the 3292 // server. 3293 googleapi.ServerResponse `json:"-"` 3294 3295 // ForceSendFields is a list of field names (e.g. "CompletionToken") to 3296 // unconditionally include in API requests. By default, fields with 3297 // empty values are omitted from API requests. However, any non-pointer, 3298 // non-interface field appearing in ForceSendFields will be sent to the 3299 // server regardless of whether the field is empty or not. This may be 3300 // used to include empty fields in Patch requests. 3301 ForceSendFields []string `json:"-"` 3302 3303 // NullFields is a list of field names (e.g. "CompletionToken") to 3304 // include in API requests with the JSON null value. By default, fields 3305 // with empty values are omitted from API requests. However, any field 3306 // with an empty value appearing in NullFields will be sent to the 3307 // server as null. It is an error if a field in this list has a 3308 // non-empty value. This may be used to include null fields in Patch 3309 // requests. 3310 NullFields []string `json:"-"` 3311} 3312 3313func (s *SignupInfo) MarshalJSON() ([]byte, error) { 3314 type NoMethod SignupInfo 3315 raw := NoMethod(*s) 3316 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3317} 3318 3319// StoreCluster: Definition of a managed Google Play store cluster, a 3320// list of products displayed as part of a store page. 3321type StoreCluster struct { 3322 // Id: Unique ID of this cluster. Assigned by the server. Immutable once 3323 // assigned. 3324 Id string `json:"id,omitempty"` 3325 3326 Kind string `json:"kind,omitempty"` 3327 3328 // Name: Ordered list of localized strings giving the name of this page. 3329 // The text displayed is the one that best matches the user locale, or 3330 // the first entry if there is no good match. There needs to be at least 3331 // one entry. 3332 Name []*LocalizedText `json:"name,omitempty"` 3333 3334 // OrderInPage: String (US-ASCII only) used to determine order of this 3335 // cluster within the parent page's elements. Page elements are sorted 3336 // in lexicographic order of this field. Duplicated values are allowed, 3337 // but ordering between elements with duplicate order is undefined. 3338 // 3339 // The value of this field is never visible to a user, it is used solely 3340 // for the purpose of defining an ordering. Maximum length is 256 3341 // characters. 3342 OrderInPage string `json:"orderInPage,omitempty"` 3343 3344 // ProductId: List of products in the order they are displayed in the 3345 // cluster. There should not be duplicates within a cluster. 3346 ProductId []string `json:"productId,omitempty"` 3347 3348 // ServerResponse contains the HTTP response code and headers from the 3349 // server. 3350 googleapi.ServerResponse `json:"-"` 3351 3352 // ForceSendFields is a list of field names (e.g. "Id") to 3353 // unconditionally include in API requests. By default, fields with 3354 // empty values are omitted from API requests. However, any non-pointer, 3355 // non-interface field appearing in ForceSendFields will be sent to the 3356 // server regardless of whether the field is empty or not. This may be 3357 // used to include empty fields in Patch requests. 3358 ForceSendFields []string `json:"-"` 3359 3360 // NullFields is a list of field names (e.g. "Id") to include in API 3361 // requests with the JSON null value. By default, fields with empty 3362 // values are omitted from API requests. However, any field with an 3363 // empty value appearing in NullFields will be sent to the server as 3364 // null. It is an error if a field in this list has a non-empty value. 3365 // This may be used to include null fields in Patch requests. 3366 NullFields []string `json:"-"` 3367} 3368 3369func (s *StoreCluster) MarshalJSON() ([]byte, error) { 3370 type NoMethod StoreCluster 3371 raw := NoMethod(*s) 3372 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3373} 3374 3375// StoreLayout: General setting for the managed Google Play store 3376// layout, currently only specifying the page to display the first time 3377// the store is opened. 3378type StoreLayout struct { 3379 // HomepageId: The ID of the store page to be used as the homepage. The 3380 // homepage is the first page shown in the managed Google Play 3381 // Store. 3382 // 3383 // Not specifying a homepage is equivalent to setting the store layout 3384 // type to "basic". 3385 HomepageId string `json:"homepageId,omitempty"` 3386 3387 Kind string `json:"kind,omitempty"` 3388 3389 // StoreLayoutType: The store layout type. By default, this value is set 3390 // to "basic" if the homepageId field is not set, and to "custom" 3391 // otherwise. If set to "basic", the layout will consist of all approved 3392 // apps that have been whitelisted for the user. 3393 StoreLayoutType string `json:"storeLayoutType,omitempty"` 3394 3395 // ServerResponse contains the HTTP response code and headers from the 3396 // server. 3397 googleapi.ServerResponse `json:"-"` 3398 3399 // ForceSendFields is a list of field names (e.g. "HomepageId") to 3400 // unconditionally include in API requests. By default, fields with 3401 // empty values are omitted from API requests. However, any non-pointer, 3402 // non-interface field appearing in ForceSendFields will be sent to the 3403 // server regardless of whether the field is empty or not. This may be 3404 // used to include empty fields in Patch requests. 3405 ForceSendFields []string `json:"-"` 3406 3407 // NullFields is a list of field names (e.g. "HomepageId") to include in 3408 // API requests with the JSON null value. By default, fields with empty 3409 // values are omitted from API requests. However, any field with an 3410 // empty value appearing in NullFields will be sent to the server as 3411 // null. It is an error if a field in this list has a non-empty value. 3412 // This may be used to include null fields in Patch requests. 3413 NullFields []string `json:"-"` 3414} 3415 3416func (s *StoreLayout) MarshalJSON() ([]byte, error) { 3417 type NoMethod StoreLayout 3418 raw := NoMethod(*s) 3419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3420} 3421 3422// StoreLayoutClustersListResponse: The store page resources for the 3423// enterprise. 3424type StoreLayoutClustersListResponse struct { 3425 // Cluster: A store cluster of an enterprise. 3426 Cluster []*StoreCluster `json:"cluster,omitempty"` 3427 3428 // Kind: Identifies what kind of resource this is. Value: the fixed 3429 // string "androidenterprise#storeLayoutClustersListResponse". 3430 Kind string `json:"kind,omitempty"` 3431 3432 // ServerResponse contains the HTTP response code and headers from the 3433 // server. 3434 googleapi.ServerResponse `json:"-"` 3435 3436 // ForceSendFields is a list of field names (e.g. "Cluster") to 3437 // unconditionally include in API requests. By default, fields with 3438 // empty values are omitted from API requests. However, any non-pointer, 3439 // non-interface field appearing in ForceSendFields will be sent to the 3440 // server regardless of whether the field is empty or not. This may be 3441 // used to include empty fields in Patch requests. 3442 ForceSendFields []string `json:"-"` 3443 3444 // NullFields is a list of field names (e.g. "Cluster") to include in 3445 // API requests with the JSON null value. By default, fields with empty 3446 // values are omitted from API requests. However, any field with an 3447 // empty value appearing in NullFields will be sent to the server as 3448 // null. It is an error if a field in this list has a non-empty value. 3449 // This may be used to include null fields in Patch requests. 3450 NullFields []string `json:"-"` 3451} 3452 3453func (s *StoreLayoutClustersListResponse) MarshalJSON() ([]byte, error) { 3454 type NoMethod StoreLayoutClustersListResponse 3455 raw := NoMethod(*s) 3456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3457} 3458 3459// StoreLayoutPagesListResponse: The store page resources for the 3460// enterprise. 3461type StoreLayoutPagesListResponse struct { 3462 // Kind: Identifies what kind of resource this is. Value: the fixed 3463 // string "androidenterprise#storeLayoutPagesListResponse". 3464 Kind string `json:"kind,omitempty"` 3465 3466 // Page: A store page of an enterprise. 3467 Page []*StorePage `json:"page,omitempty"` 3468 3469 // ServerResponse contains the HTTP response code and headers from the 3470 // server. 3471 googleapi.ServerResponse `json:"-"` 3472 3473 // ForceSendFields is a list of field names (e.g. "Kind") to 3474 // unconditionally include in API requests. By default, fields with 3475 // empty values are omitted from API requests. However, any non-pointer, 3476 // non-interface field appearing in ForceSendFields will be sent to the 3477 // server regardless of whether the field is empty or not. This may be 3478 // used to include empty fields in Patch requests. 3479 ForceSendFields []string `json:"-"` 3480 3481 // NullFields is a list of field names (e.g. "Kind") to include in API 3482 // requests with the JSON null value. By default, fields with empty 3483 // values are omitted from API requests. However, any field with an 3484 // empty value appearing in NullFields will be sent to the server as 3485 // null. It is an error if a field in this list has a non-empty value. 3486 // This may be used to include null fields in Patch requests. 3487 NullFields []string `json:"-"` 3488} 3489 3490func (s *StoreLayoutPagesListResponse) MarshalJSON() ([]byte, error) { 3491 type NoMethod StoreLayoutPagesListResponse 3492 raw := NoMethod(*s) 3493 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3494} 3495 3496// StorePage: Definition of a managed Google Play store page, made of a 3497// localized name and links to other pages. A page also contains 3498// clusters defined as a subcollection. 3499type StorePage struct { 3500 // Id: Unique ID of this page. Assigned by the server. Immutable once 3501 // assigned. 3502 Id string `json:"id,omitempty"` 3503 3504 Kind string `json:"kind,omitempty"` 3505 3506 // Link: Ordered list of pages a user should be able to reach from this 3507 // page. The list can't include this page. It is recommended that the 3508 // basic pages are created first, before adding the links between 3509 // pages. 3510 // 3511 // The API doesn't verify that the pages exist or the pages are 3512 // reachable. 3513 Link []string `json:"link,omitempty"` 3514 3515 // Name: Ordered list of localized strings giving the name of this page. 3516 // The text displayed is the one that best matches the user locale, or 3517 // the first entry if there is no good match. There needs to be at least 3518 // one entry. 3519 Name []*LocalizedText `json:"name,omitempty"` 3520 3521 // ServerResponse contains the HTTP response code and headers from the 3522 // server. 3523 googleapi.ServerResponse `json:"-"` 3524 3525 // ForceSendFields is a list of field names (e.g. "Id") to 3526 // unconditionally include in API requests. By default, fields with 3527 // empty values are omitted from API requests. However, any non-pointer, 3528 // non-interface field appearing in ForceSendFields will be sent to the 3529 // server regardless of whether the field is empty or not. This may be 3530 // used to include empty fields in Patch requests. 3531 ForceSendFields []string `json:"-"` 3532 3533 // NullFields is a list of field names (e.g. "Id") to include in API 3534 // requests with the JSON null value. By default, fields with empty 3535 // values are omitted from API requests. However, any field with an 3536 // empty value appearing in NullFields will be sent to the server as 3537 // null. It is an error if a field in this list has a non-empty value. 3538 // This may be used to include null fields in Patch requests. 3539 NullFields []string `json:"-"` 3540} 3541 3542func (s *StorePage) MarshalJSON() ([]byte, error) { 3543 type NoMethod StorePage 3544 raw := NoMethod(*s) 3545 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3546} 3547 3548type TokenPagination struct { 3549 NextPageToken string `json:"nextPageToken,omitempty"` 3550 3551 PreviousPageToken string `json:"previousPageToken,omitempty"` 3552 3553 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3554 // unconditionally include in API requests. By default, fields with 3555 // empty values are omitted from API requests. However, any non-pointer, 3556 // non-interface field appearing in ForceSendFields will be sent to the 3557 // server regardless of whether the field is empty or not. This may be 3558 // used to include empty fields in Patch requests. 3559 ForceSendFields []string `json:"-"` 3560 3561 // NullFields is a list of field names (e.g. "NextPageToken") to include 3562 // in API requests with the JSON null value. By default, fields with 3563 // empty values are omitted from API requests. However, any field with 3564 // an empty value appearing in NullFields will be sent to the server as 3565 // null. It is an error if a field in this list has a non-empty value. 3566 // This may be used to include null fields in Patch requests. 3567 NullFields []string `json:"-"` 3568} 3569 3570func (s *TokenPagination) MarshalJSON() ([]byte, error) { 3571 type NoMethod TokenPagination 3572 raw := NoMethod(*s) 3573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3574} 3575 3576// TrackInfo: Id to name association of a track. 3577type TrackInfo struct { 3578 // TrackAlias: A modifiable name for a track. This is the visible name 3579 // in the play developer console. 3580 TrackAlias string `json:"trackAlias,omitempty"` 3581 3582 // TrackId: Unmodifiable, unique track identifier. This identifier is 3583 // the releaseTrackId in the url of the play developer console page that 3584 // displays the track information. 3585 TrackId string `json:"trackId,omitempty"` 3586 3587 // ForceSendFields is a list of field names (e.g. "TrackAlias") to 3588 // unconditionally include in API requests. By default, fields with 3589 // empty values are omitted from API requests. However, any non-pointer, 3590 // non-interface field appearing in ForceSendFields will be sent to the 3591 // server regardless of whether the field is empty or not. This may be 3592 // used to include empty fields in Patch requests. 3593 ForceSendFields []string `json:"-"` 3594 3595 // NullFields is a list of field names (e.g. "TrackAlias") to include in 3596 // API requests with the JSON null value. By default, fields with empty 3597 // values are omitted from API requests. However, any field with an 3598 // empty value appearing in NullFields will be sent to the server as 3599 // null. It is an error if a field in this list has a non-empty value. 3600 // This may be used to include null fields in Patch requests. 3601 NullFields []string `json:"-"` 3602} 3603 3604func (s *TrackInfo) MarshalJSON() ([]byte, error) { 3605 type NoMethod TrackInfo 3606 raw := NoMethod(*s) 3607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3608} 3609 3610// User: A Users resource represents an account associated with an 3611// enterprise. The account may be specific to a device or to an 3612// individual user (who can then use the account across multiple 3613// devices). The account may provide access to managed Google Play only, 3614// or to other Google services, depending on the identity model: 3615// - The Google managed domain identity model requires synchronization 3616// to Google account sources (via primaryEmail). 3617// - The managed Google Play Accounts identity model provides a dynamic 3618// means for enterprises to create user or device accounts as needed. 3619// These accounts provide access to managed Google Play. 3620type User struct { 3621 // AccountIdentifier: A unique identifier you create for this user, such 3622 // as "user342" or "asset#44418". Do not use personally identifiable 3623 // information (PII) for this property. Must always be set for 3624 // EMM-managed users. Not set for Google-managed users. 3625 AccountIdentifier string `json:"accountIdentifier,omitempty"` 3626 3627 // AccountType: The type of account that this user represents. A 3628 // userAccount can be installed on multiple devices, but a deviceAccount 3629 // is specific to a single device. An EMM-managed user (emmManaged) can 3630 // be either type (userAccount, deviceAccount), but a Google-managed 3631 // user (googleManaged) is always a userAccount. 3632 AccountType string `json:"accountType,omitempty"` 3633 3634 // DisplayName: The name that will appear in user interfaces. Setting 3635 // this property is optional when creating EMM-managed users. If you do 3636 // set this property, use something generic about the organization (such 3637 // as "Example, Inc.") or your name (as EMM). Not used for 3638 // Google-managed user accounts. 3639 DisplayName string `json:"displayName,omitempty"` 3640 3641 // Id: The unique ID for the user. 3642 Id string `json:"id,omitempty"` 3643 3644 Kind string `json:"kind,omitempty"` 3645 3646 // ManagementType: The entity that manages the user. With googleManaged 3647 // users, the source of truth is Google so EMMs have to make sure a 3648 // Google Account exists for the user. With emmManaged users, the EMM is 3649 // in charge. 3650 ManagementType string `json:"managementType,omitempty"` 3651 3652 // PrimaryEmail: The user's primary email address, for example, 3653 // "jsmith@example.com". Will always be set for Google managed users and 3654 // not set for EMM managed users. 3655 PrimaryEmail string `json:"primaryEmail,omitempty"` 3656 3657 // ServerResponse contains the HTTP response code and headers from the 3658 // server. 3659 googleapi.ServerResponse `json:"-"` 3660 3661 // ForceSendFields is a list of field names (e.g. "AccountIdentifier") 3662 // to unconditionally include in API requests. By default, fields with 3663 // empty values are omitted from API requests. However, any non-pointer, 3664 // non-interface field appearing in ForceSendFields will be sent to the 3665 // server regardless of whether the field is empty or not. This may be 3666 // used to include empty fields in Patch requests. 3667 ForceSendFields []string `json:"-"` 3668 3669 // NullFields is a list of field names (e.g. "AccountIdentifier") to 3670 // include in API requests with the JSON null value. By default, fields 3671 // with empty values are omitted from API requests. However, any field 3672 // with an empty value appearing in NullFields will be sent to the 3673 // server as null. It is an error if a field in this list has a 3674 // non-empty value. This may be used to include null fields in Patch 3675 // requests. 3676 NullFields []string `json:"-"` 3677} 3678 3679func (s *User) MarshalJSON() ([]byte, error) { 3680 type NoMethod User 3681 raw := NoMethod(*s) 3682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3683} 3684 3685// UserToken: A UserToken is used by a user when setting up a managed 3686// device or profile with their managed Google Play account on a device. 3687// When the user enters their email address and token (activation code) 3688// the appropriate EMM app can be automatically downloaded. 3689type UserToken struct { 3690 Kind string `json:"kind,omitempty"` 3691 3692 // Token: The token (activation code) to be entered by the user. This 3693 // consists of a sequence of decimal digits. Note that the leading digit 3694 // may be 0. 3695 Token string `json:"token,omitempty"` 3696 3697 // UserId: The unique ID for the user. 3698 UserId string `json:"userId,omitempty"` 3699 3700 // ServerResponse contains the HTTP response code and headers from the 3701 // server. 3702 googleapi.ServerResponse `json:"-"` 3703 3704 // ForceSendFields is a list of field names (e.g. "Kind") to 3705 // unconditionally include in API requests. By default, fields with 3706 // empty values are omitted from API requests. However, any non-pointer, 3707 // non-interface field appearing in ForceSendFields will be sent to the 3708 // server regardless of whether the field is empty or not. This may be 3709 // used to include empty fields in Patch requests. 3710 ForceSendFields []string `json:"-"` 3711 3712 // NullFields is a list of field names (e.g. "Kind") to include in API 3713 // requests with the JSON null value. By default, fields with empty 3714 // values are omitted from API requests. However, any field with an 3715 // empty value appearing in NullFields will be sent to the server as 3716 // null. It is an error if a field in this list has a non-empty value. 3717 // This may be used to include null fields in Patch requests. 3718 NullFields []string `json:"-"` 3719} 3720 3721func (s *UserToken) MarshalJSON() ([]byte, error) { 3722 type NoMethod UserToken 3723 raw := NoMethod(*s) 3724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3725} 3726 3727// UsersListResponse: The matching user resources. 3728type UsersListResponse struct { 3729 // Kind: Identifies what kind of resource this is. Value: the fixed 3730 // string "androidenterprise#usersListResponse". 3731 Kind string `json:"kind,omitempty"` 3732 3733 // User: A user of an enterprise. 3734 User []*User `json:"user,omitempty"` 3735 3736 // ServerResponse contains the HTTP response code and headers from the 3737 // server. 3738 googleapi.ServerResponse `json:"-"` 3739 3740 // ForceSendFields is a list of field names (e.g. "Kind") to 3741 // unconditionally include in API requests. By default, fields with 3742 // empty values are omitted from API requests. However, any non-pointer, 3743 // non-interface field appearing in ForceSendFields will be sent to the 3744 // server regardless of whether the field is empty or not. This may be 3745 // used to include empty fields in Patch requests. 3746 ForceSendFields []string `json:"-"` 3747 3748 // NullFields is a list of field names (e.g. "Kind") to include in API 3749 // requests with the JSON null value. By default, fields with empty 3750 // values are omitted from API requests. However, any field with an 3751 // empty value appearing in NullFields will be sent to the server as 3752 // null. It is an error if a field in this list has a non-empty value. 3753 // This may be used to include null fields in Patch requests. 3754 NullFields []string `json:"-"` 3755} 3756 3757func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 3758 type NoMethod UsersListResponse 3759 raw := NoMethod(*s) 3760 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3761} 3762 3763// VariableSet: A variable set is a key-value pair of EMM-provided 3764// placeholders and its corresponding value, which is attributed to a 3765// user. For example, $FIRSTNAME could be a placeholder, and its value 3766// could be Alice. Placeholders should start with a '$' sign and should 3767// be alphanumeric only. 3768type VariableSet struct { 3769 Kind string `json:"kind,omitempty"` 3770 3771 // Placeholder: The placeholder string; defined by EMM. 3772 Placeholder string `json:"placeholder,omitempty"` 3773 3774 // UserValue: The value of the placeholder, specific to the user. 3775 UserValue string `json:"userValue,omitempty"` 3776 3777 // ForceSendFields is a list of field names (e.g. "Kind") to 3778 // unconditionally include in API requests. By default, fields with 3779 // empty values are omitted from API requests. However, any non-pointer, 3780 // non-interface field appearing in ForceSendFields will be sent to the 3781 // server regardless of whether the field is empty or not. This may be 3782 // used to include empty fields in Patch requests. 3783 ForceSendFields []string `json:"-"` 3784 3785 // NullFields is a list of field names (e.g. "Kind") to include in API 3786 // requests with the JSON null value. By default, fields with empty 3787 // values are omitted from API requests. However, any field with an 3788 // empty value appearing in NullFields will be sent to the server as 3789 // null. It is an error if a field in this list has a non-empty value. 3790 // This may be used to include null fields in Patch requests. 3791 NullFields []string `json:"-"` 3792} 3793 3794func (s *VariableSet) MarshalJSON() ([]byte, error) { 3795 type NoMethod VariableSet 3796 raw := NoMethod(*s) 3797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3798} 3799 3800// WebApp: A WebApps resource represents a web app created for an 3801// enterprise. Web apps are published to managed Google Play and can be 3802// distributed like other Android apps. On a user's device, a web app 3803// opens its specified URL. 3804type WebApp struct { 3805 // DisplayMode: The display mode of the web app. 3806 // 3807 // Possible values include: 3808 // - "minimalUi", the device's status bar, navigation bar, the app's 3809 // URL, and a refresh button are visible when the app is open. For HTTP 3810 // URLs, you can only select this option. 3811 // - "standalone", the device's status bar and navigation bar are 3812 // visible when the app is open. 3813 // - "fullScreen", the app opens in full screen mode, hiding the 3814 // device's status and navigation bars. All browser UI elements, page 3815 // URL, system status bar and back button are not visible, and the web 3816 // app takes up the entirety of the available display area. 3817 DisplayMode string `json:"displayMode,omitempty"` 3818 3819 // Icons: A list of icons representing this website. If absent, a 3820 // default icon (for create) or the current icon (for update) will be 3821 // used. 3822 Icons []*WebAppIcon `json:"icons,omitempty"` 3823 3824 // IsPublished: A flag whether the app has been published to the Play 3825 // store yet. 3826 IsPublished bool `json:"isPublished,omitempty"` 3827 3828 // StartUrl: The start URL, i.e. the URL that should load when the user 3829 // opens the application. 3830 StartUrl string `json:"startUrl,omitempty"` 3831 3832 // Title: The title of the web app as displayed to the user (e.g., 3833 // amongst a list of other applications, or as a label for an icon). 3834 Title string `json:"title,omitempty"` 3835 3836 // VersionCode: The current version of the app. 3837 // 3838 // 3839 // Note that the version can automatically increase during the lifetime 3840 // of the web app, while Google does internal housekeeping to keep the 3841 // web app up-to-date. 3842 VersionCode int64 `json:"versionCode,omitempty,string"` 3843 3844 // WebAppId: The ID of the application. A string of the form 3845 // "app:<package name>" where the package name always starts with the 3846 // prefix "com.google.enterprise.webapp." followed by a random id. 3847 WebAppId string `json:"webAppId,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. "DisplayMode") to 3854 // 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. "DisplayMode") to include 3862 // in API requests with the JSON null value. By default, fields with 3863 // empty values are omitted from API requests. However, any field with 3864 // an empty value appearing in NullFields will be sent to the server as 3865 // null. It is an error if a field in this list has a non-empty value. 3866 // This may be used to include null fields in Patch requests. 3867 NullFields []string `json:"-"` 3868} 3869 3870func (s *WebApp) MarshalJSON() ([]byte, error) { 3871 type NoMethod WebApp 3872 raw := NoMethod(*s) 3873 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3874} 3875 3876// WebAppIcon: Icon for a web app. 3877type WebAppIcon struct { 3878 // ImageData: The actual bytes of the image in a base64url encoded 3879 // string (c.f. RFC4648, section 5 "Base 64 Encoding with URL and 3880 // Filename Safe Alphabet"). 3881 // - The image type can be png or jpg. 3882 // - The image should ideally be square. 3883 // - The image should ideally have a size of 512x512. 3884 ImageData string `json:"imageData,omitempty"` 3885 3886 // ForceSendFields is a list of field names (e.g. "ImageData") to 3887 // unconditionally include in API requests. By default, fields with 3888 // empty values are omitted from API requests. However, any non-pointer, 3889 // non-interface field appearing in ForceSendFields will be sent to the 3890 // server regardless of whether the field is empty or not. This may be 3891 // used to include empty fields in Patch requests. 3892 ForceSendFields []string `json:"-"` 3893 3894 // NullFields is a list of field names (e.g. "ImageData") to include in 3895 // API requests with the JSON null value. By default, fields with empty 3896 // values are omitted from API requests. However, any field with an 3897 // empty value appearing in NullFields will be sent to the server as 3898 // null. It is an error if a field in this list has a non-empty value. 3899 // This may be used to include null fields in Patch requests. 3900 NullFields []string `json:"-"` 3901} 3902 3903func (s *WebAppIcon) MarshalJSON() ([]byte, error) { 3904 type NoMethod WebAppIcon 3905 raw := NoMethod(*s) 3906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3907} 3908 3909// WebAppsListResponse: The web app details for an enterprise. 3910type WebAppsListResponse struct { 3911 // Kind: Identifies what kind of resource this is. Value: the fixed 3912 // string "androidenterprise#webAppsListResponse". 3913 Kind string `json:"kind,omitempty"` 3914 3915 // WebApp: The manifest describing a web app. 3916 WebApp []*WebApp `json:"webApp,omitempty"` 3917 3918 // ServerResponse contains the HTTP response code and headers from the 3919 // server. 3920 googleapi.ServerResponse `json:"-"` 3921 3922 // ForceSendFields is a list of field names (e.g. "Kind") to 3923 // unconditionally include in API requests. By default, fields with 3924 // empty values are omitted from API requests. However, any non-pointer, 3925 // non-interface field appearing in ForceSendFields will be sent to the 3926 // server regardless of whether the field is empty or not. This may be 3927 // used to include empty fields in Patch requests. 3928 ForceSendFields []string `json:"-"` 3929 3930 // NullFields is a list of field names (e.g. "Kind") to include in API 3931 // requests with the JSON null value. By default, fields with empty 3932 // values are omitted from API requests. However, any field with an 3933 // empty value appearing in NullFields will be sent to the server as 3934 // null. It is an error if a field in this list has a non-empty value. 3935 // This may be used to include null fields in Patch requests. 3936 NullFields []string `json:"-"` 3937} 3938 3939func (s *WebAppsListResponse) MarshalJSON() ([]byte, error) { 3940 type NoMethod WebAppsListResponse 3941 raw := NoMethod(*s) 3942 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3943} 3944 3945// method id "androidenterprise.devices.forceReportUpload": 3946 3947type DevicesForceReportUploadCall struct { 3948 s *Service 3949 enterpriseId string 3950 userId string 3951 deviceId string 3952 urlParams_ gensupport.URLParams 3953 ctx_ context.Context 3954 header_ http.Header 3955} 3956 3957// ForceReportUpload: Uploads a report containing any changes in app 3958// states on the device since the last report was generated. You can 3959// call this method up to 3 times every 24 hours for a given device. 3960func (r *DevicesService) ForceReportUpload(enterpriseId string, userId string, deviceId string) *DevicesForceReportUploadCall { 3961 c := &DevicesForceReportUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3962 c.enterpriseId = enterpriseId 3963 c.userId = userId 3964 c.deviceId = deviceId 3965 return c 3966} 3967 3968// Fields allows partial responses to be retrieved. See 3969// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3970// for more information. 3971func (c *DevicesForceReportUploadCall) Fields(s ...googleapi.Field) *DevicesForceReportUploadCall { 3972 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3973 return c 3974} 3975 3976// Context sets the context to be used in this call's Do method. Any 3977// pending HTTP request will be aborted if the provided context is 3978// canceled. 3979func (c *DevicesForceReportUploadCall) Context(ctx context.Context) *DevicesForceReportUploadCall { 3980 c.ctx_ = ctx 3981 return c 3982} 3983 3984// Header returns an http.Header that can be modified by the caller to 3985// add HTTP headers to the request. 3986func (c *DevicesForceReportUploadCall) Header() http.Header { 3987 if c.header_ == nil { 3988 c.header_ = make(http.Header) 3989 } 3990 return c.header_ 3991} 3992 3993func (c *DevicesForceReportUploadCall) doRequest(alt string) (*http.Response, error) { 3994 reqHeaders := make(http.Header) 3995 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 3996 for k, v := range c.header_ { 3997 reqHeaders[k] = v 3998 } 3999 reqHeaders.Set("User-Agent", c.s.userAgent()) 4000 var body io.Reader = nil 4001 c.urlParams_.Set("alt", alt) 4002 c.urlParams_.Set("prettyPrint", "false") 4003 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload") 4004 urls += "?" + c.urlParams_.Encode() 4005 req, err := http.NewRequest("POST", urls, body) 4006 if err != nil { 4007 return nil, err 4008 } 4009 req.Header = reqHeaders 4010 googleapi.Expand(req.URL, map[string]string{ 4011 "enterpriseId": c.enterpriseId, 4012 "userId": c.userId, 4013 "deviceId": c.deviceId, 4014 }) 4015 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4016} 4017 4018// Do executes the "androidenterprise.devices.forceReportUpload" call. 4019func (c *DevicesForceReportUploadCall) Do(opts ...googleapi.CallOption) error { 4020 gensupport.SetOptions(c.urlParams_, opts...) 4021 res, err := c.doRequest("json") 4022 if err != nil { 4023 return err 4024 } 4025 defer googleapi.CloseBody(res) 4026 if err := googleapi.CheckResponse(res); err != nil { 4027 return err 4028 } 4029 return nil 4030 // { 4031 // "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.", 4032 // "httpMethod": "POST", 4033 // "id": "androidenterprise.devices.forceReportUpload", 4034 // "parameterOrder": [ 4035 // "enterpriseId", 4036 // "userId", 4037 // "deviceId" 4038 // ], 4039 // "parameters": { 4040 // "deviceId": { 4041 // "description": "The ID of the device.", 4042 // "location": "path", 4043 // "required": true, 4044 // "type": "string" 4045 // }, 4046 // "enterpriseId": { 4047 // "description": "The ID of the enterprise.", 4048 // "location": "path", 4049 // "required": true, 4050 // "type": "string" 4051 // }, 4052 // "userId": { 4053 // "description": "The ID of the user.", 4054 // "location": "path", 4055 // "required": true, 4056 // "type": "string" 4057 // } 4058 // }, 4059 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/forceReportUpload", 4060 // "scopes": [ 4061 // "https://www.googleapis.com/auth/androidenterprise" 4062 // ] 4063 // } 4064 4065} 4066 4067// method id "androidenterprise.devices.get": 4068 4069type DevicesGetCall struct { 4070 s *Service 4071 enterpriseId string 4072 userId string 4073 deviceId string 4074 urlParams_ gensupport.URLParams 4075 ifNoneMatch_ string 4076 ctx_ context.Context 4077 header_ http.Header 4078} 4079 4080// Get: Retrieves the details of a device. 4081func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall { 4082 c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4083 c.enterpriseId = enterpriseId 4084 c.userId = userId 4085 c.deviceId = deviceId 4086 return c 4087} 4088 4089// Fields allows partial responses to be retrieved. See 4090// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4091// for more information. 4092func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall { 4093 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4094 return c 4095} 4096 4097// IfNoneMatch sets the optional parameter which makes the operation 4098// fail if the object's ETag matches the given value. This is useful for 4099// getting updates only after the object has changed since the last 4100// request. Use googleapi.IsNotModified to check whether the response 4101// error from Do is the result of In-None-Match. 4102func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall { 4103 c.ifNoneMatch_ = entityTag 4104 return c 4105} 4106 4107// Context sets the context to be used in this call's Do method. Any 4108// pending HTTP request will be aborted if the provided context is 4109// canceled. 4110func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall { 4111 c.ctx_ = ctx 4112 return c 4113} 4114 4115// Header returns an http.Header that can be modified by the caller to 4116// add HTTP headers to the request. 4117func (c *DevicesGetCall) Header() http.Header { 4118 if c.header_ == nil { 4119 c.header_ = make(http.Header) 4120 } 4121 return c.header_ 4122} 4123 4124func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { 4125 reqHeaders := make(http.Header) 4126 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4127 for k, v := range c.header_ { 4128 reqHeaders[k] = v 4129 } 4130 reqHeaders.Set("User-Agent", c.s.userAgent()) 4131 if c.ifNoneMatch_ != "" { 4132 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4133 } 4134 var body io.Reader = nil 4135 c.urlParams_.Set("alt", alt) 4136 c.urlParams_.Set("prettyPrint", "false") 4137 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") 4138 urls += "?" + c.urlParams_.Encode() 4139 req, err := http.NewRequest("GET", urls, body) 4140 if err != nil { 4141 return nil, err 4142 } 4143 req.Header = reqHeaders 4144 googleapi.Expand(req.URL, map[string]string{ 4145 "enterpriseId": c.enterpriseId, 4146 "userId": c.userId, 4147 "deviceId": c.deviceId, 4148 }) 4149 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4150} 4151 4152// Do executes the "androidenterprise.devices.get" call. 4153// Exactly one of *Device or error will be non-nil. Any non-2xx status 4154// code is an error. Response headers are in either 4155// *Device.ServerResponse.Header or (if a response was returned at all) 4156// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4157// check whether the returned error was because http.StatusNotModified 4158// was returned. 4159func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4160 gensupport.SetOptions(c.urlParams_, opts...) 4161 res, err := c.doRequest("json") 4162 if res != nil && res.StatusCode == http.StatusNotModified { 4163 if res.Body != nil { 4164 res.Body.Close() 4165 } 4166 return nil, &googleapi.Error{ 4167 Code: res.StatusCode, 4168 Header: res.Header, 4169 } 4170 } 4171 if err != nil { 4172 return nil, err 4173 } 4174 defer googleapi.CloseBody(res) 4175 if err := googleapi.CheckResponse(res); err != nil { 4176 return nil, err 4177 } 4178 ret := &Device{ 4179 ServerResponse: googleapi.ServerResponse{ 4180 Header: res.Header, 4181 HTTPStatusCode: res.StatusCode, 4182 }, 4183 } 4184 target := &ret 4185 if err := gensupport.DecodeResponse(target, res); err != nil { 4186 return nil, err 4187 } 4188 return ret, nil 4189 // { 4190 // "description": "Retrieves the details of a device.", 4191 // "httpMethod": "GET", 4192 // "id": "androidenterprise.devices.get", 4193 // "parameterOrder": [ 4194 // "enterpriseId", 4195 // "userId", 4196 // "deviceId" 4197 // ], 4198 // "parameters": { 4199 // "deviceId": { 4200 // "description": "The ID of the device.", 4201 // "location": "path", 4202 // "required": true, 4203 // "type": "string" 4204 // }, 4205 // "enterpriseId": { 4206 // "description": "The ID of the enterprise.", 4207 // "location": "path", 4208 // "required": true, 4209 // "type": "string" 4210 // }, 4211 // "userId": { 4212 // "description": "The ID of the user.", 4213 // "location": "path", 4214 // "required": true, 4215 // "type": "string" 4216 // } 4217 // }, 4218 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 4219 // "response": { 4220 // "$ref": "Device" 4221 // }, 4222 // "scopes": [ 4223 // "https://www.googleapis.com/auth/androidenterprise" 4224 // ] 4225 // } 4226 4227} 4228 4229// method id "androidenterprise.devices.getState": 4230 4231type DevicesGetStateCall struct { 4232 s *Service 4233 enterpriseId string 4234 userId string 4235 deviceId string 4236 urlParams_ gensupport.URLParams 4237 ifNoneMatch_ string 4238 ctx_ context.Context 4239 header_ http.Header 4240} 4241 4242// GetState: Retrieves whether a device's access to Google services is 4243// enabled or disabled. The device state takes effect only if enforcing 4244// EMM policies on Android devices is enabled in the Google Admin 4245// Console. Otherwise, the device state is ignored and all devices are 4246// allowed access to Google services. This is only supported for 4247// Google-managed users. 4248func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall { 4249 c := &DevicesGetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4250 c.enterpriseId = enterpriseId 4251 c.userId = userId 4252 c.deviceId = deviceId 4253 return c 4254} 4255 4256// Fields allows partial responses to be retrieved. See 4257// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4258// for more information. 4259func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall { 4260 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4261 return c 4262} 4263 4264// IfNoneMatch sets the optional parameter which makes the operation 4265// fail if the object's ETag matches the given value. This is useful for 4266// getting updates only after the object has changed since the last 4267// request. Use googleapi.IsNotModified to check whether the response 4268// error from Do is the result of In-None-Match. 4269func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall { 4270 c.ifNoneMatch_ = entityTag 4271 return c 4272} 4273 4274// Context sets the context to be used in this call's Do method. Any 4275// pending HTTP request will be aborted if the provided context is 4276// canceled. 4277func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall { 4278 c.ctx_ = ctx 4279 return c 4280} 4281 4282// Header returns an http.Header that can be modified by the caller to 4283// add HTTP headers to the request. 4284func (c *DevicesGetStateCall) Header() http.Header { 4285 if c.header_ == nil { 4286 c.header_ = make(http.Header) 4287 } 4288 return c.header_ 4289} 4290 4291func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) { 4292 reqHeaders := make(http.Header) 4293 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4294 for k, v := range c.header_ { 4295 reqHeaders[k] = v 4296 } 4297 reqHeaders.Set("User-Agent", c.s.userAgent()) 4298 if c.ifNoneMatch_ != "" { 4299 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4300 } 4301 var body io.Reader = nil 4302 c.urlParams_.Set("alt", alt) 4303 c.urlParams_.Set("prettyPrint", "false") 4304 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") 4305 urls += "?" + c.urlParams_.Encode() 4306 req, err := http.NewRequest("GET", urls, body) 4307 if err != nil { 4308 return nil, err 4309 } 4310 req.Header = reqHeaders 4311 googleapi.Expand(req.URL, map[string]string{ 4312 "enterpriseId": c.enterpriseId, 4313 "userId": c.userId, 4314 "deviceId": c.deviceId, 4315 }) 4316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4317} 4318 4319// Do executes the "androidenterprise.devices.getState" call. 4320// Exactly one of *DeviceState or error will be non-nil. Any non-2xx 4321// status code is an error. Response headers are in either 4322// *DeviceState.ServerResponse.Header or (if a response was returned at 4323// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4324// to check whether the returned error was because 4325// http.StatusNotModified was returned. 4326func (c *DevicesGetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) { 4327 gensupport.SetOptions(c.urlParams_, opts...) 4328 res, err := c.doRequest("json") 4329 if res != nil && res.StatusCode == http.StatusNotModified { 4330 if res.Body != nil { 4331 res.Body.Close() 4332 } 4333 return nil, &googleapi.Error{ 4334 Code: res.StatusCode, 4335 Header: res.Header, 4336 } 4337 } 4338 if err != nil { 4339 return nil, err 4340 } 4341 defer googleapi.CloseBody(res) 4342 if err := googleapi.CheckResponse(res); err != nil { 4343 return nil, err 4344 } 4345 ret := &DeviceState{ 4346 ServerResponse: googleapi.ServerResponse{ 4347 Header: res.Header, 4348 HTTPStatusCode: res.StatusCode, 4349 }, 4350 } 4351 target := &ret 4352 if err := gensupport.DecodeResponse(target, res); err != nil { 4353 return nil, err 4354 } 4355 return ret, nil 4356 // { 4357 // "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.", 4358 // "httpMethod": "GET", 4359 // "id": "androidenterprise.devices.getState", 4360 // "parameterOrder": [ 4361 // "enterpriseId", 4362 // "userId", 4363 // "deviceId" 4364 // ], 4365 // "parameters": { 4366 // "deviceId": { 4367 // "description": "The ID of the device.", 4368 // "location": "path", 4369 // "required": true, 4370 // "type": "string" 4371 // }, 4372 // "enterpriseId": { 4373 // "description": "The ID of the enterprise.", 4374 // "location": "path", 4375 // "required": true, 4376 // "type": "string" 4377 // }, 4378 // "userId": { 4379 // "description": "The ID of the user.", 4380 // "location": "path", 4381 // "required": true, 4382 // "type": "string" 4383 // } 4384 // }, 4385 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4386 // "response": { 4387 // "$ref": "DeviceState" 4388 // }, 4389 // "scopes": [ 4390 // "https://www.googleapis.com/auth/androidenterprise" 4391 // ] 4392 // } 4393 4394} 4395 4396// method id "androidenterprise.devices.list": 4397 4398type DevicesListCall struct { 4399 s *Service 4400 enterpriseId string 4401 userId string 4402 urlParams_ gensupport.URLParams 4403 ifNoneMatch_ string 4404 ctx_ context.Context 4405 header_ http.Header 4406} 4407 4408// List: Retrieves the IDs of all of a user's devices. 4409func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall { 4410 c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4411 c.enterpriseId = enterpriseId 4412 c.userId = userId 4413 return c 4414} 4415 4416// Fields allows partial responses to be retrieved. See 4417// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4418// for more information. 4419func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall { 4420 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4421 return c 4422} 4423 4424// IfNoneMatch sets the optional parameter which makes the operation 4425// fail if the object's ETag matches the given value. This is useful for 4426// getting updates only after the object has changed since the last 4427// request. Use googleapi.IsNotModified to check whether the response 4428// error from Do is the result of In-None-Match. 4429func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall { 4430 c.ifNoneMatch_ = entityTag 4431 return c 4432} 4433 4434// Context sets the context to be used in this call's Do method. Any 4435// pending HTTP request will be aborted if the provided context is 4436// canceled. 4437func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall { 4438 c.ctx_ = ctx 4439 return c 4440} 4441 4442// Header returns an http.Header that can be modified by the caller to 4443// add HTTP headers to the request. 4444func (c *DevicesListCall) Header() http.Header { 4445 if c.header_ == nil { 4446 c.header_ = make(http.Header) 4447 } 4448 return c.header_ 4449} 4450 4451func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { 4452 reqHeaders := make(http.Header) 4453 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4454 for k, v := range c.header_ { 4455 reqHeaders[k] = v 4456 } 4457 reqHeaders.Set("User-Agent", c.s.userAgent()) 4458 if c.ifNoneMatch_ != "" { 4459 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4460 } 4461 var body io.Reader = nil 4462 c.urlParams_.Set("alt", alt) 4463 c.urlParams_.Set("prettyPrint", "false") 4464 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices") 4465 urls += "?" + c.urlParams_.Encode() 4466 req, err := http.NewRequest("GET", urls, body) 4467 if err != nil { 4468 return nil, err 4469 } 4470 req.Header = reqHeaders 4471 googleapi.Expand(req.URL, map[string]string{ 4472 "enterpriseId": c.enterpriseId, 4473 "userId": c.userId, 4474 }) 4475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4476} 4477 4478// Do executes the "androidenterprise.devices.list" call. 4479// Exactly one of *DevicesListResponse or error will be non-nil. Any 4480// non-2xx status code is an error. Response headers are in either 4481// *DevicesListResponse.ServerResponse.Header or (if a response was 4482// returned at all) in error.(*googleapi.Error).Header. Use 4483// googleapi.IsNotModified to check whether the returned error was 4484// because http.StatusNotModified was returned. 4485func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*DevicesListResponse, 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 := &DevicesListResponse{ 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 the IDs of all of a user's devices.", 4517 // "httpMethod": "GET", 4518 // "id": "androidenterprise.devices.list", 4519 // "parameterOrder": [ 4520 // "enterpriseId", 4521 // "userId" 4522 // ], 4523 // "parameters": { 4524 // "enterpriseId": { 4525 // "description": "The ID of the enterprise.", 4526 // "location": "path", 4527 // "required": true, 4528 // "type": "string" 4529 // }, 4530 // "userId": { 4531 // "description": "The ID of the user.", 4532 // "location": "path", 4533 // "required": true, 4534 // "type": "string" 4535 // } 4536 // }, 4537 // "path": "enterprises/{enterpriseId}/users/{userId}/devices", 4538 // "response": { 4539 // "$ref": "DevicesListResponse" 4540 // }, 4541 // "scopes": [ 4542 // "https://www.googleapis.com/auth/androidenterprise" 4543 // ] 4544 // } 4545 4546} 4547 4548// method id "androidenterprise.devices.setState": 4549 4550type DevicesSetStateCall struct { 4551 s *Service 4552 enterpriseId string 4553 userId string 4554 deviceId string 4555 devicestate *DeviceState 4556 urlParams_ gensupport.URLParams 4557 ctx_ context.Context 4558 header_ http.Header 4559} 4560 4561// SetState: Sets whether a device's access to Google services is 4562// enabled or disabled. The device state takes effect only if enforcing 4563// EMM policies on Android devices is enabled in the Google Admin 4564// Console. Otherwise, the device state is ignored and all devices are 4565// allowed access to Google services. This is only supported for 4566// Google-managed users. 4567func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall { 4568 c := &DevicesSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4569 c.enterpriseId = enterpriseId 4570 c.userId = userId 4571 c.deviceId = deviceId 4572 c.devicestate = devicestate 4573 return c 4574} 4575 4576// Fields allows partial responses to be retrieved. See 4577// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4578// for more information. 4579func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall { 4580 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4581 return c 4582} 4583 4584// Context sets the context to be used in this call's Do method. Any 4585// pending HTTP request will be aborted if the provided context is 4586// canceled. 4587func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall { 4588 c.ctx_ = ctx 4589 return c 4590} 4591 4592// Header returns an http.Header that can be modified by the caller to 4593// add HTTP headers to the request. 4594func (c *DevicesSetStateCall) Header() http.Header { 4595 if c.header_ == nil { 4596 c.header_ = make(http.Header) 4597 } 4598 return c.header_ 4599} 4600 4601func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) { 4602 reqHeaders := make(http.Header) 4603 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4604 for k, v := range c.header_ { 4605 reqHeaders[k] = v 4606 } 4607 reqHeaders.Set("User-Agent", c.s.userAgent()) 4608 var body io.Reader = nil 4609 body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate) 4610 if err != nil { 4611 return nil, err 4612 } 4613 reqHeaders.Set("Content-Type", "application/json") 4614 c.urlParams_.Set("alt", alt) 4615 c.urlParams_.Set("prettyPrint", "false") 4616 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") 4617 urls += "?" + c.urlParams_.Encode() 4618 req, err := http.NewRequest("PUT", urls, body) 4619 if err != nil { 4620 return nil, err 4621 } 4622 req.Header = reqHeaders 4623 googleapi.Expand(req.URL, map[string]string{ 4624 "enterpriseId": c.enterpriseId, 4625 "userId": c.userId, 4626 "deviceId": c.deviceId, 4627 }) 4628 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4629} 4630 4631// Do executes the "androidenterprise.devices.setState" call. 4632// Exactly one of *DeviceState or error will be non-nil. Any non-2xx 4633// status code is an error. Response headers are in either 4634// *DeviceState.ServerResponse.Header or (if a response was returned at 4635// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4636// to check whether the returned error was because 4637// http.StatusNotModified was returned. 4638func (c *DevicesSetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) { 4639 gensupport.SetOptions(c.urlParams_, opts...) 4640 res, err := c.doRequest("json") 4641 if res != nil && res.StatusCode == http.StatusNotModified { 4642 if res.Body != nil { 4643 res.Body.Close() 4644 } 4645 return nil, &googleapi.Error{ 4646 Code: res.StatusCode, 4647 Header: res.Header, 4648 } 4649 } 4650 if err != nil { 4651 return nil, err 4652 } 4653 defer googleapi.CloseBody(res) 4654 if err := googleapi.CheckResponse(res); err != nil { 4655 return nil, err 4656 } 4657 ret := &DeviceState{ 4658 ServerResponse: googleapi.ServerResponse{ 4659 Header: res.Header, 4660 HTTPStatusCode: res.StatusCode, 4661 }, 4662 } 4663 target := &ret 4664 if err := gensupport.DecodeResponse(target, res); err != nil { 4665 return nil, err 4666 } 4667 return ret, nil 4668 // { 4669 // "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.", 4670 // "httpMethod": "PUT", 4671 // "id": "androidenterprise.devices.setState", 4672 // "parameterOrder": [ 4673 // "enterpriseId", 4674 // "userId", 4675 // "deviceId" 4676 // ], 4677 // "parameters": { 4678 // "deviceId": { 4679 // "description": "The ID of the device.", 4680 // "location": "path", 4681 // "required": true, 4682 // "type": "string" 4683 // }, 4684 // "enterpriseId": { 4685 // "description": "The ID of the enterprise.", 4686 // "location": "path", 4687 // "required": true, 4688 // "type": "string" 4689 // }, 4690 // "userId": { 4691 // "description": "The ID of the user.", 4692 // "location": "path", 4693 // "required": true, 4694 // "type": "string" 4695 // } 4696 // }, 4697 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", 4698 // "request": { 4699 // "$ref": "DeviceState" 4700 // }, 4701 // "response": { 4702 // "$ref": "DeviceState" 4703 // }, 4704 // "scopes": [ 4705 // "https://www.googleapis.com/auth/androidenterprise" 4706 // ] 4707 // } 4708 4709} 4710 4711// method id "androidenterprise.devices.update": 4712 4713type DevicesUpdateCall struct { 4714 s *Service 4715 enterpriseId string 4716 userId string 4717 deviceId string 4718 device *Device 4719 urlParams_ gensupport.URLParams 4720 ctx_ context.Context 4721 header_ http.Header 4722} 4723 4724// Update: Updates the device policy 4725func (r *DevicesService) Update(enterpriseId string, userId string, deviceId string, device *Device) *DevicesUpdateCall { 4726 c := &DevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4727 c.enterpriseId = enterpriseId 4728 c.userId = userId 4729 c.deviceId = deviceId 4730 c.device = device 4731 return c 4732} 4733 4734// UpdateMask sets the optional parameter "updateMask": Mask that 4735// identifies which fields to update. If not set, all modifiable fields 4736// will be modified. 4737// 4738// When set in a query parameter, this field should be specified as 4739// updateMask=<field1>,<field2>,... 4740func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall { 4741 c.urlParams_.Set("updateMask", updateMask) 4742 return c 4743} 4744 4745// Fields allows partial responses to be retrieved. See 4746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4747// for more information. 4748func (c *DevicesUpdateCall) Fields(s ...googleapi.Field) *DevicesUpdateCall { 4749 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4750 return c 4751} 4752 4753// Context sets the context to be used in this call's Do method. Any 4754// pending HTTP request will be aborted if the provided context is 4755// canceled. 4756func (c *DevicesUpdateCall) Context(ctx context.Context) *DevicesUpdateCall { 4757 c.ctx_ = ctx 4758 return c 4759} 4760 4761// Header returns an http.Header that can be modified by the caller to 4762// add HTTP headers to the request. 4763func (c *DevicesUpdateCall) Header() http.Header { 4764 if c.header_ == nil { 4765 c.header_ = make(http.Header) 4766 } 4767 return c.header_ 4768} 4769 4770func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) { 4771 reqHeaders := make(http.Header) 4772 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4773 for k, v := range c.header_ { 4774 reqHeaders[k] = v 4775 } 4776 reqHeaders.Set("User-Agent", c.s.userAgent()) 4777 var body io.Reader = nil 4778 body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) 4779 if err != nil { 4780 return nil, err 4781 } 4782 reqHeaders.Set("Content-Type", "application/json") 4783 c.urlParams_.Set("alt", alt) 4784 c.urlParams_.Set("prettyPrint", "false") 4785 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") 4786 urls += "?" + c.urlParams_.Encode() 4787 req, err := http.NewRequest("PUT", urls, body) 4788 if err != nil { 4789 return nil, err 4790 } 4791 req.Header = reqHeaders 4792 googleapi.Expand(req.URL, map[string]string{ 4793 "enterpriseId": c.enterpriseId, 4794 "userId": c.userId, 4795 "deviceId": c.deviceId, 4796 }) 4797 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4798} 4799 4800// Do executes the "androidenterprise.devices.update" call. 4801// Exactly one of *Device or error will be non-nil. Any non-2xx status 4802// code is an error. Response headers are in either 4803// *Device.ServerResponse.Header or (if a response was returned at all) 4804// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4805// check whether the returned error was because http.StatusNotModified 4806// was returned. 4807func (c *DevicesUpdateCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4808 gensupport.SetOptions(c.urlParams_, opts...) 4809 res, err := c.doRequest("json") 4810 if res != nil && res.StatusCode == http.StatusNotModified { 4811 if res.Body != nil { 4812 res.Body.Close() 4813 } 4814 return nil, &googleapi.Error{ 4815 Code: res.StatusCode, 4816 Header: res.Header, 4817 } 4818 } 4819 if err != nil { 4820 return nil, err 4821 } 4822 defer googleapi.CloseBody(res) 4823 if err := googleapi.CheckResponse(res); err != nil { 4824 return nil, err 4825 } 4826 ret := &Device{ 4827 ServerResponse: googleapi.ServerResponse{ 4828 Header: res.Header, 4829 HTTPStatusCode: res.StatusCode, 4830 }, 4831 } 4832 target := &ret 4833 if err := gensupport.DecodeResponse(target, res); err != nil { 4834 return nil, err 4835 } 4836 return ret, nil 4837 // { 4838 // "description": "Updates the device policy", 4839 // "httpMethod": "PUT", 4840 // "id": "androidenterprise.devices.update", 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 // "updateMask": { 4860 // "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified.\n\nWhen set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...", 4861 // "location": "query", 4862 // "type": "string" 4863 // }, 4864 // "userId": { 4865 // "description": "The ID of the user.", 4866 // "location": "path", 4867 // "required": true, 4868 // "type": "string" 4869 // } 4870 // }, 4871 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", 4872 // "request": { 4873 // "$ref": "Device" 4874 // }, 4875 // "response": { 4876 // "$ref": "Device" 4877 // }, 4878 // "scopes": [ 4879 // "https://www.googleapis.com/auth/androidenterprise" 4880 // ] 4881 // } 4882 4883} 4884 4885// method id "androidenterprise.enterprises.acknowledgeNotificationSet": 4886 4887type EnterprisesAcknowledgeNotificationSetCall struct { 4888 s *Service 4889 urlParams_ gensupport.URLParams 4890 ctx_ context.Context 4891 header_ http.Header 4892} 4893 4894// AcknowledgeNotificationSet: Acknowledges notifications that were 4895// received from Enterprises.PullNotificationSet to prevent subsequent 4896// calls from returning the same notifications. 4897func (r *EnterprisesService) AcknowledgeNotificationSet() *EnterprisesAcknowledgeNotificationSetCall { 4898 c := &EnterprisesAcknowledgeNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4899 return c 4900} 4901 4902// NotificationSetId sets the optional parameter "notificationSetId": 4903// The notification set ID as returned by 4904// Enterprises.PullNotificationSet. This must be provided. 4905func (c *EnterprisesAcknowledgeNotificationSetCall) NotificationSetId(notificationSetId string) *EnterprisesAcknowledgeNotificationSetCall { 4906 c.urlParams_.Set("notificationSetId", notificationSetId) 4907 return c 4908} 4909 4910// Fields allows partial responses to be retrieved. See 4911// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4912// for more information. 4913func (c *EnterprisesAcknowledgeNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesAcknowledgeNotificationSetCall { 4914 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4915 return c 4916} 4917 4918// Context sets the context to be used in this call's Do method. Any 4919// pending HTTP request will be aborted if the provided context is 4920// canceled. 4921func (c *EnterprisesAcknowledgeNotificationSetCall) Context(ctx context.Context) *EnterprisesAcknowledgeNotificationSetCall { 4922 c.ctx_ = ctx 4923 return c 4924} 4925 4926// Header returns an http.Header that can be modified by the caller to 4927// add HTTP headers to the request. 4928func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header { 4929 if c.header_ == nil { 4930 c.header_ = make(http.Header) 4931 } 4932 return c.header_ 4933} 4934 4935func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) { 4936 reqHeaders := make(http.Header) 4937 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 4938 for k, v := range c.header_ { 4939 reqHeaders[k] = v 4940 } 4941 reqHeaders.Set("User-Agent", c.s.userAgent()) 4942 var body io.Reader = nil 4943 c.urlParams_.Set("alt", alt) 4944 c.urlParams_.Set("prettyPrint", "false") 4945 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/acknowledgeNotificationSet") 4946 urls += "?" + c.urlParams_.Encode() 4947 req, err := http.NewRequest("POST", urls, body) 4948 if err != nil { 4949 return nil, err 4950 } 4951 req.Header = reqHeaders 4952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4953} 4954 4955// Do executes the "androidenterprise.enterprises.acknowledgeNotificationSet" call. 4956func (c *EnterprisesAcknowledgeNotificationSetCall) Do(opts ...googleapi.CallOption) error { 4957 gensupport.SetOptions(c.urlParams_, opts...) 4958 res, err := c.doRequest("json") 4959 if err != nil { 4960 return err 4961 } 4962 defer googleapi.CloseBody(res) 4963 if err := googleapi.CheckResponse(res); err != nil { 4964 return err 4965 } 4966 return nil 4967 // { 4968 // "description": "Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.", 4969 // "httpMethod": "POST", 4970 // "id": "androidenterprise.enterprises.acknowledgeNotificationSet", 4971 // "parameters": { 4972 // "notificationSetId": { 4973 // "description": "The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided.", 4974 // "location": "query", 4975 // "type": "string" 4976 // } 4977 // }, 4978 // "path": "enterprises/acknowledgeNotificationSet", 4979 // "scopes": [ 4980 // "https://www.googleapis.com/auth/androidenterprise" 4981 // ] 4982 // } 4983 4984} 4985 4986// method id "androidenterprise.enterprises.completeSignup": 4987 4988type EnterprisesCompleteSignupCall struct { 4989 s *Service 4990 urlParams_ gensupport.URLParams 4991 ctx_ context.Context 4992 header_ http.Header 4993} 4994 4995// CompleteSignup: Completes the signup flow, by specifying the 4996// Completion token and Enterprise token. This request must not be 4997// called multiple times for a given Enterprise Token. 4998func (r *EnterprisesService) CompleteSignup() *EnterprisesCompleteSignupCall { 4999 c := &EnterprisesCompleteSignupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5000 return c 5001} 5002 5003// CompletionToken sets the optional parameter "completionToken": The 5004// Completion token initially returned by GenerateSignupUrl. 5005func (c *EnterprisesCompleteSignupCall) CompletionToken(completionToken string) *EnterprisesCompleteSignupCall { 5006 c.urlParams_.Set("completionToken", completionToken) 5007 return c 5008} 5009 5010// EnterpriseToken sets the optional parameter "enterpriseToken": The 5011// Enterprise token appended to the Callback URL. 5012func (c *EnterprisesCompleteSignupCall) EnterpriseToken(enterpriseToken string) *EnterprisesCompleteSignupCall { 5013 c.urlParams_.Set("enterpriseToken", enterpriseToken) 5014 return c 5015} 5016 5017// Fields allows partial responses to be retrieved. See 5018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5019// for more information. 5020func (c *EnterprisesCompleteSignupCall) Fields(s ...googleapi.Field) *EnterprisesCompleteSignupCall { 5021 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5022 return c 5023} 5024 5025// Context sets the context to be used in this call's Do method. Any 5026// pending HTTP request will be aborted if the provided context is 5027// canceled. 5028func (c *EnterprisesCompleteSignupCall) Context(ctx context.Context) *EnterprisesCompleteSignupCall { 5029 c.ctx_ = ctx 5030 return c 5031} 5032 5033// Header returns an http.Header that can be modified by the caller to 5034// add HTTP headers to the request. 5035func (c *EnterprisesCompleteSignupCall) Header() http.Header { 5036 if c.header_ == nil { 5037 c.header_ = make(http.Header) 5038 } 5039 return c.header_ 5040} 5041 5042func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) { 5043 reqHeaders := make(http.Header) 5044 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5045 for k, v := range c.header_ { 5046 reqHeaders[k] = v 5047 } 5048 reqHeaders.Set("User-Agent", c.s.userAgent()) 5049 var body io.Reader = nil 5050 c.urlParams_.Set("alt", alt) 5051 c.urlParams_.Set("prettyPrint", "false") 5052 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/completeSignup") 5053 urls += "?" + c.urlParams_.Encode() 5054 req, err := http.NewRequest("POST", urls, body) 5055 if err != nil { 5056 return nil, err 5057 } 5058 req.Header = reqHeaders 5059 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5060} 5061 5062// Do executes the "androidenterprise.enterprises.completeSignup" call. 5063// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5064// status code is an error. Response headers are in either 5065// *Enterprise.ServerResponse.Header or (if a response was returned at 5066// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5067// to check whether the returned error was because 5068// http.StatusNotModified was returned. 5069func (c *EnterprisesCompleteSignupCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5070 gensupport.SetOptions(c.urlParams_, opts...) 5071 res, err := c.doRequest("json") 5072 if res != nil && res.StatusCode == http.StatusNotModified { 5073 if res.Body != nil { 5074 res.Body.Close() 5075 } 5076 return nil, &googleapi.Error{ 5077 Code: res.StatusCode, 5078 Header: res.Header, 5079 } 5080 } 5081 if err != nil { 5082 return nil, err 5083 } 5084 defer googleapi.CloseBody(res) 5085 if err := googleapi.CheckResponse(res); err != nil { 5086 return nil, err 5087 } 5088 ret := &Enterprise{ 5089 ServerResponse: googleapi.ServerResponse{ 5090 Header: res.Header, 5091 HTTPStatusCode: res.StatusCode, 5092 }, 5093 } 5094 target := &ret 5095 if err := gensupport.DecodeResponse(target, res); err != nil { 5096 return nil, err 5097 } 5098 return ret, nil 5099 // { 5100 // "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.", 5101 // "httpMethod": "POST", 5102 // "id": "androidenterprise.enterprises.completeSignup", 5103 // "parameters": { 5104 // "completionToken": { 5105 // "description": "The Completion token initially returned by GenerateSignupUrl.", 5106 // "location": "query", 5107 // "type": "string" 5108 // }, 5109 // "enterpriseToken": { 5110 // "description": "The Enterprise token appended to the Callback URL.", 5111 // "location": "query", 5112 // "type": "string" 5113 // } 5114 // }, 5115 // "path": "enterprises/completeSignup", 5116 // "response": { 5117 // "$ref": "Enterprise" 5118 // }, 5119 // "scopes": [ 5120 // "https://www.googleapis.com/auth/androidenterprise" 5121 // ] 5122 // } 5123 5124} 5125 5126// method id "androidenterprise.enterprises.createWebToken": 5127 5128type EnterprisesCreateWebTokenCall struct { 5129 s *Service 5130 enterpriseId string 5131 administratorwebtokenspec *AdministratorWebTokenSpec 5132 urlParams_ gensupport.URLParams 5133 ctx_ context.Context 5134 header_ http.Header 5135} 5136 5137// CreateWebToken: Returns a unique token to access an embeddable UI. To 5138// generate a web UI, pass the generated token into the managed Google 5139// Play javascript API. Each token may only be used to start one UI 5140// session. See the javascript API documentation for further 5141// information. 5142func (r *EnterprisesService) CreateWebToken(enterpriseId string, administratorwebtokenspec *AdministratorWebTokenSpec) *EnterprisesCreateWebTokenCall { 5143 c := &EnterprisesCreateWebTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5144 c.enterpriseId = enterpriseId 5145 c.administratorwebtokenspec = administratorwebtokenspec 5146 return c 5147} 5148 5149// Fields allows partial responses to be retrieved. See 5150// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5151// for more information. 5152func (c *EnterprisesCreateWebTokenCall) Fields(s ...googleapi.Field) *EnterprisesCreateWebTokenCall { 5153 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5154 return c 5155} 5156 5157// Context sets the context to be used in this call's Do method. Any 5158// pending HTTP request will be aborted if the provided context is 5159// canceled. 5160func (c *EnterprisesCreateWebTokenCall) Context(ctx context.Context) *EnterprisesCreateWebTokenCall { 5161 c.ctx_ = ctx 5162 return c 5163} 5164 5165// Header returns an http.Header that can be modified by the caller to 5166// add HTTP headers to the request. 5167func (c *EnterprisesCreateWebTokenCall) Header() http.Header { 5168 if c.header_ == nil { 5169 c.header_ = make(http.Header) 5170 } 5171 return c.header_ 5172} 5173 5174func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) { 5175 reqHeaders := make(http.Header) 5176 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5177 for k, v := range c.header_ { 5178 reqHeaders[k] = v 5179 } 5180 reqHeaders.Set("User-Agent", c.s.userAgent()) 5181 var body io.Reader = nil 5182 body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec) 5183 if err != nil { 5184 return nil, err 5185 } 5186 reqHeaders.Set("Content-Type", "application/json") 5187 c.urlParams_.Set("alt", alt) 5188 c.urlParams_.Set("prettyPrint", "false") 5189 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/createWebToken") 5190 urls += "?" + c.urlParams_.Encode() 5191 req, err := http.NewRequest("POST", urls, body) 5192 if err != nil { 5193 return nil, err 5194 } 5195 req.Header = reqHeaders 5196 googleapi.Expand(req.URL, map[string]string{ 5197 "enterpriseId": c.enterpriseId, 5198 }) 5199 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5200} 5201 5202// Do executes the "androidenterprise.enterprises.createWebToken" call. 5203// Exactly one of *AdministratorWebToken or error will be non-nil. Any 5204// non-2xx status code is an error. Response headers are in either 5205// *AdministratorWebToken.ServerResponse.Header or (if a response was 5206// returned at all) in error.(*googleapi.Error).Header. Use 5207// googleapi.IsNotModified to check whether the returned error was 5208// because http.StatusNotModified was returned. 5209func (c *EnterprisesCreateWebTokenCall) Do(opts ...googleapi.CallOption) (*AdministratorWebToken, error) { 5210 gensupport.SetOptions(c.urlParams_, opts...) 5211 res, err := c.doRequest("json") 5212 if res != nil && res.StatusCode == http.StatusNotModified { 5213 if res.Body != nil { 5214 res.Body.Close() 5215 } 5216 return nil, &googleapi.Error{ 5217 Code: res.StatusCode, 5218 Header: res.Header, 5219 } 5220 } 5221 if err != nil { 5222 return nil, err 5223 } 5224 defer googleapi.CloseBody(res) 5225 if err := googleapi.CheckResponse(res); err != nil { 5226 return nil, err 5227 } 5228 ret := &AdministratorWebToken{ 5229 ServerResponse: googleapi.ServerResponse{ 5230 Header: res.Header, 5231 HTTPStatusCode: res.StatusCode, 5232 }, 5233 } 5234 target := &ret 5235 if err := gensupport.DecodeResponse(target, res); err != nil { 5236 return nil, err 5237 } 5238 return ret, nil 5239 // { 5240 // "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.", 5241 // "httpMethod": "POST", 5242 // "id": "androidenterprise.enterprises.createWebToken", 5243 // "parameterOrder": [ 5244 // "enterpriseId" 5245 // ], 5246 // "parameters": { 5247 // "enterpriseId": { 5248 // "description": "The ID of the enterprise.", 5249 // "location": "path", 5250 // "required": true, 5251 // "type": "string" 5252 // } 5253 // }, 5254 // "path": "enterprises/{enterpriseId}/createWebToken", 5255 // "request": { 5256 // "$ref": "AdministratorWebTokenSpec" 5257 // }, 5258 // "response": { 5259 // "$ref": "AdministratorWebToken" 5260 // }, 5261 // "scopes": [ 5262 // "https://www.googleapis.com/auth/androidenterprise" 5263 // ] 5264 // } 5265 5266} 5267 5268// method id "androidenterprise.enterprises.enroll": 5269 5270type EnterprisesEnrollCall struct { 5271 s *Service 5272 enterprise *Enterprise 5273 urlParams_ gensupport.URLParams 5274 ctx_ context.Context 5275 header_ http.Header 5276} 5277 5278// Enroll: Enrolls an enterprise with the calling EMM. 5279func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall { 5280 c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5281 c.urlParams_.Set("token", token) 5282 c.enterprise = enterprise 5283 return c 5284} 5285 5286// Fields allows partial responses to be retrieved. See 5287// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5288// for more information. 5289func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall { 5290 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5291 return c 5292} 5293 5294// Context sets the context to be used in this call's Do method. Any 5295// pending HTTP request will be aborted if the provided context is 5296// canceled. 5297func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall { 5298 c.ctx_ = ctx 5299 return c 5300} 5301 5302// Header returns an http.Header that can be modified by the caller to 5303// add HTTP headers to the request. 5304func (c *EnterprisesEnrollCall) Header() http.Header { 5305 if c.header_ == nil { 5306 c.header_ = make(http.Header) 5307 } 5308 return c.header_ 5309} 5310 5311func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) { 5312 reqHeaders := make(http.Header) 5313 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5314 for k, v := range c.header_ { 5315 reqHeaders[k] = v 5316 } 5317 reqHeaders.Set("User-Agent", c.s.userAgent()) 5318 var body io.Reader = nil 5319 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) 5320 if err != nil { 5321 return nil, err 5322 } 5323 reqHeaders.Set("Content-Type", "application/json") 5324 c.urlParams_.Set("alt", alt) 5325 c.urlParams_.Set("prettyPrint", "false") 5326 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll") 5327 urls += "?" + c.urlParams_.Encode() 5328 req, err := http.NewRequest("POST", urls, body) 5329 if err != nil { 5330 return nil, err 5331 } 5332 req.Header = reqHeaders 5333 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5334} 5335 5336// Do executes the "androidenterprise.enterprises.enroll" call. 5337// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5338// status code is an error. Response headers are in either 5339// *Enterprise.ServerResponse.Header or (if a response was returned at 5340// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5341// to check whether the returned error was because 5342// http.StatusNotModified was returned. 5343func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5344 gensupport.SetOptions(c.urlParams_, opts...) 5345 res, err := c.doRequest("json") 5346 if res != nil && res.StatusCode == http.StatusNotModified { 5347 if res.Body != nil { 5348 res.Body.Close() 5349 } 5350 return nil, &googleapi.Error{ 5351 Code: res.StatusCode, 5352 Header: res.Header, 5353 } 5354 } 5355 if err != nil { 5356 return nil, err 5357 } 5358 defer googleapi.CloseBody(res) 5359 if err := googleapi.CheckResponse(res); err != nil { 5360 return nil, err 5361 } 5362 ret := &Enterprise{ 5363 ServerResponse: googleapi.ServerResponse{ 5364 Header: res.Header, 5365 HTTPStatusCode: res.StatusCode, 5366 }, 5367 } 5368 target := &ret 5369 if err := gensupport.DecodeResponse(target, res); err != nil { 5370 return nil, err 5371 } 5372 return ret, nil 5373 // { 5374 // "description": "Enrolls an enterprise with the calling EMM.", 5375 // "httpMethod": "POST", 5376 // "id": "androidenterprise.enterprises.enroll", 5377 // "parameterOrder": [ 5378 // "token" 5379 // ], 5380 // "parameters": { 5381 // "token": { 5382 // "description": "The token provided by the enterprise to register the EMM.", 5383 // "location": "query", 5384 // "required": true, 5385 // "type": "string" 5386 // } 5387 // }, 5388 // "path": "enterprises/enroll", 5389 // "request": { 5390 // "$ref": "Enterprise" 5391 // }, 5392 // "response": { 5393 // "$ref": "Enterprise" 5394 // }, 5395 // "scopes": [ 5396 // "https://www.googleapis.com/auth/androidenterprise" 5397 // ] 5398 // } 5399 5400} 5401 5402// method id "androidenterprise.enterprises.generateSignupUrl": 5403 5404type EnterprisesGenerateSignupUrlCall struct { 5405 s *Service 5406 urlParams_ gensupport.URLParams 5407 ctx_ context.Context 5408 header_ http.Header 5409} 5410 5411// GenerateSignupUrl: Generates a sign-up URL. 5412func (r *EnterprisesService) GenerateSignupUrl() *EnterprisesGenerateSignupUrlCall { 5413 c := &EnterprisesGenerateSignupUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5414 return c 5415} 5416 5417// CallbackUrl sets the optional parameter "callbackUrl": The callback 5418// URL to which the Admin will be redirected after successfully creating 5419// an enterprise. Before redirecting there the system will add a single 5420// query parameter to this URL named "enterpriseToken" which will 5421// contain an opaque token to be used for the CompleteSignup 5422// request. 5423// Beware that this means that the URL will be parsed, the parameter 5424// added and then a new URL formatted, i.e. there may be some minor 5425// formatting changes and, more importantly, the URL must be well-formed 5426// so that it can be parsed. 5427func (c *EnterprisesGenerateSignupUrlCall) CallbackUrl(callbackUrl string) *EnterprisesGenerateSignupUrlCall { 5428 c.urlParams_.Set("callbackUrl", callbackUrl) 5429 return c 5430} 5431 5432// Fields allows partial responses to be retrieved. See 5433// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5434// for more information. 5435func (c *EnterprisesGenerateSignupUrlCall) Fields(s ...googleapi.Field) *EnterprisesGenerateSignupUrlCall { 5436 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5437 return c 5438} 5439 5440// Context sets the context to be used in this call's Do method. Any 5441// pending HTTP request will be aborted if the provided context is 5442// canceled. 5443func (c *EnterprisesGenerateSignupUrlCall) Context(ctx context.Context) *EnterprisesGenerateSignupUrlCall { 5444 c.ctx_ = ctx 5445 return c 5446} 5447 5448// Header returns an http.Header that can be modified by the caller to 5449// add HTTP headers to the request. 5450func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header { 5451 if c.header_ == nil { 5452 c.header_ = make(http.Header) 5453 } 5454 return c.header_ 5455} 5456 5457func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) { 5458 reqHeaders := make(http.Header) 5459 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5460 for k, v := range c.header_ { 5461 reqHeaders[k] = v 5462 } 5463 reqHeaders.Set("User-Agent", c.s.userAgent()) 5464 var body io.Reader = nil 5465 c.urlParams_.Set("alt", alt) 5466 c.urlParams_.Set("prettyPrint", "false") 5467 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/signupUrl") 5468 urls += "?" + c.urlParams_.Encode() 5469 req, err := http.NewRequest("POST", urls, body) 5470 if err != nil { 5471 return nil, err 5472 } 5473 req.Header = reqHeaders 5474 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5475} 5476 5477// Do executes the "androidenterprise.enterprises.generateSignupUrl" call. 5478// Exactly one of *SignupInfo or error will be non-nil. Any non-2xx 5479// status code is an error. Response headers are in either 5480// *SignupInfo.ServerResponse.Header or (if a response was returned at 5481// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5482// to check whether the returned error was because 5483// http.StatusNotModified was returned. 5484func (c *EnterprisesGenerateSignupUrlCall) Do(opts ...googleapi.CallOption) (*SignupInfo, error) { 5485 gensupport.SetOptions(c.urlParams_, opts...) 5486 res, err := c.doRequest("json") 5487 if res != nil && res.StatusCode == http.StatusNotModified { 5488 if res.Body != nil { 5489 res.Body.Close() 5490 } 5491 return nil, &googleapi.Error{ 5492 Code: res.StatusCode, 5493 Header: res.Header, 5494 } 5495 } 5496 if err != nil { 5497 return nil, err 5498 } 5499 defer googleapi.CloseBody(res) 5500 if err := googleapi.CheckResponse(res); err != nil { 5501 return nil, err 5502 } 5503 ret := &SignupInfo{ 5504 ServerResponse: googleapi.ServerResponse{ 5505 Header: res.Header, 5506 HTTPStatusCode: res.StatusCode, 5507 }, 5508 } 5509 target := &ret 5510 if err := gensupport.DecodeResponse(target, res); err != nil { 5511 return nil, err 5512 } 5513 return ret, nil 5514 // { 5515 // "description": "Generates a sign-up URL.", 5516 // "httpMethod": "POST", 5517 // "id": "androidenterprise.enterprises.generateSignupUrl", 5518 // "parameters": { 5519 // "callbackUrl": { 5520 // "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.\nBeware 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.", 5521 // "location": "query", 5522 // "type": "string" 5523 // } 5524 // }, 5525 // "path": "enterprises/signupUrl", 5526 // "response": { 5527 // "$ref": "SignupInfo" 5528 // }, 5529 // "scopes": [ 5530 // "https://www.googleapis.com/auth/androidenterprise" 5531 // ] 5532 // } 5533 5534} 5535 5536// method id "androidenterprise.enterprises.get": 5537 5538type EnterprisesGetCall struct { 5539 s *Service 5540 enterpriseId string 5541 urlParams_ gensupport.URLParams 5542 ifNoneMatch_ string 5543 ctx_ context.Context 5544 header_ http.Header 5545} 5546 5547// Get: Retrieves the name and domain of an enterprise. 5548func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall { 5549 c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5550 c.enterpriseId = enterpriseId 5551 return c 5552} 5553 5554// Fields allows partial responses to be retrieved. See 5555// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5556// for more information. 5557func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall { 5558 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5559 return c 5560} 5561 5562// IfNoneMatch sets the optional parameter which makes the operation 5563// fail if the object's ETag matches the given value. This is useful for 5564// getting updates only after the object has changed since the last 5565// request. Use googleapi.IsNotModified to check whether the response 5566// error from Do is the result of In-None-Match. 5567func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall { 5568 c.ifNoneMatch_ = entityTag 5569 return c 5570} 5571 5572// Context sets the context to be used in this call's Do method. Any 5573// pending HTTP request will be aborted if the provided context is 5574// canceled. 5575func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall { 5576 c.ctx_ = ctx 5577 return c 5578} 5579 5580// Header returns an http.Header that can be modified by the caller to 5581// add HTTP headers to the request. 5582func (c *EnterprisesGetCall) Header() http.Header { 5583 if c.header_ == nil { 5584 c.header_ = make(http.Header) 5585 } 5586 return c.header_ 5587} 5588 5589func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { 5590 reqHeaders := make(http.Header) 5591 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5592 for k, v := range c.header_ { 5593 reqHeaders[k] = v 5594 } 5595 reqHeaders.Set("User-Agent", c.s.userAgent()) 5596 if c.ifNoneMatch_ != "" { 5597 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5598 } 5599 var body io.Reader = nil 5600 c.urlParams_.Set("alt", alt) 5601 c.urlParams_.Set("prettyPrint", "false") 5602 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}") 5603 urls += "?" + c.urlParams_.Encode() 5604 req, err := http.NewRequest("GET", urls, body) 5605 if err != nil { 5606 return nil, err 5607 } 5608 req.Header = reqHeaders 5609 googleapi.Expand(req.URL, map[string]string{ 5610 "enterpriseId": c.enterpriseId, 5611 }) 5612 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5613} 5614 5615// Do executes the "androidenterprise.enterprises.get" call. 5616// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5617// status code is an error. Response headers are in either 5618// *Enterprise.ServerResponse.Header or (if a response was returned at 5619// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5620// to check whether the returned error was because 5621// http.StatusNotModified was returned. 5622func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5623 gensupport.SetOptions(c.urlParams_, opts...) 5624 res, err := c.doRequest("json") 5625 if res != nil && res.StatusCode == http.StatusNotModified { 5626 if res.Body != nil { 5627 res.Body.Close() 5628 } 5629 return nil, &googleapi.Error{ 5630 Code: res.StatusCode, 5631 Header: res.Header, 5632 } 5633 } 5634 if err != nil { 5635 return nil, err 5636 } 5637 defer googleapi.CloseBody(res) 5638 if err := googleapi.CheckResponse(res); err != nil { 5639 return nil, err 5640 } 5641 ret := &Enterprise{ 5642 ServerResponse: googleapi.ServerResponse{ 5643 Header: res.Header, 5644 HTTPStatusCode: res.StatusCode, 5645 }, 5646 } 5647 target := &ret 5648 if err := gensupport.DecodeResponse(target, res); err != nil { 5649 return nil, err 5650 } 5651 return ret, nil 5652 // { 5653 // "description": "Retrieves the name and domain of an enterprise.", 5654 // "httpMethod": "GET", 5655 // "id": "androidenterprise.enterprises.get", 5656 // "parameterOrder": [ 5657 // "enterpriseId" 5658 // ], 5659 // "parameters": { 5660 // "enterpriseId": { 5661 // "description": "The ID of the enterprise.", 5662 // "location": "path", 5663 // "required": true, 5664 // "type": "string" 5665 // } 5666 // }, 5667 // "path": "enterprises/{enterpriseId}", 5668 // "response": { 5669 // "$ref": "Enterprise" 5670 // }, 5671 // "scopes": [ 5672 // "https://www.googleapis.com/auth/androidenterprise" 5673 // ] 5674 // } 5675 5676} 5677 5678// method id "androidenterprise.enterprises.getServiceAccount": 5679 5680type EnterprisesGetServiceAccountCall struct { 5681 s *Service 5682 enterpriseId string 5683 urlParams_ gensupport.URLParams 5684 ifNoneMatch_ string 5685 ctx_ context.Context 5686 header_ http.Header 5687} 5688 5689// GetServiceAccount: Returns a service account and credentials. The 5690// service account can be bound to the enterprise by calling setAccount. 5691// The service account is unique to this enterprise and EMM, and will be 5692// deleted if the enterprise is unbound. The credentials contain private 5693// key data and are not stored server-side. 5694// 5695// This method can only be called after calling Enterprises.Enroll or 5696// Enterprises.CompleteSignup, and before Enterprises.SetAccount; at 5697// other times it will return an error. 5698// 5699// Subsequent calls after the first will generate a new, unique set of 5700// credentials, and invalidate the previously generated 5701// credentials. 5702// 5703// Once the service account is bound to the enterprise, it can be 5704// managed using the serviceAccountKeys resource. 5705func (r *EnterprisesService) GetServiceAccount(enterpriseId string) *EnterprisesGetServiceAccountCall { 5706 c := &EnterprisesGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5707 c.enterpriseId = enterpriseId 5708 return c 5709} 5710 5711// KeyType sets the optional parameter "keyType": The type of credential 5712// to return with the service account. Required. 5713// 5714// Possible values: 5715// "googleCredentials" 5716// "pkcs12" 5717func (c *EnterprisesGetServiceAccountCall) KeyType(keyType string) *EnterprisesGetServiceAccountCall { 5718 c.urlParams_.Set("keyType", keyType) 5719 return c 5720} 5721 5722// Fields allows partial responses to be retrieved. See 5723// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5724// for more information. 5725func (c *EnterprisesGetServiceAccountCall) Fields(s ...googleapi.Field) *EnterprisesGetServiceAccountCall { 5726 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5727 return c 5728} 5729 5730// IfNoneMatch sets the optional parameter which makes the operation 5731// fail if the object's ETag matches the given value. This is useful for 5732// getting updates only after the object has changed since the last 5733// request. Use googleapi.IsNotModified to check whether the response 5734// error from Do is the result of In-None-Match. 5735func (c *EnterprisesGetServiceAccountCall) IfNoneMatch(entityTag string) *EnterprisesGetServiceAccountCall { 5736 c.ifNoneMatch_ = entityTag 5737 return c 5738} 5739 5740// Context sets the context to be used in this call's Do method. Any 5741// pending HTTP request will be aborted if the provided context is 5742// canceled. 5743func (c *EnterprisesGetServiceAccountCall) Context(ctx context.Context) *EnterprisesGetServiceAccountCall { 5744 c.ctx_ = ctx 5745 return c 5746} 5747 5748// Header returns an http.Header that can be modified by the caller to 5749// add HTTP headers to the request. 5750func (c *EnterprisesGetServiceAccountCall) Header() http.Header { 5751 if c.header_ == nil { 5752 c.header_ = make(http.Header) 5753 } 5754 return c.header_ 5755} 5756 5757func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response, error) { 5758 reqHeaders := make(http.Header) 5759 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5760 for k, v := range c.header_ { 5761 reqHeaders[k] = v 5762 } 5763 reqHeaders.Set("User-Agent", c.s.userAgent()) 5764 if c.ifNoneMatch_ != "" { 5765 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5766 } 5767 var body io.Reader = nil 5768 c.urlParams_.Set("alt", alt) 5769 c.urlParams_.Set("prettyPrint", "false") 5770 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccount") 5771 urls += "?" + c.urlParams_.Encode() 5772 req, err := http.NewRequest("GET", urls, body) 5773 if err != nil { 5774 return nil, err 5775 } 5776 req.Header = reqHeaders 5777 googleapi.Expand(req.URL, map[string]string{ 5778 "enterpriseId": c.enterpriseId, 5779 }) 5780 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5781} 5782 5783// Do executes the "androidenterprise.enterprises.getServiceAccount" call. 5784// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx 5785// status code is an error. Response headers are in either 5786// *ServiceAccount.ServerResponse.Header or (if a response was returned 5787// at all) in error.(*googleapi.Error).Header. Use 5788// googleapi.IsNotModified to check whether the returned error was 5789// because http.StatusNotModified was returned. 5790func (c *EnterprisesGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { 5791 gensupport.SetOptions(c.urlParams_, opts...) 5792 res, err := c.doRequest("json") 5793 if res != nil && res.StatusCode == http.StatusNotModified { 5794 if res.Body != nil { 5795 res.Body.Close() 5796 } 5797 return nil, &googleapi.Error{ 5798 Code: res.StatusCode, 5799 Header: res.Header, 5800 } 5801 } 5802 if err != nil { 5803 return nil, err 5804 } 5805 defer googleapi.CloseBody(res) 5806 if err := googleapi.CheckResponse(res); err != nil { 5807 return nil, err 5808 } 5809 ret := &ServiceAccount{ 5810 ServerResponse: googleapi.ServerResponse{ 5811 Header: res.Header, 5812 HTTPStatusCode: res.StatusCode, 5813 }, 5814 } 5815 target := &ret 5816 if err := gensupport.DecodeResponse(target, res); err != nil { 5817 return nil, err 5818 } 5819 return ret, nil 5820 // { 5821 // "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.\n\nThis method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error.\n\nSubsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials.\n\nOnce the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.", 5822 // "httpMethod": "GET", 5823 // "id": "androidenterprise.enterprises.getServiceAccount", 5824 // "parameterOrder": [ 5825 // "enterpriseId" 5826 // ], 5827 // "parameters": { 5828 // "enterpriseId": { 5829 // "description": "The ID of the enterprise.", 5830 // "location": "path", 5831 // "required": true, 5832 // "type": "string" 5833 // }, 5834 // "keyType": { 5835 // "description": "The type of credential to return with the service account. Required.", 5836 // "enum": [ 5837 // "googleCredentials", 5838 // "pkcs12" 5839 // ], 5840 // "enumDescriptions": [ 5841 // "", 5842 // "" 5843 // ], 5844 // "location": "query", 5845 // "type": "string" 5846 // } 5847 // }, 5848 // "path": "enterprises/{enterpriseId}/serviceAccount", 5849 // "response": { 5850 // "$ref": "ServiceAccount" 5851 // }, 5852 // "scopes": [ 5853 // "https://www.googleapis.com/auth/androidenterprise" 5854 // ] 5855 // } 5856 5857} 5858 5859// method id "androidenterprise.enterprises.getStoreLayout": 5860 5861type EnterprisesGetStoreLayoutCall struct { 5862 s *Service 5863 enterpriseId string 5864 urlParams_ gensupport.URLParams 5865 ifNoneMatch_ string 5866 ctx_ context.Context 5867 header_ http.Header 5868} 5869 5870// GetStoreLayout: Returns the store layout for the enterprise. If the 5871// store layout has not been set, returns "basic" as the store layout 5872// type and no homepage. 5873func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall { 5874 c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5875 c.enterpriseId = enterpriseId 5876 return c 5877} 5878 5879// Fields allows partial responses to be retrieved. See 5880// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5881// for more information. 5882func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall { 5883 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5884 return c 5885} 5886 5887// IfNoneMatch sets the optional parameter which makes the operation 5888// fail if the object's ETag matches the given value. This is useful for 5889// getting updates only after the object has changed since the last 5890// request. Use googleapi.IsNotModified to check whether the response 5891// error from Do is the result of In-None-Match. 5892func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall { 5893 c.ifNoneMatch_ = entityTag 5894 return c 5895} 5896 5897// Context sets the context to be used in this call's Do method. Any 5898// pending HTTP request will be aborted if the provided context is 5899// canceled. 5900func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall { 5901 c.ctx_ = ctx 5902 return c 5903} 5904 5905// Header returns an http.Header that can be modified by the caller to 5906// add HTTP headers to the request. 5907func (c *EnterprisesGetStoreLayoutCall) Header() http.Header { 5908 if c.header_ == nil { 5909 c.header_ = make(http.Header) 5910 } 5911 return c.header_ 5912} 5913 5914func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 5915 reqHeaders := make(http.Header) 5916 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 5917 for k, v := range c.header_ { 5918 reqHeaders[k] = v 5919 } 5920 reqHeaders.Set("User-Agent", c.s.userAgent()) 5921 if c.ifNoneMatch_ != "" { 5922 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5923 } 5924 var body io.Reader = nil 5925 c.urlParams_.Set("alt", alt) 5926 c.urlParams_.Set("prettyPrint", "false") 5927 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout") 5928 urls += "?" + c.urlParams_.Encode() 5929 req, err := http.NewRequest("GET", urls, body) 5930 if err != nil { 5931 return nil, err 5932 } 5933 req.Header = reqHeaders 5934 googleapi.Expand(req.URL, map[string]string{ 5935 "enterpriseId": c.enterpriseId, 5936 }) 5937 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5938} 5939 5940// Do executes the "androidenterprise.enterprises.getStoreLayout" call. 5941// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 5942// status code is an error. Response headers are in either 5943// *StoreLayout.ServerResponse.Header or (if a response was returned at 5944// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5945// to check whether the returned error was because 5946// http.StatusNotModified was returned. 5947func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 5948 gensupport.SetOptions(c.urlParams_, opts...) 5949 res, err := c.doRequest("json") 5950 if res != nil && res.StatusCode == http.StatusNotModified { 5951 if res.Body != nil { 5952 res.Body.Close() 5953 } 5954 return nil, &googleapi.Error{ 5955 Code: res.StatusCode, 5956 Header: res.Header, 5957 } 5958 } 5959 if err != nil { 5960 return nil, err 5961 } 5962 defer googleapi.CloseBody(res) 5963 if err := googleapi.CheckResponse(res); err != nil { 5964 return nil, err 5965 } 5966 ret := &StoreLayout{ 5967 ServerResponse: googleapi.ServerResponse{ 5968 Header: res.Header, 5969 HTTPStatusCode: res.StatusCode, 5970 }, 5971 } 5972 target := &ret 5973 if err := gensupport.DecodeResponse(target, res); err != nil { 5974 return nil, err 5975 } 5976 return ret, nil 5977 // { 5978 // "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.", 5979 // "httpMethod": "GET", 5980 // "id": "androidenterprise.enterprises.getStoreLayout", 5981 // "parameterOrder": [ 5982 // "enterpriseId" 5983 // ], 5984 // "parameters": { 5985 // "enterpriseId": { 5986 // "description": "The ID of the enterprise.", 5987 // "location": "path", 5988 // "required": true, 5989 // "type": "string" 5990 // } 5991 // }, 5992 // "path": "enterprises/{enterpriseId}/storeLayout", 5993 // "response": { 5994 // "$ref": "StoreLayout" 5995 // }, 5996 // "scopes": [ 5997 // "https://www.googleapis.com/auth/androidenterprise" 5998 // ] 5999 // } 6000 6001} 6002 6003// method id "androidenterprise.enterprises.list": 6004 6005type EnterprisesListCall struct { 6006 s *Service 6007 urlParams_ gensupport.URLParams 6008 ifNoneMatch_ string 6009 ctx_ context.Context 6010 header_ http.Header 6011} 6012 6013// List: Looks up an enterprise by domain name. This is only supported 6014// for enterprises created via the Google-initiated creation flow. 6015// Lookup of the id is not needed for enterprises created via the 6016// EMM-initiated flow since the EMM learns the enterprise ID in the 6017// callback specified in the Enterprises.generateSignupUrl call. 6018func (r *EnterprisesService) List(domain string) *EnterprisesListCall { 6019 c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6020 c.urlParams_.Set("domain", domain) 6021 return c 6022} 6023 6024// Fields allows partial responses to be retrieved. See 6025// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6026// for more information. 6027func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall { 6028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6029 return c 6030} 6031 6032// IfNoneMatch sets the optional parameter which makes the operation 6033// fail if the object's ETag matches the given value. This is useful for 6034// getting updates only after the object has changed since the last 6035// request. Use googleapi.IsNotModified to check whether the response 6036// error from Do is the result of In-None-Match. 6037func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall { 6038 c.ifNoneMatch_ = entityTag 6039 return c 6040} 6041 6042// Context sets the context to be used in this call's Do method. Any 6043// pending HTTP request will be aborted if the provided context is 6044// canceled. 6045func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall { 6046 c.ctx_ = ctx 6047 return c 6048} 6049 6050// Header returns an http.Header that can be modified by the caller to 6051// add HTTP headers to the request. 6052func (c *EnterprisesListCall) Header() http.Header { 6053 if c.header_ == nil { 6054 c.header_ = make(http.Header) 6055 } 6056 return c.header_ 6057} 6058 6059func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { 6060 reqHeaders := make(http.Header) 6061 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6062 for k, v := range c.header_ { 6063 reqHeaders[k] = v 6064 } 6065 reqHeaders.Set("User-Agent", c.s.userAgent()) 6066 if c.ifNoneMatch_ != "" { 6067 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6068 } 6069 var body io.Reader = nil 6070 c.urlParams_.Set("alt", alt) 6071 c.urlParams_.Set("prettyPrint", "false") 6072 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises") 6073 urls += "?" + c.urlParams_.Encode() 6074 req, err := http.NewRequest("GET", urls, body) 6075 if err != nil { 6076 return nil, err 6077 } 6078 req.Header = reqHeaders 6079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6080} 6081 6082// Do executes the "androidenterprise.enterprises.list" call. 6083// Exactly one of *EnterprisesListResponse or error will be non-nil. Any 6084// non-2xx status code is an error. Response headers are in either 6085// *EnterprisesListResponse.ServerResponse.Header or (if a response was 6086// returned at all) in error.(*googleapi.Error).Header. Use 6087// googleapi.IsNotModified to check whether the returned error was 6088// because http.StatusNotModified was returned. 6089func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) { 6090 gensupport.SetOptions(c.urlParams_, opts...) 6091 res, err := c.doRequest("json") 6092 if res != nil && res.StatusCode == http.StatusNotModified { 6093 if res.Body != nil { 6094 res.Body.Close() 6095 } 6096 return nil, &googleapi.Error{ 6097 Code: res.StatusCode, 6098 Header: res.Header, 6099 } 6100 } 6101 if err != nil { 6102 return nil, err 6103 } 6104 defer googleapi.CloseBody(res) 6105 if err := googleapi.CheckResponse(res); err != nil { 6106 return nil, err 6107 } 6108 ret := &EnterprisesListResponse{ 6109 ServerResponse: googleapi.ServerResponse{ 6110 Header: res.Header, 6111 HTTPStatusCode: res.StatusCode, 6112 }, 6113 } 6114 target := &ret 6115 if err := gensupport.DecodeResponse(target, res); err != nil { 6116 return nil, err 6117 } 6118 return ret, nil 6119 // { 6120 // "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.", 6121 // "httpMethod": "GET", 6122 // "id": "androidenterprise.enterprises.list", 6123 // "parameterOrder": [ 6124 // "domain" 6125 // ], 6126 // "parameters": { 6127 // "domain": { 6128 // "description": "The exact primary domain name of the enterprise to look up.", 6129 // "location": "query", 6130 // "required": true, 6131 // "type": "string" 6132 // } 6133 // }, 6134 // "path": "enterprises", 6135 // "response": { 6136 // "$ref": "EnterprisesListResponse" 6137 // }, 6138 // "scopes": [ 6139 // "https://www.googleapis.com/auth/androidenterprise" 6140 // ] 6141 // } 6142 6143} 6144 6145// method id "androidenterprise.enterprises.pullNotificationSet": 6146 6147type EnterprisesPullNotificationSetCall struct { 6148 s *Service 6149 urlParams_ gensupport.URLParams 6150 ctx_ context.Context 6151 header_ http.Header 6152} 6153 6154// PullNotificationSet: Pulls and returns a notification set for the 6155// enterprises associated with the service account authenticated for the 6156// request. The notification set may be empty if no notification are 6157// pending. 6158// A notification set returned needs to be acknowledged within 20 6159// seconds by calling Enterprises.AcknowledgeNotificationSet, unless the 6160// notification set is empty. 6161// Notifications that are not acknowledged within the 20 seconds will 6162// eventually be included again in the response to another 6163// PullNotificationSet request, and those that are never acknowledged 6164// will ultimately be deleted according to the Google Cloud Platform 6165// Pub/Sub system policy. 6166// Multiple requests might be performed concurrently to retrieve 6167// notifications, in which case the pending notifications (if any) will 6168// be split among each caller, if any are pending. 6169// If no notifications are present, an empty notification list is 6170// returned. Subsequent requests may return more notifications once they 6171// become available. 6172func (r *EnterprisesService) PullNotificationSet() *EnterprisesPullNotificationSetCall { 6173 c := &EnterprisesPullNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6174 return c 6175} 6176 6177// RequestMode sets the optional parameter "requestMode": The request 6178// mode for pulling notifications. 6179// Specifying waitForNotifications will cause the request to block and 6180// wait until one or more notifications are present, or return an empty 6181// notification list if no notifications are present after some 6182// time. 6183// Speciying returnImmediately will cause the request to immediately 6184// return the pending notifications, or an empty list if no 6185// notifications are present. 6186// If omitted, defaults to waitForNotifications. 6187// 6188// Possible values: 6189// "returnImmediately" 6190// "waitForNotifications" 6191func (c *EnterprisesPullNotificationSetCall) RequestMode(requestMode string) *EnterprisesPullNotificationSetCall { 6192 c.urlParams_.Set("requestMode", requestMode) 6193 return c 6194} 6195 6196// Fields allows partial responses to be retrieved. See 6197// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6198// for more information. 6199func (c *EnterprisesPullNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesPullNotificationSetCall { 6200 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6201 return c 6202} 6203 6204// Context sets the context to be used in this call's Do method. Any 6205// pending HTTP request will be aborted if the provided context is 6206// canceled. 6207func (c *EnterprisesPullNotificationSetCall) Context(ctx context.Context) *EnterprisesPullNotificationSetCall { 6208 c.ctx_ = ctx 6209 return c 6210} 6211 6212// Header returns an http.Header that can be modified by the caller to 6213// add HTTP headers to the request. 6214func (c *EnterprisesPullNotificationSetCall) Header() http.Header { 6215 if c.header_ == nil { 6216 c.header_ = make(http.Header) 6217 } 6218 return c.header_ 6219} 6220 6221func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) { 6222 reqHeaders := make(http.Header) 6223 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6224 for k, v := range c.header_ { 6225 reqHeaders[k] = v 6226 } 6227 reqHeaders.Set("User-Agent", c.s.userAgent()) 6228 var body io.Reader = nil 6229 c.urlParams_.Set("alt", alt) 6230 c.urlParams_.Set("prettyPrint", "false") 6231 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/pullNotificationSet") 6232 urls += "?" + c.urlParams_.Encode() 6233 req, err := http.NewRequest("POST", urls, body) 6234 if err != nil { 6235 return nil, err 6236 } 6237 req.Header = reqHeaders 6238 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6239} 6240 6241// Do executes the "androidenterprise.enterprises.pullNotificationSet" call. 6242// Exactly one of *NotificationSet or error will be non-nil. Any non-2xx 6243// status code is an error. Response headers are in either 6244// *NotificationSet.ServerResponse.Header or (if a response was returned 6245// at all) in error.(*googleapi.Error).Header. Use 6246// googleapi.IsNotModified to check whether the returned error was 6247// because http.StatusNotModified was returned. 6248func (c *EnterprisesPullNotificationSetCall) Do(opts ...googleapi.CallOption) (*NotificationSet, error) { 6249 gensupport.SetOptions(c.urlParams_, opts...) 6250 res, err := c.doRequest("json") 6251 if res != nil && res.StatusCode == http.StatusNotModified { 6252 if res.Body != nil { 6253 res.Body.Close() 6254 } 6255 return nil, &googleapi.Error{ 6256 Code: res.StatusCode, 6257 Header: res.Header, 6258 } 6259 } 6260 if err != nil { 6261 return nil, err 6262 } 6263 defer googleapi.CloseBody(res) 6264 if err := googleapi.CheckResponse(res); err != nil { 6265 return nil, err 6266 } 6267 ret := &NotificationSet{ 6268 ServerResponse: googleapi.ServerResponse{ 6269 Header: res.Header, 6270 HTTPStatusCode: res.StatusCode, 6271 }, 6272 } 6273 target := &ret 6274 if err := gensupport.DecodeResponse(target, res); err != nil { 6275 return nil, err 6276 } 6277 return ret, nil 6278 // { 6279 // "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.\nA notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty.\nNotifications 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.\nMultiple 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.\nIf no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.", 6280 // "httpMethod": "POST", 6281 // "id": "androidenterprise.enterprises.pullNotificationSet", 6282 // "parameters": { 6283 // "requestMode": { 6284 // "description": "The request mode for pulling notifications.\nSpecifying 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.\nSpeciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present.\nIf omitted, defaults to waitForNotifications.", 6285 // "enum": [ 6286 // "returnImmediately", 6287 // "waitForNotifications" 6288 // ], 6289 // "enumDescriptions": [ 6290 // "", 6291 // "" 6292 // ], 6293 // "location": "query", 6294 // "type": "string" 6295 // } 6296 // }, 6297 // "path": "enterprises/pullNotificationSet", 6298 // "response": { 6299 // "$ref": "NotificationSet" 6300 // }, 6301 // "scopes": [ 6302 // "https://www.googleapis.com/auth/androidenterprise" 6303 // ] 6304 // } 6305 6306} 6307 6308// method id "androidenterprise.enterprises.sendTestPushNotification": 6309 6310type EnterprisesSendTestPushNotificationCall struct { 6311 s *Service 6312 enterpriseId string 6313 urlParams_ gensupport.URLParams 6314 ctx_ context.Context 6315 header_ http.Header 6316} 6317 6318// SendTestPushNotification: Sends a test notification to validate the 6319// EMM integration with the Google Cloud Pub/Sub service for this 6320// enterprise. 6321func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall { 6322 c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6323 c.enterpriseId = enterpriseId 6324 return c 6325} 6326 6327// Fields allows partial responses to be retrieved. See 6328// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6329// for more information. 6330func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall { 6331 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6332 return c 6333} 6334 6335// Context sets the context to be used in this call's Do method. Any 6336// pending HTTP request will be aborted if the provided context is 6337// canceled. 6338func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall { 6339 c.ctx_ = ctx 6340 return c 6341} 6342 6343// Header returns an http.Header that can be modified by the caller to 6344// add HTTP headers to the request. 6345func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header { 6346 if c.header_ == nil { 6347 c.header_ = make(http.Header) 6348 } 6349 return c.header_ 6350} 6351 6352func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) { 6353 reqHeaders := make(http.Header) 6354 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6355 for k, v := range c.header_ { 6356 reqHeaders[k] = v 6357 } 6358 reqHeaders.Set("User-Agent", c.s.userAgent()) 6359 var body io.Reader = nil 6360 c.urlParams_.Set("alt", alt) 6361 c.urlParams_.Set("prettyPrint", "false") 6362 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification") 6363 urls += "?" + c.urlParams_.Encode() 6364 req, err := http.NewRequest("POST", urls, body) 6365 if err != nil { 6366 return nil, err 6367 } 6368 req.Header = reqHeaders 6369 googleapi.Expand(req.URL, map[string]string{ 6370 "enterpriseId": c.enterpriseId, 6371 }) 6372 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6373} 6374 6375// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call. 6376// Exactly one of *EnterprisesSendTestPushNotificationResponse or error 6377// will be non-nil. Any non-2xx status code is an error. Response 6378// headers are in either 6379// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or 6380// (if a response was returned at all) in 6381// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6382// whether the returned error was because http.StatusNotModified was 6383// returned. 6384func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) { 6385 gensupport.SetOptions(c.urlParams_, opts...) 6386 res, err := c.doRequest("json") 6387 if res != nil && res.StatusCode == http.StatusNotModified { 6388 if res.Body != nil { 6389 res.Body.Close() 6390 } 6391 return nil, &googleapi.Error{ 6392 Code: res.StatusCode, 6393 Header: res.Header, 6394 } 6395 } 6396 if err != nil { 6397 return nil, err 6398 } 6399 defer googleapi.CloseBody(res) 6400 if err := googleapi.CheckResponse(res); err != nil { 6401 return nil, err 6402 } 6403 ret := &EnterprisesSendTestPushNotificationResponse{ 6404 ServerResponse: googleapi.ServerResponse{ 6405 Header: res.Header, 6406 HTTPStatusCode: res.StatusCode, 6407 }, 6408 } 6409 target := &ret 6410 if err := gensupport.DecodeResponse(target, res); err != nil { 6411 return nil, err 6412 } 6413 return ret, nil 6414 // { 6415 // "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.", 6416 // "httpMethod": "POST", 6417 // "id": "androidenterprise.enterprises.sendTestPushNotification", 6418 // "parameterOrder": [ 6419 // "enterpriseId" 6420 // ], 6421 // "parameters": { 6422 // "enterpriseId": { 6423 // "description": "The ID of the enterprise.", 6424 // "location": "path", 6425 // "required": true, 6426 // "type": "string" 6427 // } 6428 // }, 6429 // "path": "enterprises/{enterpriseId}/sendTestPushNotification", 6430 // "response": { 6431 // "$ref": "EnterprisesSendTestPushNotificationResponse" 6432 // }, 6433 // "scopes": [ 6434 // "https://www.googleapis.com/auth/androidenterprise" 6435 // ] 6436 // } 6437 6438} 6439 6440// method id "androidenterprise.enterprises.setAccount": 6441 6442type EnterprisesSetAccountCall struct { 6443 s *Service 6444 enterpriseId string 6445 enterpriseaccount *EnterpriseAccount 6446 urlParams_ gensupport.URLParams 6447 ctx_ context.Context 6448 header_ http.Header 6449} 6450 6451// SetAccount: Sets the account that will be used to authenticate to the 6452// API as the enterprise. 6453func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall { 6454 c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6455 c.enterpriseId = enterpriseId 6456 c.enterpriseaccount = enterpriseaccount 6457 return c 6458} 6459 6460// Fields allows partial responses to be retrieved. See 6461// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6462// for more information. 6463func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall { 6464 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6465 return c 6466} 6467 6468// Context sets the context to be used in this call's Do method. Any 6469// pending HTTP request will be aborted if the provided context is 6470// canceled. 6471func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall { 6472 c.ctx_ = ctx 6473 return c 6474} 6475 6476// Header returns an http.Header that can be modified by the caller to 6477// add HTTP headers to the request. 6478func (c *EnterprisesSetAccountCall) Header() http.Header { 6479 if c.header_ == nil { 6480 c.header_ = make(http.Header) 6481 } 6482 return c.header_ 6483} 6484 6485func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) { 6486 reqHeaders := make(http.Header) 6487 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6488 for k, v := range c.header_ { 6489 reqHeaders[k] = v 6490 } 6491 reqHeaders.Set("User-Agent", c.s.userAgent()) 6492 var body io.Reader = nil 6493 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount) 6494 if err != nil { 6495 return nil, err 6496 } 6497 reqHeaders.Set("Content-Type", "application/json") 6498 c.urlParams_.Set("alt", alt) 6499 c.urlParams_.Set("prettyPrint", "false") 6500 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account") 6501 urls += "?" + c.urlParams_.Encode() 6502 req, err := http.NewRequest("PUT", urls, body) 6503 if err != nil { 6504 return nil, err 6505 } 6506 req.Header = reqHeaders 6507 googleapi.Expand(req.URL, map[string]string{ 6508 "enterpriseId": c.enterpriseId, 6509 }) 6510 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6511} 6512 6513// Do executes the "androidenterprise.enterprises.setAccount" call. 6514// Exactly one of *EnterpriseAccount or error will be non-nil. Any 6515// non-2xx status code is an error. Response headers are in either 6516// *EnterpriseAccount.ServerResponse.Header or (if a response was 6517// returned at all) in error.(*googleapi.Error).Header. Use 6518// googleapi.IsNotModified to check whether the returned error was 6519// because http.StatusNotModified was returned. 6520func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) { 6521 gensupport.SetOptions(c.urlParams_, opts...) 6522 res, err := c.doRequest("json") 6523 if res != nil && res.StatusCode == http.StatusNotModified { 6524 if res.Body != nil { 6525 res.Body.Close() 6526 } 6527 return nil, &googleapi.Error{ 6528 Code: res.StatusCode, 6529 Header: res.Header, 6530 } 6531 } 6532 if err != nil { 6533 return nil, err 6534 } 6535 defer googleapi.CloseBody(res) 6536 if err := googleapi.CheckResponse(res); err != nil { 6537 return nil, err 6538 } 6539 ret := &EnterpriseAccount{ 6540 ServerResponse: googleapi.ServerResponse{ 6541 Header: res.Header, 6542 HTTPStatusCode: res.StatusCode, 6543 }, 6544 } 6545 target := &ret 6546 if err := gensupport.DecodeResponse(target, res); err != nil { 6547 return nil, err 6548 } 6549 return ret, nil 6550 // { 6551 // "description": "Sets the account that will be used to authenticate to the API as the enterprise.", 6552 // "httpMethod": "PUT", 6553 // "id": "androidenterprise.enterprises.setAccount", 6554 // "parameterOrder": [ 6555 // "enterpriseId" 6556 // ], 6557 // "parameters": { 6558 // "enterpriseId": { 6559 // "description": "The ID of the enterprise.", 6560 // "location": "path", 6561 // "required": true, 6562 // "type": "string" 6563 // } 6564 // }, 6565 // "path": "enterprises/{enterpriseId}/account", 6566 // "request": { 6567 // "$ref": "EnterpriseAccount" 6568 // }, 6569 // "response": { 6570 // "$ref": "EnterpriseAccount" 6571 // }, 6572 // "scopes": [ 6573 // "https://www.googleapis.com/auth/androidenterprise" 6574 // ] 6575 // } 6576 6577} 6578 6579// method id "androidenterprise.enterprises.setStoreLayout": 6580 6581type EnterprisesSetStoreLayoutCall struct { 6582 s *Service 6583 enterpriseId string 6584 storelayout *StoreLayout 6585 urlParams_ gensupport.URLParams 6586 ctx_ context.Context 6587 header_ http.Header 6588} 6589 6590// SetStoreLayout: Sets the store layout for the enterprise. By default, 6591// storeLayoutType is set to "basic" and the basic store layout is 6592// enabled. The basic layout only contains apps approved by the admin, 6593// and that have been added to the available product set for a user 6594// (using the setAvailableProductSet call). Apps on the page are sorted 6595// in order of their product ID value. If you create a custom store 6596// layout (by setting storeLayoutType = "custom" and setting a 6597// homepage), the basic store layout is disabled. 6598func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall { 6599 c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6600 c.enterpriseId = enterpriseId 6601 c.storelayout = storelayout 6602 return c 6603} 6604 6605// Fields allows partial responses to be retrieved. See 6606// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6607// for more information. 6608func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall { 6609 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6610 return c 6611} 6612 6613// Context sets the context to be used in this call's Do method. Any 6614// pending HTTP request will be aborted if the provided context is 6615// canceled. 6616func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall { 6617 c.ctx_ = ctx 6618 return c 6619} 6620 6621// Header returns an http.Header that can be modified by the caller to 6622// add HTTP headers to the request. 6623func (c *EnterprisesSetStoreLayoutCall) Header() http.Header { 6624 if c.header_ == nil { 6625 c.header_ = make(http.Header) 6626 } 6627 return c.header_ 6628} 6629 6630func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) { 6631 reqHeaders := make(http.Header) 6632 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6633 for k, v := range c.header_ { 6634 reqHeaders[k] = v 6635 } 6636 reqHeaders.Set("User-Agent", c.s.userAgent()) 6637 var body io.Reader = nil 6638 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout) 6639 if err != nil { 6640 return nil, err 6641 } 6642 reqHeaders.Set("Content-Type", "application/json") 6643 c.urlParams_.Set("alt", alt) 6644 c.urlParams_.Set("prettyPrint", "false") 6645 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout") 6646 urls += "?" + c.urlParams_.Encode() 6647 req, err := http.NewRequest("PUT", urls, body) 6648 if err != nil { 6649 return nil, err 6650 } 6651 req.Header = reqHeaders 6652 googleapi.Expand(req.URL, map[string]string{ 6653 "enterpriseId": c.enterpriseId, 6654 }) 6655 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6656} 6657 6658// Do executes the "androidenterprise.enterprises.setStoreLayout" call. 6659// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx 6660// status code is an error. Response headers are in either 6661// *StoreLayout.ServerResponse.Header or (if a response was returned at 6662// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6663// to check whether the returned error was because 6664// http.StatusNotModified was returned. 6665func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) { 6666 gensupport.SetOptions(c.urlParams_, opts...) 6667 res, err := c.doRequest("json") 6668 if res != nil && res.StatusCode == http.StatusNotModified { 6669 if res.Body != nil { 6670 res.Body.Close() 6671 } 6672 return nil, &googleapi.Error{ 6673 Code: res.StatusCode, 6674 Header: res.Header, 6675 } 6676 } 6677 if err != nil { 6678 return nil, err 6679 } 6680 defer googleapi.CloseBody(res) 6681 if err := googleapi.CheckResponse(res); err != nil { 6682 return nil, err 6683 } 6684 ret := &StoreLayout{ 6685 ServerResponse: googleapi.ServerResponse{ 6686 Header: res.Header, 6687 HTTPStatusCode: res.StatusCode, 6688 }, 6689 } 6690 target := &ret 6691 if err := gensupport.DecodeResponse(target, res); err != nil { 6692 return nil, err 6693 } 6694 return ret, nil 6695 // { 6696 // "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.", 6697 // "httpMethod": "PUT", 6698 // "id": "androidenterprise.enterprises.setStoreLayout", 6699 // "parameterOrder": [ 6700 // "enterpriseId" 6701 // ], 6702 // "parameters": { 6703 // "enterpriseId": { 6704 // "description": "The ID of the enterprise.", 6705 // "location": "path", 6706 // "required": true, 6707 // "type": "string" 6708 // } 6709 // }, 6710 // "path": "enterprises/{enterpriseId}/storeLayout", 6711 // "request": { 6712 // "$ref": "StoreLayout" 6713 // }, 6714 // "response": { 6715 // "$ref": "StoreLayout" 6716 // }, 6717 // "scopes": [ 6718 // "https://www.googleapis.com/auth/androidenterprise" 6719 // ] 6720 // } 6721 6722} 6723 6724// method id "androidenterprise.enterprises.unenroll": 6725 6726type EnterprisesUnenrollCall struct { 6727 s *Service 6728 enterpriseId string 6729 urlParams_ gensupport.URLParams 6730 ctx_ context.Context 6731 header_ http.Header 6732} 6733 6734// Unenroll: Unenrolls an enterprise from the calling EMM. 6735func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall { 6736 c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6737 c.enterpriseId = enterpriseId 6738 return c 6739} 6740 6741// Fields allows partial responses to be retrieved. See 6742// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6743// for more information. 6744func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall { 6745 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6746 return c 6747} 6748 6749// Context sets the context to be used in this call's Do method. Any 6750// pending HTTP request will be aborted if the provided context is 6751// canceled. 6752func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall { 6753 c.ctx_ = ctx 6754 return c 6755} 6756 6757// Header returns an http.Header that can be modified by the caller to 6758// add HTTP headers to the request. 6759func (c *EnterprisesUnenrollCall) Header() http.Header { 6760 if c.header_ == nil { 6761 c.header_ = make(http.Header) 6762 } 6763 return c.header_ 6764} 6765 6766func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) { 6767 reqHeaders := make(http.Header) 6768 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6769 for k, v := range c.header_ { 6770 reqHeaders[k] = v 6771 } 6772 reqHeaders.Set("User-Agent", c.s.userAgent()) 6773 var body io.Reader = nil 6774 c.urlParams_.Set("alt", alt) 6775 c.urlParams_.Set("prettyPrint", "false") 6776 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll") 6777 urls += "?" + c.urlParams_.Encode() 6778 req, err := http.NewRequest("POST", urls, body) 6779 if err != nil { 6780 return nil, err 6781 } 6782 req.Header = reqHeaders 6783 googleapi.Expand(req.URL, map[string]string{ 6784 "enterpriseId": c.enterpriseId, 6785 }) 6786 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6787} 6788 6789// Do executes the "androidenterprise.enterprises.unenroll" call. 6790func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error { 6791 gensupport.SetOptions(c.urlParams_, opts...) 6792 res, err := c.doRequest("json") 6793 if err != nil { 6794 return err 6795 } 6796 defer googleapi.CloseBody(res) 6797 if err := googleapi.CheckResponse(res); err != nil { 6798 return err 6799 } 6800 return nil 6801 // { 6802 // "description": "Unenrolls an enterprise from the calling EMM.", 6803 // "httpMethod": "POST", 6804 // "id": "androidenterprise.enterprises.unenroll", 6805 // "parameterOrder": [ 6806 // "enterpriseId" 6807 // ], 6808 // "parameters": { 6809 // "enterpriseId": { 6810 // "description": "The ID of the enterprise.", 6811 // "location": "path", 6812 // "required": true, 6813 // "type": "string" 6814 // } 6815 // }, 6816 // "path": "enterprises/{enterpriseId}/unenroll", 6817 // "scopes": [ 6818 // "https://www.googleapis.com/auth/androidenterprise" 6819 // ] 6820 // } 6821 6822} 6823 6824// method id "androidenterprise.entitlements.delete": 6825 6826type EntitlementsDeleteCall struct { 6827 s *Service 6828 enterpriseId string 6829 userId string 6830 entitlementId string 6831 urlParams_ gensupport.URLParams 6832 ctx_ context.Context 6833 header_ http.Header 6834} 6835 6836// Delete: Removes an entitlement to an app for a user. 6837func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall { 6838 c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6839 c.enterpriseId = enterpriseId 6840 c.userId = userId 6841 c.entitlementId = entitlementId 6842 return c 6843} 6844 6845// Fields allows partial responses to be retrieved. See 6846// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6847// for more information. 6848func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall { 6849 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6850 return c 6851} 6852 6853// Context sets the context to be used in this call's Do method. Any 6854// pending HTTP request will be aborted if the provided context is 6855// canceled. 6856func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall { 6857 c.ctx_ = ctx 6858 return c 6859} 6860 6861// Header returns an http.Header that can be modified by the caller to 6862// add HTTP headers to the request. 6863func (c *EntitlementsDeleteCall) Header() http.Header { 6864 if c.header_ == nil { 6865 c.header_ = make(http.Header) 6866 } 6867 return c.header_ 6868} 6869 6870func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) { 6871 reqHeaders := make(http.Header) 6872 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 6873 for k, v := range c.header_ { 6874 reqHeaders[k] = v 6875 } 6876 reqHeaders.Set("User-Agent", c.s.userAgent()) 6877 var body io.Reader = nil 6878 c.urlParams_.Set("alt", alt) 6879 c.urlParams_.Set("prettyPrint", "false") 6880 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 6881 urls += "?" + c.urlParams_.Encode() 6882 req, err := http.NewRequest("DELETE", urls, body) 6883 if err != nil { 6884 return nil, err 6885 } 6886 req.Header = reqHeaders 6887 googleapi.Expand(req.URL, map[string]string{ 6888 "enterpriseId": c.enterpriseId, 6889 "userId": c.userId, 6890 "entitlementId": c.entitlementId, 6891 }) 6892 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6893} 6894 6895// Do executes the "androidenterprise.entitlements.delete" call. 6896func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error { 6897 gensupport.SetOptions(c.urlParams_, opts...) 6898 res, err := c.doRequest("json") 6899 if err != nil { 6900 return err 6901 } 6902 defer googleapi.CloseBody(res) 6903 if err := googleapi.CheckResponse(res); err != nil { 6904 return err 6905 } 6906 return nil 6907 // { 6908 // "description": "Removes an entitlement to an app for a user.", 6909 // "httpMethod": "DELETE", 6910 // "id": "androidenterprise.entitlements.delete", 6911 // "parameterOrder": [ 6912 // "enterpriseId", 6913 // "userId", 6914 // "entitlementId" 6915 // ], 6916 // "parameters": { 6917 // "enterpriseId": { 6918 // "description": "The ID of the enterprise.", 6919 // "location": "path", 6920 // "required": true, 6921 // "type": "string" 6922 // }, 6923 // "entitlementId": { 6924 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 6925 // "location": "path", 6926 // "required": true, 6927 // "type": "string" 6928 // }, 6929 // "userId": { 6930 // "description": "The ID of the user.", 6931 // "location": "path", 6932 // "required": true, 6933 // "type": "string" 6934 // } 6935 // }, 6936 // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 6937 // "scopes": [ 6938 // "https://www.googleapis.com/auth/androidenterprise" 6939 // ] 6940 // } 6941 6942} 6943 6944// method id "androidenterprise.entitlements.get": 6945 6946type EntitlementsGetCall struct { 6947 s *Service 6948 enterpriseId string 6949 userId string 6950 entitlementId string 6951 urlParams_ gensupport.URLParams 6952 ifNoneMatch_ string 6953 ctx_ context.Context 6954 header_ http.Header 6955} 6956 6957// Get: Retrieves details of an entitlement. 6958func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall { 6959 c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6960 c.enterpriseId = enterpriseId 6961 c.userId = userId 6962 c.entitlementId = entitlementId 6963 return c 6964} 6965 6966// Fields allows partial responses to be retrieved. See 6967// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6968// for more information. 6969func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall { 6970 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6971 return c 6972} 6973 6974// IfNoneMatch sets the optional parameter which makes the operation 6975// fail if the object's ETag matches the given value. This is useful for 6976// getting updates only after the object has changed since the last 6977// request. Use googleapi.IsNotModified to check whether the response 6978// error from Do is the result of In-None-Match. 6979func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall { 6980 c.ifNoneMatch_ = entityTag 6981 return c 6982} 6983 6984// Context sets the context to be used in this call's Do method. Any 6985// pending HTTP request will be aborted if the provided context is 6986// canceled. 6987func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall { 6988 c.ctx_ = ctx 6989 return c 6990} 6991 6992// Header returns an http.Header that can be modified by the caller to 6993// add HTTP headers to the request. 6994func (c *EntitlementsGetCall) Header() http.Header { 6995 if c.header_ == nil { 6996 c.header_ = make(http.Header) 6997 } 6998 return c.header_ 6999} 7000 7001func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) { 7002 reqHeaders := make(http.Header) 7003 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7004 for k, v := range c.header_ { 7005 reqHeaders[k] = v 7006 } 7007 reqHeaders.Set("User-Agent", c.s.userAgent()) 7008 if c.ifNoneMatch_ != "" { 7009 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7010 } 7011 var body io.Reader = nil 7012 c.urlParams_.Set("alt", alt) 7013 c.urlParams_.Set("prettyPrint", "false") 7014 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7015 urls += "?" + c.urlParams_.Encode() 7016 req, err := http.NewRequest("GET", urls, body) 7017 if err != nil { 7018 return nil, err 7019 } 7020 req.Header = reqHeaders 7021 googleapi.Expand(req.URL, map[string]string{ 7022 "enterpriseId": c.enterpriseId, 7023 "userId": c.userId, 7024 "entitlementId": c.entitlementId, 7025 }) 7026 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7027} 7028 7029// Do executes the "androidenterprise.entitlements.get" call. 7030// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7031// status code is an error. Response headers are in either 7032// *Entitlement.ServerResponse.Header or (if a response was returned at 7033// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7034// to check whether the returned error was because 7035// http.StatusNotModified was returned. 7036func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7037 gensupport.SetOptions(c.urlParams_, opts...) 7038 res, err := c.doRequest("json") 7039 if res != nil && res.StatusCode == http.StatusNotModified { 7040 if res.Body != nil { 7041 res.Body.Close() 7042 } 7043 return nil, &googleapi.Error{ 7044 Code: res.StatusCode, 7045 Header: res.Header, 7046 } 7047 } 7048 if err != nil { 7049 return nil, err 7050 } 7051 defer googleapi.CloseBody(res) 7052 if err := googleapi.CheckResponse(res); err != nil { 7053 return nil, err 7054 } 7055 ret := &Entitlement{ 7056 ServerResponse: googleapi.ServerResponse{ 7057 Header: res.Header, 7058 HTTPStatusCode: res.StatusCode, 7059 }, 7060 } 7061 target := &ret 7062 if err := gensupport.DecodeResponse(target, res); err != nil { 7063 return nil, err 7064 } 7065 return ret, nil 7066 // { 7067 // "description": "Retrieves details of an entitlement.", 7068 // "httpMethod": "GET", 7069 // "id": "androidenterprise.entitlements.get", 7070 // "parameterOrder": [ 7071 // "enterpriseId", 7072 // "userId", 7073 // "entitlementId" 7074 // ], 7075 // "parameters": { 7076 // "enterpriseId": { 7077 // "description": "The ID of the enterprise.", 7078 // "location": "path", 7079 // "required": true, 7080 // "type": "string" 7081 // }, 7082 // "entitlementId": { 7083 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7084 // "location": "path", 7085 // "required": true, 7086 // "type": "string" 7087 // }, 7088 // "userId": { 7089 // "description": "The ID of the user.", 7090 // "location": "path", 7091 // "required": true, 7092 // "type": "string" 7093 // } 7094 // }, 7095 // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7096 // "response": { 7097 // "$ref": "Entitlement" 7098 // }, 7099 // "scopes": [ 7100 // "https://www.googleapis.com/auth/androidenterprise" 7101 // ] 7102 // } 7103 7104} 7105 7106// method id "androidenterprise.entitlements.list": 7107 7108type EntitlementsListCall struct { 7109 s *Service 7110 enterpriseId string 7111 userId string 7112 urlParams_ gensupport.URLParams 7113 ifNoneMatch_ string 7114 ctx_ context.Context 7115 header_ http.Header 7116} 7117 7118// List: Lists all entitlements for the specified user. Only the ID is 7119// set. 7120func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall { 7121 c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7122 c.enterpriseId = enterpriseId 7123 c.userId = userId 7124 return c 7125} 7126 7127// Fields allows partial responses to be retrieved. See 7128// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7129// for more information. 7130func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall { 7131 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7132 return c 7133} 7134 7135// IfNoneMatch sets the optional parameter which makes the operation 7136// fail if the object's ETag matches the given value. This is useful for 7137// getting updates only after the object has changed since the last 7138// request. Use googleapi.IsNotModified to check whether the response 7139// error from Do is the result of In-None-Match. 7140func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall { 7141 c.ifNoneMatch_ = entityTag 7142 return c 7143} 7144 7145// Context sets the context to be used in this call's Do method. Any 7146// pending HTTP request will be aborted if the provided context is 7147// canceled. 7148func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall { 7149 c.ctx_ = ctx 7150 return c 7151} 7152 7153// Header returns an http.Header that can be modified by the caller to 7154// add HTTP headers to the request. 7155func (c *EntitlementsListCall) Header() http.Header { 7156 if c.header_ == nil { 7157 c.header_ = make(http.Header) 7158 } 7159 return c.header_ 7160} 7161 7162func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { 7163 reqHeaders := make(http.Header) 7164 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7165 for k, v := range c.header_ { 7166 reqHeaders[k] = v 7167 } 7168 reqHeaders.Set("User-Agent", c.s.userAgent()) 7169 if c.ifNoneMatch_ != "" { 7170 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7171 } 7172 var body io.Reader = nil 7173 c.urlParams_.Set("alt", alt) 7174 c.urlParams_.Set("prettyPrint", "false") 7175 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements") 7176 urls += "?" + c.urlParams_.Encode() 7177 req, err := http.NewRequest("GET", urls, body) 7178 if err != nil { 7179 return nil, err 7180 } 7181 req.Header = reqHeaders 7182 googleapi.Expand(req.URL, map[string]string{ 7183 "enterpriseId": c.enterpriseId, 7184 "userId": c.userId, 7185 }) 7186 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7187} 7188 7189// Do executes the "androidenterprise.entitlements.list" call. 7190// Exactly one of *EntitlementsListResponse or error will be non-nil. 7191// Any non-2xx status code is an error. Response headers are in either 7192// *EntitlementsListResponse.ServerResponse.Header or (if a response was 7193// returned at all) in error.(*googleapi.Error).Header. Use 7194// googleapi.IsNotModified to check whether the returned error was 7195// because http.StatusNotModified was returned. 7196func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) { 7197 gensupport.SetOptions(c.urlParams_, opts...) 7198 res, err := c.doRequest("json") 7199 if res != nil && res.StatusCode == http.StatusNotModified { 7200 if res.Body != nil { 7201 res.Body.Close() 7202 } 7203 return nil, &googleapi.Error{ 7204 Code: res.StatusCode, 7205 Header: res.Header, 7206 } 7207 } 7208 if err != nil { 7209 return nil, err 7210 } 7211 defer googleapi.CloseBody(res) 7212 if err := googleapi.CheckResponse(res); err != nil { 7213 return nil, err 7214 } 7215 ret := &EntitlementsListResponse{ 7216 ServerResponse: googleapi.ServerResponse{ 7217 Header: res.Header, 7218 HTTPStatusCode: res.StatusCode, 7219 }, 7220 } 7221 target := &ret 7222 if err := gensupport.DecodeResponse(target, res); err != nil { 7223 return nil, err 7224 } 7225 return ret, nil 7226 // { 7227 // "description": "Lists all entitlements for the specified user. Only the ID is set.", 7228 // "httpMethod": "GET", 7229 // "id": "androidenterprise.entitlements.list", 7230 // "parameterOrder": [ 7231 // "enterpriseId", 7232 // "userId" 7233 // ], 7234 // "parameters": { 7235 // "enterpriseId": { 7236 // "description": "The ID of the enterprise.", 7237 // "location": "path", 7238 // "required": true, 7239 // "type": "string" 7240 // }, 7241 // "userId": { 7242 // "description": "The ID of the user.", 7243 // "location": "path", 7244 // "required": true, 7245 // "type": "string" 7246 // } 7247 // }, 7248 // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements", 7249 // "response": { 7250 // "$ref": "EntitlementsListResponse" 7251 // }, 7252 // "scopes": [ 7253 // "https://www.googleapis.com/auth/androidenterprise" 7254 // ] 7255 // } 7256 7257} 7258 7259// method id "androidenterprise.entitlements.update": 7260 7261type EntitlementsUpdateCall struct { 7262 s *Service 7263 enterpriseId string 7264 userId string 7265 entitlementId string 7266 entitlement *Entitlement 7267 urlParams_ gensupport.URLParams 7268 ctx_ context.Context 7269 header_ http.Header 7270} 7271 7272// Update: Adds or updates an entitlement to an app for a user. 7273func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall { 7274 c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7275 c.enterpriseId = enterpriseId 7276 c.userId = userId 7277 c.entitlementId = entitlementId 7278 c.entitlement = entitlement 7279 return c 7280} 7281 7282// Install sets the optional parameter "install": Set to true to also 7283// install the product on all the user's devices where possible. Failure 7284// to install on one or more devices will not prevent this operation 7285// from returning successfully, as long as the entitlement was 7286// successfully assigned to the user. 7287func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall { 7288 c.urlParams_.Set("install", fmt.Sprint(install)) 7289 return c 7290} 7291 7292// Fields allows partial responses to be retrieved. See 7293// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7294// for more information. 7295func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall { 7296 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7297 return c 7298} 7299 7300// Context sets the context to be used in this call's Do method. Any 7301// pending HTTP request will be aborted if the provided context is 7302// canceled. 7303func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall { 7304 c.ctx_ = ctx 7305 return c 7306} 7307 7308// Header returns an http.Header that can be modified by the caller to 7309// add HTTP headers to the request. 7310func (c *EntitlementsUpdateCall) Header() http.Header { 7311 if c.header_ == nil { 7312 c.header_ = make(http.Header) 7313 } 7314 return c.header_ 7315} 7316 7317func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) { 7318 reqHeaders := make(http.Header) 7319 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7320 for k, v := range c.header_ { 7321 reqHeaders[k] = v 7322 } 7323 reqHeaders.Set("User-Agent", c.s.userAgent()) 7324 var body io.Reader = nil 7325 body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) 7326 if err != nil { 7327 return nil, err 7328 } 7329 reqHeaders.Set("Content-Type", "application/json") 7330 c.urlParams_.Set("alt", alt) 7331 c.urlParams_.Set("prettyPrint", "false") 7332 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") 7333 urls += "?" + c.urlParams_.Encode() 7334 req, err := http.NewRequest("PUT", urls, body) 7335 if err != nil { 7336 return nil, err 7337 } 7338 req.Header = reqHeaders 7339 googleapi.Expand(req.URL, map[string]string{ 7340 "enterpriseId": c.enterpriseId, 7341 "userId": c.userId, 7342 "entitlementId": c.entitlementId, 7343 }) 7344 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7345} 7346 7347// Do executes the "androidenterprise.entitlements.update" call. 7348// Exactly one of *Entitlement or error will be non-nil. Any non-2xx 7349// status code is an error. Response headers are in either 7350// *Entitlement.ServerResponse.Header or (if a response was returned at 7351// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7352// to check whether the returned error was because 7353// http.StatusNotModified was returned. 7354func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) { 7355 gensupport.SetOptions(c.urlParams_, opts...) 7356 res, err := c.doRequest("json") 7357 if res != nil && res.StatusCode == http.StatusNotModified { 7358 if res.Body != nil { 7359 res.Body.Close() 7360 } 7361 return nil, &googleapi.Error{ 7362 Code: res.StatusCode, 7363 Header: res.Header, 7364 } 7365 } 7366 if err != nil { 7367 return nil, err 7368 } 7369 defer googleapi.CloseBody(res) 7370 if err := googleapi.CheckResponse(res); err != nil { 7371 return nil, err 7372 } 7373 ret := &Entitlement{ 7374 ServerResponse: googleapi.ServerResponse{ 7375 Header: res.Header, 7376 HTTPStatusCode: res.StatusCode, 7377 }, 7378 } 7379 target := &ret 7380 if err := gensupport.DecodeResponse(target, res); err != nil { 7381 return nil, err 7382 } 7383 return ret, nil 7384 // { 7385 // "description": "Adds or updates an entitlement to an app for a user.", 7386 // "httpMethod": "PUT", 7387 // "id": "androidenterprise.entitlements.update", 7388 // "parameterOrder": [ 7389 // "enterpriseId", 7390 // "userId", 7391 // "entitlementId" 7392 // ], 7393 // "parameters": { 7394 // "enterpriseId": { 7395 // "description": "The ID of the enterprise.", 7396 // "location": "path", 7397 // "required": true, 7398 // "type": "string" 7399 // }, 7400 // "entitlementId": { 7401 // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".", 7402 // "location": "path", 7403 // "required": true, 7404 // "type": "string" 7405 // }, 7406 // "install": { 7407 // "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.", 7408 // "location": "query", 7409 // "type": "boolean" 7410 // }, 7411 // "userId": { 7412 // "description": "The ID of the user.", 7413 // "location": "path", 7414 // "required": true, 7415 // "type": "string" 7416 // } 7417 // }, 7418 // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", 7419 // "request": { 7420 // "$ref": "Entitlement" 7421 // }, 7422 // "response": { 7423 // "$ref": "Entitlement" 7424 // }, 7425 // "scopes": [ 7426 // "https://www.googleapis.com/auth/androidenterprise" 7427 // ] 7428 // } 7429 7430} 7431 7432// method id "androidenterprise.grouplicenses.get": 7433 7434type GrouplicensesGetCall struct { 7435 s *Service 7436 enterpriseId string 7437 groupLicenseId string 7438 urlParams_ gensupport.URLParams 7439 ifNoneMatch_ string 7440 ctx_ context.Context 7441 header_ http.Header 7442} 7443 7444// Get: Retrieves details of an enterprise's group license for a 7445// product. 7446func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall { 7447 c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7448 c.enterpriseId = enterpriseId 7449 c.groupLicenseId = groupLicenseId 7450 return c 7451} 7452 7453// Fields allows partial responses to be retrieved. See 7454// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7455// for more information. 7456func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall { 7457 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7458 return c 7459} 7460 7461// IfNoneMatch sets the optional parameter which makes the operation 7462// fail if the object's ETag matches the given value. This is useful for 7463// getting updates only after the object has changed since the last 7464// request. Use googleapi.IsNotModified to check whether the response 7465// error from Do is the result of In-None-Match. 7466func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall { 7467 c.ifNoneMatch_ = entityTag 7468 return c 7469} 7470 7471// Context sets the context to be used in this call's Do method. Any 7472// pending HTTP request will be aborted if the provided context is 7473// canceled. 7474func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall { 7475 c.ctx_ = ctx 7476 return c 7477} 7478 7479// Header returns an http.Header that can be modified by the caller to 7480// add HTTP headers to the request. 7481func (c *GrouplicensesGetCall) Header() http.Header { 7482 if c.header_ == nil { 7483 c.header_ = make(http.Header) 7484 } 7485 return c.header_ 7486} 7487 7488func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) { 7489 reqHeaders := make(http.Header) 7490 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7491 for k, v := range c.header_ { 7492 reqHeaders[k] = v 7493 } 7494 reqHeaders.Set("User-Agent", c.s.userAgent()) 7495 if c.ifNoneMatch_ != "" { 7496 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7497 } 7498 var body io.Reader = nil 7499 c.urlParams_.Set("alt", alt) 7500 c.urlParams_.Set("prettyPrint", "false") 7501 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}") 7502 urls += "?" + c.urlParams_.Encode() 7503 req, err := http.NewRequest("GET", urls, body) 7504 if err != nil { 7505 return nil, err 7506 } 7507 req.Header = reqHeaders 7508 googleapi.Expand(req.URL, map[string]string{ 7509 "enterpriseId": c.enterpriseId, 7510 "groupLicenseId": c.groupLicenseId, 7511 }) 7512 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7513} 7514 7515// Do executes the "androidenterprise.grouplicenses.get" call. 7516// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx 7517// status code is an error. Response headers are in either 7518// *GroupLicense.ServerResponse.Header or (if a response was returned at 7519// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7520// to check whether the returned error was because 7521// http.StatusNotModified was returned. 7522func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) { 7523 gensupport.SetOptions(c.urlParams_, opts...) 7524 res, err := c.doRequest("json") 7525 if res != nil && res.StatusCode == http.StatusNotModified { 7526 if res.Body != nil { 7527 res.Body.Close() 7528 } 7529 return nil, &googleapi.Error{ 7530 Code: res.StatusCode, 7531 Header: res.Header, 7532 } 7533 } 7534 if err != nil { 7535 return nil, err 7536 } 7537 defer googleapi.CloseBody(res) 7538 if err := googleapi.CheckResponse(res); err != nil { 7539 return nil, err 7540 } 7541 ret := &GroupLicense{ 7542 ServerResponse: googleapi.ServerResponse{ 7543 Header: res.Header, 7544 HTTPStatusCode: res.StatusCode, 7545 }, 7546 } 7547 target := &ret 7548 if err := gensupport.DecodeResponse(target, res); err != nil { 7549 return nil, err 7550 } 7551 return ret, nil 7552 // { 7553 // "description": "Retrieves details of an enterprise's group license for a product.", 7554 // "httpMethod": "GET", 7555 // "id": "androidenterprise.grouplicenses.get", 7556 // "parameterOrder": [ 7557 // "enterpriseId", 7558 // "groupLicenseId" 7559 // ], 7560 // "parameters": { 7561 // "enterpriseId": { 7562 // "description": "The ID of the enterprise.", 7563 // "location": "path", 7564 // "required": true, 7565 // "type": "string" 7566 // }, 7567 // "groupLicenseId": { 7568 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 7569 // "location": "path", 7570 // "required": true, 7571 // "type": "string" 7572 // } 7573 // }, 7574 // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", 7575 // "response": { 7576 // "$ref": "GroupLicense" 7577 // }, 7578 // "scopes": [ 7579 // "https://www.googleapis.com/auth/androidenterprise" 7580 // ] 7581 // } 7582 7583} 7584 7585// method id "androidenterprise.grouplicenses.list": 7586 7587type GrouplicensesListCall struct { 7588 s *Service 7589 enterpriseId string 7590 urlParams_ gensupport.URLParams 7591 ifNoneMatch_ string 7592 ctx_ context.Context 7593 header_ http.Header 7594} 7595 7596// List: Retrieves IDs of all products for which the enterprise has a 7597// group license. 7598func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall { 7599 c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7600 c.enterpriseId = enterpriseId 7601 return c 7602} 7603 7604// Fields allows partial responses to be retrieved. See 7605// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7606// for more information. 7607func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall { 7608 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7609 return c 7610} 7611 7612// IfNoneMatch sets the optional parameter which makes the operation 7613// fail if the object's ETag matches the given value. This is useful for 7614// getting updates only after the object has changed since the last 7615// request. Use googleapi.IsNotModified to check whether the response 7616// error from Do is the result of In-None-Match. 7617func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall { 7618 c.ifNoneMatch_ = entityTag 7619 return c 7620} 7621 7622// Context sets the context to be used in this call's Do method. Any 7623// pending HTTP request will be aborted if the provided context is 7624// canceled. 7625func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall { 7626 c.ctx_ = ctx 7627 return c 7628} 7629 7630// Header returns an http.Header that can be modified by the caller to 7631// add HTTP headers to the request. 7632func (c *GrouplicensesListCall) Header() http.Header { 7633 if c.header_ == nil { 7634 c.header_ = make(http.Header) 7635 } 7636 return c.header_ 7637} 7638 7639func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) { 7640 reqHeaders := make(http.Header) 7641 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7642 for k, v := range c.header_ { 7643 reqHeaders[k] = v 7644 } 7645 reqHeaders.Set("User-Agent", c.s.userAgent()) 7646 if c.ifNoneMatch_ != "" { 7647 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7648 } 7649 var body io.Reader = nil 7650 c.urlParams_.Set("alt", alt) 7651 c.urlParams_.Set("prettyPrint", "false") 7652 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses") 7653 urls += "?" + c.urlParams_.Encode() 7654 req, err := http.NewRequest("GET", urls, body) 7655 if err != nil { 7656 return nil, err 7657 } 7658 req.Header = reqHeaders 7659 googleapi.Expand(req.URL, map[string]string{ 7660 "enterpriseId": c.enterpriseId, 7661 }) 7662 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7663} 7664 7665// Do executes the "androidenterprise.grouplicenses.list" call. 7666// Exactly one of *GroupLicensesListResponse or error will be non-nil. 7667// Any non-2xx status code is an error. Response headers are in either 7668// *GroupLicensesListResponse.ServerResponse.Header or (if a response 7669// was returned at all) in error.(*googleapi.Error).Header. Use 7670// googleapi.IsNotModified to check whether the returned error was 7671// because http.StatusNotModified was returned. 7672func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) { 7673 gensupport.SetOptions(c.urlParams_, opts...) 7674 res, err := c.doRequest("json") 7675 if res != nil && res.StatusCode == http.StatusNotModified { 7676 if res.Body != nil { 7677 res.Body.Close() 7678 } 7679 return nil, &googleapi.Error{ 7680 Code: res.StatusCode, 7681 Header: res.Header, 7682 } 7683 } 7684 if err != nil { 7685 return nil, err 7686 } 7687 defer googleapi.CloseBody(res) 7688 if err := googleapi.CheckResponse(res); err != nil { 7689 return nil, err 7690 } 7691 ret := &GroupLicensesListResponse{ 7692 ServerResponse: googleapi.ServerResponse{ 7693 Header: res.Header, 7694 HTTPStatusCode: res.StatusCode, 7695 }, 7696 } 7697 target := &ret 7698 if err := gensupport.DecodeResponse(target, res); err != nil { 7699 return nil, err 7700 } 7701 return ret, nil 7702 // { 7703 // "description": "Retrieves IDs of all products for which the enterprise has a group license.", 7704 // "httpMethod": "GET", 7705 // "id": "androidenterprise.grouplicenses.list", 7706 // "parameterOrder": [ 7707 // "enterpriseId" 7708 // ], 7709 // "parameters": { 7710 // "enterpriseId": { 7711 // "description": "The ID of the enterprise.", 7712 // "location": "path", 7713 // "required": true, 7714 // "type": "string" 7715 // } 7716 // }, 7717 // "path": "enterprises/{enterpriseId}/groupLicenses", 7718 // "response": { 7719 // "$ref": "GroupLicensesListResponse" 7720 // }, 7721 // "scopes": [ 7722 // "https://www.googleapis.com/auth/androidenterprise" 7723 // ] 7724 // } 7725 7726} 7727 7728// method id "androidenterprise.grouplicenseusers.list": 7729 7730type GrouplicenseusersListCall struct { 7731 s *Service 7732 enterpriseId string 7733 groupLicenseId string 7734 urlParams_ gensupport.URLParams 7735 ifNoneMatch_ string 7736 ctx_ context.Context 7737 header_ http.Header 7738} 7739 7740// List: Retrieves the IDs of the users who have been granted 7741// entitlements under the license. 7742func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall { 7743 c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7744 c.enterpriseId = enterpriseId 7745 c.groupLicenseId = groupLicenseId 7746 return c 7747} 7748 7749// Fields allows partial responses to be retrieved. See 7750// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7751// for more information. 7752func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall { 7753 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7754 return c 7755} 7756 7757// IfNoneMatch sets the optional parameter which makes the operation 7758// fail if the object's ETag matches the given value. This is useful for 7759// getting updates only after the object has changed since the last 7760// request. Use googleapi.IsNotModified to check whether the response 7761// error from Do is the result of In-None-Match. 7762func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall { 7763 c.ifNoneMatch_ = entityTag 7764 return c 7765} 7766 7767// Context sets the context to be used in this call's Do method. Any 7768// pending HTTP request will be aborted if the provided context is 7769// canceled. 7770func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall { 7771 c.ctx_ = ctx 7772 return c 7773} 7774 7775// Header returns an http.Header that can be modified by the caller to 7776// add HTTP headers to the request. 7777func (c *GrouplicenseusersListCall) Header() http.Header { 7778 if c.header_ == nil { 7779 c.header_ = make(http.Header) 7780 } 7781 return c.header_ 7782} 7783 7784func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) { 7785 reqHeaders := make(http.Header) 7786 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7787 for k, v := range c.header_ { 7788 reqHeaders[k] = v 7789 } 7790 reqHeaders.Set("User-Agent", c.s.userAgent()) 7791 if c.ifNoneMatch_ != "" { 7792 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7793 } 7794 var body io.Reader = nil 7795 c.urlParams_.Set("alt", alt) 7796 c.urlParams_.Set("prettyPrint", "false") 7797 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users") 7798 urls += "?" + c.urlParams_.Encode() 7799 req, err := http.NewRequest("GET", urls, body) 7800 if err != nil { 7801 return nil, err 7802 } 7803 req.Header = reqHeaders 7804 googleapi.Expand(req.URL, map[string]string{ 7805 "enterpriseId": c.enterpriseId, 7806 "groupLicenseId": c.groupLicenseId, 7807 }) 7808 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7809} 7810 7811// Do executes the "androidenterprise.grouplicenseusers.list" call. 7812// Exactly one of *GroupLicenseUsersListResponse or error will be 7813// non-nil. Any non-2xx status code is an error. Response headers are in 7814// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a 7815// response was returned at all) in error.(*googleapi.Error).Header. Use 7816// googleapi.IsNotModified to check whether the returned error was 7817// because http.StatusNotModified was returned. 7818func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) { 7819 gensupport.SetOptions(c.urlParams_, opts...) 7820 res, err := c.doRequest("json") 7821 if res != nil && res.StatusCode == http.StatusNotModified { 7822 if res.Body != nil { 7823 res.Body.Close() 7824 } 7825 return nil, &googleapi.Error{ 7826 Code: res.StatusCode, 7827 Header: res.Header, 7828 } 7829 } 7830 if err != nil { 7831 return nil, err 7832 } 7833 defer googleapi.CloseBody(res) 7834 if err := googleapi.CheckResponse(res); err != nil { 7835 return nil, err 7836 } 7837 ret := &GroupLicenseUsersListResponse{ 7838 ServerResponse: googleapi.ServerResponse{ 7839 Header: res.Header, 7840 HTTPStatusCode: res.StatusCode, 7841 }, 7842 } 7843 target := &ret 7844 if err := gensupport.DecodeResponse(target, res); err != nil { 7845 return nil, err 7846 } 7847 return ret, nil 7848 // { 7849 // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.", 7850 // "httpMethod": "GET", 7851 // "id": "androidenterprise.grouplicenseusers.list", 7852 // "parameterOrder": [ 7853 // "enterpriseId", 7854 // "groupLicenseId" 7855 // ], 7856 // "parameters": { 7857 // "enterpriseId": { 7858 // "description": "The ID of the enterprise.", 7859 // "location": "path", 7860 // "required": true, 7861 // "type": "string" 7862 // }, 7863 // "groupLicenseId": { 7864 // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", 7865 // "location": "path", 7866 // "required": true, 7867 // "type": "string" 7868 // } 7869 // }, 7870 // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", 7871 // "response": { 7872 // "$ref": "GroupLicenseUsersListResponse" 7873 // }, 7874 // "scopes": [ 7875 // "https://www.googleapis.com/auth/androidenterprise" 7876 // ] 7877 // } 7878 7879} 7880 7881// method id "androidenterprise.installs.delete": 7882 7883type InstallsDeleteCall struct { 7884 s *Service 7885 enterpriseId string 7886 userId string 7887 deviceId string 7888 installId string 7889 urlParams_ gensupport.URLParams 7890 ctx_ context.Context 7891 header_ http.Header 7892} 7893 7894// Delete: Requests to remove an app from a device. A call to get or 7895// list will still show the app as installed on the device until it is 7896// actually removed. 7897func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall { 7898 c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7899 c.enterpriseId = enterpriseId 7900 c.userId = userId 7901 c.deviceId = deviceId 7902 c.installId = installId 7903 return c 7904} 7905 7906// Fields allows partial responses to be retrieved. See 7907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7908// for more information. 7909func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall { 7910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7911 return c 7912} 7913 7914// Context sets the context to be used in this call's Do method. Any 7915// pending HTTP request will be aborted if the provided context is 7916// canceled. 7917func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall { 7918 c.ctx_ = ctx 7919 return c 7920} 7921 7922// Header returns an http.Header that can be modified by the caller to 7923// add HTTP headers to the request. 7924func (c *InstallsDeleteCall) Header() http.Header { 7925 if c.header_ == nil { 7926 c.header_ = make(http.Header) 7927 } 7928 return c.header_ 7929} 7930 7931func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) { 7932 reqHeaders := make(http.Header) 7933 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 7934 for k, v := range c.header_ { 7935 reqHeaders[k] = v 7936 } 7937 reqHeaders.Set("User-Agent", c.s.userAgent()) 7938 var body io.Reader = nil 7939 c.urlParams_.Set("alt", alt) 7940 c.urlParams_.Set("prettyPrint", "false") 7941 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 7942 urls += "?" + c.urlParams_.Encode() 7943 req, err := http.NewRequest("DELETE", urls, body) 7944 if err != nil { 7945 return nil, err 7946 } 7947 req.Header = reqHeaders 7948 googleapi.Expand(req.URL, map[string]string{ 7949 "enterpriseId": c.enterpriseId, 7950 "userId": c.userId, 7951 "deviceId": c.deviceId, 7952 "installId": c.installId, 7953 }) 7954 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7955} 7956 7957// Do executes the "androidenterprise.installs.delete" call. 7958func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error { 7959 gensupport.SetOptions(c.urlParams_, opts...) 7960 res, err := c.doRequest("json") 7961 if err != nil { 7962 return err 7963 } 7964 defer googleapi.CloseBody(res) 7965 if err := googleapi.CheckResponse(res); err != nil { 7966 return err 7967 } 7968 return nil 7969 // { 7970 // "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.", 7971 // "httpMethod": "DELETE", 7972 // "id": "androidenterprise.installs.delete", 7973 // "parameterOrder": [ 7974 // "enterpriseId", 7975 // "userId", 7976 // "deviceId", 7977 // "installId" 7978 // ], 7979 // "parameters": { 7980 // "deviceId": { 7981 // "description": "The Android ID of the device.", 7982 // "location": "path", 7983 // "required": true, 7984 // "type": "string" 7985 // }, 7986 // "enterpriseId": { 7987 // "description": "The ID of the enterprise.", 7988 // "location": "path", 7989 // "required": true, 7990 // "type": "string" 7991 // }, 7992 // "installId": { 7993 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 7994 // "location": "path", 7995 // "required": true, 7996 // "type": "string" 7997 // }, 7998 // "userId": { 7999 // "description": "The ID of the user.", 8000 // "location": "path", 8001 // "required": true, 8002 // "type": "string" 8003 // } 8004 // }, 8005 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8006 // "scopes": [ 8007 // "https://www.googleapis.com/auth/androidenterprise" 8008 // ] 8009 // } 8010 8011} 8012 8013// method id "androidenterprise.installs.get": 8014 8015type InstallsGetCall struct { 8016 s *Service 8017 enterpriseId string 8018 userId string 8019 deviceId string 8020 installId string 8021 urlParams_ gensupport.URLParams 8022 ifNoneMatch_ string 8023 ctx_ context.Context 8024 header_ http.Header 8025} 8026 8027// Get: Retrieves details of an installation of an app on a device. 8028func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall { 8029 c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8030 c.enterpriseId = enterpriseId 8031 c.userId = userId 8032 c.deviceId = deviceId 8033 c.installId = installId 8034 return c 8035} 8036 8037// Fields allows partial responses to be retrieved. See 8038// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8039// for more information. 8040func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall { 8041 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8042 return c 8043} 8044 8045// IfNoneMatch sets the optional parameter which makes the operation 8046// fail if the object's ETag matches the given value. This is useful for 8047// getting updates only after the object has changed since the last 8048// request. Use googleapi.IsNotModified to check whether the response 8049// error from Do is the result of In-None-Match. 8050func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall { 8051 c.ifNoneMatch_ = entityTag 8052 return c 8053} 8054 8055// Context sets the context to be used in this call's Do method. Any 8056// pending HTTP request will be aborted if the provided context is 8057// canceled. 8058func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall { 8059 c.ctx_ = ctx 8060 return c 8061} 8062 8063// Header returns an http.Header that can be modified by the caller to 8064// add HTTP headers to the request. 8065func (c *InstallsGetCall) Header() http.Header { 8066 if c.header_ == nil { 8067 c.header_ = make(http.Header) 8068 } 8069 return c.header_ 8070} 8071 8072func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) { 8073 reqHeaders := make(http.Header) 8074 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8075 for k, v := range c.header_ { 8076 reqHeaders[k] = v 8077 } 8078 reqHeaders.Set("User-Agent", c.s.userAgent()) 8079 if c.ifNoneMatch_ != "" { 8080 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8081 } 8082 var body io.Reader = nil 8083 c.urlParams_.Set("alt", alt) 8084 c.urlParams_.Set("prettyPrint", "false") 8085 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8086 urls += "?" + c.urlParams_.Encode() 8087 req, err := http.NewRequest("GET", urls, body) 8088 if err != nil { 8089 return nil, err 8090 } 8091 req.Header = reqHeaders 8092 googleapi.Expand(req.URL, map[string]string{ 8093 "enterpriseId": c.enterpriseId, 8094 "userId": c.userId, 8095 "deviceId": c.deviceId, 8096 "installId": c.installId, 8097 }) 8098 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8099} 8100 8101// Do executes the "androidenterprise.installs.get" call. 8102// Exactly one of *Install or error will be non-nil. Any non-2xx status 8103// code is an error. Response headers are in either 8104// *Install.ServerResponse.Header or (if a response was returned at all) 8105// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8106// check whether the returned error was because http.StatusNotModified 8107// was returned. 8108func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8109 gensupport.SetOptions(c.urlParams_, opts...) 8110 res, err := c.doRequest("json") 8111 if res != nil && res.StatusCode == http.StatusNotModified { 8112 if res.Body != nil { 8113 res.Body.Close() 8114 } 8115 return nil, &googleapi.Error{ 8116 Code: res.StatusCode, 8117 Header: res.Header, 8118 } 8119 } 8120 if err != nil { 8121 return nil, err 8122 } 8123 defer googleapi.CloseBody(res) 8124 if err := googleapi.CheckResponse(res); err != nil { 8125 return nil, err 8126 } 8127 ret := &Install{ 8128 ServerResponse: googleapi.ServerResponse{ 8129 Header: res.Header, 8130 HTTPStatusCode: res.StatusCode, 8131 }, 8132 } 8133 target := &ret 8134 if err := gensupport.DecodeResponse(target, res); err != nil { 8135 return nil, err 8136 } 8137 return ret, nil 8138 // { 8139 // "description": "Retrieves details of an installation of an app on a device.", 8140 // "httpMethod": "GET", 8141 // "id": "androidenterprise.installs.get", 8142 // "parameterOrder": [ 8143 // "enterpriseId", 8144 // "userId", 8145 // "deviceId", 8146 // "installId" 8147 // ], 8148 // "parameters": { 8149 // "deviceId": { 8150 // "description": "The Android ID of the device.", 8151 // "location": "path", 8152 // "required": true, 8153 // "type": "string" 8154 // }, 8155 // "enterpriseId": { 8156 // "description": "The ID of the enterprise.", 8157 // "location": "path", 8158 // "required": true, 8159 // "type": "string" 8160 // }, 8161 // "installId": { 8162 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8163 // "location": "path", 8164 // "required": true, 8165 // "type": "string" 8166 // }, 8167 // "userId": { 8168 // "description": "The ID of the user.", 8169 // "location": "path", 8170 // "required": true, 8171 // "type": "string" 8172 // } 8173 // }, 8174 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8175 // "response": { 8176 // "$ref": "Install" 8177 // }, 8178 // "scopes": [ 8179 // "https://www.googleapis.com/auth/androidenterprise" 8180 // ] 8181 // } 8182 8183} 8184 8185// method id "androidenterprise.installs.list": 8186 8187type InstallsListCall struct { 8188 s *Service 8189 enterpriseId string 8190 userId string 8191 deviceId string 8192 urlParams_ gensupport.URLParams 8193 ifNoneMatch_ string 8194 ctx_ context.Context 8195 header_ http.Header 8196} 8197 8198// List: Retrieves the details of all apps installed on the specified 8199// device. 8200func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall { 8201 c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8202 c.enterpriseId = enterpriseId 8203 c.userId = userId 8204 c.deviceId = deviceId 8205 return c 8206} 8207 8208// Fields allows partial responses to be retrieved. See 8209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8210// for more information. 8211func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall { 8212 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8213 return c 8214} 8215 8216// IfNoneMatch sets the optional parameter which makes the operation 8217// fail if the object's ETag matches the given value. This is useful for 8218// getting updates only after the object has changed since the last 8219// request. Use googleapi.IsNotModified to check whether the response 8220// error from Do is the result of In-None-Match. 8221func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall { 8222 c.ifNoneMatch_ = entityTag 8223 return c 8224} 8225 8226// Context sets the context to be used in this call's Do method. Any 8227// pending HTTP request will be aborted if the provided context is 8228// canceled. 8229func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall { 8230 c.ctx_ = ctx 8231 return c 8232} 8233 8234// Header returns an http.Header that can be modified by the caller to 8235// add HTTP headers to the request. 8236func (c *InstallsListCall) Header() http.Header { 8237 if c.header_ == nil { 8238 c.header_ = make(http.Header) 8239 } 8240 return c.header_ 8241} 8242 8243func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) { 8244 reqHeaders := make(http.Header) 8245 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8246 for k, v := range c.header_ { 8247 reqHeaders[k] = v 8248 } 8249 reqHeaders.Set("User-Agent", c.s.userAgent()) 8250 if c.ifNoneMatch_ != "" { 8251 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8252 } 8253 var body io.Reader = nil 8254 c.urlParams_.Set("alt", alt) 8255 c.urlParams_.Set("prettyPrint", "false") 8256 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs") 8257 urls += "?" + c.urlParams_.Encode() 8258 req, err := http.NewRequest("GET", urls, body) 8259 if err != nil { 8260 return nil, err 8261 } 8262 req.Header = reqHeaders 8263 googleapi.Expand(req.URL, map[string]string{ 8264 "enterpriseId": c.enterpriseId, 8265 "userId": c.userId, 8266 "deviceId": c.deviceId, 8267 }) 8268 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8269} 8270 8271// Do executes the "androidenterprise.installs.list" call. 8272// Exactly one of *InstallsListResponse or error will be non-nil. Any 8273// non-2xx status code is an error. Response headers are in either 8274// *InstallsListResponse.ServerResponse.Header or (if a response was 8275// returned at all) in error.(*googleapi.Error).Header. Use 8276// googleapi.IsNotModified to check whether the returned error was 8277// because http.StatusNotModified was returned. 8278func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) { 8279 gensupport.SetOptions(c.urlParams_, opts...) 8280 res, err := c.doRequest("json") 8281 if res != nil && res.StatusCode == http.StatusNotModified { 8282 if res.Body != nil { 8283 res.Body.Close() 8284 } 8285 return nil, &googleapi.Error{ 8286 Code: res.StatusCode, 8287 Header: res.Header, 8288 } 8289 } 8290 if err != nil { 8291 return nil, err 8292 } 8293 defer googleapi.CloseBody(res) 8294 if err := googleapi.CheckResponse(res); err != nil { 8295 return nil, err 8296 } 8297 ret := &InstallsListResponse{ 8298 ServerResponse: googleapi.ServerResponse{ 8299 Header: res.Header, 8300 HTTPStatusCode: res.StatusCode, 8301 }, 8302 } 8303 target := &ret 8304 if err := gensupport.DecodeResponse(target, res); err != nil { 8305 return nil, err 8306 } 8307 return ret, nil 8308 // { 8309 // "description": "Retrieves the details of all apps installed on the specified device.", 8310 // "httpMethod": "GET", 8311 // "id": "androidenterprise.installs.list", 8312 // "parameterOrder": [ 8313 // "enterpriseId", 8314 // "userId", 8315 // "deviceId" 8316 // ], 8317 // "parameters": { 8318 // "deviceId": { 8319 // "description": "The Android ID of the device.", 8320 // "location": "path", 8321 // "required": true, 8322 // "type": "string" 8323 // }, 8324 // "enterpriseId": { 8325 // "description": "The ID of the enterprise.", 8326 // "location": "path", 8327 // "required": true, 8328 // "type": "string" 8329 // }, 8330 // "userId": { 8331 // "description": "The ID of the user.", 8332 // "location": "path", 8333 // "required": true, 8334 // "type": "string" 8335 // } 8336 // }, 8337 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", 8338 // "response": { 8339 // "$ref": "InstallsListResponse" 8340 // }, 8341 // "scopes": [ 8342 // "https://www.googleapis.com/auth/androidenterprise" 8343 // ] 8344 // } 8345 8346} 8347 8348// method id "androidenterprise.installs.update": 8349 8350type InstallsUpdateCall struct { 8351 s *Service 8352 enterpriseId string 8353 userId string 8354 deviceId string 8355 installId string 8356 install *Install 8357 urlParams_ gensupport.URLParams 8358 ctx_ context.Context 8359 header_ http.Header 8360} 8361 8362// Update: Requests to install the latest version of an app to a device. 8363// If the app is already installed, then it is updated to the latest 8364// version if necessary. 8365func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall { 8366 c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8367 c.enterpriseId = enterpriseId 8368 c.userId = userId 8369 c.deviceId = deviceId 8370 c.installId = installId 8371 c.install = install 8372 return c 8373} 8374 8375// Fields allows partial responses to be retrieved. See 8376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8377// for more information. 8378func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall { 8379 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8380 return c 8381} 8382 8383// Context sets the context to be used in this call's Do method. Any 8384// pending HTTP request will be aborted if the provided context is 8385// canceled. 8386func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall { 8387 c.ctx_ = ctx 8388 return c 8389} 8390 8391// Header returns an http.Header that can be modified by the caller to 8392// add HTTP headers to the request. 8393func (c *InstallsUpdateCall) Header() http.Header { 8394 if c.header_ == nil { 8395 c.header_ = make(http.Header) 8396 } 8397 return c.header_ 8398} 8399 8400func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) { 8401 reqHeaders := make(http.Header) 8402 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8403 for k, v := range c.header_ { 8404 reqHeaders[k] = v 8405 } 8406 reqHeaders.Set("User-Agent", c.s.userAgent()) 8407 var body io.Reader = nil 8408 body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) 8409 if err != nil { 8410 return nil, err 8411 } 8412 reqHeaders.Set("Content-Type", "application/json") 8413 c.urlParams_.Set("alt", alt) 8414 c.urlParams_.Set("prettyPrint", "false") 8415 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") 8416 urls += "?" + c.urlParams_.Encode() 8417 req, err := http.NewRequest("PUT", urls, body) 8418 if err != nil { 8419 return nil, err 8420 } 8421 req.Header = reqHeaders 8422 googleapi.Expand(req.URL, map[string]string{ 8423 "enterpriseId": c.enterpriseId, 8424 "userId": c.userId, 8425 "deviceId": c.deviceId, 8426 "installId": c.installId, 8427 }) 8428 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8429} 8430 8431// Do executes the "androidenterprise.installs.update" call. 8432// Exactly one of *Install or error will be non-nil. Any non-2xx status 8433// code is an error. Response headers are in either 8434// *Install.ServerResponse.Header or (if a response was returned at all) 8435// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8436// check whether the returned error was because http.StatusNotModified 8437// was returned. 8438func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) { 8439 gensupport.SetOptions(c.urlParams_, opts...) 8440 res, err := c.doRequest("json") 8441 if res != nil && res.StatusCode == http.StatusNotModified { 8442 if res.Body != nil { 8443 res.Body.Close() 8444 } 8445 return nil, &googleapi.Error{ 8446 Code: res.StatusCode, 8447 Header: res.Header, 8448 } 8449 } 8450 if err != nil { 8451 return nil, err 8452 } 8453 defer googleapi.CloseBody(res) 8454 if err := googleapi.CheckResponse(res); err != nil { 8455 return nil, err 8456 } 8457 ret := &Install{ 8458 ServerResponse: googleapi.ServerResponse{ 8459 Header: res.Header, 8460 HTTPStatusCode: res.StatusCode, 8461 }, 8462 } 8463 target := &ret 8464 if err := gensupport.DecodeResponse(target, res); err != nil { 8465 return nil, err 8466 } 8467 return ret, nil 8468 // { 8469 // "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.", 8470 // "httpMethod": "PUT", 8471 // "id": "androidenterprise.installs.update", 8472 // "parameterOrder": [ 8473 // "enterpriseId", 8474 // "userId", 8475 // "deviceId", 8476 // "installId" 8477 // ], 8478 // "parameters": { 8479 // "deviceId": { 8480 // "description": "The Android ID of the device.", 8481 // "location": "path", 8482 // "required": true, 8483 // "type": "string" 8484 // }, 8485 // "enterpriseId": { 8486 // "description": "The ID of the enterprise.", 8487 // "location": "path", 8488 // "required": true, 8489 // "type": "string" 8490 // }, 8491 // "installId": { 8492 // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", 8493 // "location": "path", 8494 // "required": true, 8495 // "type": "string" 8496 // }, 8497 // "userId": { 8498 // "description": "The ID of the user.", 8499 // "location": "path", 8500 // "required": true, 8501 // "type": "string" 8502 // } 8503 // }, 8504 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", 8505 // "request": { 8506 // "$ref": "Install" 8507 // }, 8508 // "response": { 8509 // "$ref": "Install" 8510 // }, 8511 // "scopes": [ 8512 // "https://www.googleapis.com/auth/androidenterprise" 8513 // ] 8514 // } 8515 8516} 8517 8518// method id "androidenterprise.managedconfigurationsfordevice.delete": 8519 8520type ManagedconfigurationsfordeviceDeleteCall struct { 8521 s *Service 8522 enterpriseId string 8523 userId string 8524 deviceId string 8525 managedConfigurationForDeviceId string 8526 urlParams_ gensupport.URLParams 8527 ctx_ context.Context 8528 header_ http.Header 8529} 8530 8531// Delete: Removes a per-device managed configuration for an app for the 8532// specified device. 8533func (r *ManagedconfigurationsfordeviceService) Delete(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceDeleteCall { 8534 c := &ManagedconfigurationsfordeviceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8535 c.enterpriseId = enterpriseId 8536 c.userId = userId 8537 c.deviceId = deviceId 8538 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8539 return c 8540} 8541 8542// Fields allows partial responses to be retrieved. See 8543// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8544// for more information. 8545func (c *ManagedconfigurationsfordeviceDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceDeleteCall { 8546 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8547 return c 8548} 8549 8550// Context sets the context to be used in this call's Do method. Any 8551// pending HTTP request will be aborted if the provided context is 8552// canceled. 8553func (c *ManagedconfigurationsfordeviceDeleteCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceDeleteCall { 8554 c.ctx_ = ctx 8555 return c 8556} 8557 8558// Header returns an http.Header that can be modified by the caller to 8559// add HTTP headers to the request. 8560func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header { 8561 if c.header_ == nil { 8562 c.header_ = make(http.Header) 8563 } 8564 return c.header_ 8565} 8566 8567func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) { 8568 reqHeaders := make(http.Header) 8569 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8570 for k, v := range c.header_ { 8571 reqHeaders[k] = v 8572 } 8573 reqHeaders.Set("User-Agent", c.s.userAgent()) 8574 var body io.Reader = nil 8575 c.urlParams_.Set("alt", alt) 8576 c.urlParams_.Set("prettyPrint", "false") 8577 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 8578 urls += "?" + c.urlParams_.Encode() 8579 req, err := http.NewRequest("DELETE", urls, body) 8580 if err != nil { 8581 return nil, err 8582 } 8583 req.Header = reqHeaders 8584 googleapi.Expand(req.URL, map[string]string{ 8585 "enterpriseId": c.enterpriseId, 8586 "userId": c.userId, 8587 "deviceId": c.deviceId, 8588 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 8589 }) 8590 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8591} 8592 8593// Do executes the "androidenterprise.managedconfigurationsfordevice.delete" call. 8594func (c *ManagedconfigurationsfordeviceDeleteCall) Do(opts ...googleapi.CallOption) error { 8595 gensupport.SetOptions(c.urlParams_, opts...) 8596 res, err := c.doRequest("json") 8597 if err != nil { 8598 return err 8599 } 8600 defer googleapi.CloseBody(res) 8601 if err := googleapi.CheckResponse(res); err != nil { 8602 return err 8603 } 8604 return nil 8605 // { 8606 // "description": "Removes a per-device managed configuration for an app for the specified device.", 8607 // "httpMethod": "DELETE", 8608 // "id": "androidenterprise.managedconfigurationsfordevice.delete", 8609 // "parameterOrder": [ 8610 // "enterpriseId", 8611 // "userId", 8612 // "deviceId", 8613 // "managedConfigurationForDeviceId" 8614 // ], 8615 // "parameters": { 8616 // "deviceId": { 8617 // "description": "The Android ID of the device.", 8618 // "location": "path", 8619 // "required": true, 8620 // "type": "string" 8621 // }, 8622 // "enterpriseId": { 8623 // "description": "The ID of the enterprise.", 8624 // "location": "path", 8625 // "required": true, 8626 // "type": "string" 8627 // }, 8628 // "managedConfigurationForDeviceId": { 8629 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 8630 // "location": "path", 8631 // "required": true, 8632 // "type": "string" 8633 // }, 8634 // "userId": { 8635 // "description": "The ID of the user.", 8636 // "location": "path", 8637 // "required": true, 8638 // "type": "string" 8639 // } 8640 // }, 8641 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8642 // "scopes": [ 8643 // "https://www.googleapis.com/auth/androidenterprise" 8644 // ] 8645 // } 8646 8647} 8648 8649// method id "androidenterprise.managedconfigurationsfordevice.get": 8650 8651type ManagedconfigurationsfordeviceGetCall struct { 8652 s *Service 8653 enterpriseId string 8654 userId string 8655 deviceId string 8656 managedConfigurationForDeviceId string 8657 urlParams_ gensupport.URLParams 8658 ifNoneMatch_ string 8659 ctx_ context.Context 8660 header_ http.Header 8661} 8662 8663// Get: Retrieves details of a per-device managed configuration. 8664func (r *ManagedconfigurationsfordeviceService) Get(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceGetCall { 8665 c := &ManagedconfigurationsfordeviceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8666 c.enterpriseId = enterpriseId 8667 c.userId = userId 8668 c.deviceId = deviceId 8669 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 8670 return c 8671} 8672 8673// Fields allows partial responses to be retrieved. See 8674// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8675// for more information. 8676func (c *ManagedconfigurationsfordeviceGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceGetCall { 8677 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8678 return c 8679} 8680 8681// IfNoneMatch sets the optional parameter which makes the operation 8682// fail if the object's ETag matches the given value. This is useful for 8683// getting updates only after the object has changed since the last 8684// request. Use googleapi.IsNotModified to check whether the response 8685// error from Do is the result of In-None-Match. 8686func (c *ManagedconfigurationsfordeviceGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceGetCall { 8687 c.ifNoneMatch_ = entityTag 8688 return c 8689} 8690 8691// Context sets the context to be used in this call's Do method. Any 8692// pending HTTP request will be aborted if the provided context is 8693// canceled. 8694func (c *ManagedconfigurationsfordeviceGetCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceGetCall { 8695 c.ctx_ = ctx 8696 return c 8697} 8698 8699// Header returns an http.Header that can be modified by the caller to 8700// add HTTP headers to the request. 8701func (c *ManagedconfigurationsfordeviceGetCall) Header() http.Header { 8702 if c.header_ == nil { 8703 c.header_ = make(http.Header) 8704 } 8705 return c.header_ 8706} 8707 8708func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Response, error) { 8709 reqHeaders := make(http.Header) 8710 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8711 for k, v := range c.header_ { 8712 reqHeaders[k] = v 8713 } 8714 reqHeaders.Set("User-Agent", c.s.userAgent()) 8715 if c.ifNoneMatch_ != "" { 8716 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8717 } 8718 var body io.Reader = nil 8719 c.urlParams_.Set("alt", alt) 8720 c.urlParams_.Set("prettyPrint", "false") 8721 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 8722 urls += "?" + c.urlParams_.Encode() 8723 req, err := http.NewRequest("GET", urls, body) 8724 if err != nil { 8725 return nil, err 8726 } 8727 req.Header = reqHeaders 8728 googleapi.Expand(req.URL, map[string]string{ 8729 "enterpriseId": c.enterpriseId, 8730 "userId": c.userId, 8731 "deviceId": c.deviceId, 8732 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 8733 }) 8734 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8735} 8736 8737// Do executes the "androidenterprise.managedconfigurationsfordevice.get" call. 8738// Exactly one of *ManagedConfiguration or error will be non-nil. Any 8739// non-2xx status code is an error. Response headers are in either 8740// *ManagedConfiguration.ServerResponse.Header or (if a response was 8741// returned at all) in error.(*googleapi.Error).Header. Use 8742// googleapi.IsNotModified to check whether the returned error was 8743// because http.StatusNotModified was returned. 8744func (c *ManagedconfigurationsfordeviceGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 8745 gensupport.SetOptions(c.urlParams_, opts...) 8746 res, err := c.doRequest("json") 8747 if res != nil && res.StatusCode == http.StatusNotModified { 8748 if res.Body != nil { 8749 res.Body.Close() 8750 } 8751 return nil, &googleapi.Error{ 8752 Code: res.StatusCode, 8753 Header: res.Header, 8754 } 8755 } 8756 if err != nil { 8757 return nil, err 8758 } 8759 defer googleapi.CloseBody(res) 8760 if err := googleapi.CheckResponse(res); err != nil { 8761 return nil, err 8762 } 8763 ret := &ManagedConfiguration{ 8764 ServerResponse: googleapi.ServerResponse{ 8765 Header: res.Header, 8766 HTTPStatusCode: res.StatusCode, 8767 }, 8768 } 8769 target := &ret 8770 if err := gensupport.DecodeResponse(target, res); err != nil { 8771 return nil, err 8772 } 8773 return ret, nil 8774 // { 8775 // "description": "Retrieves details of a per-device managed configuration.", 8776 // "httpMethod": "GET", 8777 // "id": "androidenterprise.managedconfigurationsfordevice.get", 8778 // "parameterOrder": [ 8779 // "enterpriseId", 8780 // "userId", 8781 // "deviceId", 8782 // "managedConfigurationForDeviceId" 8783 // ], 8784 // "parameters": { 8785 // "deviceId": { 8786 // "description": "The Android ID of the device.", 8787 // "location": "path", 8788 // "required": true, 8789 // "type": "string" 8790 // }, 8791 // "enterpriseId": { 8792 // "description": "The ID of the enterprise.", 8793 // "location": "path", 8794 // "required": true, 8795 // "type": "string" 8796 // }, 8797 // "managedConfigurationForDeviceId": { 8798 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 8799 // "location": "path", 8800 // "required": true, 8801 // "type": "string" 8802 // }, 8803 // "userId": { 8804 // "description": "The ID of the user.", 8805 // "location": "path", 8806 // "required": true, 8807 // "type": "string" 8808 // } 8809 // }, 8810 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 8811 // "response": { 8812 // "$ref": "ManagedConfiguration" 8813 // }, 8814 // "scopes": [ 8815 // "https://www.googleapis.com/auth/androidenterprise" 8816 // ] 8817 // } 8818 8819} 8820 8821// method id "androidenterprise.managedconfigurationsfordevice.list": 8822 8823type ManagedconfigurationsfordeviceListCall struct { 8824 s *Service 8825 enterpriseId string 8826 userId string 8827 deviceId string 8828 urlParams_ gensupport.URLParams 8829 ifNoneMatch_ string 8830 ctx_ context.Context 8831 header_ http.Header 8832} 8833 8834// List: Lists all the per-device managed configurations for the 8835// specified device. Only the ID is set. 8836func (r *ManagedconfigurationsfordeviceService) List(enterpriseId string, userId string, deviceId string) *ManagedconfigurationsfordeviceListCall { 8837 c := &ManagedconfigurationsfordeviceListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8838 c.enterpriseId = enterpriseId 8839 c.userId = userId 8840 c.deviceId = deviceId 8841 return c 8842} 8843 8844// Fields allows partial responses to be retrieved. See 8845// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8846// for more information. 8847func (c *ManagedconfigurationsfordeviceListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceListCall { 8848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8849 return c 8850} 8851 8852// IfNoneMatch sets the optional parameter which makes the operation 8853// fail if the object's ETag matches the given value. This is useful for 8854// getting updates only after the object has changed since the last 8855// request. Use googleapi.IsNotModified to check whether the response 8856// error from Do is the result of In-None-Match. 8857func (c *ManagedconfigurationsfordeviceListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceListCall { 8858 c.ifNoneMatch_ = entityTag 8859 return c 8860} 8861 8862// Context sets the context to be used in this call's Do method. Any 8863// pending HTTP request will be aborted if the provided context is 8864// canceled. 8865func (c *ManagedconfigurationsfordeviceListCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceListCall { 8866 c.ctx_ = ctx 8867 return c 8868} 8869 8870// Header returns an http.Header that can be modified by the caller to 8871// add HTTP headers to the request. 8872func (c *ManagedconfigurationsfordeviceListCall) Header() http.Header { 8873 if c.header_ == nil { 8874 c.header_ = make(http.Header) 8875 } 8876 return c.header_ 8877} 8878 8879func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Response, error) { 8880 reqHeaders := make(http.Header) 8881 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 8882 for k, v := range c.header_ { 8883 reqHeaders[k] = v 8884 } 8885 reqHeaders.Set("User-Agent", c.s.userAgent()) 8886 if c.ifNoneMatch_ != "" { 8887 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8888 } 8889 var body io.Reader = nil 8890 c.urlParams_.Set("alt", alt) 8891 c.urlParams_.Set("prettyPrint", "false") 8892 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice") 8893 urls += "?" + c.urlParams_.Encode() 8894 req, err := http.NewRequest("GET", urls, body) 8895 if err != nil { 8896 return nil, err 8897 } 8898 req.Header = reqHeaders 8899 googleapi.Expand(req.URL, map[string]string{ 8900 "enterpriseId": c.enterpriseId, 8901 "userId": c.userId, 8902 "deviceId": c.deviceId, 8903 }) 8904 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8905} 8906 8907// Do executes the "androidenterprise.managedconfigurationsfordevice.list" call. 8908// Exactly one of *ManagedConfigurationsForDeviceListResponse or error 8909// will be non-nil. Any non-2xx status code is an error. Response 8910// headers are in either 8911// *ManagedConfigurationsForDeviceListResponse.ServerResponse.Header or 8912// (if a response was returned at all) in 8913// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8914// whether the returned error was because http.StatusNotModified was 8915// returned. 8916func (c *ManagedconfigurationsfordeviceListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForDeviceListResponse, error) { 8917 gensupport.SetOptions(c.urlParams_, opts...) 8918 res, err := c.doRequest("json") 8919 if res != nil && res.StatusCode == http.StatusNotModified { 8920 if res.Body != nil { 8921 res.Body.Close() 8922 } 8923 return nil, &googleapi.Error{ 8924 Code: res.StatusCode, 8925 Header: res.Header, 8926 } 8927 } 8928 if err != nil { 8929 return nil, err 8930 } 8931 defer googleapi.CloseBody(res) 8932 if err := googleapi.CheckResponse(res); err != nil { 8933 return nil, err 8934 } 8935 ret := &ManagedConfigurationsForDeviceListResponse{ 8936 ServerResponse: googleapi.ServerResponse{ 8937 Header: res.Header, 8938 HTTPStatusCode: res.StatusCode, 8939 }, 8940 } 8941 target := &ret 8942 if err := gensupport.DecodeResponse(target, res); err != nil { 8943 return nil, err 8944 } 8945 return ret, nil 8946 // { 8947 // "description": "Lists all the per-device managed configurations for the specified device. Only the ID is set.", 8948 // "httpMethod": "GET", 8949 // "id": "androidenterprise.managedconfigurationsfordevice.list", 8950 // "parameterOrder": [ 8951 // "enterpriseId", 8952 // "userId", 8953 // "deviceId" 8954 // ], 8955 // "parameters": { 8956 // "deviceId": { 8957 // "description": "The Android ID of the device.", 8958 // "location": "path", 8959 // "required": true, 8960 // "type": "string" 8961 // }, 8962 // "enterpriseId": { 8963 // "description": "The ID of the enterprise.", 8964 // "location": "path", 8965 // "required": true, 8966 // "type": "string" 8967 // }, 8968 // "userId": { 8969 // "description": "The ID of the user.", 8970 // "location": "path", 8971 // "required": true, 8972 // "type": "string" 8973 // } 8974 // }, 8975 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice", 8976 // "response": { 8977 // "$ref": "ManagedConfigurationsForDeviceListResponse" 8978 // }, 8979 // "scopes": [ 8980 // "https://www.googleapis.com/auth/androidenterprise" 8981 // ] 8982 // } 8983 8984} 8985 8986// method id "androidenterprise.managedconfigurationsfordevice.update": 8987 8988type ManagedconfigurationsfordeviceUpdateCall struct { 8989 s *Service 8990 enterpriseId string 8991 userId string 8992 deviceId string 8993 managedConfigurationForDeviceId string 8994 managedconfiguration *ManagedConfiguration 8995 urlParams_ gensupport.URLParams 8996 ctx_ context.Context 8997 header_ http.Header 8998} 8999 9000// Update: Adds or updates a per-device managed configuration for an app 9001// for the specified device. 9002func (r *ManagedconfigurationsfordeviceService) Update(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordeviceUpdateCall { 9003 c := &ManagedconfigurationsfordeviceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9004 c.enterpriseId = enterpriseId 9005 c.userId = userId 9006 c.deviceId = deviceId 9007 c.managedConfigurationForDeviceId = managedConfigurationForDeviceId 9008 c.managedconfiguration = managedconfiguration 9009 return c 9010} 9011 9012// Fields allows partial responses to be retrieved. See 9013// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9014// for more information. 9015func (c *ManagedconfigurationsfordeviceUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceUpdateCall { 9016 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9017 return c 9018} 9019 9020// Context sets the context to be used in this call's Do method. Any 9021// pending HTTP request will be aborted if the provided context is 9022// canceled. 9023func (c *ManagedconfigurationsfordeviceUpdateCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceUpdateCall { 9024 c.ctx_ = ctx 9025 return c 9026} 9027 9028// Header returns an http.Header that can be modified by the caller to 9029// add HTTP headers to the request. 9030func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header { 9031 if c.header_ == nil { 9032 c.header_ = make(http.Header) 9033 } 9034 return c.header_ 9035} 9036 9037func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) { 9038 reqHeaders := make(http.Header) 9039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9040 for k, v := range c.header_ { 9041 reqHeaders[k] = v 9042 } 9043 reqHeaders.Set("User-Agent", c.s.userAgent()) 9044 var body io.Reader = nil 9045 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9046 if err != nil { 9047 return nil, err 9048 } 9049 reqHeaders.Set("Content-Type", "application/json") 9050 c.urlParams_.Set("alt", alt) 9051 c.urlParams_.Set("prettyPrint", "false") 9052 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}") 9053 urls += "?" + c.urlParams_.Encode() 9054 req, err := http.NewRequest("PUT", urls, body) 9055 if err != nil { 9056 return nil, err 9057 } 9058 req.Header = reqHeaders 9059 googleapi.Expand(req.URL, map[string]string{ 9060 "enterpriseId": c.enterpriseId, 9061 "userId": c.userId, 9062 "deviceId": c.deviceId, 9063 "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId, 9064 }) 9065 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9066} 9067 9068// Do executes the "androidenterprise.managedconfigurationsfordevice.update" call. 9069// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9070// non-2xx status code is an error. Response headers are in either 9071// *ManagedConfiguration.ServerResponse.Header or (if a response was 9072// returned at all) in error.(*googleapi.Error).Header. Use 9073// googleapi.IsNotModified to check whether the returned error was 9074// because http.StatusNotModified was returned. 9075func (c *ManagedconfigurationsfordeviceUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9076 gensupport.SetOptions(c.urlParams_, opts...) 9077 res, err := c.doRequest("json") 9078 if res != nil && res.StatusCode == http.StatusNotModified { 9079 if res.Body != nil { 9080 res.Body.Close() 9081 } 9082 return nil, &googleapi.Error{ 9083 Code: res.StatusCode, 9084 Header: res.Header, 9085 } 9086 } 9087 if err != nil { 9088 return nil, err 9089 } 9090 defer googleapi.CloseBody(res) 9091 if err := googleapi.CheckResponse(res); err != nil { 9092 return nil, err 9093 } 9094 ret := &ManagedConfiguration{ 9095 ServerResponse: googleapi.ServerResponse{ 9096 Header: res.Header, 9097 HTTPStatusCode: res.StatusCode, 9098 }, 9099 } 9100 target := &ret 9101 if err := gensupport.DecodeResponse(target, res); err != nil { 9102 return nil, err 9103 } 9104 return ret, nil 9105 // { 9106 // "description": "Adds or updates a per-device managed configuration for an app for the specified device.", 9107 // "httpMethod": "PUT", 9108 // "id": "androidenterprise.managedconfigurationsfordevice.update", 9109 // "parameterOrder": [ 9110 // "enterpriseId", 9111 // "userId", 9112 // "deviceId", 9113 // "managedConfigurationForDeviceId" 9114 // ], 9115 // "parameters": { 9116 // "deviceId": { 9117 // "description": "The Android ID of the device.", 9118 // "location": "path", 9119 // "required": true, 9120 // "type": "string" 9121 // }, 9122 // "enterpriseId": { 9123 // "description": "The ID of the enterprise.", 9124 // "location": "path", 9125 // "required": true, 9126 // "type": "string" 9127 // }, 9128 // "managedConfigurationForDeviceId": { 9129 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9130 // "location": "path", 9131 // "required": true, 9132 // "type": "string" 9133 // }, 9134 // "userId": { 9135 // "description": "The ID of the user.", 9136 // "location": "path", 9137 // "required": true, 9138 // "type": "string" 9139 // } 9140 // }, 9141 // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}", 9142 // "request": { 9143 // "$ref": "ManagedConfiguration" 9144 // }, 9145 // "response": { 9146 // "$ref": "ManagedConfiguration" 9147 // }, 9148 // "scopes": [ 9149 // "https://www.googleapis.com/auth/androidenterprise" 9150 // ] 9151 // } 9152 9153} 9154 9155// method id "androidenterprise.managedconfigurationsforuser.delete": 9156 9157type ManagedconfigurationsforuserDeleteCall struct { 9158 s *Service 9159 enterpriseId string 9160 userId string 9161 managedConfigurationForUserId string 9162 urlParams_ gensupport.URLParams 9163 ctx_ context.Context 9164 header_ http.Header 9165} 9166 9167// Delete: Removes a per-user managed configuration for an app for the 9168// specified user. 9169func (r *ManagedconfigurationsforuserService) Delete(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserDeleteCall { 9170 c := &ManagedconfigurationsforuserDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9171 c.enterpriseId = enterpriseId 9172 c.userId = userId 9173 c.managedConfigurationForUserId = managedConfigurationForUserId 9174 return c 9175} 9176 9177// Fields allows partial responses to be retrieved. See 9178// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9179// for more information. 9180func (c *ManagedconfigurationsforuserDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserDeleteCall { 9181 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9182 return c 9183} 9184 9185// Context sets the context to be used in this call's Do method. Any 9186// pending HTTP request will be aborted if the provided context is 9187// canceled. 9188func (c *ManagedconfigurationsforuserDeleteCall) Context(ctx context.Context) *ManagedconfigurationsforuserDeleteCall { 9189 c.ctx_ = ctx 9190 return c 9191} 9192 9193// Header returns an http.Header that can be modified by the caller to 9194// add HTTP headers to the request. 9195func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header { 9196 if c.header_ == nil { 9197 c.header_ = make(http.Header) 9198 } 9199 return c.header_ 9200} 9201 9202func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) { 9203 reqHeaders := make(http.Header) 9204 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9205 for k, v := range c.header_ { 9206 reqHeaders[k] = v 9207 } 9208 reqHeaders.Set("User-Agent", c.s.userAgent()) 9209 var body io.Reader = nil 9210 c.urlParams_.Set("alt", alt) 9211 c.urlParams_.Set("prettyPrint", "false") 9212 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9213 urls += "?" + c.urlParams_.Encode() 9214 req, err := http.NewRequest("DELETE", urls, body) 9215 if err != nil { 9216 return nil, err 9217 } 9218 req.Header = reqHeaders 9219 googleapi.Expand(req.URL, map[string]string{ 9220 "enterpriseId": c.enterpriseId, 9221 "userId": c.userId, 9222 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9223 }) 9224 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9225} 9226 9227// Do executes the "androidenterprise.managedconfigurationsforuser.delete" call. 9228func (c *ManagedconfigurationsforuserDeleteCall) Do(opts ...googleapi.CallOption) error { 9229 gensupport.SetOptions(c.urlParams_, opts...) 9230 res, err := c.doRequest("json") 9231 if err != nil { 9232 return err 9233 } 9234 defer googleapi.CloseBody(res) 9235 if err := googleapi.CheckResponse(res); err != nil { 9236 return err 9237 } 9238 return nil 9239 // { 9240 // "description": "Removes a per-user managed configuration for an app for the specified user.", 9241 // "httpMethod": "DELETE", 9242 // "id": "androidenterprise.managedconfigurationsforuser.delete", 9243 // "parameterOrder": [ 9244 // "enterpriseId", 9245 // "userId", 9246 // "managedConfigurationForUserId" 9247 // ], 9248 // "parameters": { 9249 // "enterpriseId": { 9250 // "description": "The ID of the enterprise.", 9251 // "location": "path", 9252 // "required": true, 9253 // "type": "string" 9254 // }, 9255 // "managedConfigurationForUserId": { 9256 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9257 // "location": "path", 9258 // "required": true, 9259 // "type": "string" 9260 // }, 9261 // "userId": { 9262 // "description": "The ID of the user.", 9263 // "location": "path", 9264 // "required": true, 9265 // "type": "string" 9266 // } 9267 // }, 9268 // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9269 // "scopes": [ 9270 // "https://www.googleapis.com/auth/androidenterprise" 9271 // ] 9272 // } 9273 9274} 9275 9276// method id "androidenterprise.managedconfigurationsforuser.get": 9277 9278type ManagedconfigurationsforuserGetCall struct { 9279 s *Service 9280 enterpriseId string 9281 userId string 9282 managedConfigurationForUserId string 9283 urlParams_ gensupport.URLParams 9284 ifNoneMatch_ string 9285 ctx_ context.Context 9286 header_ http.Header 9287} 9288 9289// Get: Retrieves details of a per-user managed configuration for an app 9290// for the specified user. 9291func (r *ManagedconfigurationsforuserService) Get(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserGetCall { 9292 c := &ManagedconfigurationsforuserGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9293 c.enterpriseId = enterpriseId 9294 c.userId = userId 9295 c.managedConfigurationForUserId = managedConfigurationForUserId 9296 return c 9297} 9298 9299// Fields allows partial responses to be retrieved. See 9300// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9301// for more information. 9302func (c *ManagedconfigurationsforuserGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserGetCall { 9303 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9304 return c 9305} 9306 9307// IfNoneMatch sets the optional parameter which makes the operation 9308// fail if the object's ETag matches the given value. This is useful for 9309// getting updates only after the object has changed since the last 9310// request. Use googleapi.IsNotModified to check whether the response 9311// error from Do is the result of In-None-Match. 9312func (c *ManagedconfigurationsforuserGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserGetCall { 9313 c.ifNoneMatch_ = entityTag 9314 return c 9315} 9316 9317// Context sets the context to be used in this call's Do method. Any 9318// pending HTTP request will be aborted if the provided context is 9319// canceled. 9320func (c *ManagedconfigurationsforuserGetCall) Context(ctx context.Context) *ManagedconfigurationsforuserGetCall { 9321 c.ctx_ = ctx 9322 return c 9323} 9324 9325// Header returns an http.Header that can be modified by the caller to 9326// add HTTP headers to the request. 9327func (c *ManagedconfigurationsforuserGetCall) Header() http.Header { 9328 if c.header_ == nil { 9329 c.header_ = make(http.Header) 9330 } 9331 return c.header_ 9332} 9333 9334func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Response, error) { 9335 reqHeaders := make(http.Header) 9336 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9337 for k, v := range c.header_ { 9338 reqHeaders[k] = v 9339 } 9340 reqHeaders.Set("User-Agent", c.s.userAgent()) 9341 if c.ifNoneMatch_ != "" { 9342 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9343 } 9344 var body io.Reader = nil 9345 c.urlParams_.Set("alt", alt) 9346 c.urlParams_.Set("prettyPrint", "false") 9347 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9348 urls += "?" + c.urlParams_.Encode() 9349 req, err := http.NewRequest("GET", urls, body) 9350 if err != nil { 9351 return nil, err 9352 } 9353 req.Header = reqHeaders 9354 googleapi.Expand(req.URL, map[string]string{ 9355 "enterpriseId": c.enterpriseId, 9356 "userId": c.userId, 9357 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9358 }) 9359 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9360} 9361 9362// Do executes the "androidenterprise.managedconfigurationsforuser.get" call. 9363// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9364// non-2xx status code is an error. Response headers are in either 9365// *ManagedConfiguration.ServerResponse.Header or (if a response was 9366// returned at all) in error.(*googleapi.Error).Header. Use 9367// googleapi.IsNotModified to check whether the returned error was 9368// because http.StatusNotModified was returned. 9369func (c *ManagedconfigurationsforuserGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9370 gensupport.SetOptions(c.urlParams_, opts...) 9371 res, err := c.doRequest("json") 9372 if res != nil && res.StatusCode == http.StatusNotModified { 9373 if res.Body != nil { 9374 res.Body.Close() 9375 } 9376 return nil, &googleapi.Error{ 9377 Code: res.StatusCode, 9378 Header: res.Header, 9379 } 9380 } 9381 if err != nil { 9382 return nil, err 9383 } 9384 defer googleapi.CloseBody(res) 9385 if err := googleapi.CheckResponse(res); err != nil { 9386 return nil, err 9387 } 9388 ret := &ManagedConfiguration{ 9389 ServerResponse: googleapi.ServerResponse{ 9390 Header: res.Header, 9391 HTTPStatusCode: res.StatusCode, 9392 }, 9393 } 9394 target := &ret 9395 if err := gensupport.DecodeResponse(target, res); err != nil { 9396 return nil, err 9397 } 9398 return ret, nil 9399 // { 9400 // "description": "Retrieves details of a per-user managed configuration for an app for the specified user.", 9401 // "httpMethod": "GET", 9402 // "id": "androidenterprise.managedconfigurationsforuser.get", 9403 // "parameterOrder": [ 9404 // "enterpriseId", 9405 // "userId", 9406 // "managedConfigurationForUserId" 9407 // ], 9408 // "parameters": { 9409 // "enterpriseId": { 9410 // "description": "The ID of the enterprise.", 9411 // "location": "path", 9412 // "required": true, 9413 // "type": "string" 9414 // }, 9415 // "managedConfigurationForUserId": { 9416 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9417 // "location": "path", 9418 // "required": true, 9419 // "type": "string" 9420 // }, 9421 // "userId": { 9422 // "description": "The ID of the user.", 9423 // "location": "path", 9424 // "required": true, 9425 // "type": "string" 9426 // } 9427 // }, 9428 // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9429 // "response": { 9430 // "$ref": "ManagedConfiguration" 9431 // }, 9432 // "scopes": [ 9433 // "https://www.googleapis.com/auth/androidenterprise" 9434 // ] 9435 // } 9436 9437} 9438 9439// method id "androidenterprise.managedconfigurationsforuser.list": 9440 9441type ManagedconfigurationsforuserListCall struct { 9442 s *Service 9443 enterpriseId string 9444 userId string 9445 urlParams_ gensupport.URLParams 9446 ifNoneMatch_ string 9447 ctx_ context.Context 9448 header_ http.Header 9449} 9450 9451// List: Lists all the per-user managed configurations for the specified 9452// user. Only the ID is set. 9453func (r *ManagedconfigurationsforuserService) List(enterpriseId string, userId string) *ManagedconfigurationsforuserListCall { 9454 c := &ManagedconfigurationsforuserListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9455 c.enterpriseId = enterpriseId 9456 c.userId = userId 9457 return c 9458} 9459 9460// Fields allows partial responses to be retrieved. See 9461// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9462// for more information. 9463func (c *ManagedconfigurationsforuserListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserListCall { 9464 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9465 return c 9466} 9467 9468// IfNoneMatch sets the optional parameter which makes the operation 9469// fail if the object's ETag matches the given value. This is useful for 9470// getting updates only after the object has changed since the last 9471// request. Use googleapi.IsNotModified to check whether the response 9472// error from Do is the result of In-None-Match. 9473func (c *ManagedconfigurationsforuserListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserListCall { 9474 c.ifNoneMatch_ = entityTag 9475 return c 9476} 9477 9478// Context sets the context to be used in this call's Do method. Any 9479// pending HTTP request will be aborted if the provided context is 9480// canceled. 9481func (c *ManagedconfigurationsforuserListCall) Context(ctx context.Context) *ManagedconfigurationsforuserListCall { 9482 c.ctx_ = ctx 9483 return c 9484} 9485 9486// Header returns an http.Header that can be modified by the caller to 9487// add HTTP headers to the request. 9488func (c *ManagedconfigurationsforuserListCall) Header() http.Header { 9489 if c.header_ == nil { 9490 c.header_ = make(http.Header) 9491 } 9492 return c.header_ 9493} 9494 9495func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Response, error) { 9496 reqHeaders := make(http.Header) 9497 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9498 for k, v := range c.header_ { 9499 reqHeaders[k] = v 9500 } 9501 reqHeaders.Set("User-Agent", c.s.userAgent()) 9502 if c.ifNoneMatch_ != "" { 9503 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9504 } 9505 var body io.Reader = nil 9506 c.urlParams_.Set("alt", alt) 9507 c.urlParams_.Set("prettyPrint", "false") 9508 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser") 9509 urls += "?" + c.urlParams_.Encode() 9510 req, err := http.NewRequest("GET", urls, body) 9511 if err != nil { 9512 return nil, err 9513 } 9514 req.Header = reqHeaders 9515 googleapi.Expand(req.URL, map[string]string{ 9516 "enterpriseId": c.enterpriseId, 9517 "userId": c.userId, 9518 }) 9519 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9520} 9521 9522// Do executes the "androidenterprise.managedconfigurationsforuser.list" call. 9523// Exactly one of *ManagedConfigurationsForUserListResponse or error 9524// will be non-nil. Any non-2xx status code is an error. Response 9525// headers are in either 9526// *ManagedConfigurationsForUserListResponse.ServerResponse.Header or 9527// (if a response was returned at all) in 9528// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9529// whether the returned error was because http.StatusNotModified was 9530// returned. 9531func (c *ManagedconfigurationsforuserListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForUserListResponse, error) { 9532 gensupport.SetOptions(c.urlParams_, opts...) 9533 res, err := c.doRequest("json") 9534 if res != nil && res.StatusCode == http.StatusNotModified { 9535 if res.Body != nil { 9536 res.Body.Close() 9537 } 9538 return nil, &googleapi.Error{ 9539 Code: res.StatusCode, 9540 Header: res.Header, 9541 } 9542 } 9543 if err != nil { 9544 return nil, err 9545 } 9546 defer googleapi.CloseBody(res) 9547 if err := googleapi.CheckResponse(res); err != nil { 9548 return nil, err 9549 } 9550 ret := &ManagedConfigurationsForUserListResponse{ 9551 ServerResponse: googleapi.ServerResponse{ 9552 Header: res.Header, 9553 HTTPStatusCode: res.StatusCode, 9554 }, 9555 } 9556 target := &ret 9557 if err := gensupport.DecodeResponse(target, res); err != nil { 9558 return nil, err 9559 } 9560 return ret, nil 9561 // { 9562 // "description": "Lists all the per-user managed configurations for the specified user. Only the ID is set.", 9563 // "httpMethod": "GET", 9564 // "id": "androidenterprise.managedconfigurationsforuser.list", 9565 // "parameterOrder": [ 9566 // "enterpriseId", 9567 // "userId" 9568 // ], 9569 // "parameters": { 9570 // "enterpriseId": { 9571 // "description": "The ID of the enterprise.", 9572 // "location": "path", 9573 // "required": true, 9574 // "type": "string" 9575 // }, 9576 // "userId": { 9577 // "description": "The ID of the user.", 9578 // "location": "path", 9579 // "required": true, 9580 // "type": "string" 9581 // } 9582 // }, 9583 // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser", 9584 // "response": { 9585 // "$ref": "ManagedConfigurationsForUserListResponse" 9586 // }, 9587 // "scopes": [ 9588 // "https://www.googleapis.com/auth/androidenterprise" 9589 // ] 9590 // } 9591 9592} 9593 9594// method id "androidenterprise.managedconfigurationsforuser.update": 9595 9596type ManagedconfigurationsforuserUpdateCall struct { 9597 s *Service 9598 enterpriseId string 9599 userId string 9600 managedConfigurationForUserId string 9601 managedconfiguration *ManagedConfiguration 9602 urlParams_ gensupport.URLParams 9603 ctx_ context.Context 9604 header_ http.Header 9605} 9606 9607// Update: Adds or updates the managed configuration settings for an app 9608// for the specified user. If you support the Managed configurations 9609// iframe, you can apply managed configurations to a user by specifying 9610// an mcmId and its associated configuration variables (if any) in the 9611// request. Alternatively, all EMMs can apply managed configurations by 9612// passing a list of managed properties. 9613func (r *ManagedconfigurationsforuserService) Update(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserUpdateCall { 9614 c := &ManagedconfigurationsforuserUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9615 c.enterpriseId = enterpriseId 9616 c.userId = userId 9617 c.managedConfigurationForUserId = managedConfigurationForUserId 9618 c.managedconfiguration = managedconfiguration 9619 return c 9620} 9621 9622// Fields allows partial responses to be retrieved. See 9623// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9624// for more information. 9625func (c *ManagedconfigurationsforuserUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserUpdateCall { 9626 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9627 return c 9628} 9629 9630// Context sets the context to be used in this call's Do method. Any 9631// pending HTTP request will be aborted if the provided context is 9632// canceled. 9633func (c *ManagedconfigurationsforuserUpdateCall) Context(ctx context.Context) *ManagedconfigurationsforuserUpdateCall { 9634 c.ctx_ = ctx 9635 return c 9636} 9637 9638// Header returns an http.Header that can be modified by the caller to 9639// add HTTP headers to the request. 9640func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header { 9641 if c.header_ == nil { 9642 c.header_ = make(http.Header) 9643 } 9644 return c.header_ 9645} 9646 9647func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) { 9648 reqHeaders := make(http.Header) 9649 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9650 for k, v := range c.header_ { 9651 reqHeaders[k] = v 9652 } 9653 reqHeaders.Set("User-Agent", c.s.userAgent()) 9654 var body io.Reader = nil 9655 body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration) 9656 if err != nil { 9657 return nil, err 9658 } 9659 reqHeaders.Set("Content-Type", "application/json") 9660 c.urlParams_.Set("alt", alt) 9661 c.urlParams_.Set("prettyPrint", "false") 9662 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}") 9663 urls += "?" + c.urlParams_.Encode() 9664 req, err := http.NewRequest("PUT", urls, body) 9665 if err != nil { 9666 return nil, err 9667 } 9668 req.Header = reqHeaders 9669 googleapi.Expand(req.URL, map[string]string{ 9670 "enterpriseId": c.enterpriseId, 9671 "userId": c.userId, 9672 "managedConfigurationForUserId": c.managedConfigurationForUserId, 9673 }) 9674 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9675} 9676 9677// Do executes the "androidenterprise.managedconfigurationsforuser.update" call. 9678// Exactly one of *ManagedConfiguration or error will be non-nil. Any 9679// non-2xx status code is an error. Response headers are in either 9680// *ManagedConfiguration.ServerResponse.Header or (if a response was 9681// returned at all) in error.(*googleapi.Error).Header. Use 9682// googleapi.IsNotModified to check whether the returned error was 9683// because http.StatusNotModified was returned. 9684func (c *ManagedconfigurationsforuserUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) { 9685 gensupport.SetOptions(c.urlParams_, opts...) 9686 res, err := c.doRequest("json") 9687 if res != nil && res.StatusCode == http.StatusNotModified { 9688 if res.Body != nil { 9689 res.Body.Close() 9690 } 9691 return nil, &googleapi.Error{ 9692 Code: res.StatusCode, 9693 Header: res.Header, 9694 } 9695 } 9696 if err != nil { 9697 return nil, err 9698 } 9699 defer googleapi.CloseBody(res) 9700 if err := googleapi.CheckResponse(res); err != nil { 9701 return nil, err 9702 } 9703 ret := &ManagedConfiguration{ 9704 ServerResponse: googleapi.ServerResponse{ 9705 Header: res.Header, 9706 HTTPStatusCode: res.StatusCode, 9707 }, 9708 } 9709 target := &ret 9710 if err := gensupport.DecodeResponse(target, res); err != nil { 9711 return nil, err 9712 } 9713 return ret, nil 9714 // { 9715 // "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.", 9716 // "httpMethod": "PUT", 9717 // "id": "androidenterprise.managedconfigurationsforuser.update", 9718 // "parameterOrder": [ 9719 // "enterpriseId", 9720 // "userId", 9721 // "managedConfigurationForUserId" 9722 // ], 9723 // "parameters": { 9724 // "enterpriseId": { 9725 // "description": "The ID of the enterprise.", 9726 // "location": "path", 9727 // "required": true, 9728 // "type": "string" 9729 // }, 9730 // "managedConfigurationForUserId": { 9731 // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".", 9732 // "location": "path", 9733 // "required": true, 9734 // "type": "string" 9735 // }, 9736 // "userId": { 9737 // "description": "The ID of the user.", 9738 // "location": "path", 9739 // "required": true, 9740 // "type": "string" 9741 // } 9742 // }, 9743 // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}", 9744 // "request": { 9745 // "$ref": "ManagedConfiguration" 9746 // }, 9747 // "response": { 9748 // "$ref": "ManagedConfiguration" 9749 // }, 9750 // "scopes": [ 9751 // "https://www.googleapis.com/auth/androidenterprise" 9752 // ] 9753 // } 9754 9755} 9756 9757// method id "androidenterprise.managedconfigurationssettings.list": 9758 9759type ManagedconfigurationssettingsListCall struct { 9760 s *Service 9761 enterpriseId string 9762 productId string 9763 urlParams_ gensupport.URLParams 9764 ifNoneMatch_ string 9765 ctx_ context.Context 9766 header_ http.Header 9767} 9768 9769// List: Lists all the managed configurations settings for the specified 9770// app. 9771func (r *ManagedconfigurationssettingsService) List(enterpriseId string, productId string) *ManagedconfigurationssettingsListCall { 9772 c := &ManagedconfigurationssettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9773 c.enterpriseId = enterpriseId 9774 c.productId = productId 9775 return c 9776} 9777 9778// Fields allows partial responses to be retrieved. See 9779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9780// for more information. 9781func (c *ManagedconfigurationssettingsListCall) Fields(s ...googleapi.Field) *ManagedconfigurationssettingsListCall { 9782 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9783 return c 9784} 9785 9786// IfNoneMatch sets the optional parameter which makes the operation 9787// fail if the object's ETag matches the given value. This is useful for 9788// getting updates only after the object has changed since the last 9789// request. Use googleapi.IsNotModified to check whether the response 9790// error from Do is the result of In-None-Match. 9791func (c *ManagedconfigurationssettingsListCall) IfNoneMatch(entityTag string) *ManagedconfigurationssettingsListCall { 9792 c.ifNoneMatch_ = entityTag 9793 return c 9794} 9795 9796// Context sets the context to be used in this call's Do method. Any 9797// pending HTTP request will be aborted if the provided context is 9798// canceled. 9799func (c *ManagedconfigurationssettingsListCall) Context(ctx context.Context) *ManagedconfigurationssettingsListCall { 9800 c.ctx_ = ctx 9801 return c 9802} 9803 9804// Header returns an http.Header that can be modified by the caller to 9805// add HTTP headers to the request. 9806func (c *ManagedconfigurationssettingsListCall) Header() http.Header { 9807 if c.header_ == nil { 9808 c.header_ = make(http.Header) 9809 } 9810 return c.header_ 9811} 9812 9813func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Response, error) { 9814 reqHeaders := make(http.Header) 9815 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9816 for k, v := range c.header_ { 9817 reqHeaders[k] = v 9818 } 9819 reqHeaders.Set("User-Agent", c.s.userAgent()) 9820 if c.ifNoneMatch_ != "" { 9821 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9822 } 9823 var body io.Reader = nil 9824 c.urlParams_.Set("alt", alt) 9825 c.urlParams_.Set("prettyPrint", "false") 9826 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings") 9827 urls += "?" + c.urlParams_.Encode() 9828 req, err := http.NewRequest("GET", urls, body) 9829 if err != nil { 9830 return nil, err 9831 } 9832 req.Header = reqHeaders 9833 googleapi.Expand(req.URL, map[string]string{ 9834 "enterpriseId": c.enterpriseId, 9835 "productId": c.productId, 9836 }) 9837 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9838} 9839 9840// Do executes the "androidenterprise.managedconfigurationssettings.list" call. 9841// Exactly one of *ManagedConfigurationsSettingsListResponse or error 9842// will be non-nil. Any non-2xx status code is an error. Response 9843// headers are in either 9844// *ManagedConfigurationsSettingsListResponse.ServerResponse.Header or 9845// (if a response was returned at all) in 9846// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9847// whether the returned error was because http.StatusNotModified was 9848// returned. 9849func (c *ManagedconfigurationssettingsListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsSettingsListResponse, error) { 9850 gensupport.SetOptions(c.urlParams_, opts...) 9851 res, err := c.doRequest("json") 9852 if res != nil && res.StatusCode == http.StatusNotModified { 9853 if res.Body != nil { 9854 res.Body.Close() 9855 } 9856 return nil, &googleapi.Error{ 9857 Code: res.StatusCode, 9858 Header: res.Header, 9859 } 9860 } 9861 if err != nil { 9862 return nil, err 9863 } 9864 defer googleapi.CloseBody(res) 9865 if err := googleapi.CheckResponse(res); err != nil { 9866 return nil, err 9867 } 9868 ret := &ManagedConfigurationsSettingsListResponse{ 9869 ServerResponse: googleapi.ServerResponse{ 9870 Header: res.Header, 9871 HTTPStatusCode: res.StatusCode, 9872 }, 9873 } 9874 target := &ret 9875 if err := gensupport.DecodeResponse(target, res); err != nil { 9876 return nil, err 9877 } 9878 return ret, nil 9879 // { 9880 // "description": "Lists all the managed configurations settings for the specified app.", 9881 // "httpMethod": "GET", 9882 // "id": "androidenterprise.managedconfigurationssettings.list", 9883 // "parameterOrder": [ 9884 // "enterpriseId", 9885 // "productId" 9886 // ], 9887 // "parameters": { 9888 // "enterpriseId": { 9889 // "description": "The ID of the enterprise.", 9890 // "location": "path", 9891 // "required": true, 9892 // "type": "string" 9893 // }, 9894 // "productId": { 9895 // "description": "The ID of the product for which the managed configurations settings applies to.", 9896 // "location": "path", 9897 // "required": true, 9898 // "type": "string" 9899 // } 9900 // }, 9901 // "path": "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings", 9902 // "response": { 9903 // "$ref": "ManagedConfigurationsSettingsListResponse" 9904 // }, 9905 // "scopes": [ 9906 // "https://www.googleapis.com/auth/androidenterprise" 9907 // ] 9908 // } 9909 9910} 9911 9912// method id "androidenterprise.permissions.get": 9913 9914type PermissionsGetCall struct { 9915 s *Service 9916 permissionId string 9917 urlParams_ gensupport.URLParams 9918 ifNoneMatch_ string 9919 ctx_ context.Context 9920 header_ http.Header 9921} 9922 9923// Get: Retrieves details of an Android app permission for display to an 9924// enterprise admin. 9925func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall { 9926 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9927 c.permissionId = permissionId 9928 return c 9929} 9930 9931// Language sets the optional parameter "language": The BCP47 tag for 9932// the user's preferred language (e.g. "en-US", "de") 9933func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall { 9934 c.urlParams_.Set("language", language) 9935 return c 9936} 9937 9938// Fields allows partial responses to be retrieved. See 9939// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9940// for more information. 9941func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 9942 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9943 return c 9944} 9945 9946// IfNoneMatch sets the optional parameter which makes the operation 9947// fail if the object's ETag matches the given value. This is useful for 9948// getting updates only after the object has changed since the last 9949// request. Use googleapi.IsNotModified to check whether the response 9950// error from Do is the result of In-None-Match. 9951func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 9952 c.ifNoneMatch_ = entityTag 9953 return c 9954} 9955 9956// Context sets the context to be used in this call's Do method. Any 9957// pending HTTP request will be aborted if the provided context is 9958// canceled. 9959func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 9960 c.ctx_ = ctx 9961 return c 9962} 9963 9964// Header returns an http.Header that can be modified by the caller to 9965// add HTTP headers to the request. 9966func (c *PermissionsGetCall) Header() http.Header { 9967 if c.header_ == nil { 9968 c.header_ = make(http.Header) 9969 } 9970 return c.header_ 9971} 9972 9973func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 9974 reqHeaders := make(http.Header) 9975 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 9976 for k, v := range c.header_ { 9977 reqHeaders[k] = v 9978 } 9979 reqHeaders.Set("User-Agent", c.s.userAgent()) 9980 if c.ifNoneMatch_ != "" { 9981 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9982 } 9983 var body io.Reader = nil 9984 c.urlParams_.Set("alt", alt) 9985 c.urlParams_.Set("prettyPrint", "false") 9986 urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}") 9987 urls += "?" + c.urlParams_.Encode() 9988 req, err := http.NewRequest("GET", urls, body) 9989 if err != nil { 9990 return nil, err 9991 } 9992 req.Header = reqHeaders 9993 googleapi.Expand(req.URL, map[string]string{ 9994 "permissionId": c.permissionId, 9995 }) 9996 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9997} 9998 9999// Do executes the "androidenterprise.permissions.get" call. 10000// Exactly one of *Permission or error will be non-nil. Any non-2xx 10001// status code is an error. Response headers are in either 10002// *Permission.ServerResponse.Header or (if a response was returned at 10003// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10004// to check whether the returned error was because 10005// http.StatusNotModified was returned. 10006func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 10007 gensupport.SetOptions(c.urlParams_, opts...) 10008 res, err := c.doRequest("json") 10009 if res != nil && res.StatusCode == http.StatusNotModified { 10010 if res.Body != nil { 10011 res.Body.Close() 10012 } 10013 return nil, &googleapi.Error{ 10014 Code: res.StatusCode, 10015 Header: res.Header, 10016 } 10017 } 10018 if err != nil { 10019 return nil, err 10020 } 10021 defer googleapi.CloseBody(res) 10022 if err := googleapi.CheckResponse(res); err != nil { 10023 return nil, err 10024 } 10025 ret := &Permission{ 10026 ServerResponse: googleapi.ServerResponse{ 10027 Header: res.Header, 10028 HTTPStatusCode: res.StatusCode, 10029 }, 10030 } 10031 target := &ret 10032 if err := gensupport.DecodeResponse(target, res); err != nil { 10033 return nil, err 10034 } 10035 return ret, nil 10036 // { 10037 // "description": "Retrieves details of an Android app permission for display to an enterprise admin.", 10038 // "httpMethod": "GET", 10039 // "id": "androidenterprise.permissions.get", 10040 // "parameterOrder": [ 10041 // "permissionId" 10042 // ], 10043 // "parameters": { 10044 // "language": { 10045 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")", 10046 // "location": "query", 10047 // "type": "string" 10048 // }, 10049 // "permissionId": { 10050 // "description": "The ID of the permission.", 10051 // "location": "path", 10052 // "required": true, 10053 // "type": "string" 10054 // } 10055 // }, 10056 // "path": "permissions/{permissionId}", 10057 // "response": { 10058 // "$ref": "Permission" 10059 // }, 10060 // "scopes": [ 10061 // "https://www.googleapis.com/auth/androidenterprise" 10062 // ] 10063 // } 10064 10065} 10066 10067// method id "androidenterprise.products.approve": 10068 10069type ProductsApproveCall struct { 10070 s *Service 10071 enterpriseId string 10072 productId string 10073 productsapproverequest *ProductsApproveRequest 10074 urlParams_ gensupport.URLParams 10075 ctx_ context.Context 10076 header_ http.Header 10077} 10078 10079// Approve: Approves the specified product and the relevant app 10080// permissions, if any. The maximum number of products that you can 10081// approve per enterprise customer is 1,000. 10082// 10083// To learn how to use managed Google Play to design and create a store 10084// layout to display approved products to your users, see Store Layout 10085// Design. 10086func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall { 10087 c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10088 c.enterpriseId = enterpriseId 10089 c.productId = productId 10090 c.productsapproverequest = productsapproverequest 10091 return c 10092} 10093 10094// Fields allows partial responses to be retrieved. See 10095// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10096// for more information. 10097func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall { 10098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10099 return c 10100} 10101 10102// Context sets the context to be used in this call's Do method. Any 10103// pending HTTP request will be aborted if the provided context is 10104// canceled. 10105func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall { 10106 c.ctx_ = ctx 10107 return c 10108} 10109 10110// Header returns an http.Header that can be modified by the caller to 10111// add HTTP headers to the request. 10112func (c *ProductsApproveCall) Header() http.Header { 10113 if c.header_ == nil { 10114 c.header_ = make(http.Header) 10115 } 10116 return c.header_ 10117} 10118 10119func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) { 10120 reqHeaders := make(http.Header) 10121 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10122 for k, v := range c.header_ { 10123 reqHeaders[k] = v 10124 } 10125 reqHeaders.Set("User-Agent", c.s.userAgent()) 10126 var body io.Reader = nil 10127 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest) 10128 if err != nil { 10129 return nil, err 10130 } 10131 reqHeaders.Set("Content-Type", "application/json") 10132 c.urlParams_.Set("alt", alt) 10133 c.urlParams_.Set("prettyPrint", "false") 10134 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve") 10135 urls += "?" + c.urlParams_.Encode() 10136 req, err := http.NewRequest("POST", urls, body) 10137 if err != nil { 10138 return nil, err 10139 } 10140 req.Header = reqHeaders 10141 googleapi.Expand(req.URL, map[string]string{ 10142 "enterpriseId": c.enterpriseId, 10143 "productId": c.productId, 10144 }) 10145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10146} 10147 10148// Do executes the "androidenterprise.products.approve" call. 10149func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error { 10150 gensupport.SetOptions(c.urlParams_, opts...) 10151 res, err := c.doRequest("json") 10152 if err != nil { 10153 return err 10154 } 10155 defer googleapi.CloseBody(res) 10156 if err := googleapi.CheckResponse(res); err != nil { 10157 return err 10158 } 10159 return nil 10160 // { 10161 // "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.\n\nTo 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.", 10162 // "httpMethod": "POST", 10163 // "id": "androidenterprise.products.approve", 10164 // "parameterOrder": [ 10165 // "enterpriseId", 10166 // "productId" 10167 // ], 10168 // "parameters": { 10169 // "enterpriseId": { 10170 // "description": "The ID of the enterprise.", 10171 // "location": "path", 10172 // "required": true, 10173 // "type": "string" 10174 // }, 10175 // "productId": { 10176 // "description": "The ID of the product.", 10177 // "location": "path", 10178 // "required": true, 10179 // "type": "string" 10180 // } 10181 // }, 10182 // "path": "enterprises/{enterpriseId}/products/{productId}/approve", 10183 // "request": { 10184 // "$ref": "ProductsApproveRequest" 10185 // }, 10186 // "scopes": [ 10187 // "https://www.googleapis.com/auth/androidenterprise" 10188 // ] 10189 // } 10190 10191} 10192 10193// method id "androidenterprise.products.generateApprovalUrl": 10194 10195type ProductsGenerateApprovalUrlCall struct { 10196 s *Service 10197 enterpriseId string 10198 productId string 10199 urlParams_ gensupport.URLParams 10200 ctx_ context.Context 10201 header_ http.Header 10202} 10203 10204// GenerateApprovalUrl: Generates a URL that can be rendered in an 10205// iframe to display the permissions (if any) of a product. An 10206// enterprise admin must view these permissions and accept them on 10207// behalf of their organization in order to approve that 10208// product. 10209// 10210// Admins should accept the displayed permissions by interacting with a 10211// separate UI element in the EMM console, which in turn should trigger 10212// the use of this URL as the approvalUrlInfo.approvalUrl property in a 10213// Products.approve call to approve the product. This URL can only be 10214// used to display permissions for up to 1 day. 10215func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall { 10216 c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10217 c.enterpriseId = enterpriseId 10218 c.productId = productId 10219 return c 10220} 10221 10222// LanguageCode sets the optional parameter "languageCode": The BCP 47 10223// language code used for permission names and descriptions in the 10224// returned iframe, for instance "en-US". 10225func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall { 10226 c.urlParams_.Set("languageCode", languageCode) 10227 return c 10228} 10229 10230// Fields allows partial responses to be retrieved. See 10231// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10232// for more information. 10233func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall { 10234 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10235 return c 10236} 10237 10238// Context sets the context to be used in this call's Do method. Any 10239// pending HTTP request will be aborted if the provided context is 10240// canceled. 10241func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall { 10242 c.ctx_ = ctx 10243 return c 10244} 10245 10246// Header returns an http.Header that can be modified by the caller to 10247// add HTTP headers to the request. 10248func (c *ProductsGenerateApprovalUrlCall) Header() http.Header { 10249 if c.header_ == nil { 10250 c.header_ = make(http.Header) 10251 } 10252 return c.header_ 10253} 10254 10255func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) { 10256 reqHeaders := make(http.Header) 10257 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10258 for k, v := range c.header_ { 10259 reqHeaders[k] = v 10260 } 10261 reqHeaders.Set("User-Agent", c.s.userAgent()) 10262 var body io.Reader = nil 10263 c.urlParams_.Set("alt", alt) 10264 c.urlParams_.Set("prettyPrint", "false") 10265 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl") 10266 urls += "?" + c.urlParams_.Encode() 10267 req, err := http.NewRequest("POST", urls, body) 10268 if err != nil { 10269 return nil, err 10270 } 10271 req.Header = reqHeaders 10272 googleapi.Expand(req.URL, map[string]string{ 10273 "enterpriseId": c.enterpriseId, 10274 "productId": c.productId, 10275 }) 10276 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10277} 10278 10279// Do executes the "androidenterprise.products.generateApprovalUrl" call. 10280// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be 10281// non-nil. Any non-2xx status code is an error. Response headers are in 10282// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or 10283// (if a response was returned at all) in 10284// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10285// whether the returned error was because http.StatusNotModified was 10286// returned. 10287func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) { 10288 gensupport.SetOptions(c.urlParams_, opts...) 10289 res, err := c.doRequest("json") 10290 if res != nil && res.StatusCode == http.StatusNotModified { 10291 if res.Body != nil { 10292 res.Body.Close() 10293 } 10294 return nil, &googleapi.Error{ 10295 Code: res.StatusCode, 10296 Header: res.Header, 10297 } 10298 } 10299 if err != nil { 10300 return nil, err 10301 } 10302 defer googleapi.CloseBody(res) 10303 if err := googleapi.CheckResponse(res); err != nil { 10304 return nil, err 10305 } 10306 ret := &ProductsGenerateApprovalUrlResponse{ 10307 ServerResponse: googleapi.ServerResponse{ 10308 Header: res.Header, 10309 HTTPStatusCode: res.StatusCode, 10310 }, 10311 } 10312 target := &ret 10313 if err := gensupport.DecodeResponse(target, res); err != nil { 10314 return nil, err 10315 } 10316 return ret, nil 10317 // { 10318 // "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.\n\nAdmins 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.", 10319 // "httpMethod": "POST", 10320 // "id": "androidenterprise.products.generateApprovalUrl", 10321 // "parameterOrder": [ 10322 // "enterpriseId", 10323 // "productId" 10324 // ], 10325 // "parameters": { 10326 // "enterpriseId": { 10327 // "description": "The ID of the enterprise.", 10328 // "location": "path", 10329 // "required": true, 10330 // "type": "string" 10331 // }, 10332 // "languageCode": { 10333 // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", 10334 // "location": "query", 10335 // "type": "string" 10336 // }, 10337 // "productId": { 10338 // "description": "The ID of the product.", 10339 // "location": "path", 10340 // "required": true, 10341 // "type": "string" 10342 // } 10343 // }, 10344 // "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", 10345 // "response": { 10346 // "$ref": "ProductsGenerateApprovalUrlResponse" 10347 // }, 10348 // "scopes": [ 10349 // "https://www.googleapis.com/auth/androidenterprise" 10350 // ] 10351 // } 10352 10353} 10354 10355// method id "androidenterprise.products.get": 10356 10357type ProductsGetCall struct { 10358 s *Service 10359 enterpriseId string 10360 productId string 10361 urlParams_ gensupport.URLParams 10362 ifNoneMatch_ string 10363 ctx_ context.Context 10364 header_ http.Header 10365} 10366 10367// Get: Retrieves details of a product for display to an enterprise 10368// admin. 10369func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall { 10370 c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10371 c.enterpriseId = enterpriseId 10372 c.productId = productId 10373 return c 10374} 10375 10376// Language sets the optional parameter "language": The BCP47 tag for 10377// the user's preferred language (e.g. "en-US", "de"). 10378func (c *ProductsGetCall) Language(language string) *ProductsGetCall { 10379 c.urlParams_.Set("language", language) 10380 return c 10381} 10382 10383// Fields allows partial responses to be retrieved. See 10384// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10385// for more information. 10386func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall { 10387 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10388 return c 10389} 10390 10391// IfNoneMatch sets the optional parameter which makes the operation 10392// fail if the object's ETag matches the given value. This is useful for 10393// getting updates only after the object has changed since the last 10394// request. Use googleapi.IsNotModified to check whether the response 10395// error from Do is the result of In-None-Match. 10396func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall { 10397 c.ifNoneMatch_ = entityTag 10398 return c 10399} 10400 10401// Context sets the context to be used in this call's Do method. Any 10402// pending HTTP request will be aborted if the provided context is 10403// canceled. 10404func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall { 10405 c.ctx_ = ctx 10406 return c 10407} 10408 10409// Header returns an http.Header that can be modified by the caller to 10410// add HTTP headers to the request. 10411func (c *ProductsGetCall) Header() http.Header { 10412 if c.header_ == nil { 10413 c.header_ = make(http.Header) 10414 } 10415 return c.header_ 10416} 10417 10418func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { 10419 reqHeaders := make(http.Header) 10420 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10421 for k, v := range c.header_ { 10422 reqHeaders[k] = v 10423 } 10424 reqHeaders.Set("User-Agent", c.s.userAgent()) 10425 if c.ifNoneMatch_ != "" { 10426 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10427 } 10428 var body io.Reader = nil 10429 c.urlParams_.Set("alt", alt) 10430 c.urlParams_.Set("prettyPrint", "false") 10431 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}") 10432 urls += "?" + c.urlParams_.Encode() 10433 req, err := http.NewRequest("GET", urls, body) 10434 if err != nil { 10435 return nil, err 10436 } 10437 req.Header = reqHeaders 10438 googleapi.Expand(req.URL, map[string]string{ 10439 "enterpriseId": c.enterpriseId, 10440 "productId": c.productId, 10441 }) 10442 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10443} 10444 10445// Do executes the "androidenterprise.products.get" call. 10446// Exactly one of *Product or error will be non-nil. Any non-2xx status 10447// code is an error. Response headers are in either 10448// *Product.ServerResponse.Header or (if a response was returned at all) 10449// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10450// check whether the returned error was because http.StatusNotModified 10451// was returned. 10452func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) { 10453 gensupport.SetOptions(c.urlParams_, opts...) 10454 res, err := c.doRequest("json") 10455 if res != nil && res.StatusCode == http.StatusNotModified { 10456 if res.Body != nil { 10457 res.Body.Close() 10458 } 10459 return nil, &googleapi.Error{ 10460 Code: res.StatusCode, 10461 Header: res.Header, 10462 } 10463 } 10464 if err != nil { 10465 return nil, err 10466 } 10467 defer googleapi.CloseBody(res) 10468 if err := googleapi.CheckResponse(res); err != nil { 10469 return nil, err 10470 } 10471 ret := &Product{ 10472 ServerResponse: googleapi.ServerResponse{ 10473 Header: res.Header, 10474 HTTPStatusCode: res.StatusCode, 10475 }, 10476 } 10477 target := &ret 10478 if err := gensupport.DecodeResponse(target, res); err != nil { 10479 return nil, err 10480 } 10481 return ret, nil 10482 // { 10483 // "description": "Retrieves details of a product for display to an enterprise admin.", 10484 // "httpMethod": "GET", 10485 // "id": "androidenterprise.products.get", 10486 // "parameterOrder": [ 10487 // "enterpriseId", 10488 // "productId" 10489 // ], 10490 // "parameters": { 10491 // "enterpriseId": { 10492 // "description": "The ID of the enterprise.", 10493 // "location": "path", 10494 // "required": true, 10495 // "type": "string" 10496 // }, 10497 // "language": { 10498 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 10499 // "location": "query", 10500 // "type": "string" 10501 // }, 10502 // "productId": { 10503 // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".", 10504 // "location": "path", 10505 // "required": true, 10506 // "type": "string" 10507 // } 10508 // }, 10509 // "path": "enterprises/{enterpriseId}/products/{productId}", 10510 // "response": { 10511 // "$ref": "Product" 10512 // }, 10513 // "scopes": [ 10514 // "https://www.googleapis.com/auth/androidenterprise" 10515 // ] 10516 // } 10517 10518} 10519 10520// method id "androidenterprise.products.getAppRestrictionsSchema": 10521 10522type ProductsGetAppRestrictionsSchemaCall struct { 10523 s *Service 10524 enterpriseId string 10525 productId string 10526 urlParams_ gensupport.URLParams 10527 ifNoneMatch_ string 10528 ctx_ context.Context 10529 header_ http.Header 10530} 10531 10532// GetAppRestrictionsSchema: Retrieves the schema that defines the 10533// configurable properties for this product. All products have a schema, 10534// but this schema may be empty if no managed configurations have been 10535// defined. This schema can be used to populate a UI that allows an 10536// admin to configure the product. To apply a managed configuration 10537// based on the schema obtained using this API, see Managed 10538// Configurations through Play. 10539func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall { 10540 c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10541 c.enterpriseId = enterpriseId 10542 c.productId = productId 10543 return c 10544} 10545 10546// Language sets the optional parameter "language": The BCP47 tag for 10547// the user's preferred language (e.g. "en-US", "de"). 10548func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall { 10549 c.urlParams_.Set("language", language) 10550 return c 10551} 10552 10553// Fields allows partial responses to be retrieved. See 10554// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10555// for more information. 10556func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall { 10557 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10558 return c 10559} 10560 10561// IfNoneMatch sets the optional parameter which makes the operation 10562// fail if the object's ETag matches the given value. This is useful for 10563// getting updates only after the object has changed since the last 10564// request. Use googleapi.IsNotModified to check whether the response 10565// error from Do is the result of In-None-Match. 10566func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall { 10567 c.ifNoneMatch_ = entityTag 10568 return c 10569} 10570 10571// Context sets the context to be used in this call's Do method. Any 10572// pending HTTP request will be aborted if the provided context is 10573// canceled. 10574func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall { 10575 c.ctx_ = ctx 10576 return c 10577} 10578 10579// Header returns an http.Header that can be modified by the caller to 10580// add HTTP headers to the request. 10581func (c *ProductsGetAppRestrictionsSchemaCall) Header() http.Header { 10582 if c.header_ == nil { 10583 c.header_ = make(http.Header) 10584 } 10585 return c.header_ 10586} 10587 10588func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) { 10589 reqHeaders := make(http.Header) 10590 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10591 for k, v := range c.header_ { 10592 reqHeaders[k] = v 10593 } 10594 reqHeaders.Set("User-Agent", c.s.userAgent()) 10595 if c.ifNoneMatch_ != "" { 10596 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10597 } 10598 var body io.Reader = nil 10599 c.urlParams_.Set("alt", alt) 10600 c.urlParams_.Set("prettyPrint", "false") 10601 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema") 10602 urls += "?" + c.urlParams_.Encode() 10603 req, err := http.NewRequest("GET", urls, body) 10604 if err != nil { 10605 return nil, err 10606 } 10607 req.Header = reqHeaders 10608 googleapi.Expand(req.URL, map[string]string{ 10609 "enterpriseId": c.enterpriseId, 10610 "productId": c.productId, 10611 }) 10612 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10613} 10614 10615// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call. 10616// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any 10617// non-2xx status code is an error. Response headers are in either 10618// *AppRestrictionsSchema.ServerResponse.Header or (if a response was 10619// returned at all) in error.(*googleapi.Error).Header. Use 10620// googleapi.IsNotModified to check whether the returned error was 10621// because http.StatusNotModified was returned. 10622func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) { 10623 gensupport.SetOptions(c.urlParams_, opts...) 10624 res, err := c.doRequest("json") 10625 if res != nil && res.StatusCode == http.StatusNotModified { 10626 if res.Body != nil { 10627 res.Body.Close() 10628 } 10629 return nil, &googleapi.Error{ 10630 Code: res.StatusCode, 10631 Header: res.Header, 10632 } 10633 } 10634 if err != nil { 10635 return nil, err 10636 } 10637 defer googleapi.CloseBody(res) 10638 if err := googleapi.CheckResponse(res); err != nil { 10639 return nil, err 10640 } 10641 ret := &AppRestrictionsSchema{ 10642 ServerResponse: googleapi.ServerResponse{ 10643 Header: res.Header, 10644 HTTPStatusCode: res.StatusCode, 10645 }, 10646 } 10647 target := &ret 10648 if err := gensupport.DecodeResponse(target, res); err != nil { 10649 return nil, err 10650 } 10651 return ret, nil 10652 // { 10653 // "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.", 10654 // "httpMethod": "GET", 10655 // "id": "androidenterprise.products.getAppRestrictionsSchema", 10656 // "parameterOrder": [ 10657 // "enterpriseId", 10658 // "productId" 10659 // ], 10660 // "parameters": { 10661 // "enterpriseId": { 10662 // "description": "The ID of the enterprise.", 10663 // "location": "path", 10664 // "required": true, 10665 // "type": "string" 10666 // }, 10667 // "language": { 10668 // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", 10669 // "location": "query", 10670 // "type": "string" 10671 // }, 10672 // "productId": { 10673 // "description": "The ID of the product.", 10674 // "location": "path", 10675 // "required": true, 10676 // "type": "string" 10677 // } 10678 // }, 10679 // "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", 10680 // "response": { 10681 // "$ref": "AppRestrictionsSchema" 10682 // }, 10683 // "scopes": [ 10684 // "https://www.googleapis.com/auth/androidenterprise" 10685 // ] 10686 // } 10687 10688} 10689 10690// method id "androidenterprise.products.getPermissions": 10691 10692type ProductsGetPermissionsCall struct { 10693 s *Service 10694 enterpriseId string 10695 productId string 10696 urlParams_ gensupport.URLParams 10697 ifNoneMatch_ string 10698 ctx_ context.Context 10699 header_ http.Header 10700} 10701 10702// GetPermissions: Retrieves the Android app permissions required by 10703// this app. 10704func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall { 10705 c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10706 c.enterpriseId = enterpriseId 10707 c.productId = productId 10708 return c 10709} 10710 10711// Fields allows partial responses to be retrieved. See 10712// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10713// for more information. 10714func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall { 10715 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10716 return c 10717} 10718 10719// IfNoneMatch sets the optional parameter which makes the operation 10720// fail if the object's ETag matches the given value. This is useful for 10721// getting updates only after the object has changed since the last 10722// request. Use googleapi.IsNotModified to check whether the response 10723// error from Do is the result of In-None-Match. 10724func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall { 10725 c.ifNoneMatch_ = entityTag 10726 return c 10727} 10728 10729// Context sets the context to be used in this call's Do method. Any 10730// pending HTTP request will be aborted if the provided context is 10731// canceled. 10732func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall { 10733 c.ctx_ = ctx 10734 return c 10735} 10736 10737// Header returns an http.Header that can be modified by the caller to 10738// add HTTP headers to the request. 10739func (c *ProductsGetPermissionsCall) Header() http.Header { 10740 if c.header_ == nil { 10741 c.header_ = make(http.Header) 10742 } 10743 return c.header_ 10744} 10745 10746func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) { 10747 reqHeaders := make(http.Header) 10748 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10749 for k, v := range c.header_ { 10750 reqHeaders[k] = v 10751 } 10752 reqHeaders.Set("User-Agent", c.s.userAgent()) 10753 if c.ifNoneMatch_ != "" { 10754 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10755 } 10756 var body io.Reader = nil 10757 c.urlParams_.Set("alt", alt) 10758 c.urlParams_.Set("prettyPrint", "false") 10759 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions") 10760 urls += "?" + c.urlParams_.Encode() 10761 req, err := http.NewRequest("GET", urls, body) 10762 if err != nil { 10763 return nil, err 10764 } 10765 req.Header = reqHeaders 10766 googleapi.Expand(req.URL, map[string]string{ 10767 "enterpriseId": c.enterpriseId, 10768 "productId": c.productId, 10769 }) 10770 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10771} 10772 10773// Do executes the "androidenterprise.products.getPermissions" call. 10774// Exactly one of *ProductPermissions or error will be non-nil. Any 10775// non-2xx status code is an error. Response headers are in either 10776// *ProductPermissions.ServerResponse.Header or (if a response was 10777// returned at all) in error.(*googleapi.Error).Header. Use 10778// googleapi.IsNotModified to check whether the returned error was 10779// because http.StatusNotModified was returned. 10780func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) { 10781 gensupport.SetOptions(c.urlParams_, opts...) 10782 res, err := c.doRequest("json") 10783 if res != nil && res.StatusCode == http.StatusNotModified { 10784 if res.Body != nil { 10785 res.Body.Close() 10786 } 10787 return nil, &googleapi.Error{ 10788 Code: res.StatusCode, 10789 Header: res.Header, 10790 } 10791 } 10792 if err != nil { 10793 return nil, err 10794 } 10795 defer googleapi.CloseBody(res) 10796 if err := googleapi.CheckResponse(res); err != nil { 10797 return nil, err 10798 } 10799 ret := &ProductPermissions{ 10800 ServerResponse: googleapi.ServerResponse{ 10801 Header: res.Header, 10802 HTTPStatusCode: res.StatusCode, 10803 }, 10804 } 10805 target := &ret 10806 if err := gensupport.DecodeResponse(target, res); err != nil { 10807 return nil, err 10808 } 10809 return ret, nil 10810 // { 10811 // "description": "Retrieves the Android app permissions required by this app.", 10812 // "httpMethod": "GET", 10813 // "id": "androidenterprise.products.getPermissions", 10814 // "parameterOrder": [ 10815 // "enterpriseId", 10816 // "productId" 10817 // ], 10818 // "parameters": { 10819 // "enterpriseId": { 10820 // "description": "The ID of the enterprise.", 10821 // "location": "path", 10822 // "required": true, 10823 // "type": "string" 10824 // }, 10825 // "productId": { 10826 // "description": "The ID of the product.", 10827 // "location": "path", 10828 // "required": true, 10829 // "type": "string" 10830 // } 10831 // }, 10832 // "path": "enterprises/{enterpriseId}/products/{productId}/permissions", 10833 // "response": { 10834 // "$ref": "ProductPermissions" 10835 // }, 10836 // "scopes": [ 10837 // "https://www.googleapis.com/auth/androidenterprise" 10838 // ] 10839 // } 10840 10841} 10842 10843// method id "androidenterprise.products.list": 10844 10845type ProductsListCall struct { 10846 s *Service 10847 enterpriseId string 10848 urlParams_ gensupport.URLParams 10849 ifNoneMatch_ string 10850 ctx_ context.Context 10851 header_ http.Header 10852} 10853 10854// List: Finds approved products that match a query, or all approved 10855// products if there is no query. 10856func (r *ProductsService) List(enterpriseId string) *ProductsListCall { 10857 c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10858 c.enterpriseId = enterpriseId 10859 return c 10860} 10861 10862// Approved sets the optional parameter "approved": Specifies whether to 10863// search among all products (false) or among only products that have 10864// been approved (true). Only "true" is supported, and should be 10865// specified. 10866func (c *ProductsListCall) Approved(approved bool) *ProductsListCall { 10867 c.urlParams_.Set("approved", fmt.Sprint(approved)) 10868 return c 10869} 10870 10871// Language sets the optional parameter "language": The BCP47 tag for 10872// the user's preferred language (e.g. "en-US", "de"). Results are 10873// returned in the language best matching the preferred language. 10874func (c *ProductsListCall) Language(language string) *ProductsListCall { 10875 c.urlParams_.Set("language", language) 10876 return c 10877} 10878 10879// MaxResults sets the optional parameter "maxResults": Specifies the 10880// maximum number of products that can be returned per request. If not 10881// specified, uses a default value of 100, which is also the maximum 10882// retrievable within a single response. 10883func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall { 10884 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10885 return c 10886} 10887 10888// Query sets the optional parameter "query": The search query as typed 10889// in the Google Play store search box. If omitted, all approved apps 10890// will be returned (using the pagination parameters), including apps 10891// that are not available in the store (e.g. unpublished apps). 10892func (c *ProductsListCall) Query(query string) *ProductsListCall { 10893 c.urlParams_.Set("query", query) 10894 return c 10895} 10896 10897// Token sets the optional parameter "token": A pagination token is 10898// contained in a request's response when there are more products. The 10899// token can be used in a subsequent request to obtain more products, 10900// and so forth. This parameter cannot be used in the initial request. 10901func (c *ProductsListCall) Token(token string) *ProductsListCall { 10902 c.urlParams_.Set("token", token) 10903 return c 10904} 10905 10906// Fields allows partial responses to be retrieved. See 10907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10908// for more information. 10909func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall { 10910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10911 return c 10912} 10913 10914// IfNoneMatch sets the optional parameter which makes the operation 10915// fail if the object's ETag matches the given value. This is useful for 10916// getting updates only after the object has changed since the last 10917// request. Use googleapi.IsNotModified to check whether the response 10918// error from Do is the result of In-None-Match. 10919func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall { 10920 c.ifNoneMatch_ = entityTag 10921 return c 10922} 10923 10924// Context sets the context to be used in this call's Do method. Any 10925// pending HTTP request will be aborted if the provided context is 10926// canceled. 10927func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall { 10928 c.ctx_ = ctx 10929 return c 10930} 10931 10932// Header returns an http.Header that can be modified by the caller to 10933// add HTTP headers to the request. 10934func (c *ProductsListCall) Header() http.Header { 10935 if c.header_ == nil { 10936 c.header_ = make(http.Header) 10937 } 10938 return c.header_ 10939} 10940 10941func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { 10942 reqHeaders := make(http.Header) 10943 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 10944 for k, v := range c.header_ { 10945 reqHeaders[k] = v 10946 } 10947 reqHeaders.Set("User-Agent", c.s.userAgent()) 10948 if c.ifNoneMatch_ != "" { 10949 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10950 } 10951 var body io.Reader = nil 10952 c.urlParams_.Set("alt", alt) 10953 c.urlParams_.Set("prettyPrint", "false") 10954 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products") 10955 urls += "?" + c.urlParams_.Encode() 10956 req, err := http.NewRequest("GET", urls, body) 10957 if err != nil { 10958 return nil, err 10959 } 10960 req.Header = reqHeaders 10961 googleapi.Expand(req.URL, map[string]string{ 10962 "enterpriseId": c.enterpriseId, 10963 }) 10964 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10965} 10966 10967// Do executes the "androidenterprise.products.list" call. 10968// Exactly one of *ProductsListResponse or error will be non-nil. Any 10969// non-2xx status code is an error. Response headers are in either 10970// *ProductsListResponse.ServerResponse.Header or (if a response was 10971// returned at all) in error.(*googleapi.Error).Header. Use 10972// googleapi.IsNotModified to check whether the returned error was 10973// because http.StatusNotModified was returned. 10974func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) { 10975 gensupport.SetOptions(c.urlParams_, opts...) 10976 res, err := c.doRequest("json") 10977 if res != nil && res.StatusCode == http.StatusNotModified { 10978 if res.Body != nil { 10979 res.Body.Close() 10980 } 10981 return nil, &googleapi.Error{ 10982 Code: res.StatusCode, 10983 Header: res.Header, 10984 } 10985 } 10986 if err != nil { 10987 return nil, err 10988 } 10989 defer googleapi.CloseBody(res) 10990 if err := googleapi.CheckResponse(res); err != nil { 10991 return nil, err 10992 } 10993 ret := &ProductsListResponse{ 10994 ServerResponse: googleapi.ServerResponse{ 10995 Header: res.Header, 10996 HTTPStatusCode: res.StatusCode, 10997 }, 10998 } 10999 target := &ret 11000 if err := gensupport.DecodeResponse(target, res); err != nil { 11001 return nil, err 11002 } 11003 return ret, nil 11004 // { 11005 // "description": "Finds approved products that match a query, or all approved products if there is no query.", 11006 // "httpMethod": "GET", 11007 // "id": "androidenterprise.products.list", 11008 // "parameterOrder": [ 11009 // "enterpriseId" 11010 // ], 11011 // "parameters": { 11012 // "approved": { 11013 // "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.", 11014 // "location": "query", 11015 // "type": "boolean" 11016 // }, 11017 // "enterpriseId": { 11018 // "description": "The ID of the enterprise.", 11019 // "location": "path", 11020 // "required": true, 11021 // "type": "string" 11022 // }, 11023 // "language": { 11024 // "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.", 11025 // "location": "query", 11026 // "type": "string" 11027 // }, 11028 // "maxResults": { 11029 // "description": "Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response.", 11030 // "format": "uint32", 11031 // "location": "query", 11032 // "type": "integer" 11033 // }, 11034 // "query": { 11035 // "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).", 11036 // "location": "query", 11037 // "type": "string" 11038 // }, 11039 // "token": { 11040 // "description": "A pagination token is contained in a request's response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request.", 11041 // "location": "query", 11042 // "type": "string" 11043 // } 11044 // }, 11045 // "path": "enterprises/{enterpriseId}/products", 11046 // "response": { 11047 // "$ref": "ProductsListResponse" 11048 // }, 11049 // "scopes": [ 11050 // "https://www.googleapis.com/auth/androidenterprise" 11051 // ] 11052 // } 11053 11054} 11055 11056// method id "androidenterprise.products.unapprove": 11057 11058type ProductsUnapproveCall struct { 11059 s *Service 11060 enterpriseId string 11061 productId string 11062 urlParams_ gensupport.URLParams 11063 ctx_ context.Context 11064 header_ http.Header 11065} 11066 11067// Unapprove: Unapproves the specified product (and the relevant app 11068// permissions, if any) 11069func (r *ProductsService) Unapprove(enterpriseId string, productId string) *ProductsUnapproveCall { 11070 c := &ProductsUnapproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11071 c.enterpriseId = enterpriseId 11072 c.productId = productId 11073 return c 11074} 11075 11076// Fields allows partial responses to be retrieved. See 11077// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11078// for more information. 11079func (c *ProductsUnapproveCall) Fields(s ...googleapi.Field) *ProductsUnapproveCall { 11080 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11081 return c 11082} 11083 11084// Context sets the context to be used in this call's Do method. Any 11085// pending HTTP request will be aborted if the provided context is 11086// canceled. 11087func (c *ProductsUnapproveCall) Context(ctx context.Context) *ProductsUnapproveCall { 11088 c.ctx_ = ctx 11089 return c 11090} 11091 11092// Header returns an http.Header that can be modified by the caller to 11093// add HTTP headers to the request. 11094func (c *ProductsUnapproveCall) Header() http.Header { 11095 if c.header_ == nil { 11096 c.header_ = make(http.Header) 11097 } 11098 return c.header_ 11099} 11100 11101func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) { 11102 reqHeaders := make(http.Header) 11103 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11104 for k, v := range c.header_ { 11105 reqHeaders[k] = v 11106 } 11107 reqHeaders.Set("User-Agent", c.s.userAgent()) 11108 var body io.Reader = nil 11109 c.urlParams_.Set("alt", alt) 11110 c.urlParams_.Set("prettyPrint", "false") 11111 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/unapprove") 11112 urls += "?" + c.urlParams_.Encode() 11113 req, err := http.NewRequest("POST", urls, body) 11114 if err != nil { 11115 return nil, err 11116 } 11117 req.Header = reqHeaders 11118 googleapi.Expand(req.URL, map[string]string{ 11119 "enterpriseId": c.enterpriseId, 11120 "productId": c.productId, 11121 }) 11122 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11123} 11124 11125// Do executes the "androidenterprise.products.unapprove" call. 11126func (c *ProductsUnapproveCall) Do(opts ...googleapi.CallOption) error { 11127 gensupport.SetOptions(c.urlParams_, opts...) 11128 res, err := c.doRequest("json") 11129 if err != nil { 11130 return err 11131 } 11132 defer googleapi.CloseBody(res) 11133 if err := googleapi.CheckResponse(res); err != nil { 11134 return err 11135 } 11136 return nil 11137 // { 11138 // "description": "Unapproves the specified product (and the relevant app permissions, if any)", 11139 // "httpMethod": "POST", 11140 // "id": "androidenterprise.products.unapprove", 11141 // "parameterOrder": [ 11142 // "enterpriseId", 11143 // "productId" 11144 // ], 11145 // "parameters": { 11146 // "enterpriseId": { 11147 // "description": "The ID of the enterprise.", 11148 // "location": "path", 11149 // "required": true, 11150 // "type": "string" 11151 // }, 11152 // "productId": { 11153 // "description": "The ID of the product.", 11154 // "location": "path", 11155 // "required": true, 11156 // "type": "string" 11157 // } 11158 // }, 11159 // "path": "enterprises/{enterpriseId}/products/{productId}/unapprove", 11160 // "scopes": [ 11161 // "https://www.googleapis.com/auth/androidenterprise" 11162 // ] 11163 // } 11164 11165} 11166 11167// method id "androidenterprise.serviceaccountkeys.delete": 11168 11169type ServiceaccountkeysDeleteCall struct { 11170 s *Service 11171 enterpriseId string 11172 keyId string 11173 urlParams_ gensupport.URLParams 11174 ctx_ context.Context 11175 header_ http.Header 11176} 11177 11178// Delete: Removes and invalidates the specified credentials for the 11179// service account associated with this enterprise. The calling service 11180// account must have been retrieved by calling 11181// Enterprises.GetServiceAccount and must have been set as the 11182// enterprise service account by calling Enterprises.SetAccount. 11183func (r *ServiceaccountkeysService) Delete(enterpriseId string, keyId string) *ServiceaccountkeysDeleteCall { 11184 c := &ServiceaccountkeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11185 c.enterpriseId = enterpriseId 11186 c.keyId = keyId 11187 return c 11188} 11189 11190// Fields allows partial responses to be retrieved. See 11191// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11192// for more information. 11193func (c *ServiceaccountkeysDeleteCall) Fields(s ...googleapi.Field) *ServiceaccountkeysDeleteCall { 11194 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11195 return c 11196} 11197 11198// Context sets the context to be used in this call's Do method. Any 11199// pending HTTP request will be aborted if the provided context is 11200// canceled. 11201func (c *ServiceaccountkeysDeleteCall) Context(ctx context.Context) *ServiceaccountkeysDeleteCall { 11202 c.ctx_ = ctx 11203 return c 11204} 11205 11206// Header returns an http.Header that can be modified by the caller to 11207// add HTTP headers to the request. 11208func (c *ServiceaccountkeysDeleteCall) Header() http.Header { 11209 if c.header_ == nil { 11210 c.header_ = make(http.Header) 11211 } 11212 return c.header_ 11213} 11214 11215func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) { 11216 reqHeaders := make(http.Header) 11217 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11218 for k, v := range c.header_ { 11219 reqHeaders[k] = v 11220 } 11221 reqHeaders.Set("User-Agent", c.s.userAgent()) 11222 var body io.Reader = nil 11223 c.urlParams_.Set("alt", alt) 11224 c.urlParams_.Set("prettyPrint", "false") 11225 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}") 11226 urls += "?" + c.urlParams_.Encode() 11227 req, err := http.NewRequest("DELETE", urls, body) 11228 if err != nil { 11229 return nil, err 11230 } 11231 req.Header = reqHeaders 11232 googleapi.Expand(req.URL, map[string]string{ 11233 "enterpriseId": c.enterpriseId, 11234 "keyId": c.keyId, 11235 }) 11236 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11237} 11238 11239// Do executes the "androidenterprise.serviceaccountkeys.delete" call. 11240func (c *ServiceaccountkeysDeleteCall) Do(opts ...googleapi.CallOption) error { 11241 gensupport.SetOptions(c.urlParams_, opts...) 11242 res, err := c.doRequest("json") 11243 if err != nil { 11244 return err 11245 } 11246 defer googleapi.CloseBody(res) 11247 if err := googleapi.CheckResponse(res); err != nil { 11248 return err 11249 } 11250 return nil 11251 // { 11252 // "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.", 11253 // "httpMethod": "DELETE", 11254 // "id": "androidenterprise.serviceaccountkeys.delete", 11255 // "parameterOrder": [ 11256 // "enterpriseId", 11257 // "keyId" 11258 // ], 11259 // "parameters": { 11260 // "enterpriseId": { 11261 // "description": "The ID of the enterprise.", 11262 // "location": "path", 11263 // "required": true, 11264 // "type": "string" 11265 // }, 11266 // "keyId": { 11267 // "description": "The ID of the key.", 11268 // "location": "path", 11269 // "required": true, 11270 // "type": "string" 11271 // } 11272 // }, 11273 // "path": "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}", 11274 // "scopes": [ 11275 // "https://www.googleapis.com/auth/androidenterprise" 11276 // ] 11277 // } 11278 11279} 11280 11281// method id "androidenterprise.serviceaccountkeys.insert": 11282 11283type ServiceaccountkeysInsertCall struct { 11284 s *Service 11285 enterpriseId string 11286 serviceaccountkey *ServiceAccountKey 11287 urlParams_ gensupport.URLParams 11288 ctx_ context.Context 11289 header_ http.Header 11290} 11291 11292// Insert: Generates new credentials for the service account associated 11293// with this enterprise. The calling service account must have been 11294// retrieved by calling Enterprises.GetServiceAccount and must have been 11295// set as the enterprise service account by calling 11296// Enterprises.SetAccount. 11297// 11298// Only the type of the key should be populated in the resource to be 11299// inserted. 11300func (r *ServiceaccountkeysService) Insert(enterpriseId string, serviceaccountkey *ServiceAccountKey) *ServiceaccountkeysInsertCall { 11301 c := &ServiceaccountkeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11302 c.enterpriseId = enterpriseId 11303 c.serviceaccountkey = serviceaccountkey 11304 return c 11305} 11306 11307// Fields allows partial responses to be retrieved. See 11308// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11309// for more information. 11310func (c *ServiceaccountkeysInsertCall) Fields(s ...googleapi.Field) *ServiceaccountkeysInsertCall { 11311 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11312 return c 11313} 11314 11315// Context sets the context to be used in this call's Do method. Any 11316// pending HTTP request will be aborted if the provided context is 11317// canceled. 11318func (c *ServiceaccountkeysInsertCall) Context(ctx context.Context) *ServiceaccountkeysInsertCall { 11319 c.ctx_ = ctx 11320 return c 11321} 11322 11323// Header returns an http.Header that can be modified by the caller to 11324// add HTTP headers to the request. 11325func (c *ServiceaccountkeysInsertCall) Header() http.Header { 11326 if c.header_ == nil { 11327 c.header_ = make(http.Header) 11328 } 11329 return c.header_ 11330} 11331 11332func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) { 11333 reqHeaders := make(http.Header) 11334 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11335 for k, v := range c.header_ { 11336 reqHeaders[k] = v 11337 } 11338 reqHeaders.Set("User-Agent", c.s.userAgent()) 11339 var body io.Reader = nil 11340 body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey) 11341 if err != nil { 11342 return nil, err 11343 } 11344 reqHeaders.Set("Content-Type", "application/json") 11345 c.urlParams_.Set("alt", alt) 11346 c.urlParams_.Set("prettyPrint", "false") 11347 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys") 11348 urls += "?" + c.urlParams_.Encode() 11349 req, err := http.NewRequest("POST", urls, body) 11350 if err != nil { 11351 return nil, err 11352 } 11353 req.Header = reqHeaders 11354 googleapi.Expand(req.URL, map[string]string{ 11355 "enterpriseId": c.enterpriseId, 11356 }) 11357 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11358} 11359 11360// Do executes the "androidenterprise.serviceaccountkeys.insert" call. 11361// Exactly one of *ServiceAccountKey or error will be non-nil. Any 11362// non-2xx status code is an error. Response headers are in either 11363// *ServiceAccountKey.ServerResponse.Header or (if a response was 11364// returned at all) in error.(*googleapi.Error).Header. Use 11365// googleapi.IsNotModified to check whether the returned error was 11366// because http.StatusNotModified was returned. 11367func (c *ServiceaccountkeysInsertCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKey, error) { 11368 gensupport.SetOptions(c.urlParams_, opts...) 11369 res, err := c.doRequest("json") 11370 if res != nil && res.StatusCode == http.StatusNotModified { 11371 if res.Body != nil { 11372 res.Body.Close() 11373 } 11374 return nil, &googleapi.Error{ 11375 Code: res.StatusCode, 11376 Header: res.Header, 11377 } 11378 } 11379 if err != nil { 11380 return nil, err 11381 } 11382 defer googleapi.CloseBody(res) 11383 if err := googleapi.CheckResponse(res); err != nil { 11384 return nil, err 11385 } 11386 ret := &ServiceAccountKey{ 11387 ServerResponse: googleapi.ServerResponse{ 11388 Header: res.Header, 11389 HTTPStatusCode: res.StatusCode, 11390 }, 11391 } 11392 target := &ret 11393 if err := gensupport.DecodeResponse(target, res); err != nil { 11394 return nil, err 11395 } 11396 return ret, nil 11397 // { 11398 // "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.\n\nOnly the type of the key should be populated in the resource to be inserted.", 11399 // "httpMethod": "POST", 11400 // "id": "androidenterprise.serviceaccountkeys.insert", 11401 // "parameterOrder": [ 11402 // "enterpriseId" 11403 // ], 11404 // "parameters": { 11405 // "enterpriseId": { 11406 // "description": "The ID of the enterprise.", 11407 // "location": "path", 11408 // "required": true, 11409 // "type": "string" 11410 // } 11411 // }, 11412 // "path": "enterprises/{enterpriseId}/serviceAccountKeys", 11413 // "request": { 11414 // "$ref": "ServiceAccountKey" 11415 // }, 11416 // "response": { 11417 // "$ref": "ServiceAccountKey" 11418 // }, 11419 // "scopes": [ 11420 // "https://www.googleapis.com/auth/androidenterprise" 11421 // ] 11422 // } 11423 11424} 11425 11426// method id "androidenterprise.serviceaccountkeys.list": 11427 11428type ServiceaccountkeysListCall struct { 11429 s *Service 11430 enterpriseId string 11431 urlParams_ gensupport.URLParams 11432 ifNoneMatch_ string 11433 ctx_ context.Context 11434 header_ http.Header 11435} 11436 11437// List: Lists all active credentials for the service account associated 11438// with this enterprise. Only the ID and key type are returned. The 11439// calling service account must have been retrieved by calling 11440// Enterprises.GetServiceAccount and must have been set as the 11441// enterprise service account by calling Enterprises.SetAccount. 11442func (r *ServiceaccountkeysService) List(enterpriseId string) *ServiceaccountkeysListCall { 11443 c := &ServiceaccountkeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11444 c.enterpriseId = enterpriseId 11445 return c 11446} 11447 11448// Fields allows partial responses to be retrieved. See 11449// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11450// for more information. 11451func (c *ServiceaccountkeysListCall) Fields(s ...googleapi.Field) *ServiceaccountkeysListCall { 11452 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11453 return c 11454} 11455 11456// IfNoneMatch sets the optional parameter which makes the operation 11457// fail if the object's ETag matches the given value. This is useful for 11458// getting updates only after the object has changed since the last 11459// request. Use googleapi.IsNotModified to check whether the response 11460// error from Do is the result of In-None-Match. 11461func (c *ServiceaccountkeysListCall) IfNoneMatch(entityTag string) *ServiceaccountkeysListCall { 11462 c.ifNoneMatch_ = entityTag 11463 return c 11464} 11465 11466// Context sets the context to be used in this call's Do method. Any 11467// pending HTTP request will be aborted if the provided context is 11468// canceled. 11469func (c *ServiceaccountkeysListCall) Context(ctx context.Context) *ServiceaccountkeysListCall { 11470 c.ctx_ = ctx 11471 return c 11472} 11473 11474// Header returns an http.Header that can be modified by the caller to 11475// add HTTP headers to the request. 11476func (c *ServiceaccountkeysListCall) Header() http.Header { 11477 if c.header_ == nil { 11478 c.header_ = make(http.Header) 11479 } 11480 return c.header_ 11481} 11482 11483func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, error) { 11484 reqHeaders := make(http.Header) 11485 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11486 for k, v := range c.header_ { 11487 reqHeaders[k] = v 11488 } 11489 reqHeaders.Set("User-Agent", c.s.userAgent()) 11490 if c.ifNoneMatch_ != "" { 11491 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11492 } 11493 var body io.Reader = nil 11494 c.urlParams_.Set("alt", alt) 11495 c.urlParams_.Set("prettyPrint", "false") 11496 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys") 11497 urls += "?" + c.urlParams_.Encode() 11498 req, err := http.NewRequest("GET", urls, body) 11499 if err != nil { 11500 return nil, err 11501 } 11502 req.Header = reqHeaders 11503 googleapi.Expand(req.URL, map[string]string{ 11504 "enterpriseId": c.enterpriseId, 11505 }) 11506 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11507} 11508 11509// Do executes the "androidenterprise.serviceaccountkeys.list" call. 11510// Exactly one of *ServiceAccountKeysListResponse or error will be 11511// non-nil. Any non-2xx status code is an error. Response headers are in 11512// either *ServiceAccountKeysListResponse.ServerResponse.Header or (if a 11513// response was returned at all) in error.(*googleapi.Error).Header. Use 11514// googleapi.IsNotModified to check whether the returned error was 11515// because http.StatusNotModified was returned. 11516func (c *ServiceaccountkeysListCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKeysListResponse, error) { 11517 gensupport.SetOptions(c.urlParams_, opts...) 11518 res, err := c.doRequest("json") 11519 if res != nil && res.StatusCode == http.StatusNotModified { 11520 if res.Body != nil { 11521 res.Body.Close() 11522 } 11523 return nil, &googleapi.Error{ 11524 Code: res.StatusCode, 11525 Header: res.Header, 11526 } 11527 } 11528 if err != nil { 11529 return nil, err 11530 } 11531 defer googleapi.CloseBody(res) 11532 if err := googleapi.CheckResponse(res); err != nil { 11533 return nil, err 11534 } 11535 ret := &ServiceAccountKeysListResponse{ 11536 ServerResponse: googleapi.ServerResponse{ 11537 Header: res.Header, 11538 HTTPStatusCode: res.StatusCode, 11539 }, 11540 } 11541 target := &ret 11542 if err := gensupport.DecodeResponse(target, res); err != nil { 11543 return nil, err 11544 } 11545 return ret, nil 11546 // { 11547 // "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.", 11548 // "httpMethod": "GET", 11549 // "id": "androidenterprise.serviceaccountkeys.list", 11550 // "parameterOrder": [ 11551 // "enterpriseId" 11552 // ], 11553 // "parameters": { 11554 // "enterpriseId": { 11555 // "description": "The ID of the enterprise.", 11556 // "location": "path", 11557 // "required": true, 11558 // "type": "string" 11559 // } 11560 // }, 11561 // "path": "enterprises/{enterpriseId}/serviceAccountKeys", 11562 // "response": { 11563 // "$ref": "ServiceAccountKeysListResponse" 11564 // }, 11565 // "scopes": [ 11566 // "https://www.googleapis.com/auth/androidenterprise" 11567 // ] 11568 // } 11569 11570} 11571 11572// method id "androidenterprise.storelayoutclusters.delete": 11573 11574type StorelayoutclustersDeleteCall struct { 11575 s *Service 11576 enterpriseId string 11577 pageId string 11578 clusterId string 11579 urlParams_ gensupport.URLParams 11580 ctx_ context.Context 11581 header_ http.Header 11582} 11583 11584// Delete: Deletes a cluster. 11585func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall { 11586 c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11587 c.enterpriseId = enterpriseId 11588 c.pageId = pageId 11589 c.clusterId = clusterId 11590 return c 11591} 11592 11593// Fields allows partial responses to be retrieved. See 11594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11595// for more information. 11596func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall { 11597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11598 return c 11599} 11600 11601// Context sets the context to be used in this call's Do method. Any 11602// pending HTTP request will be aborted if the provided context is 11603// canceled. 11604func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall { 11605 c.ctx_ = ctx 11606 return c 11607} 11608 11609// Header returns an http.Header that can be modified by the caller to 11610// add HTTP headers to the request. 11611func (c *StorelayoutclustersDeleteCall) Header() http.Header { 11612 if c.header_ == nil { 11613 c.header_ = make(http.Header) 11614 } 11615 return c.header_ 11616} 11617 11618func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) { 11619 reqHeaders := make(http.Header) 11620 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11621 for k, v := range c.header_ { 11622 reqHeaders[k] = v 11623 } 11624 reqHeaders.Set("User-Agent", c.s.userAgent()) 11625 var body io.Reader = nil 11626 c.urlParams_.Set("alt", alt) 11627 c.urlParams_.Set("prettyPrint", "false") 11628 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 11629 urls += "?" + c.urlParams_.Encode() 11630 req, err := http.NewRequest("DELETE", urls, body) 11631 if err != nil { 11632 return nil, err 11633 } 11634 req.Header = reqHeaders 11635 googleapi.Expand(req.URL, map[string]string{ 11636 "enterpriseId": c.enterpriseId, 11637 "pageId": c.pageId, 11638 "clusterId": c.clusterId, 11639 }) 11640 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11641} 11642 11643// Do executes the "androidenterprise.storelayoutclusters.delete" call. 11644func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error { 11645 gensupport.SetOptions(c.urlParams_, opts...) 11646 res, err := c.doRequest("json") 11647 if err != nil { 11648 return err 11649 } 11650 defer googleapi.CloseBody(res) 11651 if err := googleapi.CheckResponse(res); err != nil { 11652 return err 11653 } 11654 return nil 11655 // { 11656 // "description": "Deletes a cluster.", 11657 // "httpMethod": "DELETE", 11658 // "id": "androidenterprise.storelayoutclusters.delete", 11659 // "parameterOrder": [ 11660 // "enterpriseId", 11661 // "pageId", 11662 // "clusterId" 11663 // ], 11664 // "parameters": { 11665 // "clusterId": { 11666 // "description": "The ID of the cluster.", 11667 // "location": "path", 11668 // "required": true, 11669 // "type": "string" 11670 // }, 11671 // "enterpriseId": { 11672 // "description": "The ID of the enterprise.", 11673 // "location": "path", 11674 // "required": true, 11675 // "type": "string" 11676 // }, 11677 // "pageId": { 11678 // "description": "The ID of the page.", 11679 // "location": "path", 11680 // "required": true, 11681 // "type": "string" 11682 // } 11683 // }, 11684 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 11685 // "scopes": [ 11686 // "https://www.googleapis.com/auth/androidenterprise" 11687 // ] 11688 // } 11689 11690} 11691 11692// method id "androidenterprise.storelayoutclusters.get": 11693 11694type StorelayoutclustersGetCall struct { 11695 s *Service 11696 enterpriseId string 11697 pageId string 11698 clusterId string 11699 urlParams_ gensupport.URLParams 11700 ifNoneMatch_ string 11701 ctx_ context.Context 11702 header_ http.Header 11703} 11704 11705// Get: Retrieves details of a cluster. 11706func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall { 11707 c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11708 c.enterpriseId = enterpriseId 11709 c.pageId = pageId 11710 c.clusterId = clusterId 11711 return c 11712} 11713 11714// Fields allows partial responses to be retrieved. See 11715// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11716// for more information. 11717func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall { 11718 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11719 return c 11720} 11721 11722// IfNoneMatch sets the optional parameter which makes the operation 11723// fail if the object's ETag matches the given value. This is useful for 11724// getting updates only after the object has changed since the last 11725// request. Use googleapi.IsNotModified to check whether the response 11726// error from Do is the result of In-None-Match. 11727func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall { 11728 c.ifNoneMatch_ = entityTag 11729 return c 11730} 11731 11732// Context sets the context to be used in this call's Do method. Any 11733// pending HTTP request will be aborted if the provided context is 11734// canceled. 11735func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall { 11736 c.ctx_ = ctx 11737 return c 11738} 11739 11740// Header returns an http.Header that can be modified by the caller to 11741// add HTTP headers to the request. 11742func (c *StorelayoutclustersGetCall) Header() http.Header { 11743 if c.header_ == nil { 11744 c.header_ = make(http.Header) 11745 } 11746 return c.header_ 11747} 11748 11749func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) { 11750 reqHeaders := make(http.Header) 11751 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11752 for k, v := range c.header_ { 11753 reqHeaders[k] = v 11754 } 11755 reqHeaders.Set("User-Agent", c.s.userAgent()) 11756 if c.ifNoneMatch_ != "" { 11757 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11758 } 11759 var body io.Reader = nil 11760 c.urlParams_.Set("alt", alt) 11761 c.urlParams_.Set("prettyPrint", "false") 11762 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 11763 urls += "?" + c.urlParams_.Encode() 11764 req, err := http.NewRequest("GET", urls, body) 11765 if err != nil { 11766 return nil, err 11767 } 11768 req.Header = reqHeaders 11769 googleapi.Expand(req.URL, map[string]string{ 11770 "enterpriseId": c.enterpriseId, 11771 "pageId": c.pageId, 11772 "clusterId": c.clusterId, 11773 }) 11774 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11775} 11776 11777// Do executes the "androidenterprise.storelayoutclusters.get" call. 11778// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 11779// status code is an error. Response headers are in either 11780// *StoreCluster.ServerResponse.Header or (if a response was returned at 11781// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11782// to check whether the returned error was because 11783// http.StatusNotModified was returned. 11784func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 11785 gensupport.SetOptions(c.urlParams_, opts...) 11786 res, err := c.doRequest("json") 11787 if res != nil && res.StatusCode == http.StatusNotModified { 11788 if res.Body != nil { 11789 res.Body.Close() 11790 } 11791 return nil, &googleapi.Error{ 11792 Code: res.StatusCode, 11793 Header: res.Header, 11794 } 11795 } 11796 if err != nil { 11797 return nil, err 11798 } 11799 defer googleapi.CloseBody(res) 11800 if err := googleapi.CheckResponse(res); err != nil { 11801 return nil, err 11802 } 11803 ret := &StoreCluster{ 11804 ServerResponse: googleapi.ServerResponse{ 11805 Header: res.Header, 11806 HTTPStatusCode: res.StatusCode, 11807 }, 11808 } 11809 target := &ret 11810 if err := gensupport.DecodeResponse(target, res); err != nil { 11811 return nil, err 11812 } 11813 return ret, nil 11814 // { 11815 // "description": "Retrieves details of a cluster.", 11816 // "httpMethod": "GET", 11817 // "id": "androidenterprise.storelayoutclusters.get", 11818 // "parameterOrder": [ 11819 // "enterpriseId", 11820 // "pageId", 11821 // "clusterId" 11822 // ], 11823 // "parameters": { 11824 // "clusterId": { 11825 // "description": "The ID of the cluster.", 11826 // "location": "path", 11827 // "required": true, 11828 // "type": "string" 11829 // }, 11830 // "enterpriseId": { 11831 // "description": "The ID of the enterprise.", 11832 // "location": "path", 11833 // "required": true, 11834 // "type": "string" 11835 // }, 11836 // "pageId": { 11837 // "description": "The ID of the page.", 11838 // "location": "path", 11839 // "required": true, 11840 // "type": "string" 11841 // } 11842 // }, 11843 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 11844 // "response": { 11845 // "$ref": "StoreCluster" 11846 // }, 11847 // "scopes": [ 11848 // "https://www.googleapis.com/auth/androidenterprise" 11849 // ] 11850 // } 11851 11852} 11853 11854// method id "androidenterprise.storelayoutclusters.insert": 11855 11856type StorelayoutclustersInsertCall struct { 11857 s *Service 11858 enterpriseId string 11859 pageId string 11860 storecluster *StoreCluster 11861 urlParams_ gensupport.URLParams 11862 ctx_ context.Context 11863 header_ http.Header 11864} 11865 11866// Insert: Inserts a new cluster in a page. 11867func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall { 11868 c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11869 c.enterpriseId = enterpriseId 11870 c.pageId = pageId 11871 c.storecluster = storecluster 11872 return c 11873} 11874 11875// Fields allows partial responses to be retrieved. See 11876// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11877// for more information. 11878func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall { 11879 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11880 return c 11881} 11882 11883// Context sets the context to be used in this call's Do method. Any 11884// pending HTTP request will be aborted if the provided context is 11885// canceled. 11886func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall { 11887 c.ctx_ = ctx 11888 return c 11889} 11890 11891// Header returns an http.Header that can be modified by the caller to 11892// add HTTP headers to the request. 11893func (c *StorelayoutclustersInsertCall) Header() http.Header { 11894 if c.header_ == nil { 11895 c.header_ = make(http.Header) 11896 } 11897 return c.header_ 11898} 11899 11900func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) { 11901 reqHeaders := make(http.Header) 11902 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 11903 for k, v := range c.header_ { 11904 reqHeaders[k] = v 11905 } 11906 reqHeaders.Set("User-Agent", c.s.userAgent()) 11907 var body io.Reader = nil 11908 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 11909 if err != nil { 11910 return nil, err 11911 } 11912 reqHeaders.Set("Content-Type", "application/json") 11913 c.urlParams_.Set("alt", alt) 11914 c.urlParams_.Set("prettyPrint", "false") 11915 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 11916 urls += "?" + c.urlParams_.Encode() 11917 req, err := http.NewRequest("POST", urls, body) 11918 if err != nil { 11919 return nil, err 11920 } 11921 req.Header = reqHeaders 11922 googleapi.Expand(req.URL, map[string]string{ 11923 "enterpriseId": c.enterpriseId, 11924 "pageId": c.pageId, 11925 }) 11926 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11927} 11928 11929// Do executes the "androidenterprise.storelayoutclusters.insert" call. 11930// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 11931// status code is an error. Response headers are in either 11932// *StoreCluster.ServerResponse.Header or (if a response was returned at 11933// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11934// to check whether the returned error was because 11935// http.StatusNotModified was returned. 11936func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 11937 gensupport.SetOptions(c.urlParams_, opts...) 11938 res, err := c.doRequest("json") 11939 if res != nil && res.StatusCode == http.StatusNotModified { 11940 if res.Body != nil { 11941 res.Body.Close() 11942 } 11943 return nil, &googleapi.Error{ 11944 Code: res.StatusCode, 11945 Header: res.Header, 11946 } 11947 } 11948 if err != nil { 11949 return nil, err 11950 } 11951 defer googleapi.CloseBody(res) 11952 if err := googleapi.CheckResponse(res); err != nil { 11953 return nil, err 11954 } 11955 ret := &StoreCluster{ 11956 ServerResponse: googleapi.ServerResponse{ 11957 Header: res.Header, 11958 HTTPStatusCode: res.StatusCode, 11959 }, 11960 } 11961 target := &ret 11962 if err := gensupport.DecodeResponse(target, res); err != nil { 11963 return nil, err 11964 } 11965 return ret, nil 11966 // { 11967 // "description": "Inserts a new cluster in a page.", 11968 // "httpMethod": "POST", 11969 // "id": "androidenterprise.storelayoutclusters.insert", 11970 // "parameterOrder": [ 11971 // "enterpriseId", 11972 // "pageId" 11973 // ], 11974 // "parameters": { 11975 // "enterpriseId": { 11976 // "description": "The ID of the enterprise.", 11977 // "location": "path", 11978 // "required": true, 11979 // "type": "string" 11980 // }, 11981 // "pageId": { 11982 // "description": "The ID of the page.", 11983 // "location": "path", 11984 // "required": true, 11985 // "type": "string" 11986 // } 11987 // }, 11988 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 11989 // "request": { 11990 // "$ref": "StoreCluster" 11991 // }, 11992 // "response": { 11993 // "$ref": "StoreCluster" 11994 // }, 11995 // "scopes": [ 11996 // "https://www.googleapis.com/auth/androidenterprise" 11997 // ] 11998 // } 11999 12000} 12001 12002// method id "androidenterprise.storelayoutclusters.list": 12003 12004type StorelayoutclustersListCall struct { 12005 s *Service 12006 enterpriseId string 12007 pageId string 12008 urlParams_ gensupport.URLParams 12009 ifNoneMatch_ string 12010 ctx_ context.Context 12011 header_ http.Header 12012} 12013 12014// List: Retrieves the details of all clusters on the specified page. 12015func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall { 12016 c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12017 c.enterpriseId = enterpriseId 12018 c.pageId = pageId 12019 return c 12020} 12021 12022// Fields allows partial responses to be retrieved. See 12023// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12024// for more information. 12025func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall { 12026 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12027 return c 12028} 12029 12030// IfNoneMatch sets the optional parameter which makes the operation 12031// fail if the object's ETag matches the given value. This is useful for 12032// getting updates only after the object has changed since the last 12033// request. Use googleapi.IsNotModified to check whether the response 12034// error from Do is the result of In-None-Match. 12035func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall { 12036 c.ifNoneMatch_ = entityTag 12037 return c 12038} 12039 12040// Context sets the context to be used in this call's Do method. Any 12041// pending HTTP request will be aborted if the provided context is 12042// canceled. 12043func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall { 12044 c.ctx_ = ctx 12045 return c 12046} 12047 12048// Header returns an http.Header that can be modified by the caller to 12049// add HTTP headers to the request. 12050func (c *StorelayoutclustersListCall) Header() http.Header { 12051 if c.header_ == nil { 12052 c.header_ = make(http.Header) 12053 } 12054 return c.header_ 12055} 12056 12057func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) { 12058 reqHeaders := make(http.Header) 12059 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12060 for k, v := range c.header_ { 12061 reqHeaders[k] = v 12062 } 12063 reqHeaders.Set("User-Agent", c.s.userAgent()) 12064 if c.ifNoneMatch_ != "" { 12065 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12066 } 12067 var body io.Reader = nil 12068 c.urlParams_.Set("alt", alt) 12069 c.urlParams_.Set("prettyPrint", "false") 12070 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters") 12071 urls += "?" + c.urlParams_.Encode() 12072 req, err := http.NewRequest("GET", urls, body) 12073 if err != nil { 12074 return nil, err 12075 } 12076 req.Header = reqHeaders 12077 googleapi.Expand(req.URL, map[string]string{ 12078 "enterpriseId": c.enterpriseId, 12079 "pageId": c.pageId, 12080 }) 12081 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12082} 12083 12084// Do executes the "androidenterprise.storelayoutclusters.list" call. 12085// Exactly one of *StoreLayoutClustersListResponse or error will be 12086// non-nil. Any non-2xx status code is an error. Response headers are in 12087// either *StoreLayoutClustersListResponse.ServerResponse.Header or (if 12088// a response was returned at all) in error.(*googleapi.Error).Header. 12089// Use googleapi.IsNotModified to check whether the returned error was 12090// because http.StatusNotModified was returned. 12091func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) { 12092 gensupport.SetOptions(c.urlParams_, opts...) 12093 res, err := c.doRequest("json") 12094 if res != nil && res.StatusCode == http.StatusNotModified { 12095 if res.Body != nil { 12096 res.Body.Close() 12097 } 12098 return nil, &googleapi.Error{ 12099 Code: res.StatusCode, 12100 Header: res.Header, 12101 } 12102 } 12103 if err != nil { 12104 return nil, err 12105 } 12106 defer googleapi.CloseBody(res) 12107 if err := googleapi.CheckResponse(res); err != nil { 12108 return nil, err 12109 } 12110 ret := &StoreLayoutClustersListResponse{ 12111 ServerResponse: googleapi.ServerResponse{ 12112 Header: res.Header, 12113 HTTPStatusCode: res.StatusCode, 12114 }, 12115 } 12116 target := &ret 12117 if err := gensupport.DecodeResponse(target, res); err != nil { 12118 return nil, err 12119 } 12120 return ret, nil 12121 // { 12122 // "description": "Retrieves the details of all clusters on the specified page.", 12123 // "httpMethod": "GET", 12124 // "id": "androidenterprise.storelayoutclusters.list", 12125 // "parameterOrder": [ 12126 // "enterpriseId", 12127 // "pageId" 12128 // ], 12129 // "parameters": { 12130 // "enterpriseId": { 12131 // "description": "The ID of the enterprise.", 12132 // "location": "path", 12133 // "required": true, 12134 // "type": "string" 12135 // }, 12136 // "pageId": { 12137 // "description": "The ID of the page.", 12138 // "location": "path", 12139 // "required": true, 12140 // "type": "string" 12141 // } 12142 // }, 12143 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters", 12144 // "response": { 12145 // "$ref": "StoreLayoutClustersListResponse" 12146 // }, 12147 // "scopes": [ 12148 // "https://www.googleapis.com/auth/androidenterprise" 12149 // ] 12150 // } 12151 12152} 12153 12154// method id "androidenterprise.storelayoutclusters.update": 12155 12156type StorelayoutclustersUpdateCall struct { 12157 s *Service 12158 enterpriseId string 12159 pageId string 12160 clusterId string 12161 storecluster *StoreCluster 12162 urlParams_ gensupport.URLParams 12163 ctx_ context.Context 12164 header_ http.Header 12165} 12166 12167// Update: Updates a cluster. 12168func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall { 12169 c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12170 c.enterpriseId = enterpriseId 12171 c.pageId = pageId 12172 c.clusterId = clusterId 12173 c.storecluster = storecluster 12174 return c 12175} 12176 12177// Fields allows partial responses to be retrieved. See 12178// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12179// for more information. 12180func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall { 12181 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12182 return c 12183} 12184 12185// Context sets the context to be used in this call's Do method. Any 12186// pending HTTP request will be aborted if the provided context is 12187// canceled. 12188func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall { 12189 c.ctx_ = ctx 12190 return c 12191} 12192 12193// Header returns an http.Header that can be modified by the caller to 12194// add HTTP headers to the request. 12195func (c *StorelayoutclustersUpdateCall) Header() http.Header { 12196 if c.header_ == nil { 12197 c.header_ = make(http.Header) 12198 } 12199 return c.header_ 12200} 12201 12202func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) { 12203 reqHeaders := make(http.Header) 12204 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12205 for k, v := range c.header_ { 12206 reqHeaders[k] = v 12207 } 12208 reqHeaders.Set("User-Agent", c.s.userAgent()) 12209 var body io.Reader = nil 12210 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster) 12211 if err != nil { 12212 return nil, err 12213 } 12214 reqHeaders.Set("Content-Type", "application/json") 12215 c.urlParams_.Set("alt", alt) 12216 c.urlParams_.Set("prettyPrint", "false") 12217 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}") 12218 urls += "?" + c.urlParams_.Encode() 12219 req, err := http.NewRequest("PUT", urls, body) 12220 if err != nil { 12221 return nil, err 12222 } 12223 req.Header = reqHeaders 12224 googleapi.Expand(req.URL, map[string]string{ 12225 "enterpriseId": c.enterpriseId, 12226 "pageId": c.pageId, 12227 "clusterId": c.clusterId, 12228 }) 12229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12230} 12231 12232// Do executes the "androidenterprise.storelayoutclusters.update" call. 12233// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx 12234// status code is an error. Response headers are in either 12235// *StoreCluster.ServerResponse.Header or (if a response was returned at 12236// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12237// to check whether the returned error was because 12238// http.StatusNotModified was returned. 12239func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) { 12240 gensupport.SetOptions(c.urlParams_, opts...) 12241 res, err := c.doRequest("json") 12242 if res != nil && res.StatusCode == http.StatusNotModified { 12243 if res.Body != nil { 12244 res.Body.Close() 12245 } 12246 return nil, &googleapi.Error{ 12247 Code: res.StatusCode, 12248 Header: res.Header, 12249 } 12250 } 12251 if err != nil { 12252 return nil, err 12253 } 12254 defer googleapi.CloseBody(res) 12255 if err := googleapi.CheckResponse(res); err != nil { 12256 return nil, err 12257 } 12258 ret := &StoreCluster{ 12259 ServerResponse: googleapi.ServerResponse{ 12260 Header: res.Header, 12261 HTTPStatusCode: res.StatusCode, 12262 }, 12263 } 12264 target := &ret 12265 if err := gensupport.DecodeResponse(target, res); err != nil { 12266 return nil, err 12267 } 12268 return ret, nil 12269 // { 12270 // "description": "Updates a cluster.", 12271 // "httpMethod": "PUT", 12272 // "id": "androidenterprise.storelayoutclusters.update", 12273 // "parameterOrder": [ 12274 // "enterpriseId", 12275 // "pageId", 12276 // "clusterId" 12277 // ], 12278 // "parameters": { 12279 // "clusterId": { 12280 // "description": "The ID of the cluster.", 12281 // "location": "path", 12282 // "required": true, 12283 // "type": "string" 12284 // }, 12285 // "enterpriseId": { 12286 // "description": "The ID of the enterprise.", 12287 // "location": "path", 12288 // "required": true, 12289 // "type": "string" 12290 // }, 12291 // "pageId": { 12292 // "description": "The ID of the page.", 12293 // "location": "path", 12294 // "required": true, 12295 // "type": "string" 12296 // } 12297 // }, 12298 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}", 12299 // "request": { 12300 // "$ref": "StoreCluster" 12301 // }, 12302 // "response": { 12303 // "$ref": "StoreCluster" 12304 // }, 12305 // "scopes": [ 12306 // "https://www.googleapis.com/auth/androidenterprise" 12307 // ] 12308 // } 12309 12310} 12311 12312// method id "androidenterprise.storelayoutpages.delete": 12313 12314type StorelayoutpagesDeleteCall struct { 12315 s *Service 12316 enterpriseId string 12317 pageId string 12318 urlParams_ gensupport.URLParams 12319 ctx_ context.Context 12320 header_ http.Header 12321} 12322 12323// Delete: Deletes a store page. 12324func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall { 12325 c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12326 c.enterpriseId = enterpriseId 12327 c.pageId = pageId 12328 return c 12329} 12330 12331// Fields allows partial responses to be retrieved. See 12332// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12333// for more information. 12334func (c *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall { 12335 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12336 return c 12337} 12338 12339// Context sets the context to be used in this call's Do method. Any 12340// pending HTTP request will be aborted if the provided context is 12341// canceled. 12342func (c *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall { 12343 c.ctx_ = ctx 12344 return c 12345} 12346 12347// Header returns an http.Header that can be modified by the caller to 12348// add HTTP headers to the request. 12349func (c *StorelayoutpagesDeleteCall) Header() http.Header { 12350 if c.header_ == nil { 12351 c.header_ = make(http.Header) 12352 } 12353 return c.header_ 12354} 12355 12356func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) { 12357 reqHeaders := make(http.Header) 12358 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12359 for k, v := range c.header_ { 12360 reqHeaders[k] = v 12361 } 12362 reqHeaders.Set("User-Agent", c.s.userAgent()) 12363 var body io.Reader = nil 12364 c.urlParams_.Set("alt", alt) 12365 c.urlParams_.Set("prettyPrint", "false") 12366 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12367 urls += "?" + c.urlParams_.Encode() 12368 req, err := http.NewRequest("DELETE", urls, body) 12369 if err != nil { 12370 return nil, err 12371 } 12372 req.Header = reqHeaders 12373 googleapi.Expand(req.URL, map[string]string{ 12374 "enterpriseId": c.enterpriseId, 12375 "pageId": c.pageId, 12376 }) 12377 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12378} 12379 12380// Do executes the "androidenterprise.storelayoutpages.delete" call. 12381func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error { 12382 gensupport.SetOptions(c.urlParams_, opts...) 12383 res, err := c.doRequest("json") 12384 if err != nil { 12385 return err 12386 } 12387 defer googleapi.CloseBody(res) 12388 if err := googleapi.CheckResponse(res); err != nil { 12389 return err 12390 } 12391 return nil 12392 // { 12393 // "description": "Deletes a store page.", 12394 // "httpMethod": "DELETE", 12395 // "id": "androidenterprise.storelayoutpages.delete", 12396 // "parameterOrder": [ 12397 // "enterpriseId", 12398 // "pageId" 12399 // ], 12400 // "parameters": { 12401 // "enterpriseId": { 12402 // "description": "The ID of the enterprise.", 12403 // "location": "path", 12404 // "required": true, 12405 // "type": "string" 12406 // }, 12407 // "pageId": { 12408 // "description": "The ID of the page.", 12409 // "location": "path", 12410 // "required": true, 12411 // "type": "string" 12412 // } 12413 // }, 12414 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12415 // "scopes": [ 12416 // "https://www.googleapis.com/auth/androidenterprise" 12417 // ] 12418 // } 12419 12420} 12421 12422// method id "androidenterprise.storelayoutpages.get": 12423 12424type StorelayoutpagesGetCall struct { 12425 s *Service 12426 enterpriseId string 12427 pageId string 12428 urlParams_ gensupport.URLParams 12429 ifNoneMatch_ string 12430 ctx_ context.Context 12431 header_ http.Header 12432} 12433 12434// Get: Retrieves details of a store page. 12435func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall { 12436 c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12437 c.enterpriseId = enterpriseId 12438 c.pageId = pageId 12439 return c 12440} 12441 12442// Fields allows partial responses to be retrieved. See 12443// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12444// for more information. 12445func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall { 12446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12447 return c 12448} 12449 12450// IfNoneMatch sets the optional parameter which makes the operation 12451// fail if the object's ETag matches the given value. This is useful for 12452// getting updates only after the object has changed since the last 12453// request. Use googleapi.IsNotModified to check whether the response 12454// error from Do is the result of In-None-Match. 12455func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall { 12456 c.ifNoneMatch_ = entityTag 12457 return c 12458} 12459 12460// Context sets the context to be used in this call's Do method. Any 12461// pending HTTP request will be aborted if the provided context is 12462// canceled. 12463func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall { 12464 c.ctx_ = ctx 12465 return c 12466} 12467 12468// Header returns an http.Header that can be modified by the caller to 12469// add HTTP headers to the request. 12470func (c *StorelayoutpagesGetCall) Header() http.Header { 12471 if c.header_ == nil { 12472 c.header_ = make(http.Header) 12473 } 12474 return c.header_ 12475} 12476 12477func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) { 12478 reqHeaders := make(http.Header) 12479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12480 for k, v := range c.header_ { 12481 reqHeaders[k] = v 12482 } 12483 reqHeaders.Set("User-Agent", c.s.userAgent()) 12484 if c.ifNoneMatch_ != "" { 12485 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12486 } 12487 var body io.Reader = nil 12488 c.urlParams_.Set("alt", alt) 12489 c.urlParams_.Set("prettyPrint", "false") 12490 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12491 urls += "?" + c.urlParams_.Encode() 12492 req, err := http.NewRequest("GET", urls, body) 12493 if err != nil { 12494 return nil, err 12495 } 12496 req.Header = reqHeaders 12497 googleapi.Expand(req.URL, map[string]string{ 12498 "enterpriseId": c.enterpriseId, 12499 "pageId": c.pageId, 12500 }) 12501 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12502} 12503 12504// Do executes the "androidenterprise.storelayoutpages.get" call. 12505// Exactly one of *StorePage or error will be non-nil. Any non-2xx 12506// status code is an error. Response headers are in either 12507// *StorePage.ServerResponse.Header or (if a response was returned at 12508// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12509// to check whether the returned error was because 12510// http.StatusNotModified was returned. 12511func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 12512 gensupport.SetOptions(c.urlParams_, opts...) 12513 res, err := c.doRequest("json") 12514 if res != nil && res.StatusCode == http.StatusNotModified { 12515 if res.Body != nil { 12516 res.Body.Close() 12517 } 12518 return nil, &googleapi.Error{ 12519 Code: res.StatusCode, 12520 Header: res.Header, 12521 } 12522 } 12523 if err != nil { 12524 return nil, err 12525 } 12526 defer googleapi.CloseBody(res) 12527 if err := googleapi.CheckResponse(res); err != nil { 12528 return nil, err 12529 } 12530 ret := &StorePage{ 12531 ServerResponse: googleapi.ServerResponse{ 12532 Header: res.Header, 12533 HTTPStatusCode: res.StatusCode, 12534 }, 12535 } 12536 target := &ret 12537 if err := gensupport.DecodeResponse(target, res); err != nil { 12538 return nil, err 12539 } 12540 return ret, nil 12541 // { 12542 // "description": "Retrieves details of a store page.", 12543 // "httpMethod": "GET", 12544 // "id": "androidenterprise.storelayoutpages.get", 12545 // "parameterOrder": [ 12546 // "enterpriseId", 12547 // "pageId" 12548 // ], 12549 // "parameters": { 12550 // "enterpriseId": { 12551 // "description": "The ID of the enterprise.", 12552 // "location": "path", 12553 // "required": true, 12554 // "type": "string" 12555 // }, 12556 // "pageId": { 12557 // "description": "The ID of the page.", 12558 // "location": "path", 12559 // "required": true, 12560 // "type": "string" 12561 // } 12562 // }, 12563 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12564 // "response": { 12565 // "$ref": "StorePage" 12566 // }, 12567 // "scopes": [ 12568 // "https://www.googleapis.com/auth/androidenterprise" 12569 // ] 12570 // } 12571 12572} 12573 12574// method id "androidenterprise.storelayoutpages.insert": 12575 12576type StorelayoutpagesInsertCall struct { 12577 s *Service 12578 enterpriseId string 12579 storepage *StorePage 12580 urlParams_ gensupport.URLParams 12581 ctx_ context.Context 12582 header_ http.Header 12583} 12584 12585// Insert: Inserts a new store page. 12586func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall { 12587 c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12588 c.enterpriseId = enterpriseId 12589 c.storepage = storepage 12590 return c 12591} 12592 12593// Fields allows partial responses to be retrieved. See 12594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12595// for more information. 12596func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall { 12597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12598 return c 12599} 12600 12601// Context sets the context to be used in this call's Do method. Any 12602// pending HTTP request will be aborted if the provided context is 12603// canceled. 12604func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall { 12605 c.ctx_ = ctx 12606 return c 12607} 12608 12609// Header returns an http.Header that can be modified by the caller to 12610// add HTTP headers to the request. 12611func (c *StorelayoutpagesInsertCall) Header() http.Header { 12612 if c.header_ == nil { 12613 c.header_ = make(http.Header) 12614 } 12615 return c.header_ 12616} 12617 12618func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) { 12619 reqHeaders := make(http.Header) 12620 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12621 for k, v := range c.header_ { 12622 reqHeaders[k] = v 12623 } 12624 reqHeaders.Set("User-Agent", c.s.userAgent()) 12625 var body io.Reader = nil 12626 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 12627 if err != nil { 12628 return nil, err 12629 } 12630 reqHeaders.Set("Content-Type", "application/json") 12631 c.urlParams_.Set("alt", alt) 12632 c.urlParams_.Set("prettyPrint", "false") 12633 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages") 12634 urls += "?" + c.urlParams_.Encode() 12635 req, err := http.NewRequest("POST", urls, body) 12636 if err != nil { 12637 return nil, err 12638 } 12639 req.Header = reqHeaders 12640 googleapi.Expand(req.URL, map[string]string{ 12641 "enterpriseId": c.enterpriseId, 12642 }) 12643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12644} 12645 12646// Do executes the "androidenterprise.storelayoutpages.insert" call. 12647// Exactly one of *StorePage or error will be non-nil. Any non-2xx 12648// status code is an error. Response headers are in either 12649// *StorePage.ServerResponse.Header or (if a response was returned at 12650// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12651// to check whether the returned error was because 12652// http.StatusNotModified was returned. 12653func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 12654 gensupport.SetOptions(c.urlParams_, opts...) 12655 res, err := c.doRequest("json") 12656 if res != nil && res.StatusCode == http.StatusNotModified { 12657 if res.Body != nil { 12658 res.Body.Close() 12659 } 12660 return nil, &googleapi.Error{ 12661 Code: res.StatusCode, 12662 Header: res.Header, 12663 } 12664 } 12665 if err != nil { 12666 return nil, err 12667 } 12668 defer googleapi.CloseBody(res) 12669 if err := googleapi.CheckResponse(res); err != nil { 12670 return nil, err 12671 } 12672 ret := &StorePage{ 12673 ServerResponse: googleapi.ServerResponse{ 12674 Header: res.Header, 12675 HTTPStatusCode: res.StatusCode, 12676 }, 12677 } 12678 target := &ret 12679 if err := gensupport.DecodeResponse(target, res); err != nil { 12680 return nil, err 12681 } 12682 return ret, nil 12683 // { 12684 // "description": "Inserts a new store page.", 12685 // "httpMethod": "POST", 12686 // "id": "androidenterprise.storelayoutpages.insert", 12687 // "parameterOrder": [ 12688 // "enterpriseId" 12689 // ], 12690 // "parameters": { 12691 // "enterpriseId": { 12692 // "description": "The ID of the enterprise.", 12693 // "location": "path", 12694 // "required": true, 12695 // "type": "string" 12696 // } 12697 // }, 12698 // "path": "enterprises/{enterpriseId}/storeLayout/pages", 12699 // "request": { 12700 // "$ref": "StorePage" 12701 // }, 12702 // "response": { 12703 // "$ref": "StorePage" 12704 // }, 12705 // "scopes": [ 12706 // "https://www.googleapis.com/auth/androidenterprise" 12707 // ] 12708 // } 12709 12710} 12711 12712// method id "androidenterprise.storelayoutpages.list": 12713 12714type StorelayoutpagesListCall struct { 12715 s *Service 12716 enterpriseId string 12717 urlParams_ gensupport.URLParams 12718 ifNoneMatch_ string 12719 ctx_ context.Context 12720 header_ http.Header 12721} 12722 12723// List: Retrieves the details of all pages in the store. 12724func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall { 12725 c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12726 c.enterpriseId = enterpriseId 12727 return c 12728} 12729 12730// Fields allows partial responses to be retrieved. See 12731// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12732// for more information. 12733func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall { 12734 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12735 return c 12736} 12737 12738// IfNoneMatch sets the optional parameter which makes the operation 12739// fail if the object's ETag matches the given value. This is useful for 12740// getting updates only after the object has changed since the last 12741// request. Use googleapi.IsNotModified to check whether the response 12742// error from Do is the result of In-None-Match. 12743func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall { 12744 c.ifNoneMatch_ = entityTag 12745 return c 12746} 12747 12748// Context sets the context to be used in this call's Do method. Any 12749// pending HTTP request will be aborted if the provided context is 12750// canceled. 12751func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall { 12752 c.ctx_ = ctx 12753 return c 12754} 12755 12756// Header returns an http.Header that can be modified by the caller to 12757// add HTTP headers to the request. 12758func (c *StorelayoutpagesListCall) Header() http.Header { 12759 if c.header_ == nil { 12760 c.header_ = make(http.Header) 12761 } 12762 return c.header_ 12763} 12764 12765func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) { 12766 reqHeaders := make(http.Header) 12767 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12768 for k, v := range c.header_ { 12769 reqHeaders[k] = v 12770 } 12771 reqHeaders.Set("User-Agent", c.s.userAgent()) 12772 if c.ifNoneMatch_ != "" { 12773 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12774 } 12775 var body io.Reader = nil 12776 c.urlParams_.Set("alt", alt) 12777 c.urlParams_.Set("prettyPrint", "false") 12778 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages") 12779 urls += "?" + c.urlParams_.Encode() 12780 req, err := http.NewRequest("GET", urls, body) 12781 if err != nil { 12782 return nil, err 12783 } 12784 req.Header = reqHeaders 12785 googleapi.Expand(req.URL, map[string]string{ 12786 "enterpriseId": c.enterpriseId, 12787 }) 12788 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12789} 12790 12791// Do executes the "androidenterprise.storelayoutpages.list" call. 12792// Exactly one of *StoreLayoutPagesListResponse or error will be 12793// non-nil. Any non-2xx status code is an error. Response headers are in 12794// either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a 12795// response was returned at all) in error.(*googleapi.Error).Header. Use 12796// googleapi.IsNotModified to check whether the returned error was 12797// because http.StatusNotModified was returned. 12798func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) { 12799 gensupport.SetOptions(c.urlParams_, opts...) 12800 res, err := c.doRequest("json") 12801 if res != nil && res.StatusCode == http.StatusNotModified { 12802 if res.Body != nil { 12803 res.Body.Close() 12804 } 12805 return nil, &googleapi.Error{ 12806 Code: res.StatusCode, 12807 Header: res.Header, 12808 } 12809 } 12810 if err != nil { 12811 return nil, err 12812 } 12813 defer googleapi.CloseBody(res) 12814 if err := googleapi.CheckResponse(res); err != nil { 12815 return nil, err 12816 } 12817 ret := &StoreLayoutPagesListResponse{ 12818 ServerResponse: googleapi.ServerResponse{ 12819 Header: res.Header, 12820 HTTPStatusCode: res.StatusCode, 12821 }, 12822 } 12823 target := &ret 12824 if err := gensupport.DecodeResponse(target, res); err != nil { 12825 return nil, err 12826 } 12827 return ret, nil 12828 // { 12829 // "description": "Retrieves the details of all pages in the store.", 12830 // "httpMethod": "GET", 12831 // "id": "androidenterprise.storelayoutpages.list", 12832 // "parameterOrder": [ 12833 // "enterpriseId" 12834 // ], 12835 // "parameters": { 12836 // "enterpriseId": { 12837 // "description": "The ID of the enterprise.", 12838 // "location": "path", 12839 // "required": true, 12840 // "type": "string" 12841 // } 12842 // }, 12843 // "path": "enterprises/{enterpriseId}/storeLayout/pages", 12844 // "response": { 12845 // "$ref": "StoreLayoutPagesListResponse" 12846 // }, 12847 // "scopes": [ 12848 // "https://www.googleapis.com/auth/androidenterprise" 12849 // ] 12850 // } 12851 12852} 12853 12854// method id "androidenterprise.storelayoutpages.update": 12855 12856type StorelayoutpagesUpdateCall struct { 12857 s *Service 12858 enterpriseId string 12859 pageId string 12860 storepage *StorePage 12861 urlParams_ gensupport.URLParams 12862 ctx_ context.Context 12863 header_ http.Header 12864} 12865 12866// Update: Updates the content of a store page. 12867func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall { 12868 c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12869 c.enterpriseId = enterpriseId 12870 c.pageId = pageId 12871 c.storepage = storepage 12872 return c 12873} 12874 12875// Fields allows partial responses to be retrieved. See 12876// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12877// for more information. 12878func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall { 12879 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12880 return c 12881} 12882 12883// Context sets the context to be used in this call's Do method. Any 12884// pending HTTP request will be aborted if the provided context is 12885// canceled. 12886func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall { 12887 c.ctx_ = ctx 12888 return c 12889} 12890 12891// Header returns an http.Header that can be modified by the caller to 12892// add HTTP headers to the request. 12893func (c *StorelayoutpagesUpdateCall) Header() http.Header { 12894 if c.header_ == nil { 12895 c.header_ = make(http.Header) 12896 } 12897 return c.header_ 12898} 12899 12900func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) { 12901 reqHeaders := make(http.Header) 12902 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 12903 for k, v := range c.header_ { 12904 reqHeaders[k] = v 12905 } 12906 reqHeaders.Set("User-Agent", c.s.userAgent()) 12907 var body io.Reader = nil 12908 body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage) 12909 if err != nil { 12910 return nil, err 12911 } 12912 reqHeaders.Set("Content-Type", "application/json") 12913 c.urlParams_.Set("alt", alt) 12914 c.urlParams_.Set("prettyPrint", "false") 12915 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}") 12916 urls += "?" + c.urlParams_.Encode() 12917 req, err := http.NewRequest("PUT", urls, body) 12918 if err != nil { 12919 return nil, err 12920 } 12921 req.Header = reqHeaders 12922 googleapi.Expand(req.URL, map[string]string{ 12923 "enterpriseId": c.enterpriseId, 12924 "pageId": c.pageId, 12925 }) 12926 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12927} 12928 12929// Do executes the "androidenterprise.storelayoutpages.update" call. 12930// Exactly one of *StorePage or error will be non-nil. Any non-2xx 12931// status code is an error. Response headers are in either 12932// *StorePage.ServerResponse.Header or (if a response was returned at 12933// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12934// to check whether the returned error was because 12935// http.StatusNotModified was returned. 12936func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) { 12937 gensupport.SetOptions(c.urlParams_, opts...) 12938 res, err := c.doRequest("json") 12939 if res != nil && res.StatusCode == http.StatusNotModified { 12940 if res.Body != nil { 12941 res.Body.Close() 12942 } 12943 return nil, &googleapi.Error{ 12944 Code: res.StatusCode, 12945 Header: res.Header, 12946 } 12947 } 12948 if err != nil { 12949 return nil, err 12950 } 12951 defer googleapi.CloseBody(res) 12952 if err := googleapi.CheckResponse(res); err != nil { 12953 return nil, err 12954 } 12955 ret := &StorePage{ 12956 ServerResponse: googleapi.ServerResponse{ 12957 Header: res.Header, 12958 HTTPStatusCode: res.StatusCode, 12959 }, 12960 } 12961 target := &ret 12962 if err := gensupport.DecodeResponse(target, res); err != nil { 12963 return nil, err 12964 } 12965 return ret, nil 12966 // { 12967 // "description": "Updates the content of a store page.", 12968 // "httpMethod": "PUT", 12969 // "id": "androidenterprise.storelayoutpages.update", 12970 // "parameterOrder": [ 12971 // "enterpriseId", 12972 // "pageId" 12973 // ], 12974 // "parameters": { 12975 // "enterpriseId": { 12976 // "description": "The ID of the enterprise.", 12977 // "location": "path", 12978 // "required": true, 12979 // "type": "string" 12980 // }, 12981 // "pageId": { 12982 // "description": "The ID of the page.", 12983 // "location": "path", 12984 // "required": true, 12985 // "type": "string" 12986 // } 12987 // }, 12988 // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}", 12989 // "request": { 12990 // "$ref": "StorePage" 12991 // }, 12992 // "response": { 12993 // "$ref": "StorePage" 12994 // }, 12995 // "scopes": [ 12996 // "https://www.googleapis.com/auth/androidenterprise" 12997 // ] 12998 // } 12999 13000} 13001 13002// method id "androidenterprise.users.delete": 13003 13004type UsersDeleteCall struct { 13005 s *Service 13006 enterpriseId string 13007 userId string 13008 urlParams_ gensupport.URLParams 13009 ctx_ context.Context 13010 header_ http.Header 13011} 13012 13013// Delete: Deleted an EMM-managed user. 13014func (r *UsersService) Delete(enterpriseId string, userId string) *UsersDeleteCall { 13015 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13016 c.enterpriseId = enterpriseId 13017 c.userId = userId 13018 return c 13019} 13020 13021// Fields allows partial responses to be retrieved. See 13022// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13023// for more information. 13024func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 13025 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13026 return c 13027} 13028 13029// Context sets the context to be used in this call's Do method. Any 13030// pending HTTP request will be aborted if the provided context is 13031// canceled. 13032func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 13033 c.ctx_ = ctx 13034 return c 13035} 13036 13037// Header returns an http.Header that can be modified by the caller to 13038// add HTTP headers to the request. 13039func (c *UsersDeleteCall) Header() http.Header { 13040 if c.header_ == nil { 13041 c.header_ = make(http.Header) 13042 } 13043 return c.header_ 13044} 13045 13046func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 13047 reqHeaders := make(http.Header) 13048 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13049 for k, v := range c.header_ { 13050 reqHeaders[k] = v 13051 } 13052 reqHeaders.Set("User-Agent", c.s.userAgent()) 13053 var body io.Reader = nil 13054 c.urlParams_.Set("alt", alt) 13055 c.urlParams_.Set("prettyPrint", "false") 13056 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}") 13057 urls += "?" + c.urlParams_.Encode() 13058 req, err := http.NewRequest("DELETE", urls, body) 13059 if err != nil { 13060 return nil, err 13061 } 13062 req.Header = reqHeaders 13063 googleapi.Expand(req.URL, map[string]string{ 13064 "enterpriseId": c.enterpriseId, 13065 "userId": c.userId, 13066 }) 13067 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13068} 13069 13070// Do executes the "androidenterprise.users.delete" call. 13071func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error { 13072 gensupport.SetOptions(c.urlParams_, opts...) 13073 res, err := c.doRequest("json") 13074 if err != nil { 13075 return err 13076 } 13077 defer googleapi.CloseBody(res) 13078 if err := googleapi.CheckResponse(res); err != nil { 13079 return err 13080 } 13081 return nil 13082 // { 13083 // "description": "Deleted an EMM-managed user.", 13084 // "httpMethod": "DELETE", 13085 // "id": "androidenterprise.users.delete", 13086 // "parameterOrder": [ 13087 // "enterpriseId", 13088 // "userId" 13089 // ], 13090 // "parameters": { 13091 // "enterpriseId": { 13092 // "description": "The ID of the enterprise.", 13093 // "location": "path", 13094 // "required": true, 13095 // "type": "string" 13096 // }, 13097 // "userId": { 13098 // "description": "The ID of the user.", 13099 // "location": "path", 13100 // "required": true, 13101 // "type": "string" 13102 // } 13103 // }, 13104 // "path": "enterprises/{enterpriseId}/users/{userId}", 13105 // "scopes": [ 13106 // "https://www.googleapis.com/auth/androidenterprise" 13107 // ] 13108 // } 13109 13110} 13111 13112// method id "androidenterprise.users.generateAuthenticationToken": 13113 13114type UsersGenerateAuthenticationTokenCall struct { 13115 s *Service 13116 enterpriseId string 13117 userId string 13118 urlParams_ gensupport.URLParams 13119 ctx_ context.Context 13120 header_ http.Header 13121} 13122 13123// GenerateAuthenticationToken: Generates an authentication token which 13124// the device policy client can use to provision the given EMM-managed 13125// user account on a device. The generated token is single-use and 13126// expires after a few minutes. 13127// 13128// You can provision a maximum of 10 devices per user. 13129// 13130// This call only works with EMM-managed accounts. 13131func (r *UsersService) GenerateAuthenticationToken(enterpriseId string, userId string) *UsersGenerateAuthenticationTokenCall { 13132 c := &UsersGenerateAuthenticationTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13133 c.enterpriseId = enterpriseId 13134 c.userId = userId 13135 return c 13136} 13137 13138// Fields allows partial responses to be retrieved. See 13139// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13140// for more information. 13141func (c *UsersGenerateAuthenticationTokenCall) Fields(s ...googleapi.Field) *UsersGenerateAuthenticationTokenCall { 13142 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13143 return c 13144} 13145 13146// Context sets the context to be used in this call's Do method. Any 13147// pending HTTP request will be aborted if the provided context is 13148// canceled. 13149func (c *UsersGenerateAuthenticationTokenCall) Context(ctx context.Context) *UsersGenerateAuthenticationTokenCall { 13150 c.ctx_ = ctx 13151 return c 13152} 13153 13154// Header returns an http.Header that can be modified by the caller to 13155// add HTTP headers to the request. 13156func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header { 13157 if c.header_ == nil { 13158 c.header_ = make(http.Header) 13159 } 13160 return c.header_ 13161} 13162 13163func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) { 13164 reqHeaders := make(http.Header) 13165 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13166 for k, v := range c.header_ { 13167 reqHeaders[k] = v 13168 } 13169 reqHeaders.Set("User-Agent", c.s.userAgent()) 13170 var body io.Reader = nil 13171 c.urlParams_.Set("alt", alt) 13172 c.urlParams_.Set("prettyPrint", "false") 13173 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/authenticationToken") 13174 urls += "?" + c.urlParams_.Encode() 13175 req, err := http.NewRequest("POST", urls, body) 13176 if err != nil { 13177 return nil, err 13178 } 13179 req.Header = reqHeaders 13180 googleapi.Expand(req.URL, map[string]string{ 13181 "enterpriseId": c.enterpriseId, 13182 "userId": c.userId, 13183 }) 13184 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13185} 13186 13187// Do executes the "androidenterprise.users.generateAuthenticationToken" call. 13188// Exactly one of *AuthenticationToken or error will be non-nil. Any 13189// non-2xx status code is an error. Response headers are in either 13190// *AuthenticationToken.ServerResponse.Header or (if a response was 13191// returned at all) in error.(*googleapi.Error).Header. Use 13192// googleapi.IsNotModified to check whether the returned error was 13193// because http.StatusNotModified was returned. 13194func (c *UsersGenerateAuthenticationTokenCall) Do(opts ...googleapi.CallOption) (*AuthenticationToken, error) { 13195 gensupport.SetOptions(c.urlParams_, opts...) 13196 res, err := c.doRequest("json") 13197 if res != nil && res.StatusCode == http.StatusNotModified { 13198 if res.Body != nil { 13199 res.Body.Close() 13200 } 13201 return nil, &googleapi.Error{ 13202 Code: res.StatusCode, 13203 Header: res.Header, 13204 } 13205 } 13206 if err != nil { 13207 return nil, err 13208 } 13209 defer googleapi.CloseBody(res) 13210 if err := googleapi.CheckResponse(res); err != nil { 13211 return nil, err 13212 } 13213 ret := &AuthenticationToken{ 13214 ServerResponse: googleapi.ServerResponse{ 13215 Header: res.Header, 13216 HTTPStatusCode: res.StatusCode, 13217 }, 13218 } 13219 target := &ret 13220 if err := gensupport.DecodeResponse(target, res); err != nil { 13221 return nil, err 13222 } 13223 return ret, nil 13224 // { 13225 // "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.\n\nYou can provision a maximum of 10 devices per user.\n\nThis call only works with EMM-managed accounts.", 13226 // "httpMethod": "POST", 13227 // "id": "androidenterprise.users.generateAuthenticationToken", 13228 // "parameterOrder": [ 13229 // "enterpriseId", 13230 // "userId" 13231 // ], 13232 // "parameters": { 13233 // "enterpriseId": { 13234 // "description": "The ID of the enterprise.", 13235 // "location": "path", 13236 // "required": true, 13237 // "type": "string" 13238 // }, 13239 // "userId": { 13240 // "description": "The ID of the user.", 13241 // "location": "path", 13242 // "required": true, 13243 // "type": "string" 13244 // } 13245 // }, 13246 // "path": "enterprises/{enterpriseId}/users/{userId}/authenticationToken", 13247 // "response": { 13248 // "$ref": "AuthenticationToken" 13249 // }, 13250 // "scopes": [ 13251 // "https://www.googleapis.com/auth/androidenterprise" 13252 // ] 13253 // } 13254 13255} 13256 13257// method id "androidenterprise.users.generateToken": 13258 13259type UsersGenerateTokenCall struct { 13260 s *Service 13261 enterpriseId string 13262 userId string 13263 urlParams_ gensupport.URLParams 13264 ctx_ context.Context 13265 header_ http.Header 13266} 13267 13268// GenerateToken: Generates a token (activation code) to allow this user 13269// to configure their managed account in the Android Setup Wizard. 13270// Revokes any previously generated token. 13271// 13272// This call only works with Google managed accounts. 13273func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall { 13274 c := &UsersGenerateTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13275 c.enterpriseId = enterpriseId 13276 c.userId = userId 13277 return c 13278} 13279 13280// Fields allows partial responses to be retrieved. See 13281// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13282// for more information. 13283func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall { 13284 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13285 return c 13286} 13287 13288// Context sets the context to be used in this call's Do method. Any 13289// pending HTTP request will be aborted if the provided context is 13290// canceled. 13291func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall { 13292 c.ctx_ = ctx 13293 return c 13294} 13295 13296// Header returns an http.Header that can be modified by the caller to 13297// add HTTP headers to the request. 13298func (c *UsersGenerateTokenCall) Header() http.Header { 13299 if c.header_ == nil { 13300 c.header_ = make(http.Header) 13301 } 13302 return c.header_ 13303} 13304 13305func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) { 13306 reqHeaders := make(http.Header) 13307 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13308 for k, v := range c.header_ { 13309 reqHeaders[k] = v 13310 } 13311 reqHeaders.Set("User-Agent", c.s.userAgent()) 13312 var body io.Reader = nil 13313 c.urlParams_.Set("alt", alt) 13314 c.urlParams_.Set("prettyPrint", "false") 13315 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token") 13316 urls += "?" + c.urlParams_.Encode() 13317 req, err := http.NewRequest("POST", urls, body) 13318 if err != nil { 13319 return nil, err 13320 } 13321 req.Header = reqHeaders 13322 googleapi.Expand(req.URL, map[string]string{ 13323 "enterpriseId": c.enterpriseId, 13324 "userId": c.userId, 13325 }) 13326 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13327} 13328 13329// Do executes the "androidenterprise.users.generateToken" call. 13330// Exactly one of *UserToken or error will be non-nil. Any non-2xx 13331// status code is an error. Response headers are in either 13332// *UserToken.ServerResponse.Header or (if a response was returned at 13333// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13334// to check whether the returned error was because 13335// http.StatusNotModified was returned. 13336func (c *UsersGenerateTokenCall) Do(opts ...googleapi.CallOption) (*UserToken, error) { 13337 gensupport.SetOptions(c.urlParams_, opts...) 13338 res, err := c.doRequest("json") 13339 if res != nil && res.StatusCode == http.StatusNotModified { 13340 if res.Body != nil { 13341 res.Body.Close() 13342 } 13343 return nil, &googleapi.Error{ 13344 Code: res.StatusCode, 13345 Header: res.Header, 13346 } 13347 } 13348 if err != nil { 13349 return nil, err 13350 } 13351 defer googleapi.CloseBody(res) 13352 if err := googleapi.CheckResponse(res); err != nil { 13353 return nil, err 13354 } 13355 ret := &UserToken{ 13356 ServerResponse: googleapi.ServerResponse{ 13357 Header: res.Header, 13358 HTTPStatusCode: res.StatusCode, 13359 }, 13360 } 13361 target := &ret 13362 if err := gensupport.DecodeResponse(target, res); err != nil { 13363 return nil, err 13364 } 13365 return ret, nil 13366 // { 13367 // "description": "Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token.\n\nThis call only works with Google managed accounts.", 13368 // "httpMethod": "POST", 13369 // "id": "androidenterprise.users.generateToken", 13370 // "parameterOrder": [ 13371 // "enterpriseId", 13372 // "userId" 13373 // ], 13374 // "parameters": { 13375 // "enterpriseId": { 13376 // "description": "The ID of the enterprise.", 13377 // "location": "path", 13378 // "required": true, 13379 // "type": "string" 13380 // }, 13381 // "userId": { 13382 // "description": "The ID of the user.", 13383 // "location": "path", 13384 // "required": true, 13385 // "type": "string" 13386 // } 13387 // }, 13388 // "path": "enterprises/{enterpriseId}/users/{userId}/token", 13389 // "response": { 13390 // "$ref": "UserToken" 13391 // }, 13392 // "scopes": [ 13393 // "https://www.googleapis.com/auth/androidenterprise" 13394 // ] 13395 // } 13396 13397} 13398 13399// method id "androidenterprise.users.get": 13400 13401type UsersGetCall struct { 13402 s *Service 13403 enterpriseId string 13404 userId string 13405 urlParams_ gensupport.URLParams 13406 ifNoneMatch_ string 13407 ctx_ context.Context 13408 header_ http.Header 13409} 13410 13411// Get: Retrieves a user's details. 13412func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall { 13413 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13414 c.enterpriseId = enterpriseId 13415 c.userId = userId 13416 return c 13417} 13418 13419// Fields allows partial responses to be retrieved. See 13420// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13421// for more information. 13422func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 13423 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13424 return c 13425} 13426 13427// IfNoneMatch sets the optional parameter which makes the operation 13428// fail if the object's ETag matches the given value. This is useful for 13429// getting updates only after the object has changed since the last 13430// request. Use googleapi.IsNotModified to check whether the response 13431// error from Do is the result of In-None-Match. 13432func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 13433 c.ifNoneMatch_ = entityTag 13434 return c 13435} 13436 13437// Context sets the context to be used in this call's Do method. Any 13438// pending HTTP request will be aborted if the provided context is 13439// canceled. 13440func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 13441 c.ctx_ = ctx 13442 return c 13443} 13444 13445// Header returns an http.Header that can be modified by the caller to 13446// add HTTP headers to the request. 13447func (c *UsersGetCall) Header() http.Header { 13448 if c.header_ == nil { 13449 c.header_ = make(http.Header) 13450 } 13451 return c.header_ 13452} 13453 13454func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 13455 reqHeaders := make(http.Header) 13456 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13457 for k, v := range c.header_ { 13458 reqHeaders[k] = v 13459 } 13460 reqHeaders.Set("User-Agent", c.s.userAgent()) 13461 if c.ifNoneMatch_ != "" { 13462 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13463 } 13464 var body io.Reader = nil 13465 c.urlParams_.Set("alt", alt) 13466 c.urlParams_.Set("prettyPrint", "false") 13467 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}") 13468 urls += "?" + c.urlParams_.Encode() 13469 req, err := http.NewRequest("GET", urls, body) 13470 if err != nil { 13471 return nil, err 13472 } 13473 req.Header = reqHeaders 13474 googleapi.Expand(req.URL, map[string]string{ 13475 "enterpriseId": c.enterpriseId, 13476 "userId": c.userId, 13477 }) 13478 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13479} 13480 13481// Do executes the "androidenterprise.users.get" call. 13482// Exactly one of *User or error will be non-nil. Any non-2xx status 13483// code is an error. Response headers are in either 13484// *User.ServerResponse.Header or (if a response was returned at all) in 13485// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13486// whether the returned error was because http.StatusNotModified was 13487// returned. 13488func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 13489 gensupport.SetOptions(c.urlParams_, opts...) 13490 res, err := c.doRequest("json") 13491 if res != nil && res.StatusCode == http.StatusNotModified { 13492 if res.Body != nil { 13493 res.Body.Close() 13494 } 13495 return nil, &googleapi.Error{ 13496 Code: res.StatusCode, 13497 Header: res.Header, 13498 } 13499 } 13500 if err != nil { 13501 return nil, err 13502 } 13503 defer googleapi.CloseBody(res) 13504 if err := googleapi.CheckResponse(res); err != nil { 13505 return nil, err 13506 } 13507 ret := &User{ 13508 ServerResponse: googleapi.ServerResponse{ 13509 Header: res.Header, 13510 HTTPStatusCode: res.StatusCode, 13511 }, 13512 } 13513 target := &ret 13514 if err := gensupport.DecodeResponse(target, res); err != nil { 13515 return nil, err 13516 } 13517 return ret, nil 13518 // { 13519 // "description": "Retrieves a user's details.", 13520 // "httpMethod": "GET", 13521 // "id": "androidenterprise.users.get", 13522 // "parameterOrder": [ 13523 // "enterpriseId", 13524 // "userId" 13525 // ], 13526 // "parameters": { 13527 // "enterpriseId": { 13528 // "description": "The ID of the enterprise.", 13529 // "location": "path", 13530 // "required": true, 13531 // "type": "string" 13532 // }, 13533 // "userId": { 13534 // "description": "The ID of the user.", 13535 // "location": "path", 13536 // "required": true, 13537 // "type": "string" 13538 // } 13539 // }, 13540 // "path": "enterprises/{enterpriseId}/users/{userId}", 13541 // "response": { 13542 // "$ref": "User" 13543 // }, 13544 // "scopes": [ 13545 // "https://www.googleapis.com/auth/androidenterprise" 13546 // ] 13547 // } 13548 13549} 13550 13551// method id "androidenterprise.users.getAvailableProductSet": 13552 13553type UsersGetAvailableProductSetCall struct { 13554 s *Service 13555 enterpriseId string 13556 userId string 13557 urlParams_ gensupport.URLParams 13558 ifNoneMatch_ string 13559 ctx_ context.Context 13560 header_ http.Header 13561} 13562 13563// GetAvailableProductSet: Retrieves the set of products a user is 13564// entitled to access. 13565func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall { 13566 c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13567 c.enterpriseId = enterpriseId 13568 c.userId = userId 13569 return c 13570} 13571 13572// Fields allows partial responses to be retrieved. See 13573// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13574// for more information. 13575func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall { 13576 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13577 return c 13578} 13579 13580// IfNoneMatch sets the optional parameter which makes the operation 13581// fail if the object's ETag matches the given value. This is useful for 13582// getting updates only after the object has changed since the last 13583// request. Use googleapi.IsNotModified to check whether the response 13584// error from Do is the result of In-None-Match. 13585func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall { 13586 c.ifNoneMatch_ = entityTag 13587 return c 13588} 13589 13590// Context sets the context to be used in this call's Do method. Any 13591// pending HTTP request will be aborted if the provided context is 13592// canceled. 13593func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall { 13594 c.ctx_ = ctx 13595 return c 13596} 13597 13598// Header returns an http.Header that can be modified by the caller to 13599// add HTTP headers to the request. 13600func (c *UsersGetAvailableProductSetCall) Header() http.Header { 13601 if c.header_ == nil { 13602 c.header_ = make(http.Header) 13603 } 13604 return c.header_ 13605} 13606 13607func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 13608 reqHeaders := make(http.Header) 13609 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13610 for k, v := range c.header_ { 13611 reqHeaders[k] = v 13612 } 13613 reqHeaders.Set("User-Agent", c.s.userAgent()) 13614 if c.ifNoneMatch_ != "" { 13615 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13616 } 13617 var body io.Reader = nil 13618 c.urlParams_.Set("alt", alt) 13619 c.urlParams_.Set("prettyPrint", "false") 13620 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet") 13621 urls += "?" + c.urlParams_.Encode() 13622 req, err := http.NewRequest("GET", urls, body) 13623 if err != nil { 13624 return nil, err 13625 } 13626 req.Header = reqHeaders 13627 googleapi.Expand(req.URL, map[string]string{ 13628 "enterpriseId": c.enterpriseId, 13629 "userId": c.userId, 13630 }) 13631 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13632} 13633 13634// Do executes the "androidenterprise.users.getAvailableProductSet" call. 13635// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 13636// status code is an error. Response headers are in either 13637// *ProductSet.ServerResponse.Header or (if a response was returned at 13638// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13639// to check whether the returned error was because 13640// http.StatusNotModified was returned. 13641func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 13642 gensupport.SetOptions(c.urlParams_, opts...) 13643 res, err := c.doRequest("json") 13644 if res != nil && res.StatusCode == http.StatusNotModified { 13645 if res.Body != nil { 13646 res.Body.Close() 13647 } 13648 return nil, &googleapi.Error{ 13649 Code: res.StatusCode, 13650 Header: res.Header, 13651 } 13652 } 13653 if err != nil { 13654 return nil, err 13655 } 13656 defer googleapi.CloseBody(res) 13657 if err := googleapi.CheckResponse(res); err != nil { 13658 return nil, err 13659 } 13660 ret := &ProductSet{ 13661 ServerResponse: googleapi.ServerResponse{ 13662 Header: res.Header, 13663 HTTPStatusCode: res.StatusCode, 13664 }, 13665 } 13666 target := &ret 13667 if err := gensupport.DecodeResponse(target, res); err != nil { 13668 return nil, err 13669 } 13670 return ret, nil 13671 // { 13672 // "description": "Retrieves the set of products a user is entitled to access.", 13673 // "httpMethod": "GET", 13674 // "id": "androidenterprise.users.getAvailableProductSet", 13675 // "parameterOrder": [ 13676 // "enterpriseId", 13677 // "userId" 13678 // ], 13679 // "parameters": { 13680 // "enterpriseId": { 13681 // "description": "The ID of the enterprise.", 13682 // "location": "path", 13683 // "required": true, 13684 // "type": "string" 13685 // }, 13686 // "userId": { 13687 // "description": "The ID of the user.", 13688 // "location": "path", 13689 // "required": true, 13690 // "type": "string" 13691 // } 13692 // }, 13693 // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", 13694 // "response": { 13695 // "$ref": "ProductSet" 13696 // }, 13697 // "scopes": [ 13698 // "https://www.googleapis.com/auth/androidenterprise" 13699 // ] 13700 // } 13701 13702} 13703 13704// method id "androidenterprise.users.insert": 13705 13706type UsersInsertCall struct { 13707 s *Service 13708 enterpriseId string 13709 user *User 13710 urlParams_ gensupport.URLParams 13711 ctx_ context.Context 13712 header_ http.Header 13713} 13714 13715// Insert: Creates a new EMM-managed user. 13716// 13717// The Users resource passed in the body of the request should include 13718// an accountIdentifier and an accountType. 13719// If a corresponding user already exists with the same account 13720// identifier, the user will be updated with the resource. In this case 13721// only the displayName field can be changed. 13722func (r *UsersService) Insert(enterpriseId string, user *User) *UsersInsertCall { 13723 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13724 c.enterpriseId = enterpriseId 13725 c.user = user 13726 return c 13727} 13728 13729// Fields allows partial responses to be retrieved. See 13730// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13731// for more information. 13732func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 13733 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13734 return c 13735} 13736 13737// Context sets the context to be used in this call's Do method. Any 13738// pending HTTP request will be aborted if the provided context is 13739// canceled. 13740func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 13741 c.ctx_ = ctx 13742 return c 13743} 13744 13745// Header returns an http.Header that can be modified by the caller to 13746// add HTTP headers to the request. 13747func (c *UsersInsertCall) Header() http.Header { 13748 if c.header_ == nil { 13749 c.header_ = make(http.Header) 13750 } 13751 return c.header_ 13752} 13753 13754func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 13755 reqHeaders := make(http.Header) 13756 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13757 for k, v := range c.header_ { 13758 reqHeaders[k] = v 13759 } 13760 reqHeaders.Set("User-Agent", c.s.userAgent()) 13761 var body io.Reader = nil 13762 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 13763 if err != nil { 13764 return nil, err 13765 } 13766 reqHeaders.Set("Content-Type", "application/json") 13767 c.urlParams_.Set("alt", alt) 13768 c.urlParams_.Set("prettyPrint", "false") 13769 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users") 13770 urls += "?" + c.urlParams_.Encode() 13771 req, err := http.NewRequest("POST", urls, body) 13772 if err != nil { 13773 return nil, err 13774 } 13775 req.Header = reqHeaders 13776 googleapi.Expand(req.URL, map[string]string{ 13777 "enterpriseId": c.enterpriseId, 13778 }) 13779 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13780} 13781 13782// Do executes the "androidenterprise.users.insert" call. 13783// Exactly one of *User or error will be non-nil. Any non-2xx status 13784// code is an error. Response headers are in either 13785// *User.ServerResponse.Header or (if a response was returned at all) in 13786// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13787// whether the returned error was because http.StatusNotModified was 13788// returned. 13789func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) { 13790 gensupport.SetOptions(c.urlParams_, opts...) 13791 res, err := c.doRequest("json") 13792 if res != nil && res.StatusCode == http.StatusNotModified { 13793 if res.Body != nil { 13794 res.Body.Close() 13795 } 13796 return nil, &googleapi.Error{ 13797 Code: res.StatusCode, 13798 Header: res.Header, 13799 } 13800 } 13801 if err != nil { 13802 return nil, err 13803 } 13804 defer googleapi.CloseBody(res) 13805 if err := googleapi.CheckResponse(res); err != nil { 13806 return nil, err 13807 } 13808 ret := &User{ 13809 ServerResponse: googleapi.ServerResponse{ 13810 Header: res.Header, 13811 HTTPStatusCode: res.StatusCode, 13812 }, 13813 } 13814 target := &ret 13815 if err := gensupport.DecodeResponse(target, res); err != nil { 13816 return nil, err 13817 } 13818 return ret, nil 13819 // { 13820 // "description": "Creates a new EMM-managed user.\n\nThe Users resource passed in the body of the request should include an accountIdentifier and an accountType.\nIf 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.", 13821 // "httpMethod": "POST", 13822 // "id": "androidenterprise.users.insert", 13823 // "parameterOrder": [ 13824 // "enterpriseId" 13825 // ], 13826 // "parameters": { 13827 // "enterpriseId": { 13828 // "description": "The ID of the enterprise.", 13829 // "location": "path", 13830 // "required": true, 13831 // "type": "string" 13832 // } 13833 // }, 13834 // "path": "enterprises/{enterpriseId}/users", 13835 // "request": { 13836 // "$ref": "User" 13837 // }, 13838 // "response": { 13839 // "$ref": "User" 13840 // }, 13841 // "scopes": [ 13842 // "https://www.googleapis.com/auth/androidenterprise" 13843 // ] 13844 // } 13845 13846} 13847 13848// method id "androidenterprise.users.list": 13849 13850type UsersListCall struct { 13851 s *Service 13852 enterpriseId string 13853 urlParams_ gensupport.URLParams 13854 ifNoneMatch_ string 13855 ctx_ context.Context 13856 header_ http.Header 13857} 13858 13859// List: Looks up a user by primary email address. This is only 13860// supported for Google-managed users. Lookup of the id is not needed 13861// for EMM-managed users because the id is already returned in the 13862// result of the Users.insert call. 13863func (r *UsersService) List(enterpriseId string, email string) *UsersListCall { 13864 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13865 c.enterpriseId = enterpriseId 13866 c.urlParams_.Set("email", email) 13867 return c 13868} 13869 13870// Fields allows partial responses to be retrieved. See 13871// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13872// for more information. 13873func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 13874 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13875 return c 13876} 13877 13878// IfNoneMatch sets the optional parameter which makes the operation 13879// fail if the object's ETag matches the given value. This is useful for 13880// getting updates only after the object has changed since the last 13881// request. Use googleapi.IsNotModified to check whether the response 13882// error from Do is the result of In-None-Match. 13883func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 13884 c.ifNoneMatch_ = entityTag 13885 return c 13886} 13887 13888// Context sets the context to be used in this call's Do method. Any 13889// pending HTTP request will be aborted if the provided context is 13890// canceled. 13891func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 13892 c.ctx_ = ctx 13893 return c 13894} 13895 13896// Header returns an http.Header that can be modified by the caller to 13897// add HTTP headers to the request. 13898func (c *UsersListCall) Header() http.Header { 13899 if c.header_ == nil { 13900 c.header_ = make(http.Header) 13901 } 13902 return c.header_ 13903} 13904 13905func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 13906 reqHeaders := make(http.Header) 13907 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 13908 for k, v := range c.header_ { 13909 reqHeaders[k] = v 13910 } 13911 reqHeaders.Set("User-Agent", c.s.userAgent()) 13912 if c.ifNoneMatch_ != "" { 13913 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13914 } 13915 var body io.Reader = nil 13916 c.urlParams_.Set("alt", alt) 13917 c.urlParams_.Set("prettyPrint", "false") 13918 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users") 13919 urls += "?" + c.urlParams_.Encode() 13920 req, err := http.NewRequest("GET", urls, body) 13921 if err != nil { 13922 return nil, err 13923 } 13924 req.Header = reqHeaders 13925 googleapi.Expand(req.URL, map[string]string{ 13926 "enterpriseId": c.enterpriseId, 13927 }) 13928 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13929} 13930 13931// Do executes the "androidenterprise.users.list" call. 13932// Exactly one of *UsersListResponse or error will be non-nil. Any 13933// non-2xx status code is an error. Response headers are in either 13934// *UsersListResponse.ServerResponse.Header or (if a response was 13935// returned at all) in error.(*googleapi.Error).Header. Use 13936// googleapi.IsNotModified to check whether the returned error was 13937// because http.StatusNotModified was returned. 13938func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 13939 gensupport.SetOptions(c.urlParams_, opts...) 13940 res, err := c.doRequest("json") 13941 if res != nil && res.StatusCode == http.StatusNotModified { 13942 if res.Body != nil { 13943 res.Body.Close() 13944 } 13945 return nil, &googleapi.Error{ 13946 Code: res.StatusCode, 13947 Header: res.Header, 13948 } 13949 } 13950 if err != nil { 13951 return nil, err 13952 } 13953 defer googleapi.CloseBody(res) 13954 if err := googleapi.CheckResponse(res); err != nil { 13955 return nil, err 13956 } 13957 ret := &UsersListResponse{ 13958 ServerResponse: googleapi.ServerResponse{ 13959 Header: res.Header, 13960 HTTPStatusCode: res.StatusCode, 13961 }, 13962 } 13963 target := &ret 13964 if err := gensupport.DecodeResponse(target, res); err != nil { 13965 return nil, err 13966 } 13967 return ret, nil 13968 // { 13969 // "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.", 13970 // "httpMethod": "GET", 13971 // "id": "androidenterprise.users.list", 13972 // "parameterOrder": [ 13973 // "enterpriseId", 13974 // "email" 13975 // ], 13976 // "parameters": { 13977 // "email": { 13978 // "description": "The exact primary email address of the user to look up.", 13979 // "location": "query", 13980 // "required": true, 13981 // "type": "string" 13982 // }, 13983 // "enterpriseId": { 13984 // "description": "The ID of the enterprise.", 13985 // "location": "path", 13986 // "required": true, 13987 // "type": "string" 13988 // } 13989 // }, 13990 // "path": "enterprises/{enterpriseId}/users", 13991 // "response": { 13992 // "$ref": "UsersListResponse" 13993 // }, 13994 // "scopes": [ 13995 // "https://www.googleapis.com/auth/androidenterprise" 13996 // ] 13997 // } 13998 13999} 14000 14001// method id "androidenterprise.users.revokeDeviceAccess": 14002 14003type UsersRevokeDeviceAccessCall struct { 14004 s *Service 14005 enterpriseId string 14006 userId string 14007 urlParams_ gensupport.URLParams 14008 ctx_ context.Context 14009 header_ http.Header 14010} 14011 14012// RevokeDeviceAccess: Revokes access to all devices currently 14013// provisioned to the user. The user will no longer be able to use the 14014// managed Play store on any of their managed devices. 14015// 14016// This call only works with EMM-managed accounts. 14017func (r *UsersService) RevokeDeviceAccess(enterpriseId string, userId string) *UsersRevokeDeviceAccessCall { 14018 c := &UsersRevokeDeviceAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14019 c.enterpriseId = enterpriseId 14020 c.userId = userId 14021 return c 14022} 14023 14024// Fields allows partial responses to be retrieved. See 14025// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14026// for more information. 14027func (c *UsersRevokeDeviceAccessCall) Fields(s ...googleapi.Field) *UsersRevokeDeviceAccessCall { 14028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14029 return c 14030} 14031 14032// Context sets the context to be used in this call's Do method. Any 14033// pending HTTP request will be aborted if the provided context is 14034// canceled. 14035func (c *UsersRevokeDeviceAccessCall) Context(ctx context.Context) *UsersRevokeDeviceAccessCall { 14036 c.ctx_ = ctx 14037 return c 14038} 14039 14040// Header returns an http.Header that can be modified by the caller to 14041// add HTTP headers to the request. 14042func (c *UsersRevokeDeviceAccessCall) Header() http.Header { 14043 if c.header_ == nil { 14044 c.header_ = make(http.Header) 14045 } 14046 return c.header_ 14047} 14048 14049func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) { 14050 reqHeaders := make(http.Header) 14051 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14052 for k, v := range c.header_ { 14053 reqHeaders[k] = v 14054 } 14055 reqHeaders.Set("User-Agent", c.s.userAgent()) 14056 var body io.Reader = nil 14057 c.urlParams_.Set("alt", alt) 14058 c.urlParams_.Set("prettyPrint", "false") 14059 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/deviceAccess") 14060 urls += "?" + c.urlParams_.Encode() 14061 req, err := http.NewRequest("DELETE", urls, body) 14062 if err != nil { 14063 return nil, err 14064 } 14065 req.Header = reqHeaders 14066 googleapi.Expand(req.URL, map[string]string{ 14067 "enterpriseId": c.enterpriseId, 14068 "userId": c.userId, 14069 }) 14070 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14071} 14072 14073// Do executes the "androidenterprise.users.revokeDeviceAccess" call. 14074func (c *UsersRevokeDeviceAccessCall) Do(opts ...googleapi.CallOption) error { 14075 gensupport.SetOptions(c.urlParams_, opts...) 14076 res, err := c.doRequest("json") 14077 if err != nil { 14078 return err 14079 } 14080 defer googleapi.CloseBody(res) 14081 if err := googleapi.CheckResponse(res); err != nil { 14082 return err 14083 } 14084 return nil 14085 // { 14086 // "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.\n\nThis call only works with EMM-managed accounts.", 14087 // "httpMethod": "DELETE", 14088 // "id": "androidenterprise.users.revokeDeviceAccess", 14089 // "parameterOrder": [ 14090 // "enterpriseId", 14091 // "userId" 14092 // ], 14093 // "parameters": { 14094 // "enterpriseId": { 14095 // "description": "The ID of the enterprise.", 14096 // "location": "path", 14097 // "required": true, 14098 // "type": "string" 14099 // }, 14100 // "userId": { 14101 // "description": "The ID of the user.", 14102 // "location": "path", 14103 // "required": true, 14104 // "type": "string" 14105 // } 14106 // }, 14107 // "path": "enterprises/{enterpriseId}/users/{userId}/deviceAccess", 14108 // "scopes": [ 14109 // "https://www.googleapis.com/auth/androidenterprise" 14110 // ] 14111 // } 14112 14113} 14114 14115// method id "androidenterprise.users.revokeToken": 14116 14117type UsersRevokeTokenCall struct { 14118 s *Service 14119 enterpriseId string 14120 userId string 14121 urlParams_ gensupport.URLParams 14122 ctx_ context.Context 14123 header_ http.Header 14124} 14125 14126// RevokeToken: Revokes a previously generated token (activation code) 14127// for the user. 14128func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall { 14129 c := &UsersRevokeTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14130 c.enterpriseId = enterpriseId 14131 c.userId = userId 14132 return c 14133} 14134 14135// Fields allows partial responses to be retrieved. See 14136// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14137// for more information. 14138func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall { 14139 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14140 return c 14141} 14142 14143// Context sets the context to be used in this call's Do method. Any 14144// pending HTTP request will be aborted if the provided context is 14145// canceled. 14146func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall { 14147 c.ctx_ = ctx 14148 return c 14149} 14150 14151// Header returns an http.Header that can be modified by the caller to 14152// add HTTP headers to the request. 14153func (c *UsersRevokeTokenCall) Header() http.Header { 14154 if c.header_ == nil { 14155 c.header_ = make(http.Header) 14156 } 14157 return c.header_ 14158} 14159 14160func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) { 14161 reqHeaders := make(http.Header) 14162 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14163 for k, v := range c.header_ { 14164 reqHeaders[k] = v 14165 } 14166 reqHeaders.Set("User-Agent", c.s.userAgent()) 14167 var body io.Reader = nil 14168 c.urlParams_.Set("alt", alt) 14169 c.urlParams_.Set("prettyPrint", "false") 14170 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token") 14171 urls += "?" + c.urlParams_.Encode() 14172 req, err := http.NewRequest("DELETE", urls, body) 14173 if err != nil { 14174 return nil, err 14175 } 14176 req.Header = reqHeaders 14177 googleapi.Expand(req.URL, map[string]string{ 14178 "enterpriseId": c.enterpriseId, 14179 "userId": c.userId, 14180 }) 14181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14182} 14183 14184// Do executes the "androidenterprise.users.revokeToken" call. 14185func (c *UsersRevokeTokenCall) Do(opts ...googleapi.CallOption) error { 14186 gensupport.SetOptions(c.urlParams_, opts...) 14187 res, err := c.doRequest("json") 14188 if err != nil { 14189 return err 14190 } 14191 defer googleapi.CloseBody(res) 14192 if err := googleapi.CheckResponse(res); err != nil { 14193 return err 14194 } 14195 return nil 14196 // { 14197 // "description": "Revokes a previously generated token (activation code) for the user.", 14198 // "httpMethod": "DELETE", 14199 // "id": "androidenterprise.users.revokeToken", 14200 // "parameterOrder": [ 14201 // "enterpriseId", 14202 // "userId" 14203 // ], 14204 // "parameters": { 14205 // "enterpriseId": { 14206 // "description": "The ID of the enterprise.", 14207 // "location": "path", 14208 // "required": true, 14209 // "type": "string" 14210 // }, 14211 // "userId": { 14212 // "description": "The ID of the user.", 14213 // "location": "path", 14214 // "required": true, 14215 // "type": "string" 14216 // } 14217 // }, 14218 // "path": "enterprises/{enterpriseId}/users/{userId}/token", 14219 // "scopes": [ 14220 // "https://www.googleapis.com/auth/androidenterprise" 14221 // ] 14222 // } 14223 14224} 14225 14226// method id "androidenterprise.users.setAvailableProductSet": 14227 14228type UsersSetAvailableProductSetCall struct { 14229 s *Service 14230 enterpriseId string 14231 userId string 14232 productset *ProductSet 14233 urlParams_ gensupport.URLParams 14234 ctx_ context.Context 14235 header_ http.Header 14236} 14237 14238// SetAvailableProductSet: Modifies the set of products that a user is 14239// entitled to access (referred to as whitelisted products). Only 14240// products that are approved or products that were previously approved 14241// (products with revoked approval) can be whitelisted. 14242func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall { 14243 c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14244 c.enterpriseId = enterpriseId 14245 c.userId = userId 14246 c.productset = productset 14247 return c 14248} 14249 14250// Fields allows partial responses to be retrieved. See 14251// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14252// for more information. 14253func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall { 14254 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14255 return c 14256} 14257 14258// Context sets the context to be used in this call's Do method. Any 14259// pending HTTP request will be aborted if the provided context is 14260// canceled. 14261func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall { 14262 c.ctx_ = ctx 14263 return c 14264} 14265 14266// Header returns an http.Header that can be modified by the caller to 14267// add HTTP headers to the request. 14268func (c *UsersSetAvailableProductSetCall) Header() http.Header { 14269 if c.header_ == nil { 14270 c.header_ = make(http.Header) 14271 } 14272 return c.header_ 14273} 14274 14275func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { 14276 reqHeaders := make(http.Header) 14277 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14278 for k, v := range c.header_ { 14279 reqHeaders[k] = v 14280 } 14281 reqHeaders.Set("User-Agent", c.s.userAgent()) 14282 var body io.Reader = nil 14283 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) 14284 if err != nil { 14285 return nil, err 14286 } 14287 reqHeaders.Set("Content-Type", "application/json") 14288 c.urlParams_.Set("alt", alt) 14289 c.urlParams_.Set("prettyPrint", "false") 14290 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet") 14291 urls += "?" + c.urlParams_.Encode() 14292 req, err := http.NewRequest("PUT", urls, body) 14293 if err != nil { 14294 return nil, err 14295 } 14296 req.Header = reqHeaders 14297 googleapi.Expand(req.URL, map[string]string{ 14298 "enterpriseId": c.enterpriseId, 14299 "userId": c.userId, 14300 }) 14301 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14302} 14303 14304// Do executes the "androidenterprise.users.setAvailableProductSet" call. 14305// Exactly one of *ProductSet or error will be non-nil. Any non-2xx 14306// status code is an error. Response headers are in either 14307// *ProductSet.ServerResponse.Header or (if a response was returned at 14308// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14309// to check whether the returned error was because 14310// http.StatusNotModified was returned. 14311func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) { 14312 gensupport.SetOptions(c.urlParams_, opts...) 14313 res, err := c.doRequest("json") 14314 if res != nil && res.StatusCode == http.StatusNotModified { 14315 if res.Body != nil { 14316 res.Body.Close() 14317 } 14318 return nil, &googleapi.Error{ 14319 Code: res.StatusCode, 14320 Header: res.Header, 14321 } 14322 } 14323 if err != nil { 14324 return nil, err 14325 } 14326 defer googleapi.CloseBody(res) 14327 if err := googleapi.CheckResponse(res); err != nil { 14328 return nil, err 14329 } 14330 ret := &ProductSet{ 14331 ServerResponse: googleapi.ServerResponse{ 14332 Header: res.Header, 14333 HTTPStatusCode: res.StatusCode, 14334 }, 14335 } 14336 target := &ret 14337 if err := gensupport.DecodeResponse(target, res); err != nil { 14338 return nil, err 14339 } 14340 return ret, nil 14341 // { 14342 // "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.", 14343 // "httpMethod": "PUT", 14344 // "id": "androidenterprise.users.setAvailableProductSet", 14345 // "parameterOrder": [ 14346 // "enterpriseId", 14347 // "userId" 14348 // ], 14349 // "parameters": { 14350 // "enterpriseId": { 14351 // "description": "The ID of the enterprise.", 14352 // "location": "path", 14353 // "required": true, 14354 // "type": "string" 14355 // }, 14356 // "userId": { 14357 // "description": "The ID of the user.", 14358 // "location": "path", 14359 // "required": true, 14360 // "type": "string" 14361 // } 14362 // }, 14363 // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", 14364 // "request": { 14365 // "$ref": "ProductSet" 14366 // }, 14367 // "response": { 14368 // "$ref": "ProductSet" 14369 // }, 14370 // "scopes": [ 14371 // "https://www.googleapis.com/auth/androidenterprise" 14372 // ] 14373 // } 14374 14375} 14376 14377// method id "androidenterprise.users.update": 14378 14379type UsersUpdateCall struct { 14380 s *Service 14381 enterpriseId string 14382 userId string 14383 user *User 14384 urlParams_ gensupport.URLParams 14385 ctx_ context.Context 14386 header_ http.Header 14387} 14388 14389// Update: Updates the details of an EMM-managed user. 14390// 14391// Can be used with EMM-managed users only (not Google managed users). 14392// Pass the new details in the Users resource in the request body. Only 14393// the displayName field can be changed. Other fields must either be 14394// unset or have the currently active value. 14395func (r *UsersService) Update(enterpriseId string, userId string, user *User) *UsersUpdateCall { 14396 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14397 c.enterpriseId = enterpriseId 14398 c.userId = userId 14399 c.user = user 14400 return c 14401} 14402 14403// Fields allows partial responses to be retrieved. See 14404// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14405// for more information. 14406func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 14407 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14408 return c 14409} 14410 14411// Context sets the context to be used in this call's Do method. Any 14412// pending HTTP request will be aborted if the provided context is 14413// canceled. 14414func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 14415 c.ctx_ = ctx 14416 return c 14417} 14418 14419// Header returns an http.Header that can be modified by the caller to 14420// add HTTP headers to the request. 14421func (c *UsersUpdateCall) Header() http.Header { 14422 if c.header_ == nil { 14423 c.header_ = make(http.Header) 14424 } 14425 return c.header_ 14426} 14427 14428func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 14429 reqHeaders := make(http.Header) 14430 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14431 for k, v := range c.header_ { 14432 reqHeaders[k] = v 14433 } 14434 reqHeaders.Set("User-Agent", c.s.userAgent()) 14435 var body io.Reader = nil 14436 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 14437 if err != nil { 14438 return nil, err 14439 } 14440 reqHeaders.Set("Content-Type", "application/json") 14441 c.urlParams_.Set("alt", alt) 14442 c.urlParams_.Set("prettyPrint", "false") 14443 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}") 14444 urls += "?" + c.urlParams_.Encode() 14445 req, err := http.NewRequest("PUT", urls, body) 14446 if err != nil { 14447 return nil, err 14448 } 14449 req.Header = reqHeaders 14450 googleapi.Expand(req.URL, map[string]string{ 14451 "enterpriseId": c.enterpriseId, 14452 "userId": c.userId, 14453 }) 14454 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14455} 14456 14457// Do executes the "androidenterprise.users.update" call. 14458// Exactly one of *User or error will be non-nil. Any non-2xx status 14459// code is an error. Response headers are in either 14460// *User.ServerResponse.Header or (if a response was returned at all) in 14461// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 14462// whether the returned error was because http.StatusNotModified was 14463// returned. 14464func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) { 14465 gensupport.SetOptions(c.urlParams_, opts...) 14466 res, err := c.doRequest("json") 14467 if res != nil && res.StatusCode == http.StatusNotModified { 14468 if res.Body != nil { 14469 res.Body.Close() 14470 } 14471 return nil, &googleapi.Error{ 14472 Code: res.StatusCode, 14473 Header: res.Header, 14474 } 14475 } 14476 if err != nil { 14477 return nil, err 14478 } 14479 defer googleapi.CloseBody(res) 14480 if err := googleapi.CheckResponse(res); err != nil { 14481 return nil, err 14482 } 14483 ret := &User{ 14484 ServerResponse: googleapi.ServerResponse{ 14485 Header: res.Header, 14486 HTTPStatusCode: res.StatusCode, 14487 }, 14488 } 14489 target := &ret 14490 if err := gensupport.DecodeResponse(target, res); err != nil { 14491 return nil, err 14492 } 14493 return ret, nil 14494 // { 14495 // "description": "Updates the details of an EMM-managed user.\n\nCan 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.", 14496 // "httpMethod": "PUT", 14497 // "id": "androidenterprise.users.update", 14498 // "parameterOrder": [ 14499 // "enterpriseId", 14500 // "userId" 14501 // ], 14502 // "parameters": { 14503 // "enterpriseId": { 14504 // "description": "The ID of the enterprise.", 14505 // "location": "path", 14506 // "required": true, 14507 // "type": "string" 14508 // }, 14509 // "userId": { 14510 // "description": "The ID of the user.", 14511 // "location": "path", 14512 // "required": true, 14513 // "type": "string" 14514 // } 14515 // }, 14516 // "path": "enterprises/{enterpriseId}/users/{userId}", 14517 // "request": { 14518 // "$ref": "User" 14519 // }, 14520 // "response": { 14521 // "$ref": "User" 14522 // }, 14523 // "scopes": [ 14524 // "https://www.googleapis.com/auth/androidenterprise" 14525 // ] 14526 // } 14527 14528} 14529 14530// method id "androidenterprise.webapps.delete": 14531 14532type WebappsDeleteCall struct { 14533 s *Service 14534 enterpriseId string 14535 webAppId string 14536 urlParams_ gensupport.URLParams 14537 ctx_ context.Context 14538 header_ http.Header 14539} 14540 14541// Delete: Deletes an existing web app. 14542func (r *WebappsService) Delete(enterpriseId string, webAppId string) *WebappsDeleteCall { 14543 c := &WebappsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14544 c.enterpriseId = enterpriseId 14545 c.webAppId = webAppId 14546 return c 14547} 14548 14549// Fields allows partial responses to be retrieved. See 14550// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14551// for more information. 14552func (c *WebappsDeleteCall) Fields(s ...googleapi.Field) *WebappsDeleteCall { 14553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14554 return c 14555} 14556 14557// Context sets the context to be used in this call's Do method. Any 14558// pending HTTP request will be aborted if the provided context is 14559// canceled. 14560func (c *WebappsDeleteCall) Context(ctx context.Context) *WebappsDeleteCall { 14561 c.ctx_ = ctx 14562 return c 14563} 14564 14565// Header returns an http.Header that can be modified by the caller to 14566// add HTTP headers to the request. 14567func (c *WebappsDeleteCall) Header() http.Header { 14568 if c.header_ == nil { 14569 c.header_ = make(http.Header) 14570 } 14571 return c.header_ 14572} 14573 14574func (c *WebappsDeleteCall) doRequest(alt string) (*http.Response, error) { 14575 reqHeaders := make(http.Header) 14576 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14577 for k, v := range c.header_ { 14578 reqHeaders[k] = v 14579 } 14580 reqHeaders.Set("User-Agent", c.s.userAgent()) 14581 var body io.Reader = nil 14582 c.urlParams_.Set("alt", alt) 14583 c.urlParams_.Set("prettyPrint", "false") 14584 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}") 14585 urls += "?" + c.urlParams_.Encode() 14586 req, err := http.NewRequest("DELETE", urls, body) 14587 if err != nil { 14588 return nil, err 14589 } 14590 req.Header = reqHeaders 14591 googleapi.Expand(req.URL, map[string]string{ 14592 "enterpriseId": c.enterpriseId, 14593 "webAppId": c.webAppId, 14594 }) 14595 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14596} 14597 14598// Do executes the "androidenterprise.webapps.delete" call. 14599func (c *WebappsDeleteCall) Do(opts ...googleapi.CallOption) error { 14600 gensupport.SetOptions(c.urlParams_, opts...) 14601 res, err := c.doRequest("json") 14602 if err != nil { 14603 return err 14604 } 14605 defer googleapi.CloseBody(res) 14606 if err := googleapi.CheckResponse(res); err != nil { 14607 return err 14608 } 14609 return nil 14610 // { 14611 // "description": "Deletes an existing web app.", 14612 // "httpMethod": "DELETE", 14613 // "id": "androidenterprise.webapps.delete", 14614 // "parameterOrder": [ 14615 // "enterpriseId", 14616 // "webAppId" 14617 // ], 14618 // "parameters": { 14619 // "enterpriseId": { 14620 // "description": "The ID of the enterprise.", 14621 // "location": "path", 14622 // "required": true, 14623 // "type": "string" 14624 // }, 14625 // "webAppId": { 14626 // "description": "The ID of the web app.", 14627 // "location": "path", 14628 // "required": true, 14629 // "type": "string" 14630 // } 14631 // }, 14632 // "path": "enterprises/{enterpriseId}/webApps/{webAppId}", 14633 // "scopes": [ 14634 // "https://www.googleapis.com/auth/androidenterprise" 14635 // ] 14636 // } 14637 14638} 14639 14640// method id "androidenterprise.webapps.get": 14641 14642type WebappsGetCall struct { 14643 s *Service 14644 enterpriseId string 14645 webAppId string 14646 urlParams_ gensupport.URLParams 14647 ifNoneMatch_ string 14648 ctx_ context.Context 14649 header_ http.Header 14650} 14651 14652// Get: Gets an existing web app. 14653func (r *WebappsService) Get(enterpriseId string, webAppId string) *WebappsGetCall { 14654 c := &WebappsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14655 c.enterpriseId = enterpriseId 14656 c.webAppId = webAppId 14657 return c 14658} 14659 14660// Fields allows partial responses to be retrieved. See 14661// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14662// for more information. 14663func (c *WebappsGetCall) Fields(s ...googleapi.Field) *WebappsGetCall { 14664 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14665 return c 14666} 14667 14668// IfNoneMatch sets the optional parameter which makes the operation 14669// fail if the object's ETag matches the given value. This is useful for 14670// getting updates only after the object has changed since the last 14671// request. Use googleapi.IsNotModified to check whether the response 14672// error from Do is the result of In-None-Match. 14673func (c *WebappsGetCall) IfNoneMatch(entityTag string) *WebappsGetCall { 14674 c.ifNoneMatch_ = entityTag 14675 return c 14676} 14677 14678// Context sets the context to be used in this call's Do method. Any 14679// pending HTTP request will be aborted if the provided context is 14680// canceled. 14681func (c *WebappsGetCall) Context(ctx context.Context) *WebappsGetCall { 14682 c.ctx_ = ctx 14683 return c 14684} 14685 14686// Header returns an http.Header that can be modified by the caller to 14687// add HTTP headers to the request. 14688func (c *WebappsGetCall) Header() http.Header { 14689 if c.header_ == nil { 14690 c.header_ = make(http.Header) 14691 } 14692 return c.header_ 14693} 14694 14695func (c *WebappsGetCall) doRequest(alt string) (*http.Response, error) { 14696 reqHeaders := make(http.Header) 14697 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14698 for k, v := range c.header_ { 14699 reqHeaders[k] = v 14700 } 14701 reqHeaders.Set("User-Agent", c.s.userAgent()) 14702 if c.ifNoneMatch_ != "" { 14703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14704 } 14705 var body io.Reader = nil 14706 c.urlParams_.Set("alt", alt) 14707 c.urlParams_.Set("prettyPrint", "false") 14708 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}") 14709 urls += "?" + c.urlParams_.Encode() 14710 req, err := http.NewRequest("GET", urls, body) 14711 if err != nil { 14712 return nil, err 14713 } 14714 req.Header = reqHeaders 14715 googleapi.Expand(req.URL, map[string]string{ 14716 "enterpriseId": c.enterpriseId, 14717 "webAppId": c.webAppId, 14718 }) 14719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14720} 14721 14722// Do executes the "androidenterprise.webapps.get" call. 14723// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 14724// code is an error. Response headers are in either 14725// *WebApp.ServerResponse.Header or (if a response was returned at all) 14726// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14727// check whether the returned error was because http.StatusNotModified 14728// was returned. 14729func (c *WebappsGetCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 14730 gensupport.SetOptions(c.urlParams_, opts...) 14731 res, err := c.doRequest("json") 14732 if res != nil && res.StatusCode == http.StatusNotModified { 14733 if res.Body != nil { 14734 res.Body.Close() 14735 } 14736 return nil, &googleapi.Error{ 14737 Code: res.StatusCode, 14738 Header: res.Header, 14739 } 14740 } 14741 if err != nil { 14742 return nil, err 14743 } 14744 defer googleapi.CloseBody(res) 14745 if err := googleapi.CheckResponse(res); err != nil { 14746 return nil, err 14747 } 14748 ret := &WebApp{ 14749 ServerResponse: googleapi.ServerResponse{ 14750 Header: res.Header, 14751 HTTPStatusCode: res.StatusCode, 14752 }, 14753 } 14754 target := &ret 14755 if err := gensupport.DecodeResponse(target, res); err != nil { 14756 return nil, err 14757 } 14758 return ret, nil 14759 // { 14760 // "description": "Gets an existing web app.", 14761 // "httpMethod": "GET", 14762 // "id": "androidenterprise.webapps.get", 14763 // "parameterOrder": [ 14764 // "enterpriseId", 14765 // "webAppId" 14766 // ], 14767 // "parameters": { 14768 // "enterpriseId": { 14769 // "description": "The ID of the enterprise.", 14770 // "location": "path", 14771 // "required": true, 14772 // "type": "string" 14773 // }, 14774 // "webAppId": { 14775 // "description": "The ID of the web app.", 14776 // "location": "path", 14777 // "required": true, 14778 // "type": "string" 14779 // } 14780 // }, 14781 // "path": "enterprises/{enterpriseId}/webApps/{webAppId}", 14782 // "response": { 14783 // "$ref": "WebApp" 14784 // }, 14785 // "scopes": [ 14786 // "https://www.googleapis.com/auth/androidenterprise" 14787 // ] 14788 // } 14789 14790} 14791 14792// method id "androidenterprise.webapps.insert": 14793 14794type WebappsInsertCall struct { 14795 s *Service 14796 enterpriseId string 14797 webapp *WebApp 14798 urlParams_ gensupport.URLParams 14799 ctx_ context.Context 14800 header_ http.Header 14801} 14802 14803// Insert: Creates a new web app for the enterprise. 14804func (r *WebappsService) Insert(enterpriseId string, webapp *WebApp) *WebappsInsertCall { 14805 c := &WebappsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14806 c.enterpriseId = enterpriseId 14807 c.webapp = webapp 14808 return c 14809} 14810 14811// Fields allows partial responses to be retrieved. See 14812// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14813// for more information. 14814func (c *WebappsInsertCall) Fields(s ...googleapi.Field) *WebappsInsertCall { 14815 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14816 return c 14817} 14818 14819// Context sets the context to be used in this call's Do method. Any 14820// pending HTTP request will be aborted if the provided context is 14821// canceled. 14822func (c *WebappsInsertCall) Context(ctx context.Context) *WebappsInsertCall { 14823 c.ctx_ = ctx 14824 return c 14825} 14826 14827// Header returns an http.Header that can be modified by the caller to 14828// add HTTP headers to the request. 14829func (c *WebappsInsertCall) Header() http.Header { 14830 if c.header_ == nil { 14831 c.header_ = make(http.Header) 14832 } 14833 return c.header_ 14834} 14835 14836func (c *WebappsInsertCall) doRequest(alt string) (*http.Response, error) { 14837 reqHeaders := make(http.Header) 14838 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14839 for k, v := range c.header_ { 14840 reqHeaders[k] = v 14841 } 14842 reqHeaders.Set("User-Agent", c.s.userAgent()) 14843 var body io.Reader = nil 14844 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 14845 if err != nil { 14846 return nil, err 14847 } 14848 reqHeaders.Set("Content-Type", "application/json") 14849 c.urlParams_.Set("alt", alt) 14850 c.urlParams_.Set("prettyPrint", "false") 14851 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps") 14852 urls += "?" + c.urlParams_.Encode() 14853 req, err := http.NewRequest("POST", urls, body) 14854 if err != nil { 14855 return nil, err 14856 } 14857 req.Header = reqHeaders 14858 googleapi.Expand(req.URL, map[string]string{ 14859 "enterpriseId": c.enterpriseId, 14860 }) 14861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14862} 14863 14864// Do executes the "androidenterprise.webapps.insert" call. 14865// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 14866// code is an error. Response headers are in either 14867// *WebApp.ServerResponse.Header or (if a response was returned at all) 14868// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14869// check whether the returned error was because http.StatusNotModified 14870// was returned. 14871func (c *WebappsInsertCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 14872 gensupport.SetOptions(c.urlParams_, opts...) 14873 res, err := c.doRequest("json") 14874 if res != nil && res.StatusCode == http.StatusNotModified { 14875 if res.Body != nil { 14876 res.Body.Close() 14877 } 14878 return nil, &googleapi.Error{ 14879 Code: res.StatusCode, 14880 Header: res.Header, 14881 } 14882 } 14883 if err != nil { 14884 return nil, err 14885 } 14886 defer googleapi.CloseBody(res) 14887 if err := googleapi.CheckResponse(res); err != nil { 14888 return nil, err 14889 } 14890 ret := &WebApp{ 14891 ServerResponse: googleapi.ServerResponse{ 14892 Header: res.Header, 14893 HTTPStatusCode: res.StatusCode, 14894 }, 14895 } 14896 target := &ret 14897 if err := gensupport.DecodeResponse(target, res); err != nil { 14898 return nil, err 14899 } 14900 return ret, nil 14901 // { 14902 // "description": "Creates a new web app for the enterprise.", 14903 // "httpMethod": "POST", 14904 // "id": "androidenterprise.webapps.insert", 14905 // "parameterOrder": [ 14906 // "enterpriseId" 14907 // ], 14908 // "parameters": { 14909 // "enterpriseId": { 14910 // "description": "The ID of the enterprise.", 14911 // "location": "path", 14912 // "required": true, 14913 // "type": "string" 14914 // } 14915 // }, 14916 // "path": "enterprises/{enterpriseId}/webApps", 14917 // "request": { 14918 // "$ref": "WebApp" 14919 // }, 14920 // "response": { 14921 // "$ref": "WebApp" 14922 // }, 14923 // "scopes": [ 14924 // "https://www.googleapis.com/auth/androidenterprise" 14925 // ] 14926 // } 14927 14928} 14929 14930// method id "androidenterprise.webapps.list": 14931 14932type WebappsListCall struct { 14933 s *Service 14934 enterpriseId string 14935 urlParams_ gensupport.URLParams 14936 ifNoneMatch_ string 14937 ctx_ context.Context 14938 header_ http.Header 14939} 14940 14941// List: Retrieves the details of all web apps for a given enterprise. 14942func (r *WebappsService) List(enterpriseId string) *WebappsListCall { 14943 c := &WebappsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14944 c.enterpriseId = enterpriseId 14945 return c 14946} 14947 14948// Fields allows partial responses to be retrieved. See 14949// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14950// for more information. 14951func (c *WebappsListCall) Fields(s ...googleapi.Field) *WebappsListCall { 14952 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14953 return c 14954} 14955 14956// IfNoneMatch sets the optional parameter which makes the operation 14957// fail if the object's ETag matches the given value. This is useful for 14958// getting updates only after the object has changed since the last 14959// request. Use googleapi.IsNotModified to check whether the response 14960// error from Do is the result of In-None-Match. 14961func (c *WebappsListCall) IfNoneMatch(entityTag string) *WebappsListCall { 14962 c.ifNoneMatch_ = entityTag 14963 return c 14964} 14965 14966// Context sets the context to be used in this call's Do method. Any 14967// pending HTTP request will be aborted if the provided context is 14968// canceled. 14969func (c *WebappsListCall) Context(ctx context.Context) *WebappsListCall { 14970 c.ctx_ = ctx 14971 return c 14972} 14973 14974// Header returns an http.Header that can be modified by the caller to 14975// add HTTP headers to the request. 14976func (c *WebappsListCall) Header() http.Header { 14977 if c.header_ == nil { 14978 c.header_ = make(http.Header) 14979 } 14980 return c.header_ 14981} 14982 14983func (c *WebappsListCall) doRequest(alt string) (*http.Response, error) { 14984 reqHeaders := make(http.Header) 14985 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 14986 for k, v := range c.header_ { 14987 reqHeaders[k] = v 14988 } 14989 reqHeaders.Set("User-Agent", c.s.userAgent()) 14990 if c.ifNoneMatch_ != "" { 14991 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14992 } 14993 var body io.Reader = nil 14994 c.urlParams_.Set("alt", alt) 14995 c.urlParams_.Set("prettyPrint", "false") 14996 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps") 14997 urls += "?" + c.urlParams_.Encode() 14998 req, err := http.NewRequest("GET", urls, body) 14999 if err != nil { 15000 return nil, err 15001 } 15002 req.Header = reqHeaders 15003 googleapi.Expand(req.URL, map[string]string{ 15004 "enterpriseId": c.enterpriseId, 15005 }) 15006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15007} 15008 15009// Do executes the "androidenterprise.webapps.list" call. 15010// Exactly one of *WebAppsListResponse or error will be non-nil. Any 15011// non-2xx status code is an error. Response headers are in either 15012// *WebAppsListResponse.ServerResponse.Header or (if a response was 15013// returned at all) in error.(*googleapi.Error).Header. Use 15014// googleapi.IsNotModified to check whether the returned error was 15015// because http.StatusNotModified was returned. 15016func (c *WebappsListCall) Do(opts ...googleapi.CallOption) (*WebAppsListResponse, error) { 15017 gensupport.SetOptions(c.urlParams_, opts...) 15018 res, err := c.doRequest("json") 15019 if res != nil && res.StatusCode == http.StatusNotModified { 15020 if res.Body != nil { 15021 res.Body.Close() 15022 } 15023 return nil, &googleapi.Error{ 15024 Code: res.StatusCode, 15025 Header: res.Header, 15026 } 15027 } 15028 if err != nil { 15029 return nil, err 15030 } 15031 defer googleapi.CloseBody(res) 15032 if err := googleapi.CheckResponse(res); err != nil { 15033 return nil, err 15034 } 15035 ret := &WebAppsListResponse{ 15036 ServerResponse: googleapi.ServerResponse{ 15037 Header: res.Header, 15038 HTTPStatusCode: res.StatusCode, 15039 }, 15040 } 15041 target := &ret 15042 if err := gensupport.DecodeResponse(target, res); err != nil { 15043 return nil, err 15044 } 15045 return ret, nil 15046 // { 15047 // "description": "Retrieves the details of all web apps for a given enterprise.", 15048 // "httpMethod": "GET", 15049 // "id": "androidenterprise.webapps.list", 15050 // "parameterOrder": [ 15051 // "enterpriseId" 15052 // ], 15053 // "parameters": { 15054 // "enterpriseId": { 15055 // "description": "The ID of the enterprise.", 15056 // "location": "path", 15057 // "required": true, 15058 // "type": "string" 15059 // } 15060 // }, 15061 // "path": "enterprises/{enterpriseId}/webApps", 15062 // "response": { 15063 // "$ref": "WebAppsListResponse" 15064 // }, 15065 // "scopes": [ 15066 // "https://www.googleapis.com/auth/androidenterprise" 15067 // ] 15068 // } 15069 15070} 15071 15072// method id "androidenterprise.webapps.update": 15073 15074type WebappsUpdateCall struct { 15075 s *Service 15076 enterpriseId string 15077 webAppId string 15078 webapp *WebApp 15079 urlParams_ gensupport.URLParams 15080 ctx_ context.Context 15081 header_ http.Header 15082} 15083 15084// Update: Updates an existing web app. 15085func (r *WebappsService) Update(enterpriseId string, webAppId string, webapp *WebApp) *WebappsUpdateCall { 15086 c := &WebappsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15087 c.enterpriseId = enterpriseId 15088 c.webAppId = webAppId 15089 c.webapp = webapp 15090 return c 15091} 15092 15093// Fields allows partial responses to be retrieved. See 15094// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15095// for more information. 15096func (c *WebappsUpdateCall) Fields(s ...googleapi.Field) *WebappsUpdateCall { 15097 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15098 return c 15099} 15100 15101// Context sets the context to be used in this call's Do method. Any 15102// pending HTTP request will be aborted if the provided context is 15103// canceled. 15104func (c *WebappsUpdateCall) Context(ctx context.Context) *WebappsUpdateCall { 15105 c.ctx_ = ctx 15106 return c 15107} 15108 15109// Header returns an http.Header that can be modified by the caller to 15110// add HTTP headers to the request. 15111func (c *WebappsUpdateCall) Header() http.Header { 15112 if c.header_ == nil { 15113 c.header_ = make(http.Header) 15114 } 15115 return c.header_ 15116} 15117 15118func (c *WebappsUpdateCall) doRequest(alt string) (*http.Response, error) { 15119 reqHeaders := make(http.Header) 15120 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 15121 for k, v := range c.header_ { 15122 reqHeaders[k] = v 15123 } 15124 reqHeaders.Set("User-Agent", c.s.userAgent()) 15125 var body io.Reader = nil 15126 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 15127 if err != nil { 15128 return nil, err 15129 } 15130 reqHeaders.Set("Content-Type", "application/json") 15131 c.urlParams_.Set("alt", alt) 15132 c.urlParams_.Set("prettyPrint", "false") 15133 urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}") 15134 urls += "?" + c.urlParams_.Encode() 15135 req, err := http.NewRequest("PUT", urls, body) 15136 if err != nil { 15137 return nil, err 15138 } 15139 req.Header = reqHeaders 15140 googleapi.Expand(req.URL, map[string]string{ 15141 "enterpriseId": c.enterpriseId, 15142 "webAppId": c.webAppId, 15143 }) 15144 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15145} 15146 15147// Do executes the "androidenterprise.webapps.update" call. 15148// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 15149// code is an error. Response headers are in either 15150// *WebApp.ServerResponse.Header or (if a response was returned at all) 15151// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 15152// check whether the returned error was because http.StatusNotModified 15153// was returned. 15154func (c *WebappsUpdateCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 15155 gensupport.SetOptions(c.urlParams_, opts...) 15156 res, err := c.doRequest("json") 15157 if res != nil && res.StatusCode == http.StatusNotModified { 15158 if res.Body != nil { 15159 res.Body.Close() 15160 } 15161 return nil, &googleapi.Error{ 15162 Code: res.StatusCode, 15163 Header: res.Header, 15164 } 15165 } 15166 if err != nil { 15167 return nil, err 15168 } 15169 defer googleapi.CloseBody(res) 15170 if err := googleapi.CheckResponse(res); err != nil { 15171 return nil, err 15172 } 15173 ret := &WebApp{ 15174 ServerResponse: googleapi.ServerResponse{ 15175 Header: res.Header, 15176 HTTPStatusCode: res.StatusCode, 15177 }, 15178 } 15179 target := &ret 15180 if err := gensupport.DecodeResponse(target, res); err != nil { 15181 return nil, err 15182 } 15183 return ret, nil 15184 // { 15185 // "description": "Updates an existing web app.", 15186 // "httpMethod": "PUT", 15187 // "id": "androidenterprise.webapps.update", 15188 // "parameterOrder": [ 15189 // "enterpriseId", 15190 // "webAppId" 15191 // ], 15192 // "parameters": { 15193 // "enterpriseId": { 15194 // "description": "The ID of the enterprise.", 15195 // "location": "path", 15196 // "required": true, 15197 // "type": "string" 15198 // }, 15199 // "webAppId": { 15200 // "description": "The ID of the web app.", 15201 // "location": "path", 15202 // "required": true, 15203 // "type": "string" 15204 // } 15205 // }, 15206 // "path": "enterprises/{enterpriseId}/webApps/{webAppId}", 15207 // "request": { 15208 // "$ref": "WebApp" 15209 // }, 15210 // "response": { 15211 // "$ref": "WebApp" 15212 // }, 15213 // "scopes": [ 15214 // "https://www.googleapis.com/auth/androidenterprise" 15215 // ] 15216 // } 15217 15218} 15219