1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package androidmanagement provides access to the Android Management API. 8// 9// For product documentation, see: https://developers.google.com/android/management 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/androidmanagement/v1" 16// ... 17// ctx := context.Background() 18// androidmanagementService, err := androidmanagement.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// androidmanagementService, err := androidmanagement.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// androidmanagementService, err := androidmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package androidmanagement // import "google.golang.org/api/androidmanagement/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 = "androidmanagement:v1" 75const apiName = "androidmanagement" 76const apiVersion = "v1" 77const basePath = "https://androidmanagement.googleapis.com/" 78const mtlsBasePath = "https://androidmanagement.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // Manage Android devices and apps for your customers 83 AndroidmanagementScope = "https://www.googleapis.com/auth/androidmanagement" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/androidmanagement", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Enterprises = NewEnterprisesService(s) 120 s.SignupUrls = NewSignupUrlsService(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Enterprises *EnterprisesService 130 131 SignupUrls *SignupUrlsService 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewEnterprisesService(s *Service) *EnterprisesService { 142 rs := &EnterprisesService{s: s} 143 rs.Applications = NewEnterprisesApplicationsService(s) 144 rs.Devices = NewEnterprisesDevicesService(s) 145 rs.EnrollmentTokens = NewEnterprisesEnrollmentTokensService(s) 146 rs.Policies = NewEnterprisesPoliciesService(s) 147 rs.WebApps = NewEnterprisesWebAppsService(s) 148 rs.WebTokens = NewEnterprisesWebTokensService(s) 149 return rs 150} 151 152type EnterprisesService struct { 153 s *Service 154 155 Applications *EnterprisesApplicationsService 156 157 Devices *EnterprisesDevicesService 158 159 EnrollmentTokens *EnterprisesEnrollmentTokensService 160 161 Policies *EnterprisesPoliciesService 162 163 WebApps *EnterprisesWebAppsService 164 165 WebTokens *EnterprisesWebTokensService 166} 167 168func NewEnterprisesApplicationsService(s *Service) *EnterprisesApplicationsService { 169 rs := &EnterprisesApplicationsService{s: s} 170 return rs 171} 172 173type EnterprisesApplicationsService struct { 174 s *Service 175} 176 177func NewEnterprisesDevicesService(s *Service) *EnterprisesDevicesService { 178 rs := &EnterprisesDevicesService{s: s} 179 rs.Operations = NewEnterprisesDevicesOperationsService(s) 180 return rs 181} 182 183type EnterprisesDevicesService struct { 184 s *Service 185 186 Operations *EnterprisesDevicesOperationsService 187} 188 189func NewEnterprisesDevicesOperationsService(s *Service) *EnterprisesDevicesOperationsService { 190 rs := &EnterprisesDevicesOperationsService{s: s} 191 return rs 192} 193 194type EnterprisesDevicesOperationsService struct { 195 s *Service 196} 197 198func NewEnterprisesEnrollmentTokensService(s *Service) *EnterprisesEnrollmentTokensService { 199 rs := &EnterprisesEnrollmentTokensService{s: s} 200 return rs 201} 202 203type EnterprisesEnrollmentTokensService struct { 204 s *Service 205} 206 207func NewEnterprisesPoliciesService(s *Service) *EnterprisesPoliciesService { 208 rs := &EnterprisesPoliciesService{s: s} 209 return rs 210} 211 212type EnterprisesPoliciesService struct { 213 s *Service 214} 215 216func NewEnterprisesWebAppsService(s *Service) *EnterprisesWebAppsService { 217 rs := &EnterprisesWebAppsService{s: s} 218 return rs 219} 220 221type EnterprisesWebAppsService struct { 222 s *Service 223} 224 225func NewEnterprisesWebTokensService(s *Service) *EnterprisesWebTokensService { 226 rs := &EnterprisesWebTokensService{s: s} 227 return rs 228} 229 230type EnterprisesWebTokensService struct { 231 s *Service 232} 233 234func NewSignupUrlsService(s *Service) *SignupUrlsService { 235 rs := &SignupUrlsService{s: s} 236 return rs 237} 238 239type SignupUrlsService struct { 240 s *Service 241} 242 243// AdvancedSecurityOverrides: Security policies set to the most secure 244// values by default. To maintain the security posture of a device, we 245// don't recommend overriding any of the default values. 246type AdvancedSecurityOverrides struct { 247 // CommonCriteriaMode: Controls Common Criteria Mode—security 248 // standards defined in the Common Criteria for Information Technology 249 // Security Evaluation (https://www.commoncriteriaportal.org/) (CC). 250 // Enabling Common Criteria Mode increases certain security components 251 // on a device, including AES-GCM encryption of Bluetooth Long Term 252 // Keys, and Wi-Fi configuration stores.Warning: Common Criteria Mode 253 // enforces a strict security model typically only required for IT 254 // products used in national security systems and other highly sensitive 255 // organizations. Standard device use may be affected. Only enabled if 256 // required. 257 // 258 // Possible values: 259 // "COMMON_CRITERIA_MODE_UNSPECIFIED" - Unspecified. Defaults to 260 // COMMON_CRITERIA_MODE_DISABLED. 261 // "COMMON_CRITERIA_MODE_DISABLED" - Default. Disables Common Criteria 262 // Mode. 263 // "COMMON_CRITERIA_MODE_ENABLED" - Enables Common Criteria Mode. 264 CommonCriteriaMode string `json:"commonCriteriaMode,omitempty"` 265 266 // DeveloperSettings: Controls access to developer settings: developer 267 // options and safe boot. Replaces safeBootDisabled (deprecated) and 268 // debuggingFeaturesAllowed (deprecated). 269 // 270 // Possible values: 271 // "DEVELOPER_SETTINGS_UNSPECIFIED" - Unspecified. Defaults to 272 // DEVELOPER_SETTINGS_DISABLED. 273 // "DEVELOPER_SETTINGS_DISABLED" - Default. Disables all developer 274 // settings and prevents the user from accessing them. 275 // "DEVELOPER_SETTINGS_ALLOWED" - Allows all developer settings. The 276 // user can access and optionally configure the settings. 277 DeveloperSettings string `json:"developerSettings,omitempty"` 278 279 // GooglePlayProtectVerifyApps: Whether Google Play Protect verification 280 // (https://support.google.com/accounts/answer/2812853) is enforced. 281 // Replaces ensureVerifyAppsEnabled (deprecated). 282 // 283 // Possible values: 284 // "GOOGLE_PLAY_PROTECT_VERIFY_APPS_UNSPECIFIED" - Unspecified. 285 // Defaults to VERIFY_APPS_ENFORCED. 286 // "VERIFY_APPS_ENFORCED" - Default. Force-enables app verification. 287 // "VERIFY_APPS_USER_CHOICE" - Allows the user to choose whether to 288 // enable app verification. 289 GooglePlayProtectVerifyApps string `json:"googlePlayProtectVerifyApps,omitempty"` 290 291 // UntrustedAppsPolicy: The policy for untrusted apps (apps from unknown 292 // sources) enforced on the device. Replaces 293 // install_unknown_sources_allowed (deprecated). 294 // 295 // Possible values: 296 // "UNTRUSTED_APPS_POLICY_UNSPECIFIED" - Unspecified. Defaults to 297 // DISALLOW_INSTALL. 298 // "DISALLOW_INSTALL" - Default. Disallow untrusted app installs on 299 // entire device. 300 // "ALLOW_INSTALL_IN_PERSONAL_PROFILE_ONLY" - For devices with work 301 // profiles, allow untrusted app installs in the device's personal 302 // profile only. 303 // "ALLOW_INSTALL_DEVICE_WIDE" - Allow untrusted app installs on 304 // entire device. 305 UntrustedAppsPolicy string `json:"untrustedAppsPolicy,omitempty"` 306 307 // ForceSendFields is a list of field names (e.g. "CommonCriteriaMode") 308 // to unconditionally include in API requests. By default, fields with 309 // empty values are omitted from API requests. However, any non-pointer, 310 // non-interface field appearing in ForceSendFields will be sent to the 311 // server regardless of whether the field is empty or not. This may be 312 // used to include empty fields in Patch requests. 313 ForceSendFields []string `json:"-"` 314 315 // NullFields is a list of field names (e.g. "CommonCriteriaMode") to 316 // include in API requests with the JSON null value. By default, fields 317 // with empty values are omitted from API requests. However, any field 318 // with an empty value appearing in NullFields will be sent to the 319 // server as null. It is an error if a field in this list has a 320 // non-empty value. This may be used to include null fields in Patch 321 // requests. 322 NullFields []string `json:"-"` 323} 324 325func (s *AdvancedSecurityOverrides) MarshalJSON() ([]byte, error) { 326 type NoMethod AdvancedSecurityOverrides 327 raw := NoMethod(*s) 328 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 329} 330 331// AlwaysOnVpnPackage: Configuration for an always-on VPN connection. 332type AlwaysOnVpnPackage struct { 333 // LockdownEnabled: Disallows networking when the VPN is not connected. 334 LockdownEnabled bool `json:"lockdownEnabled,omitempty"` 335 336 // PackageName: The package name of the VPN app. 337 PackageName string `json:"packageName,omitempty"` 338 339 // ForceSendFields is a list of field names (e.g. "LockdownEnabled") to 340 // unconditionally include in API requests. By default, fields with 341 // empty values are omitted from API requests. However, any non-pointer, 342 // non-interface field appearing in ForceSendFields will be sent to the 343 // server regardless of whether the field is empty or not. This may be 344 // used to include empty fields in Patch requests. 345 ForceSendFields []string `json:"-"` 346 347 // NullFields is a list of field names (e.g. "LockdownEnabled") to 348 // include in API requests with the JSON null value. By default, fields 349 // with empty values are omitted from API requests. However, any field 350 // with an empty value appearing in NullFields will be sent to the 351 // server as null. It is an error if a field in this list has a 352 // non-empty value. This may be used to include null fields in Patch 353 // requests. 354 NullFields []string `json:"-"` 355} 356 357func (s *AlwaysOnVpnPackage) MarshalJSON() ([]byte, error) { 358 type NoMethod AlwaysOnVpnPackage 359 raw := NoMethod(*s) 360 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 361} 362 363// ApiLevelCondition: A compliance rule condition which is satisfied if 364// the Android Framework API level on the device doesn't meet a minimum 365// requirement. There can only be one rule with this type of condition 366// per policy. 367type ApiLevelCondition struct { 368 // MinApiLevel: The minimum desired Android Framework API level. If the 369 // device doesn't meet the minimum requirement, this condition is 370 // satisfied. Must be greater than zero. 371 MinApiLevel int64 `json:"minApiLevel,omitempty"` 372 373 // ForceSendFields is a list of field names (e.g. "MinApiLevel") to 374 // unconditionally include in API requests. By default, fields with 375 // empty values are omitted from API requests. However, any non-pointer, 376 // non-interface field appearing in ForceSendFields will be sent to the 377 // server regardless of whether the field is empty or not. This may be 378 // used to include empty fields in Patch requests. 379 ForceSendFields []string `json:"-"` 380 381 // NullFields is a list of field names (e.g. "MinApiLevel") to include 382 // in API requests with the JSON null value. By default, fields with 383 // empty values are omitted from API requests. However, any field with 384 // an empty value appearing in NullFields will be sent to the server as 385 // null. It is an error if a field in this list has a non-empty value. 386 // This may be used to include null fields in Patch requests. 387 NullFields []string `json:"-"` 388} 389 390func (s *ApiLevelCondition) MarshalJSON() ([]byte, error) { 391 type NoMethod ApiLevelCondition 392 raw := NoMethod(*s) 393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 394} 395 396// AppTrackInfo: Id to name association of a app track. 397type AppTrackInfo struct { 398 // TrackAlias: The track name associated with the trackId, set in the 399 // Play Console. The name is modifiable from Play Console. 400 TrackAlias string `json:"trackAlias,omitempty"` 401 402 // TrackId: The unmodifiable unique track identifier, taken from the 403 // releaseTrackId in the URL of the Play Console page that displays the 404 // app’s track information. 405 TrackId string `json:"trackId,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "TrackAlias") to 408 // unconditionally include in API requests. By default, fields with 409 // empty values are omitted from API requests. However, any non-pointer, 410 // non-interface field appearing in ForceSendFields will be sent to the 411 // server regardless of whether the field is empty or not. This may be 412 // used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "TrackAlias") to include in 416 // API requests with the JSON null value. By default, fields with empty 417 // values are omitted from API requests. However, any field with an 418 // empty value appearing in NullFields will be sent to the server as 419 // null. It is an error if a field in this list has a non-empty value. 420 // This may be used to include null fields in Patch requests. 421 NullFields []string `json:"-"` 422} 423 424func (s *AppTrackInfo) MarshalJSON() ([]byte, error) { 425 type NoMethod AppTrackInfo 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428} 429 430// Application: Information about an app. 431type Application struct { 432 // AppTracks: Application tracks visible to the enterprise. 433 AppTracks []*AppTrackInfo `json:"appTracks,omitempty"` 434 435 // ManagedProperties: The set of managed properties available to be 436 // pre-configured for the app. 437 ManagedProperties []*ManagedProperty `json:"managedProperties,omitempty"` 438 439 // Name: The name of the app in the form 440 // enterprises/{enterpriseId}/applications/{package_name}. 441 Name string `json:"name,omitempty"` 442 443 // Permissions: The permissions required by the app. 444 Permissions []*ApplicationPermission `json:"permissions,omitempty"` 445 446 // Title: The title of the app. Localized. 447 Title string `json:"title,omitempty"` 448 449 // ServerResponse contains the HTTP response code and headers from the 450 // server. 451 googleapi.ServerResponse `json:"-"` 452 453 // ForceSendFields is a list of field names (e.g. "AppTracks") to 454 // unconditionally include in API requests. By default, fields with 455 // empty values are omitted from API requests. However, any non-pointer, 456 // non-interface field appearing in ForceSendFields will be sent to the 457 // server regardless of whether the field is empty or not. This may be 458 // used to include empty fields in Patch requests. 459 ForceSendFields []string `json:"-"` 460 461 // NullFields is a list of field names (e.g. "AppTracks") to include in 462 // API requests with the JSON null value. By default, fields with empty 463 // values are omitted from API requests. However, any field with an 464 // empty value appearing in NullFields will be sent to the server as 465 // null. It is an error if a field in this list has a non-empty value. 466 // This may be used to include null fields in Patch requests. 467 NullFields []string `json:"-"` 468} 469 470func (s *Application) MarshalJSON() ([]byte, error) { 471 type NoMethod Application 472 raw := NoMethod(*s) 473 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 474} 475 476// ApplicationEvent: An app-related event. 477type ApplicationEvent struct { 478 // CreateTime: The creation time of the event. 479 CreateTime string `json:"createTime,omitempty"` 480 481 // EventType: App event type. 482 // 483 // Possible values: 484 // "APPLICATION_EVENT_TYPE_UNSPECIFIED" - This value is disallowed. 485 // "INSTALLED" - The app was installed. 486 // "CHANGED" - The app was changed, for example, a component was 487 // enabled or disabled. 488 // "DATA_CLEARED" - The app data was cleared. 489 // "REMOVED" - The app was removed. 490 // "REPLACED" - A new version of the app has been installed, replacing 491 // the old version. 492 // "RESTARTED" - The app was restarted. 493 // "PINNED" - The app was pinned to the foreground. 494 // "UNPINNED" - The app was unpinned. 495 EventType string `json:"eventType,omitempty"` 496 497 // ForceSendFields is a list of field names (e.g. "CreateTime") to 498 // unconditionally include in API requests. By default, fields with 499 // empty values are omitted from API requests. However, any non-pointer, 500 // non-interface field appearing in ForceSendFields will be sent to the 501 // server regardless of whether the field is empty or not. This may be 502 // used to include empty fields in Patch requests. 503 ForceSendFields []string `json:"-"` 504 505 // NullFields is a list of field names (e.g. "CreateTime") to include in 506 // API requests with the JSON null value. By default, fields with empty 507 // values are omitted from API requests. However, any field with an 508 // empty value appearing in NullFields will be sent to the server as 509 // null. It is an error if a field in this list has a non-empty value. 510 // This may be used to include null fields in Patch requests. 511 NullFields []string `json:"-"` 512} 513 514func (s *ApplicationEvent) MarshalJSON() ([]byte, error) { 515 type NoMethod ApplicationEvent 516 raw := NoMethod(*s) 517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 518} 519 520// ApplicationPermission: A permission required by the app. 521type ApplicationPermission struct { 522 // Description: A longer description of the permission, providing more 523 // detail on what it affects. Localized. 524 Description string `json:"description,omitempty"` 525 526 // Name: The name of the permission. Localized. 527 Name string `json:"name,omitempty"` 528 529 // PermissionId: An opaque string uniquely identifying the permission. 530 // Not localized. 531 PermissionId string `json:"permissionId,omitempty"` 532 533 // ForceSendFields is a list of field names (e.g. "Description") to 534 // unconditionally include in API requests. By default, fields with 535 // empty values are omitted from API requests. However, any non-pointer, 536 // non-interface field appearing in ForceSendFields will be sent to the 537 // server regardless of whether the field is empty or not. This may be 538 // used to include empty fields in Patch requests. 539 ForceSendFields []string `json:"-"` 540 541 // NullFields is a list of field names (e.g. "Description") to include 542 // in API requests with the JSON null value. By default, fields with 543 // empty values are omitted from API requests. However, any field with 544 // an empty value appearing in NullFields will be sent to the server as 545 // null. It is an error if a field in this list has a non-empty value. 546 // This may be used to include null fields in Patch requests. 547 NullFields []string `json:"-"` 548} 549 550func (s *ApplicationPermission) MarshalJSON() ([]byte, error) { 551 type NoMethod ApplicationPermission 552 raw := NoMethod(*s) 553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 554} 555 556// ApplicationPolicy: Policy for an individual app. 557type ApplicationPolicy struct { 558 // AccessibleTrackIds: List of the app’s track IDs that a device 559 // belonging to the enterprise can access. If the list contains multiple 560 // track IDs, devices receive the latest version among all accessible 561 // tracks. If the list contains no track IDs, devices only have access 562 // to the app’s production track. More details about each track are 563 // available in AppTrackInfo. 564 AccessibleTrackIds []string `json:"accessibleTrackIds,omitempty"` 565 566 // AutoUpdateMode: This feature is not generally available yet. 567 // 568 // Possible values: 569 // "AUTO_UPDATE_MODE_UNSPECIFIED" - This feature is not generally 570 // available yet. 571 // "AUTO_UPDATE_DEFAULT" - This feature is not generally available 572 // yet. 573 // "AUTO_UPDATE_POSTPONED" - This feature is not generally available 574 // yet. 575 // "AUTO_UPDATE_HIGH_PRIORITY" - This feature is not generally 576 // available yet. 577 AutoUpdateMode string `json:"autoUpdateMode,omitempty"` 578 579 // ConnectedWorkAndPersonalApp: Controls whether the app can communicate 580 // with itself across a device’s work and personal profiles, subject 581 // to user consent. 582 // 583 // Possible values: 584 // "CONNECTED_WORK_AND_PERSONAL_APP_UNSPECIFIED" - Unspecified. 585 // Defaults to CONNECTED_WORK_AND_PERSONAL_APPS_DISALLOWED. 586 // "CONNECTED_WORK_AND_PERSONAL_APP_DISALLOWED" - Default. Prevents 587 // the app from communicating cross-profile. 588 // "CONNECTED_WORK_AND_PERSONAL_APP_ALLOWED" - Allows the app to 589 // communicate across profiles after receiving user consent. 590 ConnectedWorkAndPersonalApp string `json:"connectedWorkAndPersonalApp,omitempty"` 591 592 // DefaultPermissionPolicy: The default policy for all permissions 593 // requested by the app. If specified, this overrides the policy-level 594 // default_permission_policy which applies to all apps. It does not 595 // override the permission_grants which applies to all apps. 596 // 597 // Possible values: 598 // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no 599 // policy is specified for a permission at any level, then the PROMPT 600 // behavior is used by default. 601 // "PROMPT" - Prompt the user to grant a permission. 602 // "GRANT" - Automatically grant a permission. 603 // "DENY" - Automatically deny a permission. 604 DefaultPermissionPolicy string `json:"defaultPermissionPolicy,omitempty"` 605 606 // DelegatedScopes: The scopes delegated to the app from Android Device 607 // Policy. 608 // 609 // Possible values: 610 // "DELEGATED_SCOPE_UNSPECIFIED" - No delegation scope specified. 611 // "CERT_INSTALL" - Grants access to certificate installation and 612 // management. 613 // "MANAGED_CONFIGURATIONS" - Grants access to managed configurations 614 // management. 615 // "BLOCK_UNINSTALL" - Grants access to blocking uninstallation. 616 // "PERMISSION_GRANT" - Grants access to permission policy and 617 // permission grant state. 618 // "PACKAGE_ACCESS" - Grants access to package access state. 619 // "ENABLE_SYSTEM_APP" - Grants access for enabling system apps. 620 DelegatedScopes []string `json:"delegatedScopes,omitempty"` 621 622 // Disabled: Whether the app is disabled. When disabled, the app data is 623 // still preserved. 624 Disabled bool `json:"disabled,omitempty"` 625 626 // InstallType: The type of installation to perform. 627 // 628 // Possible values: 629 // "INSTALL_TYPE_UNSPECIFIED" - Unspecified. Defaults to AVAILABLE. 630 // "PREINSTALLED" - The app is automatically installed and can be 631 // removed by the user. 632 // "FORCE_INSTALLED" - The app is automatically installed and can't be 633 // removed by the user. 634 // "BLOCKED" - The app is blocked and can't be installed. If the app 635 // was installed under a previous policy, it will be uninstalled. 636 // "AVAILABLE" - The app is available to install. 637 // "REQUIRED_FOR_SETUP" - The app is automatically installed and can't 638 // be removed by the user and will prevent setup from completion until 639 // installation is complete. 640 // "KIOSK" - The app is automatically installed in kiosk mode: it's 641 // set as the preferred home intent and whitelisted for lock task mode. 642 // Device setup won't complete until the app is installed. After 643 // installation, users won't be able to remove the app. You can only set 644 // this installType for one app per policy. When this is present in the 645 // policy, status bar will be automatically disabled. 646 InstallType string `json:"installType,omitempty"` 647 648 // LockTaskAllowed: Whether the app is allowed to lock itself in 649 // full-screen mode. DEPRECATED. Use InstallType KIOSK or 650 // kioskCustomLauncherEnabled to to configure a dedicated device. 651 LockTaskAllowed bool `json:"lockTaskAllowed,omitempty"` 652 653 // ManagedConfiguration: Managed configuration applied to the app. The 654 // format for the configuration is dictated by the ManagedProperty 655 // values supported by the app. Each field name in the managed 656 // configuration must match the key field of the ManagedProperty. The 657 // field value must be compatible with the type of the ManagedProperty: 658 // *type* *JSON value* BOOL true or false STRING string INTEGER number 659 // CHOICE string MULTISELECT array of strings HIDDEN string BUNDLE_ARRAY 660 // array of objects 661 ManagedConfiguration googleapi.RawMessage `json:"managedConfiguration,omitempty"` 662 663 // ManagedConfigurationTemplate: The managed configurations template for 664 // the app, saved from the managed configurations iframe. This field is 665 // ignored if managed_configuration is set. 666 ManagedConfigurationTemplate *ManagedConfigurationTemplate `json:"managedConfigurationTemplate,omitempty"` 667 668 // MinimumVersionCode: The minimum version of the app that runs on the 669 // device. If set, the device attempts to update the app to at least 670 // this version code. If the app is not up-to-date, the device will 671 // contain a NonComplianceDetail with non_compliance_reason set to 672 // APP_NOT_UPDATED. The app must already be published to Google Play 673 // with a version code greater than or equal to this value. At most 20 674 // apps may specify a minimum version code per policy. 675 MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"` 676 677 // PackageName: The package name of the app. For example, 678 // com.google.android.youtube for the YouTube app. 679 PackageName string `json:"packageName,omitempty"` 680 681 // PermissionGrants: Explicit permission grants or denials for the app. 682 // These values override the default_permission_policy and 683 // permission_grants which apply to all apps. 684 PermissionGrants []*PermissionGrant `json:"permissionGrants,omitempty"` 685 686 // ForceSendFields is a list of field names (e.g. "AccessibleTrackIds") 687 // to unconditionally include in API requests. By default, fields with 688 // empty values are omitted from API requests. However, any non-pointer, 689 // non-interface field appearing in ForceSendFields will be sent to the 690 // server regardless of whether the field is empty or not. This may be 691 // used to include empty fields in Patch requests. 692 ForceSendFields []string `json:"-"` 693 694 // NullFields is a list of field names (e.g. "AccessibleTrackIds") to 695 // include in API requests with the JSON null value. By default, fields 696 // with empty values are omitted from API requests. However, any field 697 // with an empty value appearing in NullFields will be sent to the 698 // server as null. It is an error if a field in this list has a 699 // non-empty value. This may be used to include null fields in Patch 700 // requests. 701 NullFields []string `json:"-"` 702} 703 704func (s *ApplicationPolicy) MarshalJSON() ([]byte, error) { 705 type NoMethod ApplicationPolicy 706 raw := NoMethod(*s) 707 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 708} 709 710// ApplicationReport: Information reported about an installed app. 711type ApplicationReport struct { 712 // ApplicationSource: The source of the package. 713 // 714 // Possible values: 715 // "APPLICATION_SOURCE_UNSPECIFIED" - The app was sideloaded from an 716 // unspecified source. 717 // "SYSTEM_APP_FACTORY_VERSION" - This is a system app from the 718 // device's factory image. 719 // "SYSTEM_APP_UPDATED_VERSION" - This is an updated system app. 720 // "INSTALLED_FROM_PLAY_STORE" - The app was installed from the Google 721 // Play Store. 722 ApplicationSource string `json:"applicationSource,omitempty"` 723 724 // DisplayName: The display name of the app. 725 DisplayName string `json:"displayName,omitempty"` 726 727 // Events: List of app events. The most recent 20 events are stored in 728 // the list. 729 Events []*ApplicationEvent `json:"events,omitempty"` 730 731 // InstallerPackageName: The package name of the app that installed this 732 // app. 733 InstallerPackageName string `json:"installerPackageName,omitempty"` 734 735 // KeyedAppStates: List of keyed app states reported by the app. 736 KeyedAppStates []*KeyedAppState `json:"keyedAppStates,omitempty"` 737 738 // PackageName: Package name of the app. 739 PackageName string `json:"packageName,omitempty"` 740 741 // PackageSha256Hash: The SHA-256 hash of the app's APK file, which can 742 // be used to verify the app hasn't been modified. Each byte of the hash 743 // value is represented as a two-digit hexadecimal number. 744 PackageSha256Hash string `json:"packageSha256Hash,omitempty"` 745 746 // SigningKeyCertFingerprints: The SHA-1 hash of each 747 // android.content.pm.Signature 748 // (https://developer.android.com/reference/android/content/pm/Signature.html) 749 // associated with the app package. Each byte of each hash value is 750 // represented as a two-digit hexadecimal number. 751 SigningKeyCertFingerprints []string `json:"signingKeyCertFingerprints,omitempty"` 752 753 // State: Application state. 754 // 755 // Possible values: 756 // "APPLICATION_STATE_UNSPECIFIED" - App state is unspecified 757 // "REMOVED" - App was removed from the device 758 // "INSTALLED" - App is installed on the device 759 State string `json:"state,omitempty"` 760 761 // VersionCode: The app version code, which can be used to determine 762 // whether one version is more recent than another. 763 VersionCode int64 `json:"versionCode,omitempty"` 764 765 // VersionName: The app version as displayed to the user. 766 VersionName string `json:"versionName,omitempty"` 767 768 // ForceSendFields is a list of field names (e.g. "ApplicationSource") 769 // to unconditionally include in API requests. By default, fields with 770 // empty values are omitted from API requests. However, any non-pointer, 771 // non-interface field appearing in ForceSendFields will be sent to the 772 // server regardless of whether the field is empty or not. This may be 773 // used to include empty fields in Patch requests. 774 ForceSendFields []string `json:"-"` 775 776 // NullFields is a list of field names (e.g. "ApplicationSource") to 777 // include in API requests with the JSON null value. By default, fields 778 // with empty values are omitted from API requests. However, any field 779 // with an empty value appearing in NullFields will be sent to the 780 // server as null. It is an error if a field in this list has a 781 // non-empty value. This may be used to include null fields in Patch 782 // requests. 783 NullFields []string `json:"-"` 784} 785 786func (s *ApplicationReport) MarshalJSON() ([]byte, error) { 787 type NoMethod ApplicationReport 788 raw := NoMethod(*s) 789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 790} 791 792// ApplicationReportingSettings: Settings controlling the behavior of 793// application reports. 794type ApplicationReportingSettings struct { 795 // IncludeRemovedApps: Whether removed apps are included in application 796 // reports. 797 IncludeRemovedApps bool `json:"includeRemovedApps,omitempty"` 798 799 // ForceSendFields is a list of field names (e.g. "IncludeRemovedApps") 800 // to unconditionally include in API requests. By default, fields with 801 // empty values are omitted from API requests. However, any non-pointer, 802 // non-interface field appearing in ForceSendFields will be sent to the 803 // server regardless of whether the field is empty or not. This may be 804 // used to include empty fields in Patch requests. 805 ForceSendFields []string `json:"-"` 806 807 // NullFields is a list of field names (e.g. "IncludeRemovedApps") to 808 // include in API requests with the JSON null value. By default, fields 809 // with empty values are omitted from API requests. However, any field 810 // with an empty value appearing in NullFields will be sent to the 811 // server as null. It is an error if a field in this list has a 812 // non-empty value. This may be used to include null fields in Patch 813 // requests. 814 NullFields []string `json:"-"` 815} 816 817func (s *ApplicationReportingSettings) MarshalJSON() ([]byte, error) { 818 type NoMethod ApplicationReportingSettings 819 raw := NoMethod(*s) 820 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 821} 822 823// BlockAction: An action to block access to apps and data on a fully 824// managed device or in a work profile. This action also triggers a 825// device or work profile to displays a user-facing notification with 826// information (where possible) on how to correct the compliance issue. 827// Note: wipeAction must also be specified. 828type BlockAction struct { 829 // BlockAfterDays: Number of days the policy is non-compliant before the 830 // device or work profile is blocked. To block access immediately, set 831 // to 0. blockAfterDays must be less than wipeAfterDays. 832 BlockAfterDays int64 `json:"blockAfterDays,omitempty"` 833 834 // BlockScope: Specifies the scope of this BlockAction. Only applicable 835 // to devices that are company-owned. 836 // 837 // Possible values: 838 // "BLOCK_SCOPE_UNSPECIFIED" - Unspecified. Defaults to 839 // BLOCK_SCOPE_WORK_PROFILE. 840 // "BLOCK_SCOPE_WORK_PROFILE" - Block action is only applied to apps 841 // in the work profile. Apps in the personal profile are unaffected. 842 // "BLOCK_SCOPE_DEVICE" - Block action is applied to the entire 843 // device, including apps in the personal profile. 844 BlockScope string `json:"blockScope,omitempty"` 845 846 // ForceSendFields is a list of field names (e.g. "BlockAfterDays") 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. "BlockAfterDays") to 855 // include in API requests with the JSON null value. By default, fields 856 // with empty values are omitted from API requests. However, any field 857 // with an empty value appearing in NullFields will be sent to the 858 // server as null. It is an error if a field in this list has a 859 // non-empty value. This may be used to include null fields in Patch 860 // requests. 861 NullFields []string `json:"-"` 862} 863 864func (s *BlockAction) MarshalJSON() ([]byte, error) { 865 type NoMethod BlockAction 866 raw := NoMethod(*s) 867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 868} 869 870// ChoosePrivateKeyRule: Controls apps' access to private keys. The rule 871// determines which private key, if any, Android Device Policy grants to 872// the specified app. Access is granted either when the app calls 873// KeyChain.choosePrivateKeyAlias 874// (https://developer.android.com/reference/android/security/KeyChain#choosePrivateKeyAlias%28android.app.Activity,%20android.security.KeyChainAliasCallback,%20java.lang.String[],%20java.security.Principal[],%20java.lang.String,%20int,%20java.lang.String%29) 875// (or any overloads) to request a private key alias for a given URL, or 876// for rules that are not URL-specific (that is, if urlPattern is not 877// set, or set to the empty string or .*) on Android 11 and above, 878// directly so that the app can call KeyChain.getPrivateKey 879// (https://developer.android.com/reference/android/security/KeyChain#getPrivateKey%28android.content.Context,%20java.lang.String%29), 880// without first having to call KeyChain.choosePrivateKeyAlias.When an 881// app calls KeyChain.choosePrivateKeyAlias if more than one 882// choosePrivateKeyRules matches, the last matching rule defines which 883// key alias to return. 884type ChoosePrivateKeyRule struct { 885 // PackageNames: The package names to which this rule applies. The hash 886 // of the signing certificate for each app is verified against the hash 887 // provided by Play. If no package names are specified, then the alias 888 // is provided to all apps that call KeyChain.choosePrivateKeyAlias 889 // (https://developer.android.com/reference/android/security/KeyChain#choosePrivateKeyAlias%28android.app.Activity,%20android.security.KeyChainAliasCallback,%20java.lang.String[],%20java.security.Principal[],%20java.lang.String,%20int,%20java.lang.String%29) 890 // or any overloads (but not without calling 891 // KeyChain.choosePrivateKeyAlias, even on Android 11 and above). Any 892 // app with the same Android UID as a package specified here will have 893 // access when they call KeyChain.choosePrivateKeyAlias. 894 PackageNames []string `json:"packageNames,omitempty"` 895 896 // PrivateKeyAlias: The alias of the private key to be used. 897 PrivateKeyAlias string `json:"privateKeyAlias,omitempty"` 898 899 // UrlPattern: The URL pattern to match against the URL of the request. 900 // If not set or empty, it matches all URLs. This uses the regular 901 // expression syntax of java.util.regex.Pattern. 902 UrlPattern string `json:"urlPattern,omitempty"` 903 904 // ForceSendFields is a list of field names (e.g. "PackageNames") to 905 // unconditionally include in API requests. By default, fields with 906 // empty values are omitted from API requests. However, any non-pointer, 907 // non-interface field appearing in ForceSendFields will be sent to the 908 // server regardless of whether the field is empty or not. This may be 909 // used to include empty fields in Patch requests. 910 ForceSendFields []string `json:"-"` 911 912 // NullFields is a list of field names (e.g. "PackageNames") to include 913 // in API requests with the JSON null value. By default, fields with 914 // empty values are omitted from API requests. However, any field with 915 // an empty value appearing in NullFields will be sent to the server as 916 // null. It is an error if a field in this list has a non-empty value. 917 // This may be used to include null fields in Patch requests. 918 NullFields []string `json:"-"` 919} 920 921func (s *ChoosePrivateKeyRule) MarshalJSON() ([]byte, error) { 922 type NoMethod ChoosePrivateKeyRule 923 raw := NoMethod(*s) 924 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 925} 926 927// Command: A command. 928type Command struct { 929 // CreateTime: The timestamp at which the command was created. The 930 // timestamp is automatically generated by the server. 931 CreateTime string `json:"createTime,omitempty"` 932 933 // Duration: The duration for which the command is valid. The command 934 // will expire if not executed by the device during this time. The 935 // default duration if unspecified is ten minutes. There is no maximum 936 // duration. 937 Duration string `json:"duration,omitempty"` 938 939 // ErrorCode: If the command failed, an error code explaining the 940 // failure. This is not set when the command is cancelled by the caller. 941 // 942 // Possible values: 943 // "COMMAND_ERROR_CODE_UNSPECIFIED" - There was no error. 944 // "UNKNOWN" - An unknown error occurred. 945 // "API_LEVEL" - The API level of the device does not support this 946 // command. 947 // "MANAGEMENT_MODE" - The management mode (profile owner, device 948 // owner, etc.) does not support the command. 949 // "INVALID_VALUE" - The command has an invalid parameter value. 950 // "UNSUPPORTED" - The device doesn't support the command. Updating 951 // Android Device Policy to the latest version may resolve the issue. 952 ErrorCode string `json:"errorCode,omitempty"` 953 954 // NewPassword: For commands of type RESET_PASSWORD, optionally 955 // specifies the new password. 956 NewPassword string `json:"newPassword,omitempty"` 957 958 // ResetPasswordFlags: For commands of type RESET_PASSWORD, optionally 959 // specifies flags. 960 // 961 // Possible values: 962 // "RESET_PASSWORD_FLAG_UNSPECIFIED" - This value is ignored. 963 // "REQUIRE_ENTRY" - Don't allow other admins to change the password 964 // again until the user has entered it. 965 // "DO_NOT_ASK_CREDENTIALS_ON_BOOT" - Don't ask for user credentials 966 // on device boot. 967 // "LOCK_NOW" - Lock the device after password reset. 968 ResetPasswordFlags []string `json:"resetPasswordFlags,omitempty"` 969 970 // Type: The type of the command. 971 // 972 // Possible values: 973 // "COMMAND_TYPE_UNSPECIFIED" - This value is disallowed. 974 // "LOCK" - Lock the device, as if the lock screen timeout had 975 // expired. 976 // "RESET_PASSWORD" - Reset the user's password. 977 // "REBOOT" - Reboot the device. Only supported on fully managed 978 // devices running Android 7.0 (API level 24) or higher. 979 // "RELINQUISH_OWNERSHIP" - Removes the work profile and all policies 980 // from a company-owned Android 8.0+ device, relinquishing the device 981 // for personal use. Apps and data associated with the personal 982 // profile(s) are preserved. The device will be deleted from the server 983 // after it acknowledges the command. 984 Type string `json:"type,omitempty"` 985 986 // UserName: The resource name of the user that owns the device in the 987 // form enterprises/{enterpriseId}/users/{userId}. This is automatically 988 // generated by the server based on the device the command is sent to. 989 UserName string `json:"userName,omitempty"` 990 991 // ForceSendFields is a list of field names (e.g. "CreateTime") to 992 // unconditionally include in API requests. By default, fields with 993 // empty values are omitted from API requests. However, any non-pointer, 994 // non-interface field appearing in ForceSendFields will be sent to the 995 // server regardless of whether the field is empty or not. This may be 996 // used to include empty fields in Patch requests. 997 ForceSendFields []string `json:"-"` 998 999 // NullFields is a list of field names (e.g. "CreateTime") to include in 1000 // API requests with the JSON null value. By default, fields with empty 1001 // values are omitted from API requests. However, any field with an 1002 // empty value appearing in NullFields will be sent to the server as 1003 // null. It is an error if a field in this list has a non-empty value. 1004 // This may be used to include null fields in Patch requests. 1005 NullFields []string `json:"-"` 1006} 1007 1008func (s *Command) MarshalJSON() ([]byte, error) { 1009 type NoMethod Command 1010 raw := NoMethod(*s) 1011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1012} 1013 1014// CommonCriteriaModeInfo: Information about Common Criteria 1015// Mode—security standards defined in the Common Criteria for 1016// Information Technology Security Evaluation 1017// (https://www.commoncriteriaportal.org/) (CC).This information is only 1018// available if statusReportingSettings.commonCriteriaModeEnabled is 1019// true in the device's policy. 1020type CommonCriteriaModeInfo struct { 1021 // CommonCriteriaModeStatus: Whether Common Criteria Mode is enabled. 1022 // 1023 // Possible values: 1024 // "COMMON_CRITERIA_MODE_STATUS_UNKNOWN" - Unknown status. 1025 // "COMMON_CRITERIA_MODE_DISABLED" - Common Criteria Mode is currently 1026 // disabled. 1027 // "COMMON_CRITERIA_MODE_ENABLED" - Common Criteria Mode is currently 1028 // enabled. 1029 CommonCriteriaModeStatus string `json:"commonCriteriaModeStatus,omitempty"` 1030 1031 // ForceSendFields is a list of field names (e.g. 1032 // "CommonCriteriaModeStatus") to unconditionally include in API 1033 // requests. By default, fields with empty values are omitted from API 1034 // requests. However, any non-pointer, non-interface field appearing in 1035 // ForceSendFields will be sent to the server regardless of whether the 1036 // field is empty or not. This may be used to include empty fields in 1037 // Patch requests. 1038 ForceSendFields []string `json:"-"` 1039 1040 // NullFields is a list of field names (e.g. "CommonCriteriaModeStatus") 1041 // to include in API requests with the JSON null value. By default, 1042 // fields with empty values are omitted from API requests. However, any 1043 // field with an empty value appearing in NullFields will be sent to the 1044 // server as null. It is an error if a field in this list has a 1045 // non-empty value. This may be used to include null fields in Patch 1046 // requests. 1047 NullFields []string `json:"-"` 1048} 1049 1050func (s *CommonCriteriaModeInfo) MarshalJSON() ([]byte, error) { 1051 type NoMethod CommonCriteriaModeInfo 1052 raw := NoMethod(*s) 1053 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1054} 1055 1056// ComplianceRule: A rule declaring which mitigating actions to take 1057// when a device is not compliant with its policy. For every rule, there 1058// is always an implicit mitigating action to set policy_compliant to 1059// false for the Device resource, and display a message on the device 1060// indicating that the device is not compliant with its policy. Other 1061// mitigating actions may optionally be taken as well, depending on the 1062// field values in the rule. 1063type ComplianceRule struct { 1064 // ApiLevelCondition: A condition which is satisfied if the Android 1065 // Framework API level on the device doesn't meet a minimum requirement. 1066 ApiLevelCondition *ApiLevelCondition `json:"apiLevelCondition,omitempty"` 1067 1068 // DisableApps: If set to true, the rule includes a mitigating action to 1069 // disable apps so that the device is effectively disabled, but app data 1070 // is preserved. If the device is running an app in locked task mode, 1071 // the app will be closed and a UI showing the reason for non-compliance 1072 // will be displayed. 1073 DisableApps bool `json:"disableApps,omitempty"` 1074 1075 // NonComplianceDetailCondition: A condition which is satisfied if there 1076 // exists any matching NonComplianceDetail for the device. 1077 NonComplianceDetailCondition *NonComplianceDetailCondition `json:"nonComplianceDetailCondition,omitempty"` 1078 1079 // PackageNamesToDisable: If set, the rule includes a mitigating action 1080 // to disable apps specified in the list, but app data is preserved. 1081 PackageNamesToDisable []string `json:"packageNamesToDisable,omitempty"` 1082 1083 // ForceSendFields is a list of field names (e.g. "ApiLevelCondition") 1084 // to unconditionally include in API requests. By default, fields with 1085 // empty values are omitted from API requests. However, any non-pointer, 1086 // non-interface field appearing in ForceSendFields will be sent to the 1087 // server regardless of whether the field is empty or not. This may be 1088 // used to include empty fields in Patch requests. 1089 ForceSendFields []string `json:"-"` 1090 1091 // NullFields is a list of field names (e.g. "ApiLevelCondition") to 1092 // include in API requests with the JSON null value. By default, fields 1093 // with empty values are omitted from API requests. However, any field 1094 // with an empty value appearing in NullFields will be sent to the 1095 // server as null. It is an error if a field in this list has a 1096 // non-empty value. This may be used to include null fields in Patch 1097 // requests. 1098 NullFields []string `json:"-"` 1099} 1100 1101func (s *ComplianceRule) MarshalJSON() ([]byte, error) { 1102 type NoMethod ComplianceRule 1103 raw := NoMethod(*s) 1104 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1105} 1106 1107// ContactInfo: Contact details for LaForge enterprises. 1108type ContactInfo struct { 1109 // ContactEmail: Email address for a point of contact, which will be 1110 // used to send important announcements related to managed Google Play. 1111 ContactEmail string `json:"contactEmail,omitempty"` 1112 1113 // DataProtectionOfficerEmail: The email of the data protection officer. 1114 // The email is validated but not verified. 1115 DataProtectionOfficerEmail string `json:"dataProtectionOfficerEmail,omitempty"` 1116 1117 // DataProtectionOfficerName: The name of the data protection officer. 1118 DataProtectionOfficerName string `json:"dataProtectionOfficerName,omitempty"` 1119 1120 // DataProtectionOfficerPhone: The phone number of the data protection 1121 // officer The phone number is validated but not verified. 1122 DataProtectionOfficerPhone string `json:"dataProtectionOfficerPhone,omitempty"` 1123 1124 // EuRepresentativeEmail: The email of the EU representative. The email 1125 // is validated but not verified. 1126 EuRepresentativeEmail string `json:"euRepresentativeEmail,omitempty"` 1127 1128 // EuRepresentativeName: The name of the EU representative. 1129 EuRepresentativeName string `json:"euRepresentativeName,omitempty"` 1130 1131 // EuRepresentativePhone: The phone number of the EU representative. The 1132 // phone number is validated but not verified. 1133 EuRepresentativePhone string `json:"euRepresentativePhone,omitempty"` 1134 1135 // ForceSendFields is a list of field names (e.g. "ContactEmail") to 1136 // unconditionally include in API requests. By default, fields with 1137 // empty values are omitted from API requests. However, any non-pointer, 1138 // non-interface field appearing in ForceSendFields will be sent to the 1139 // server regardless of whether the field is empty or not. This may be 1140 // used to include empty fields in Patch requests. 1141 ForceSendFields []string `json:"-"` 1142 1143 // NullFields is a list of field names (e.g. "ContactEmail") to include 1144 // in API requests with the JSON null value. By default, fields with 1145 // empty values are omitted from API requests. However, any field with 1146 // an empty value appearing in NullFields will be sent to the server as 1147 // null. It is an error if a field in this list has a non-empty value. 1148 // This may be used to include null fields in Patch requests. 1149 NullFields []string `json:"-"` 1150} 1151 1152func (s *ContactInfo) MarshalJSON() ([]byte, error) { 1153 type NoMethod ContactInfo 1154 raw := NoMethod(*s) 1155 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1156} 1157 1158// ContentProviderEndpoint: This feature is not generally available. 1159type ContentProviderEndpoint struct { 1160 // PackageName: This feature is not generally available. 1161 PackageName string `json:"packageName,omitempty"` 1162 1163 // SigningCertsSha256: Required. This feature is not generally 1164 // available. 1165 SigningCertsSha256 []string `json:"signingCertsSha256,omitempty"` 1166 1167 // Uri: This feature is not generally available. 1168 Uri string `json:"uri,omitempty"` 1169 1170 // ForceSendFields is a list of field names (e.g. "PackageName") to 1171 // unconditionally include in API requests. By default, fields with 1172 // empty values are omitted from API requests. However, any non-pointer, 1173 // non-interface field appearing in ForceSendFields will be sent to the 1174 // server regardless of whether the field is empty or not. This may be 1175 // used to include empty fields in Patch requests. 1176 ForceSendFields []string `json:"-"` 1177 1178 // NullFields is a list of field names (e.g. "PackageName") to include 1179 // in API requests with the JSON null value. By default, fields with 1180 // empty values are omitted from API requests. However, any field with 1181 // an empty value appearing in NullFields will be sent to the server as 1182 // null. It is an error if a field in this list has a non-empty value. 1183 // This may be used to include null fields in Patch requests. 1184 NullFields []string `json:"-"` 1185} 1186 1187func (s *ContentProviderEndpoint) MarshalJSON() ([]byte, error) { 1188 type NoMethod ContentProviderEndpoint 1189 raw := NoMethod(*s) 1190 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1191} 1192 1193// Date: Represents a whole or partial calendar date, such as a 1194// birthday. The time of day and time zone are either specified 1195// elsewhere or are insignificant. The date is relative to the Gregorian 1196// Calendar. This can represent one of the following: A full date, with 1197// non-zero year, month, and day values A month and day value, with a 1198// zero year, such as an anniversary A year on its own, with zero month 1199// and day values A year and month value, with a zero day, such as a 1200// credit card expiration dateRelated types are google.type.TimeOfDay 1201// and google.protobuf.Timestamp. 1202type Date struct { 1203 // Day: Day of a month. Must be from 1 to 31 and valid for the year and 1204 // month, or 0 to specify a year by itself or a year and month where the 1205 // day isn't significant. 1206 Day int64 `json:"day,omitempty"` 1207 1208 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year 1209 // without a month and day. 1210 Month int64 `json:"month,omitempty"` 1211 1212 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a 1213 // date without a year. 1214 Year int64 `json:"year,omitempty"` 1215 1216 // ForceSendFields is a list of field names (e.g. "Day") to 1217 // unconditionally include in API requests. By default, fields with 1218 // empty values are omitted from API requests. However, any non-pointer, 1219 // non-interface field appearing in ForceSendFields will be sent to the 1220 // server regardless of whether the field is empty or not. This may be 1221 // used to include empty fields in Patch requests. 1222 ForceSendFields []string `json:"-"` 1223 1224 // NullFields is a list of field names (e.g. "Day") to include in API 1225 // requests with the JSON null value. By default, fields with empty 1226 // values are omitted from API requests. However, any field with an 1227 // empty value appearing in NullFields will be sent to the server as 1228 // null. It is an error if a field in this list has a non-empty value. 1229 // This may be used to include null fields in Patch requests. 1230 NullFields []string `json:"-"` 1231} 1232 1233func (s *Date) MarshalJSON() ([]byte, error) { 1234 type NoMethod Date 1235 raw := NoMethod(*s) 1236 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1237} 1238 1239// Device: A device owned by an enterprise. Unless otherwise noted, all 1240// fields are read-only and can't be modified by 1241// enterprises.devices.patch. 1242type Device struct { 1243 // ApiLevel: The API level of the Android platform version running on 1244 // the device. 1245 ApiLevel int64 `json:"apiLevel,omitempty"` 1246 1247 // ApplicationReports: Reports for apps installed on the device. This 1248 // information is only available when application_reports_enabled is 1249 // true in the device's policy. 1250 ApplicationReports []*ApplicationReport `json:"applicationReports,omitempty"` 1251 1252 // AppliedPolicyName: The name of the policy currently applied to the 1253 // device. 1254 AppliedPolicyName string `json:"appliedPolicyName,omitempty"` 1255 1256 // AppliedPolicyVersion: The version of the policy currently applied to 1257 // the device. 1258 AppliedPolicyVersion int64 `json:"appliedPolicyVersion,omitempty,string"` 1259 1260 // AppliedState: The state currently applied to the device. 1261 // 1262 // Possible values: 1263 // "DEVICE_STATE_UNSPECIFIED" - This value is disallowed. 1264 // "ACTIVE" - The device is active. 1265 // "DISABLED" - The device is disabled. 1266 // "DELETED" - The device was deleted. This state will never be 1267 // returned by an API call, but is used in the final status report 1268 // published to Cloud Pub/Sub when the device acknowledges the deletion. 1269 // "PROVISIONING" - The device is being provisioned. Newly enrolled 1270 // devices are in this state until they have a policy applied. 1271 AppliedState string `json:"appliedState,omitempty"` 1272 1273 // CommonCriteriaModeInfo: Information about Common Criteria 1274 // Mode—security standards defined in the Common Criteria for 1275 // Information Technology Security Evaluation 1276 // (https://www.commoncriteriaportal.org/) (CC).This information is only 1277 // available if statusReportingSettings.commonCriteriaModeEnabled is 1278 // true in the device's policy. 1279 CommonCriteriaModeInfo *CommonCriteriaModeInfo `json:"commonCriteriaModeInfo,omitempty"` 1280 1281 // DeviceSettings: Device settings information. This information is only 1282 // available if deviceSettingsEnabled is true in the device's policy. 1283 DeviceSettings *DeviceSettings `json:"deviceSettings,omitempty"` 1284 1285 // DisabledReason: If the device state is DISABLED, an optional message 1286 // that is displayed on the device indicating the reason the device is 1287 // disabled. This field can be modified by a patch request. 1288 DisabledReason *UserFacingMessage `json:"disabledReason,omitempty"` 1289 1290 // Displays: Detailed information about displays on the device. This 1291 // information is only available if displayInfoEnabled is true in the 1292 // device's policy. 1293 Displays []*Display `json:"displays,omitempty"` 1294 1295 // EnrollmentTime: The time of device enrollment. 1296 EnrollmentTime string `json:"enrollmentTime,omitempty"` 1297 1298 // EnrollmentTokenData: If the device was enrolled with an enrollment 1299 // token with additional data provided, this field contains that data. 1300 EnrollmentTokenData string `json:"enrollmentTokenData,omitempty"` 1301 1302 // EnrollmentTokenName: If the device was enrolled with an enrollment 1303 // token, this field contains the name of the token. 1304 EnrollmentTokenName string `json:"enrollmentTokenName,omitempty"` 1305 1306 // HardwareInfo: Detailed information about the device hardware. 1307 HardwareInfo *HardwareInfo `json:"hardwareInfo,omitempty"` 1308 1309 // HardwareStatusSamples: Hardware status samples in chronological 1310 // order. This information is only available if hardwareStatusEnabled is 1311 // true in the device's policy. 1312 HardwareStatusSamples []*HardwareStatus `json:"hardwareStatusSamples,omitempty"` 1313 1314 // LastPolicyComplianceReportTime: Deprecated. 1315 LastPolicyComplianceReportTime string `json:"lastPolicyComplianceReportTime,omitempty"` 1316 1317 // LastPolicySyncTime: The last time the device fetched its policy. 1318 LastPolicySyncTime string `json:"lastPolicySyncTime,omitempty"` 1319 1320 // LastStatusReportTime: The last time the device sent a status report. 1321 LastStatusReportTime string `json:"lastStatusReportTime,omitempty"` 1322 1323 // ManagementMode: The type of management mode Android Device Policy 1324 // takes on the device. This influences which policy settings are 1325 // supported. 1326 // 1327 // Possible values: 1328 // "MANAGEMENT_MODE_UNSPECIFIED" - This value is disallowed. 1329 // "DEVICE_OWNER" - Device owner. Android Device Policy has full 1330 // control over the device. 1331 // "PROFILE_OWNER" - Profile owner. Android Device Policy has control 1332 // over a managed profile on the device. 1333 ManagementMode string `json:"managementMode,omitempty"` 1334 1335 // MemoryEvents: Events related to memory and storage measurements in 1336 // chronological order. This information is only available if 1337 // memoryInfoEnabled is true in the device's policy. 1338 MemoryEvents []*MemoryEvent `json:"memoryEvents,omitempty"` 1339 1340 // MemoryInfo: Memory information. This information is only available if 1341 // memoryInfoEnabled is true in the device's policy. 1342 MemoryInfo *MemoryInfo `json:"memoryInfo,omitempty"` 1343 1344 // Name: The name of the device in the form 1345 // enterprises/{enterpriseId}/devices/{deviceId}. 1346 Name string `json:"name,omitempty"` 1347 1348 // NetworkInfo: Device network information. This information is only 1349 // available if networkInfoEnabled is true in the device's policy. 1350 NetworkInfo *NetworkInfo `json:"networkInfo,omitempty"` 1351 1352 // NonComplianceDetails: Details about policy settings that the device 1353 // is not compliant with. 1354 NonComplianceDetails []*NonComplianceDetail `json:"nonComplianceDetails,omitempty"` 1355 1356 // Ownership: Ownership of the managed device. 1357 // 1358 // Possible values: 1359 // "OWNERSHIP_UNSPECIFIED" - Ownership is unspecified. 1360 // "COMPANY_OWNED" - Device is company-owned. 1361 // "PERSONALLY_OWNED" - Device is personally-owned. 1362 Ownership string `json:"ownership,omitempty"` 1363 1364 // PolicyCompliant: Whether the device is compliant with its policy. 1365 PolicyCompliant bool `json:"policyCompliant,omitempty"` 1366 1367 // PolicyName: The name of the policy applied to the device, in the form 1368 // enterprises/{enterpriseId}/policies/{policyId}. If not specified, the 1369 // policy_name for the device's user is applied. This field can be 1370 // modified by a patch request. You can specify only the policyId when 1371 // calling enterprises.devices.patch, as long as the policyId doesn’t 1372 // contain any slashes. The rest of the policy name is inferred. 1373 PolicyName string `json:"policyName,omitempty"` 1374 1375 // PowerManagementEvents: Power management events on the device in 1376 // chronological order. This information is only available if 1377 // powerManagementEventsEnabled is true in the device's policy. 1378 PowerManagementEvents []*PowerManagementEvent `json:"powerManagementEvents,omitempty"` 1379 1380 // PreviousDeviceNames: If the same physical device has been enrolled 1381 // multiple times, this field contains its previous device names. The 1382 // serial number is used as the unique identifier to determine if the 1383 // same physical device has enrolled previously. The names are in 1384 // chronological order. 1385 PreviousDeviceNames []string `json:"previousDeviceNames,omitempty"` 1386 1387 // SecurityPosture: Device's security posture value that reflects how 1388 // secure the device is. 1389 SecurityPosture *SecurityPosture `json:"securityPosture,omitempty"` 1390 1391 // SoftwareInfo: Detailed information about the device software. This 1392 // information is only available if softwareInfoEnabled is true in the 1393 // device's policy. 1394 SoftwareInfo *SoftwareInfo `json:"softwareInfo,omitempty"` 1395 1396 // State: The state to be applied to the device. This field can be 1397 // modified by a patch request. Note that when calling 1398 // enterprises.devices.patch, ACTIVE and DISABLED are the only allowable 1399 // values. To enter the device into a DELETED state, call 1400 // enterprises.devices.delete. 1401 // 1402 // Possible values: 1403 // "DEVICE_STATE_UNSPECIFIED" - This value is disallowed. 1404 // "ACTIVE" - The device is active. 1405 // "DISABLED" - The device is disabled. 1406 // "DELETED" - The device was deleted. This state will never be 1407 // returned by an API call, but is used in the final status report 1408 // published to Cloud Pub/Sub when the device acknowledges the deletion. 1409 // "PROVISIONING" - The device is being provisioned. Newly enrolled 1410 // devices are in this state until they have a policy applied. 1411 State string `json:"state,omitempty"` 1412 1413 // SystemProperties: Map of selected system properties name and value 1414 // related to the device. This information is only available if 1415 // systemPropertiesEnabled is true in the device's policy. 1416 SystemProperties map[string]string `json:"systemProperties,omitempty"` 1417 1418 // User: The user who owns the device. 1419 User *User `json:"user,omitempty"` 1420 1421 // UserName: The resource name of the user that owns this device in the 1422 // form enterprises/{enterpriseId}/users/{userId}. 1423 UserName string `json:"userName,omitempty"` 1424 1425 // ServerResponse contains the HTTP response code and headers from the 1426 // server. 1427 googleapi.ServerResponse `json:"-"` 1428 1429 // ForceSendFields is a list of field names (e.g. "ApiLevel") to 1430 // unconditionally include in API requests. By default, fields with 1431 // empty values are omitted from API requests. However, any non-pointer, 1432 // non-interface field appearing in ForceSendFields will be sent to the 1433 // server regardless of whether the field is empty or not. This may be 1434 // used to include empty fields in Patch requests. 1435 ForceSendFields []string `json:"-"` 1436 1437 // NullFields is a list of field names (e.g. "ApiLevel") to include in 1438 // API requests with the JSON null value. By default, fields with empty 1439 // values are omitted from API requests. However, any field with an 1440 // empty value appearing in NullFields will be sent to the server as 1441 // null. It is an error if a field in this list has a non-empty value. 1442 // This may be used to include null fields in Patch requests. 1443 NullFields []string `json:"-"` 1444} 1445 1446func (s *Device) MarshalJSON() ([]byte, error) { 1447 type NoMethod Device 1448 raw := NoMethod(*s) 1449 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1450} 1451 1452// DeviceSettings: Information about security related device settings on 1453// device. 1454type DeviceSettings struct { 1455 // AdbEnabled: Whether ADB 1456 // (https://developer.android.com/studio/command-line/adb.html) is 1457 // enabled on the device. 1458 AdbEnabled bool `json:"adbEnabled,omitempty"` 1459 1460 // DevelopmentSettingsEnabled: Whether developer mode is enabled on the 1461 // device. 1462 DevelopmentSettingsEnabled bool `json:"developmentSettingsEnabled,omitempty"` 1463 1464 // EncryptionStatus: Encryption status from DevicePolicyManager. 1465 // 1466 // Possible values: 1467 // "ENCRYPTION_STATUS_UNSPECIFIED" - Unspecified. No device should 1468 // have this type. 1469 // "UNSUPPORTED" - Encryption is not supported by the device. 1470 // "INACTIVE" - Encryption is supported by the device, but is not 1471 // currently active. 1472 // "ACTIVATING" - Encryption is not currently active, but is currently 1473 // being activated. 1474 // "ACTIVE" - Encryption is active. 1475 // "ACTIVE_DEFAULT_KEY" - Encryption is active, but an encryption key 1476 // is not set by the user. 1477 // "ACTIVE_PER_USER" - Encryption is active, and the encryption key is 1478 // tied to the user profile. 1479 EncryptionStatus string `json:"encryptionStatus,omitempty"` 1480 1481 // IsDeviceSecure: Whether the device is secured with PIN/password. 1482 IsDeviceSecure bool `json:"isDeviceSecure,omitempty"` 1483 1484 // IsEncrypted: Whether the storage encryption is enabled. 1485 IsEncrypted bool `json:"isEncrypted,omitempty"` 1486 1487 // UnknownSourcesEnabled: Whether installing apps from unknown sources 1488 // is enabled. 1489 UnknownSourcesEnabled bool `json:"unknownSourcesEnabled,omitempty"` 1490 1491 // VerifyAppsEnabled: Whether Google Play Protect verification 1492 // (https://support.google.com/accounts/answer/2812853) is enforced on 1493 // the device. 1494 VerifyAppsEnabled bool `json:"verifyAppsEnabled,omitempty"` 1495 1496 // ForceSendFields is a list of field names (e.g. "AdbEnabled") to 1497 // unconditionally include in API requests. By default, fields with 1498 // empty values are omitted from API requests. However, any non-pointer, 1499 // non-interface field appearing in ForceSendFields will be sent to the 1500 // server regardless of whether the field is empty or not. This may be 1501 // used to include empty fields in Patch requests. 1502 ForceSendFields []string `json:"-"` 1503 1504 // NullFields is a list of field names (e.g. "AdbEnabled") to include in 1505 // API requests with the JSON null value. By default, fields with empty 1506 // values are omitted from API requests. However, any field with an 1507 // empty value appearing in NullFields will be sent to the server as 1508 // null. It is an error if a field in this list has a non-empty value. 1509 // This may be used to include null fields in Patch requests. 1510 NullFields []string `json:"-"` 1511} 1512 1513func (s *DeviceSettings) MarshalJSON() ([]byte, error) { 1514 type NoMethod DeviceSettings 1515 raw := NoMethod(*s) 1516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1517} 1518 1519// Display: Device display information. 1520type Display struct { 1521 // Density: Display density expressed as dots-per-inch. 1522 Density int64 `json:"density,omitempty"` 1523 1524 // DisplayId: Unique display id. 1525 DisplayId int64 `json:"displayId,omitempty"` 1526 1527 // Height: Display height in pixels. 1528 Height int64 `json:"height,omitempty"` 1529 1530 // Name: Name of the display. 1531 Name string `json:"name,omitempty"` 1532 1533 // RefreshRate: Refresh rate of the display in frames per second. 1534 RefreshRate int64 `json:"refreshRate,omitempty"` 1535 1536 // State: State of the display. 1537 // 1538 // Possible values: 1539 // "DISPLAY_STATE_UNSPECIFIED" - This value is disallowed. 1540 // "OFF" - Display is off. 1541 // "ON" - Display is on. 1542 // "DOZE" - Display is dozing in a low power state 1543 // "SUSPENDED" - Display is dozing in a suspended low power state. 1544 State string `json:"state,omitempty"` 1545 1546 // Width: Display width in pixels. 1547 Width int64 `json:"width,omitempty"` 1548 1549 // ForceSendFields is a list of field names (e.g. "Density") to 1550 // unconditionally include in API requests. By default, fields with 1551 // empty values are omitted from API requests. However, any non-pointer, 1552 // non-interface field appearing in ForceSendFields will be sent to the 1553 // server regardless of whether the field is empty or not. This may be 1554 // used to include empty fields in Patch requests. 1555 ForceSendFields []string `json:"-"` 1556 1557 // NullFields is a list of field names (e.g. "Density") to include in 1558 // API requests with the JSON null value. By default, fields with empty 1559 // values are omitted from API requests. However, any field with an 1560 // empty value appearing in NullFields will be sent to the server as 1561 // null. It is an error if a field in this list has a non-empty value. 1562 // This may be used to include null fields in Patch requests. 1563 NullFields []string `json:"-"` 1564} 1565 1566func (s *Display) MarshalJSON() ([]byte, error) { 1567 type NoMethod Display 1568 raw := NoMethod(*s) 1569 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1570} 1571 1572// Empty: A generic empty message that you can re-use to avoid defining 1573// duplicated empty messages in your APIs. A typical example is to use 1574// it as the request or the response type of an API method. For 1575// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1576// (google.protobuf.Empty); } The JSON representation for Empty is empty 1577// JSON object {}. 1578type Empty struct { 1579 // ServerResponse contains the HTTP response code and headers from the 1580 // server. 1581 googleapi.ServerResponse `json:"-"` 1582} 1583 1584// EnrollmentToken: An enrollment token. 1585type EnrollmentToken struct { 1586 // AdditionalData: Optional, arbitrary data associated with the 1587 // enrollment token. This could contain, for example, the ID of an org 1588 // unit the device is assigned to after enrollment. After a device 1589 // enrolls with the token, this data will be exposed in the 1590 // enrollment_token_data field of the Device resource. The data must be 1591 // 1024 characters or less; otherwise, the creation request will fail. 1592 AdditionalData string `json:"additionalData,omitempty"` 1593 1594 // AllowPersonalUsage: Controls whether personal usage is allowed on a 1595 // device provisioned with this enrollment token.For company-owned 1596 // devices: Enabling personal usage allows the user to set up a work 1597 // profile on the device. Disabling personal usage requires the user 1598 // provision the device as a fully managed device.For personally-owned 1599 // devices: Enabling personal usage allows the user to set up a work 1600 // profile on the device. Disabling personal usage will prevent the 1601 // device from provisioning. Personal usage cannot be disabled on 1602 // personally-owned device. 1603 // 1604 // Possible values: 1605 // "ALLOW_PERSONAL_USAGE_UNSPECIFIED" - Personal usage restriction is 1606 // not specified 1607 // "PERSONAL_USAGE_ALLOWED" - Personal usage is allowed 1608 // "PERSONAL_USAGE_DISALLOWED" - Personal usage is disallowed 1609 AllowPersonalUsage string `json:"allowPersonalUsage,omitempty"` 1610 1611 // Duration: The length of time the enrollment token is valid, ranging 1612 // from 1 minute to 90 days. If not specified, the default duration is 1 1613 // hour. 1614 Duration string `json:"duration,omitempty"` 1615 1616 // ExpirationTimestamp: The expiration time of the token. This is a 1617 // read-only field generated by the server. 1618 ExpirationTimestamp string `json:"expirationTimestamp,omitempty"` 1619 1620 // Name: The name of the enrollment token, which is generated by the 1621 // server during creation, in the form 1622 // enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. 1623 Name string `json:"name,omitempty"` 1624 1625 // OneTimeOnly: Whether the enrollment token is for one time use only. 1626 // If the flag is set to true, only one device can use it for 1627 // registration. 1628 OneTimeOnly bool `json:"oneTimeOnly,omitempty"` 1629 1630 // PolicyName: The name of the policy initially applied to the enrolled 1631 // device, in the form enterprises/{enterpriseId}/policies/{policyId}. 1632 // If not specified, the policy_name for the device’s user is applied. 1633 // If user_name is also not specified, 1634 // enterprises/{enterpriseId}/policies/default is applied by default. 1635 // When updating this field, you can specify only the policyId as long 1636 // as the policyId doesn’t contain any slashes. The rest of the policy 1637 // name will be inferred. 1638 PolicyName string `json:"policyName,omitempty"` 1639 1640 // QrCode: A JSON string whose UTF-8 representation can be used to 1641 // generate a QR code to enroll a device with this enrollment token. To 1642 // enroll a device using NFC, the NFC record must contain a serialized 1643 // java.util.Properties representation of the properties in the JSON. 1644 QrCode string `json:"qrCode,omitempty"` 1645 1646 // User: The user associated with this enrollment token. If it's 1647 // specified when the enrollment token is created and the user does not 1648 // exist, the user will be created. This field must not contain 1649 // personally identifiable information. Only the account_identifier 1650 // field needs to be set. 1651 User *User `json:"user,omitempty"` 1652 1653 // Value: The token value that's passed to the device and authorizes the 1654 // device to enroll. This is a read-only field generated by the server. 1655 Value string `json:"value,omitempty"` 1656 1657 // ServerResponse contains the HTTP response code and headers from the 1658 // server. 1659 googleapi.ServerResponse `json:"-"` 1660 1661 // ForceSendFields is a list of field names (e.g. "AdditionalData") to 1662 // unconditionally include in API requests. By default, fields with 1663 // empty values are omitted from API requests. However, any non-pointer, 1664 // non-interface field appearing in ForceSendFields will be sent to the 1665 // server regardless of whether the field is empty or not. This may be 1666 // used to include empty fields in Patch requests. 1667 ForceSendFields []string `json:"-"` 1668 1669 // NullFields is a list of field names (e.g. "AdditionalData") to 1670 // include in API requests with the JSON null value. By default, fields 1671 // with empty values are omitted from API requests. However, any field 1672 // with an empty value appearing in NullFields will be sent to the 1673 // server as null. It is an error if a field in this list has a 1674 // non-empty value. This may be used to include null fields in Patch 1675 // requests. 1676 NullFields []string `json:"-"` 1677} 1678 1679func (s *EnrollmentToken) MarshalJSON() ([]byte, error) { 1680 type NoMethod EnrollmentToken 1681 raw := NoMethod(*s) 1682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1683} 1684 1685// Enterprise: The configuration applied to an enterprise. 1686type Enterprise struct { 1687 // AppAutoApprovalEnabled: Deprecated and unused. 1688 AppAutoApprovalEnabled bool `json:"appAutoApprovalEnabled,omitempty"` 1689 1690 // ContactInfo: This feature is not generally available yet. The 1691 // enterprise contact info of an EMM owned enterprise 1692 ContactInfo *ContactInfo `json:"contactInfo,omitempty"` 1693 1694 // EnabledNotificationTypes: The types of Google Pub/Sub notifications 1695 // enabled for the enterprise. 1696 // 1697 // Possible values: 1698 // "NOTIFICATION_TYPE_UNSPECIFIED" - This value is ignored. 1699 // "ENROLLMENT" - A notification sent when a device enrolls. 1700 // "COMPLIANCE_REPORT" - Deprecated. 1701 // "STATUS_REPORT" - A notification sent when a device issues a status 1702 // report. 1703 // "COMMAND" - A notification sent when a device command has 1704 // completed. 1705 EnabledNotificationTypes []string `json:"enabledNotificationTypes,omitempty"` 1706 1707 // EnterpriseDisplayName: The name of the enterprise displayed to users. 1708 EnterpriseDisplayName string `json:"enterpriseDisplayName,omitempty"` 1709 1710 // Logo: An image displayed as a logo during device provisioning. 1711 // Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, 1712 // image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng. 1713 Logo *ExternalData `json:"logo,omitempty"` 1714 1715 // Name: The name of the enterprise which is generated by the server 1716 // during creation, in the form enterprises/{enterpriseId}. 1717 Name string `json:"name,omitempty"` 1718 1719 // PrimaryColor: A color in RGB format that indicates the predominant 1720 // color to display in the device management app UI. The color 1721 // components are stored as follows: (red << 16) | (green << 8) | blue, 1722 // where the value of each component is between 0 and 255, inclusive. 1723 PrimaryColor int64 `json:"primaryColor,omitempty"` 1724 1725 // PubsubTopic: The topic that Cloud Pub/Sub notifications are published 1726 // to, in the form projects/{project}/topics/{topic}. This field is only 1727 // required if Pub/Sub notifications are enabled. 1728 PubsubTopic string `json:"pubsubTopic,omitempty"` 1729 1730 // SigninDetails: Sign-in details of the enterprise. 1731 SigninDetails []*SigninDetail `json:"signinDetails,omitempty"` 1732 1733 // TermsAndConditions: Terms and conditions that must be accepted when 1734 // provisioning a device for this enterprise. A page of terms is 1735 // generated for each value in this list. 1736 TermsAndConditions []*TermsAndConditions `json:"termsAndConditions,omitempty"` 1737 1738 // ServerResponse contains the HTTP response code and headers from the 1739 // server. 1740 googleapi.ServerResponse `json:"-"` 1741 1742 // ForceSendFields is a list of field names (e.g. 1743 // "AppAutoApprovalEnabled") to unconditionally include in API requests. 1744 // By default, fields with empty values are omitted from API requests. 1745 // However, any non-pointer, non-interface field appearing in 1746 // ForceSendFields will be sent to the server regardless of whether the 1747 // field is empty or not. This may be used to include empty fields in 1748 // Patch requests. 1749 ForceSendFields []string `json:"-"` 1750 1751 // NullFields is a list of field names (e.g. "AppAutoApprovalEnabled") 1752 // to include in API requests with the JSON null value. By default, 1753 // fields with empty values are omitted from API requests. However, any 1754 // field with an empty value appearing in NullFields will be sent to the 1755 // server as null. It is an error if a field in this list has a 1756 // non-empty value. This may be used to include null fields in Patch 1757 // requests. 1758 NullFields []string `json:"-"` 1759} 1760 1761func (s *Enterprise) MarshalJSON() ([]byte, error) { 1762 type NoMethod Enterprise 1763 raw := NoMethod(*s) 1764 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1765} 1766 1767// ExternalData: Data hosted at an external location. The data is to be 1768// downloaded by Android Device Policy and verified against the hash. 1769type ExternalData struct { 1770 // Sha256Hash: The base-64 encoded SHA-256 hash of the content hosted at 1771 // url. If the content doesn't match this hash, Android Device Policy 1772 // won't use the data. 1773 Sha256Hash string `json:"sha256Hash,omitempty"` 1774 1775 // Url: The absolute URL to the data, which must use either the http or 1776 // https scheme. Android Device Policy doesn't provide any credentials 1777 // in the GET request, so the URL must be publicly accessible. Including 1778 // a long, random component in the URL may be used to prevent attackers 1779 // from discovering the URL. 1780 Url string `json:"url,omitempty"` 1781 1782 // ForceSendFields is a list of field names (e.g. "Sha256Hash") to 1783 // unconditionally include in API requests. By default, fields with 1784 // empty values are omitted from API requests. However, any non-pointer, 1785 // non-interface field appearing in ForceSendFields will be sent to the 1786 // server regardless of whether the field is empty or not. This may be 1787 // used to include empty fields in Patch requests. 1788 ForceSendFields []string `json:"-"` 1789 1790 // NullFields is a list of field names (e.g. "Sha256Hash") to include in 1791 // API requests with the JSON null value. By default, fields with empty 1792 // values are omitted from API requests. However, any field with an 1793 // empty value appearing in NullFields will be sent to the server as 1794 // null. It is an error if a field in this list has a non-empty value. 1795 // This may be used to include null fields in Patch requests. 1796 NullFields []string `json:"-"` 1797} 1798 1799func (s *ExternalData) MarshalJSON() ([]byte, error) { 1800 type NoMethod ExternalData 1801 raw := NoMethod(*s) 1802 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1803} 1804 1805// FreezePeriod: A system freeze period. When a device’s clock is 1806// within the freeze period, all incoming system updates (including 1807// security patches) are blocked and won’t be installed. When a device 1808// is outside the freeze period, normal update behavior applies. Leap 1809// years are ignored in freeze period calculations, in particular: * If 1810// Feb. 29th is set as the start or end date of a freeze period, the 1811// freeze period will start or end on Feb. 28th instead. * When a 1812// device’s system clock reads Feb. 29th, it’s treated as Feb. 28th. 1813// * When calculating the number of days in a freeze period or the time 1814// between two freeze periods, Feb. 29th is ignored and not counted as a 1815// day. 1816type FreezePeriod struct { 1817 // EndDate: The end date (inclusive) of the freeze period. Must be no 1818 // later than 90 days from the start date. If the end date is earlier 1819 // than the start date, the freeze period is considered wrapping 1820 // year-end. Note: year must not be set. For example, {"month": 1821 // 1,"date": 30}. 1822 EndDate *Date `json:"endDate,omitempty"` 1823 1824 // StartDate: The start date (inclusive) of the freeze period. Note: 1825 // year must not be set. For example, {"month": 1,"date": 30}. 1826 StartDate *Date `json:"startDate,omitempty"` 1827 1828 // ForceSendFields is a list of field names (e.g. "EndDate") to 1829 // unconditionally include in API requests. By default, fields with 1830 // empty values are omitted from API requests. However, any non-pointer, 1831 // non-interface field appearing in ForceSendFields will be sent to the 1832 // server regardless of whether the field is empty or not. This may be 1833 // used to include empty fields in Patch requests. 1834 ForceSendFields []string `json:"-"` 1835 1836 // NullFields is a list of field names (e.g. "EndDate") to include in 1837 // API requests with the JSON null value. By default, fields with empty 1838 // values are omitted from API requests. However, any field with an 1839 // empty value appearing in NullFields will be sent to the server as 1840 // null. It is an error if a field in this list has a non-empty value. 1841 // This may be used to include null fields in Patch requests. 1842 NullFields []string `json:"-"` 1843} 1844 1845func (s *FreezePeriod) MarshalJSON() ([]byte, error) { 1846 type NoMethod FreezePeriod 1847 raw := NoMethod(*s) 1848 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1849} 1850 1851// HardwareInfo: Information about device hardware. The fields related 1852// to temperature thresholds are only available if hardwareStatusEnabled 1853// is true in the device's policy. 1854type HardwareInfo struct { 1855 // BatteryShutdownTemperatures: Battery shutdown temperature thresholds 1856 // in Celsius for each battery on the device. 1857 BatteryShutdownTemperatures []float64 `json:"batteryShutdownTemperatures,omitempty"` 1858 1859 // BatteryThrottlingTemperatures: Battery throttling temperature 1860 // thresholds in Celsius for each battery on the device. 1861 BatteryThrottlingTemperatures []float64 `json:"batteryThrottlingTemperatures,omitempty"` 1862 1863 // Brand: Brand of the device. For example, Google. 1864 Brand string `json:"brand,omitempty"` 1865 1866 // CpuShutdownTemperatures: CPU shutdown temperature thresholds in 1867 // Celsius for each CPU on the device. 1868 CpuShutdownTemperatures []float64 `json:"cpuShutdownTemperatures,omitempty"` 1869 1870 // CpuThrottlingTemperatures: CPU throttling temperature thresholds in 1871 // Celsius for each CPU on the device. 1872 CpuThrottlingTemperatures []float64 `json:"cpuThrottlingTemperatures,omitempty"` 1873 1874 // DeviceBasebandVersion: Baseband version. For example, 1875 // MDM9625_104662.22.05.34p. 1876 DeviceBasebandVersion string `json:"deviceBasebandVersion,omitempty"` 1877 1878 // GpuShutdownTemperatures: GPU shutdown temperature thresholds in 1879 // Celsius for each GPU on the device. 1880 GpuShutdownTemperatures []float64 `json:"gpuShutdownTemperatures,omitempty"` 1881 1882 // GpuThrottlingTemperatures: GPU throttling temperature thresholds in 1883 // Celsius for each GPU on the device. 1884 GpuThrottlingTemperatures []float64 `json:"gpuThrottlingTemperatures,omitempty"` 1885 1886 // Hardware: Name of the hardware. For example, Angler. 1887 Hardware string `json:"hardware,omitempty"` 1888 1889 // Manufacturer: Manufacturer. For example, Motorola. 1890 Manufacturer string `json:"manufacturer,omitempty"` 1891 1892 // Model: The model of the device. For example, Asus Nexus 7. 1893 Model string `json:"model,omitempty"` 1894 1895 // SerialNumber: The device serial number. 1896 SerialNumber string `json:"serialNumber,omitempty"` 1897 1898 // SkinShutdownTemperatures: Device skin shutdown temperature thresholds 1899 // in Celsius. 1900 SkinShutdownTemperatures []float64 `json:"skinShutdownTemperatures,omitempty"` 1901 1902 // SkinThrottlingTemperatures: Device skin throttling temperature 1903 // thresholds in Celsius. 1904 SkinThrottlingTemperatures []float64 `json:"skinThrottlingTemperatures,omitempty"` 1905 1906 // ForceSendFields is a list of field names (e.g. 1907 // "BatteryShutdownTemperatures") to unconditionally include in API 1908 // requests. By default, fields with empty values are omitted from API 1909 // requests. However, any non-pointer, non-interface field appearing in 1910 // ForceSendFields will be sent to the server regardless of whether the 1911 // field is empty or not. This may be used to include empty fields in 1912 // Patch requests. 1913 ForceSendFields []string `json:"-"` 1914 1915 // NullFields is a list of field names (e.g. 1916 // "BatteryShutdownTemperatures") to include in API requests with the 1917 // JSON null value. By default, fields with empty values are omitted 1918 // from API requests. However, any field with an empty value appearing 1919 // in NullFields will be sent to the server as null. It is an error if a 1920 // field in this list has a non-empty value. This may be used to include 1921 // null fields in Patch requests. 1922 NullFields []string `json:"-"` 1923} 1924 1925func (s *HardwareInfo) MarshalJSON() ([]byte, error) { 1926 type NoMethod HardwareInfo 1927 raw := NoMethod(*s) 1928 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1929} 1930 1931// HardwareStatus: Hardware status. Temperatures may be compared to the 1932// temperature thresholds available in hardwareInfo to determine 1933// hardware health. 1934type HardwareStatus struct { 1935 // BatteryTemperatures: Current battery temperatures in Celsius for each 1936 // battery on the device. 1937 BatteryTemperatures []float64 `json:"batteryTemperatures,omitempty"` 1938 1939 // CpuTemperatures: Current CPU temperatures in Celsius for each CPU on 1940 // the device. 1941 CpuTemperatures []float64 `json:"cpuTemperatures,omitempty"` 1942 1943 // CpuUsages: CPU usages in percentage for each core available on the 1944 // device. Usage is 0 for each unplugged core. Empty array implies that 1945 // CPU usage is not supported in the system. 1946 CpuUsages []float64 `json:"cpuUsages,omitempty"` 1947 1948 // CreateTime: The time the measurements were taken. 1949 CreateTime string `json:"createTime,omitempty"` 1950 1951 // FanSpeeds: Fan speeds in RPM for each fan on the device. Empty array 1952 // means that there are no fans or fan speed is not supported on the 1953 // system. 1954 FanSpeeds []float64 `json:"fanSpeeds,omitempty"` 1955 1956 // GpuTemperatures: Current GPU temperatures in Celsius for each GPU on 1957 // the device. 1958 GpuTemperatures []float64 `json:"gpuTemperatures,omitempty"` 1959 1960 // SkinTemperatures: Current device skin temperatures in Celsius. 1961 SkinTemperatures []float64 `json:"skinTemperatures,omitempty"` 1962 1963 // ForceSendFields is a list of field names (e.g. "BatteryTemperatures") 1964 // to unconditionally include in API requests. By default, fields with 1965 // empty values are omitted from API requests. However, any non-pointer, 1966 // non-interface field appearing in ForceSendFields will be sent to the 1967 // server regardless of whether the field is empty or not. This may be 1968 // used to include empty fields in Patch requests. 1969 ForceSendFields []string `json:"-"` 1970 1971 // NullFields is a list of field names (e.g. "BatteryTemperatures") to 1972 // include in API requests with the JSON null value. By default, fields 1973 // with empty values are omitted from API requests. However, any field 1974 // with an empty value appearing in NullFields will be sent to the 1975 // server as null. It is an error if a field in this list has a 1976 // non-empty value. This may be used to include null fields in Patch 1977 // requests. 1978 NullFields []string `json:"-"` 1979} 1980 1981func (s *HardwareStatus) MarshalJSON() ([]byte, error) { 1982 type NoMethod HardwareStatus 1983 raw := NoMethod(*s) 1984 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1985} 1986 1987// KeyedAppState: Keyed app state reported by the app. 1988type KeyedAppState struct { 1989 // CreateTime: The creation time of the app state on the device. 1990 CreateTime string `json:"createTime,omitempty"` 1991 1992 // Data: Optionally, a machine-readable value to be read by the EMM. For 1993 // example, setting values that the admin can choose to query against in 1994 // the EMM console (e.g. “notify me if the battery_warning data < 1995 // 10”). 1996 Data string `json:"data,omitempty"` 1997 1998 // Key: The key for the app state. Acts as a point of reference for what 1999 // the app is providing state for. For example, when providing managed 2000 // configuration feedback, this key could be the managed configuration 2001 // key. 2002 Key string `json:"key,omitempty"` 2003 2004 // LastUpdateTime: The time the app state was most recently updated. 2005 LastUpdateTime string `json:"lastUpdateTime,omitempty"` 2006 2007 // Message: Optionally, a free-form message string to explain the app 2008 // state. If the state was triggered by a particular value (e.g. a 2009 // managed configuration value), it should be included in the message. 2010 Message string `json:"message,omitempty"` 2011 2012 // Severity: The severity of the app state. 2013 // 2014 // Possible values: 2015 // "SEVERITY_UNSPECIFIED" - Unspecified severity level. 2016 // "INFO" - Information severity level. 2017 // "ERROR" - Error severity level. This should only be set for genuine 2018 // error conditions that a management organization needs to take action 2019 // to fix. 2020 Severity string `json:"severity,omitempty"` 2021 2022 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2023 // unconditionally include in API requests. By default, fields with 2024 // empty values are omitted from API requests. However, any non-pointer, 2025 // non-interface field appearing in ForceSendFields will be sent to the 2026 // server regardless of whether the field is empty or not. This may be 2027 // used to include empty fields in Patch requests. 2028 ForceSendFields []string `json:"-"` 2029 2030 // NullFields is a list of field names (e.g. "CreateTime") to include in 2031 // API requests with the JSON null value. By default, fields with empty 2032 // values are omitted from API requests. However, any field with an 2033 // empty value appearing in NullFields will be sent to the server as 2034 // null. It is an error if a field in this list has a non-empty value. 2035 // This may be used to include null fields in Patch requests. 2036 NullFields []string `json:"-"` 2037} 2038 2039func (s *KeyedAppState) MarshalJSON() ([]byte, error) { 2040 type NoMethod KeyedAppState 2041 raw := NoMethod(*s) 2042 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2043} 2044 2045// KioskCustomization: Settings controlling the behavior of a device in 2046// kiosk mode. To enable kiosk mode, set kioskCustomLauncherEnabled to 2047// true or specify an app in the policy with installType KIOSK. 2048type KioskCustomization struct { 2049 // DeviceSettings: Specifies whether the Settings app is allowed in 2050 // kiosk mode. 2051 // 2052 // Possible values: 2053 // "DEVICE_SETTINGS_UNSPECIFIED" - Unspecified, defaults to 2054 // SETTINGS_ACCESS_ALLOWED. 2055 // "SETTINGS_ACCESS_ALLOWED" - Access to the Settings app is allowed 2056 // in kiosk mode. 2057 // "SETTINGS_ACCESS_BLOCKED" - Access to the Settings app is not 2058 // allowed in kiosk mode. 2059 DeviceSettings string `json:"deviceSettings,omitempty"` 2060 2061 // PowerButtonActions: Sets the behavior of a device in kiosk mode when 2062 // a user presses and holds (long-presses) the Power button. 2063 // 2064 // Possible values: 2065 // "POWER_BUTTON_ACTIONS_UNSPECIFIED" - Unspecified, defaults to 2066 // POWER_BUTTON_AVAILABLE. 2067 // "POWER_BUTTON_AVAILABLE" - The power menu (e.g. Power off, Restart) 2068 // is shown when a user long-presses the Power button of a device in 2069 // kiosk mode. 2070 // "POWER_BUTTON_BLOCKED" - The power menu (e.g. Power off, Restart) 2071 // is not shown when a user long-presses the Power button of a device in 2072 // kiosk mode. Note: this may prevent users from turning off the device. 2073 PowerButtonActions string `json:"powerButtonActions,omitempty"` 2074 2075 // StatusBar: Specifies whether system info and notifications are 2076 // disabled in kiosk mode. 2077 // 2078 // Possible values: 2079 // "STATUS_BAR_UNSPECIFIED" - Unspecified, defaults to 2080 // INFO_AND_NOTIFICATIONS_DISABLED. 2081 // "NOTIFICATIONS_AND_SYSTEM_INFO_ENABLED" - System info and 2082 // notifications are shown on the status bar in kiosk mode.Note: For 2083 // this policy to take effect, the device's home button must be enabled 2084 // using kioskCustomization.systemNavigation. 2085 // "NOTIFICATIONS_AND_SYSTEM_INFO_DISABLED" - System info and 2086 // notifications are disabled in kiosk mode. 2087 // "SYSTEM_INFO_ONLY" - Only system info is shown on the status bar. 2088 StatusBar string `json:"statusBar,omitempty"` 2089 2090 // SystemErrorWarnings: Specifies whether system error dialogs for 2091 // crashed or unresponsive apps are blocked in kiosk mode. When blocked, 2092 // the system will force-stop the app as if the user chooses the "close 2093 // app" option on the UI. 2094 // 2095 // Possible values: 2096 // "SYSTEM_ERROR_WARNINGS_UNSPECIFIED" - Unspecified, defaults to 2097 // ERROR_AND_WARNINGS_MUTED. 2098 // "ERROR_AND_WARNINGS_ENABLED" - All system error dialogs such as 2099 // crash and app not responding (ANR) are displayed. 2100 // "ERROR_AND_WARNINGS_MUTED" - All system error dialogs, such as 2101 // crash and app not responding (ANR) are blocked. When blocked, the 2102 // system force-stops the app as if the user closes the app from the UI. 2103 SystemErrorWarnings string `json:"systemErrorWarnings,omitempty"` 2104 2105 // SystemNavigation: Specifies which navigation features are enabled 2106 // (e.g. Home, Overview buttons) in kiosk mode. 2107 // 2108 // Possible values: 2109 // "SYSTEM_NAVIGATION_UNSPECIFIED" - Unspecified, defaults to 2110 // NAVIGATION_DISABLED. 2111 // "NAVIGATION_ENABLED" - Home and overview buttons are enabled. 2112 // "NAVIGATION_DISABLED" - The home and Overview buttons are not 2113 // accessible. 2114 // "HOME_BUTTON_ONLY" - Only the home button is enabled. 2115 SystemNavigation string `json:"systemNavigation,omitempty"` 2116 2117 // ForceSendFields is a list of field names (e.g. "DeviceSettings") to 2118 // unconditionally include in API requests. By default, fields with 2119 // empty values are omitted from API requests. However, any non-pointer, 2120 // non-interface field appearing in ForceSendFields will be sent to the 2121 // server regardless of whether the field is empty or not. This may be 2122 // used to include empty fields in Patch requests. 2123 ForceSendFields []string `json:"-"` 2124 2125 // NullFields is a list of field names (e.g. "DeviceSettings") to 2126 // include in API requests with the JSON null value. By default, fields 2127 // with empty values are omitted from API requests. However, any field 2128 // with an empty value appearing in NullFields will be sent to the 2129 // server as null. It is an error if a field in this list has a 2130 // non-empty value. This may be used to include null fields in Patch 2131 // requests. 2132 NullFields []string `json:"-"` 2133} 2134 2135func (s *KioskCustomization) MarshalJSON() ([]byte, error) { 2136 type NoMethod KioskCustomization 2137 raw := NoMethod(*s) 2138 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2139} 2140 2141// LaunchAppAction: An action to launch an app. 2142type LaunchAppAction struct { 2143 // PackageName: Package name of app to be launched 2144 PackageName string `json:"packageName,omitempty"` 2145 2146 // ForceSendFields is a list of field names (e.g. "PackageName") to 2147 // unconditionally include in API requests. By default, fields with 2148 // empty values are omitted from API requests. However, any non-pointer, 2149 // non-interface field appearing in ForceSendFields will be sent to the 2150 // server regardless of whether the field is empty or not. This may be 2151 // used to include empty fields in Patch requests. 2152 ForceSendFields []string `json:"-"` 2153 2154 // NullFields is a list of field names (e.g. "PackageName") to include 2155 // in API requests with the JSON null value. By default, fields with 2156 // empty values are omitted from API requests. However, any field with 2157 // an empty value appearing in NullFields will be sent to the server as 2158 // null. It is an error if a field in this list has a non-empty value. 2159 // This may be used to include null fields in Patch requests. 2160 NullFields []string `json:"-"` 2161} 2162 2163func (s *LaunchAppAction) MarshalJSON() ([]byte, error) { 2164 type NoMethod LaunchAppAction 2165 raw := NoMethod(*s) 2166 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2167} 2168 2169// ListDevicesResponse: Response to a request to list devices for a 2170// given enterprise. 2171type ListDevicesResponse struct { 2172 // Devices: The list of devices. 2173 Devices []*Device `json:"devices,omitempty"` 2174 2175 // NextPageToken: If there are more results, a token to retrieve next 2176 // page of results. 2177 NextPageToken string `json:"nextPageToken,omitempty"` 2178 2179 // ServerResponse contains the HTTP response code and headers from the 2180 // server. 2181 googleapi.ServerResponse `json:"-"` 2182 2183 // ForceSendFields is a list of field names (e.g. "Devices") to 2184 // unconditionally include in API requests. By default, fields with 2185 // empty values are omitted from API requests. However, any non-pointer, 2186 // non-interface field appearing in ForceSendFields will be sent to the 2187 // server regardless of whether the field is empty or not. This may be 2188 // used to include empty fields in Patch requests. 2189 ForceSendFields []string `json:"-"` 2190 2191 // NullFields is a list of field names (e.g. "Devices") to include in 2192 // API requests with the JSON null value. By default, fields with empty 2193 // values are omitted from API requests. However, any field with an 2194 // empty value appearing in NullFields will be sent to the server as 2195 // null. It is an error if a field in this list has a non-empty value. 2196 // This may be used to include null fields in Patch requests. 2197 NullFields []string `json:"-"` 2198} 2199 2200func (s *ListDevicesResponse) MarshalJSON() ([]byte, error) { 2201 type NoMethod ListDevicesResponse 2202 raw := NoMethod(*s) 2203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2204} 2205 2206// ListEnterprisesResponse: This feature is not generally available yet. 2207// Response to a request to list enterprises. 2208type ListEnterprisesResponse struct { 2209 // Enterprises: This feature is not generally available yet. The list of 2210 // enterprises. 2211 Enterprises []*Enterprise `json:"enterprises,omitempty"` 2212 2213 // NextPageToken: This feature is not generally available yet. If there 2214 // are more results, a token to retrieve next page of results. 2215 NextPageToken string `json:"nextPageToken,omitempty"` 2216 2217 // ServerResponse contains the HTTP response code and headers from the 2218 // server. 2219 googleapi.ServerResponse `json:"-"` 2220 2221 // ForceSendFields is a list of field names (e.g. "Enterprises") to 2222 // unconditionally include in API requests. By default, fields with 2223 // empty values are omitted from API requests. However, any non-pointer, 2224 // non-interface field appearing in ForceSendFields will be sent to the 2225 // server regardless of whether the field is empty or not. This may be 2226 // used to include empty fields in Patch requests. 2227 ForceSendFields []string `json:"-"` 2228 2229 // NullFields is a list of field names (e.g. "Enterprises") to include 2230 // in API requests with the JSON null value. By default, fields with 2231 // empty values are omitted from API requests. However, any field with 2232 // an empty value appearing in NullFields will be sent to the server as 2233 // null. It is an error if a field in this list has a non-empty value. 2234 // This may be used to include null fields in Patch requests. 2235 NullFields []string `json:"-"` 2236} 2237 2238func (s *ListEnterprisesResponse) MarshalJSON() ([]byte, error) { 2239 type NoMethod ListEnterprisesResponse 2240 raw := NoMethod(*s) 2241 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2242} 2243 2244// ListOperationsResponse: The response message for 2245// Operations.ListOperations. 2246type ListOperationsResponse struct { 2247 // NextPageToken: The standard List next-page token. 2248 NextPageToken string `json:"nextPageToken,omitempty"` 2249 2250 // Operations: A list of operations that matches the specified filter in 2251 // the request. 2252 Operations []*Operation `json:"operations,omitempty"` 2253 2254 // ServerResponse contains the HTTP response code and headers from the 2255 // server. 2256 googleapi.ServerResponse `json:"-"` 2257 2258 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2259 // unconditionally include in API requests. By default, fields with 2260 // empty values are omitted from API requests. However, any non-pointer, 2261 // non-interface field appearing in ForceSendFields will be sent to the 2262 // server regardless of whether the field is empty or not. This may be 2263 // used to include empty fields in Patch requests. 2264 ForceSendFields []string `json:"-"` 2265 2266 // NullFields is a list of field names (e.g. "NextPageToken") to include 2267 // in API requests with the JSON null value. By default, fields with 2268 // empty values are omitted from API requests. However, any field with 2269 // an empty value appearing in NullFields will be sent to the server as 2270 // null. It is an error if a field in this list has a non-empty value. 2271 // This may be used to include null fields in Patch requests. 2272 NullFields []string `json:"-"` 2273} 2274 2275func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2276 type NoMethod ListOperationsResponse 2277 raw := NoMethod(*s) 2278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2279} 2280 2281// ListPoliciesResponse: Response to a request to list policies for a 2282// given enterprise. 2283type ListPoliciesResponse struct { 2284 // NextPageToken: If there are more results, a token to retrieve next 2285 // page of results. 2286 NextPageToken string `json:"nextPageToken,omitempty"` 2287 2288 // Policies: The list of policies. 2289 Policies []*Policy `json:"policies,omitempty"` 2290 2291 // ServerResponse contains the HTTP response code and headers from the 2292 // server. 2293 googleapi.ServerResponse `json:"-"` 2294 2295 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2296 // unconditionally include in API requests. By default, fields with 2297 // empty values are omitted from API requests. However, any non-pointer, 2298 // non-interface field appearing in ForceSendFields will be sent to the 2299 // server regardless of whether the field is empty or not. This may be 2300 // used to include empty fields in Patch requests. 2301 ForceSendFields []string `json:"-"` 2302 2303 // NullFields is a list of field names (e.g. "NextPageToken") to include 2304 // in API requests with the JSON null value. By default, fields with 2305 // empty values are omitted from API requests. However, any field with 2306 // an empty value appearing in NullFields will be sent to the server as 2307 // null. It is an error if a field in this list has a non-empty value. 2308 // This may be used to include null fields in Patch requests. 2309 NullFields []string `json:"-"` 2310} 2311 2312func (s *ListPoliciesResponse) MarshalJSON() ([]byte, error) { 2313 type NoMethod ListPoliciesResponse 2314 raw := NoMethod(*s) 2315 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2316} 2317 2318// ListWebAppsResponse: Response to a request to list web apps for a 2319// given enterprise. 2320type ListWebAppsResponse struct { 2321 // NextPageToken: If there are more results, a token to retrieve next 2322 // page of results. 2323 NextPageToken string `json:"nextPageToken,omitempty"` 2324 2325 // WebApps: The list of web apps. 2326 WebApps []*WebApp `json:"webApps,omitempty"` 2327 2328 // ServerResponse contains the HTTP response code and headers from the 2329 // server. 2330 googleapi.ServerResponse `json:"-"` 2331 2332 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2333 // unconditionally include in API requests. By default, fields with 2334 // empty values are omitted from API requests. However, any non-pointer, 2335 // non-interface field appearing in ForceSendFields will be sent to the 2336 // server regardless of whether the field is empty or not. This may be 2337 // used to include empty fields in Patch requests. 2338 ForceSendFields []string `json:"-"` 2339 2340 // NullFields is a list of field names (e.g. "NextPageToken") to include 2341 // in API requests with the JSON null value. By default, fields with 2342 // empty values are omitted from API requests. However, any field with 2343 // an empty value appearing in NullFields will be sent to the server as 2344 // null. It is an error if a field in this list has a non-empty value. 2345 // This may be used to include null fields in Patch requests. 2346 NullFields []string `json:"-"` 2347} 2348 2349func (s *ListWebAppsResponse) MarshalJSON() ([]byte, error) { 2350 type NoMethod ListWebAppsResponse 2351 raw := NoMethod(*s) 2352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2353} 2354 2355// ManagedConfigurationTemplate: The managed configurations template for 2356// the app, saved from the managed configurations iframe. 2357type ManagedConfigurationTemplate struct { 2358 // ConfigurationVariables: Optional, a map containing configuration 2359 // variables defined for the configuration. 2360 ConfigurationVariables map[string]string `json:"configurationVariables,omitempty"` 2361 2362 // TemplateId: The ID of the managed configurations template. 2363 TemplateId string `json:"templateId,omitempty"` 2364 2365 // ForceSendFields is a list of field names (e.g. 2366 // "ConfigurationVariables") to unconditionally include in API requests. 2367 // By default, fields with empty values are omitted from API requests. 2368 // However, any non-pointer, non-interface field appearing in 2369 // ForceSendFields will be sent to the server regardless of whether the 2370 // field is empty or not. This may be used to include empty fields in 2371 // Patch requests. 2372 ForceSendFields []string `json:"-"` 2373 2374 // NullFields is a list of field names (e.g. "ConfigurationVariables") 2375 // to include in API requests with the JSON null value. By default, 2376 // fields with empty values are omitted from API requests. However, any 2377 // field with an empty value appearing in NullFields will be sent to the 2378 // server as null. It is an error if a field in this list has a 2379 // non-empty value. This may be used to include null fields in Patch 2380 // requests. 2381 NullFields []string `json:"-"` 2382} 2383 2384func (s *ManagedConfigurationTemplate) MarshalJSON() ([]byte, error) { 2385 type NoMethod ManagedConfigurationTemplate 2386 raw := NoMethod(*s) 2387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2388} 2389 2390// ManagedProperty: Managed property. 2391type ManagedProperty struct { 2392 // DefaultValue: The default value of the property. BUNDLE_ARRAY 2393 // properties don't have a default value. 2394 DefaultValue interface{} `json:"defaultValue,omitempty"` 2395 2396 // Description: A longer description of the property, providing more 2397 // detail of what it affects. Localized. 2398 Description string `json:"description,omitempty"` 2399 2400 // Entries: For CHOICE or MULTISELECT properties, the list of possible 2401 // entries. 2402 Entries []*ManagedPropertyEntry `json:"entries,omitempty"` 2403 2404 // Key: The unique key that the app uses to identify the property, e.g. 2405 // "com.google.android.gm.fieldname". 2406 Key string `json:"key,omitempty"` 2407 2408 // NestedProperties: For BUNDLE_ARRAY properties, the list of nested 2409 // properties. A BUNDLE_ARRAY property is at most two levels deep. 2410 NestedProperties []*ManagedProperty `json:"nestedProperties,omitempty"` 2411 2412 // Title: The name of the property. Localized. 2413 Title string `json:"title,omitempty"` 2414 2415 // Type: The type of the property. 2416 // 2417 // Possible values: 2418 // "MANAGED_PROPERTY_TYPE_UNSPECIFIED" - Not used. 2419 // "BOOL" - A property of boolean type. 2420 // "STRING" - A property of string type. 2421 // "INTEGER" - A property of integer type. 2422 // "CHOICE" - A choice of one item from a set. 2423 // "MULTISELECT" - A choice of multiple items from a set. 2424 // "HIDDEN" - A hidden restriction of string type (the default value 2425 // can be used to pass along information that can't be modified, such as 2426 // a version code). 2427 // "BUNDLE" - A bundle of properties 2428 // "BUNDLE_ARRAY" - An array of property bundles. 2429 Type string `json:"type,omitempty"` 2430 2431 // ForceSendFields is a list of field names (e.g. "DefaultValue") to 2432 // unconditionally include in API requests. By default, fields with 2433 // empty values are omitted from API requests. However, any non-pointer, 2434 // non-interface field appearing in ForceSendFields will be sent to the 2435 // server regardless of whether the field is empty or not. This may be 2436 // used to include empty fields in Patch requests. 2437 ForceSendFields []string `json:"-"` 2438 2439 // NullFields is a list of field names (e.g. "DefaultValue") to include 2440 // in API requests with the JSON null value. By default, fields with 2441 // empty values are omitted from API requests. However, any field with 2442 // an empty value appearing in NullFields will be sent to the server as 2443 // null. It is an error if a field in this list has a non-empty value. 2444 // This may be used to include null fields in Patch requests. 2445 NullFields []string `json:"-"` 2446} 2447 2448func (s *ManagedProperty) MarshalJSON() ([]byte, error) { 2449 type NoMethod ManagedProperty 2450 raw := NoMethod(*s) 2451 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2452} 2453 2454// ManagedPropertyEntry: An entry of a managed property. 2455type ManagedPropertyEntry struct { 2456 // Name: The human-readable name of the value. Localized. 2457 Name string `json:"name,omitempty"` 2458 2459 // Value: The machine-readable value of the entry, which should be used 2460 // in the configuration. Not localized. 2461 Value string `json:"value,omitempty"` 2462 2463 // ForceSendFields is a list of field names (e.g. "Name") to 2464 // unconditionally include in API requests. By default, fields with 2465 // empty values are omitted from API requests. However, any non-pointer, 2466 // non-interface field appearing in ForceSendFields will be sent to the 2467 // server regardless of whether the field is empty or not. This may be 2468 // used to include empty fields in Patch requests. 2469 ForceSendFields []string `json:"-"` 2470 2471 // NullFields is a list of field names (e.g. "Name") to include in API 2472 // requests with the JSON null value. By default, fields with empty 2473 // values are omitted from API requests. However, any field with an 2474 // empty value appearing in NullFields will be sent to the server as 2475 // null. It is an error if a field in this list has a non-empty value. 2476 // This may be used to include null fields in Patch requests. 2477 NullFields []string `json:"-"` 2478} 2479 2480func (s *ManagedPropertyEntry) MarshalJSON() ([]byte, error) { 2481 type NoMethod ManagedPropertyEntry 2482 raw := NoMethod(*s) 2483 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2484} 2485 2486// MemoryEvent: An event related to memory and storage measurements. 2487type MemoryEvent struct { 2488 // ByteCount: The number of free bytes in the medium, or for 2489 // EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage 2490 // medium. 2491 ByteCount int64 `json:"byteCount,omitempty,string"` 2492 2493 // CreateTime: The creation time of the event. 2494 CreateTime string `json:"createTime,omitempty"` 2495 2496 // EventType: Event type. 2497 // 2498 // Possible values: 2499 // "MEMORY_EVENT_TYPE_UNSPECIFIED" - Unspecified. No events have this 2500 // type. 2501 // "RAM_MEASURED" - Free space in RAM was measured. 2502 // "INTERNAL_STORAGE_MEASURED" - Free space in internal storage was 2503 // measured. 2504 // "EXTERNAL_STORAGE_DETECTED" - A new external storage medium was 2505 // detected. The reported byte count is the total capacity of the 2506 // storage medium. 2507 // "EXTERNAL_STORAGE_REMOVED" - An external storage medium was 2508 // removed. The reported byte count is zero. 2509 // "EXTERNAL_STORAGE_MEASURED" - Free space in an external storage 2510 // medium was measured. 2511 EventType string `json:"eventType,omitempty"` 2512 2513 // ForceSendFields is a list of field names (e.g. "ByteCount") to 2514 // unconditionally include in API requests. By default, fields with 2515 // empty values are omitted from API requests. However, any non-pointer, 2516 // non-interface field appearing in ForceSendFields will be sent to the 2517 // server regardless of whether the field is empty or not. This may be 2518 // used to include empty fields in Patch requests. 2519 ForceSendFields []string `json:"-"` 2520 2521 // NullFields is a list of field names (e.g. "ByteCount") to include in 2522 // API requests with the JSON null value. By default, fields with empty 2523 // values are omitted from API requests. However, any field with an 2524 // empty value appearing in NullFields will be sent to the server as 2525 // null. It is an error if a field in this list has a non-empty value. 2526 // This may be used to include null fields in Patch requests. 2527 NullFields []string `json:"-"` 2528} 2529 2530func (s *MemoryEvent) MarshalJSON() ([]byte, error) { 2531 type NoMethod MemoryEvent 2532 raw := NoMethod(*s) 2533 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2534} 2535 2536// MemoryInfo: Information about device memory and storage. 2537type MemoryInfo struct { 2538 // TotalInternalStorage: Total internal storage on device in bytes. 2539 TotalInternalStorage int64 `json:"totalInternalStorage,omitempty,string"` 2540 2541 // TotalRam: Total RAM on device in bytes. 2542 TotalRam int64 `json:"totalRam,omitempty,string"` 2543 2544 // ForceSendFields is a list of field names (e.g. 2545 // "TotalInternalStorage") to unconditionally include in API requests. 2546 // By default, fields with empty values are omitted from API requests. 2547 // However, any non-pointer, non-interface field appearing in 2548 // ForceSendFields will be sent to the server regardless of whether the 2549 // field is empty or not. This may be used to include empty fields in 2550 // Patch requests. 2551 ForceSendFields []string `json:"-"` 2552 2553 // NullFields is a list of field names (e.g. "TotalInternalStorage") to 2554 // include in API requests with the JSON null value. By default, fields 2555 // with empty values are omitted from API requests. However, any field 2556 // with an empty value appearing in NullFields will be sent to the 2557 // server as null. It is an error if a field in this list has a 2558 // non-empty value. This may be used to include null fields in Patch 2559 // requests. 2560 NullFields []string `json:"-"` 2561} 2562 2563func (s *MemoryInfo) MarshalJSON() ([]byte, error) { 2564 type NoMethod MemoryInfo 2565 raw := NoMethod(*s) 2566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2567} 2568 2569// NetworkInfo: Device network info. 2570type NetworkInfo struct { 2571 // Imei: IMEI number of the GSM device. For example, A1000031212. 2572 Imei string `json:"imei,omitempty"` 2573 2574 // Meid: MEID number of the CDMA device. For example, A00000292788E1. 2575 Meid string `json:"meid,omitempty"` 2576 2577 // NetworkOperatorName: Alphabetic name of current registered operator. 2578 // For example, Vodafone. 2579 NetworkOperatorName string `json:"networkOperatorName,omitempty"` 2580 2581 // TelephonyInfos: Provides telephony information associated with each 2582 // SIM card on the device. Only supported on fully managed devices 2583 // starting from Android API level 23. 2584 TelephonyInfos []*TelephonyInfo `json:"telephonyInfos,omitempty"` 2585 2586 // WifiMacAddress: Wi-Fi MAC address of the device. For example, 2587 // 7c:11:11:11:11:11. 2588 WifiMacAddress string `json:"wifiMacAddress,omitempty"` 2589 2590 // ForceSendFields is a list of field names (e.g. "Imei") to 2591 // unconditionally include in API requests. By default, fields with 2592 // empty values are omitted from API requests. However, any non-pointer, 2593 // non-interface field appearing in ForceSendFields will be sent to the 2594 // server regardless of whether the field is empty or not. This may be 2595 // used to include empty fields in Patch requests. 2596 ForceSendFields []string `json:"-"` 2597 2598 // NullFields is a list of field names (e.g. "Imei") to include in API 2599 // requests with the JSON null value. By default, fields with empty 2600 // values are omitted from API requests. However, any field with an 2601 // empty value appearing in NullFields will be sent to the server as 2602 // null. It is an error if a field in this list has a non-empty value. 2603 // This may be used to include null fields in Patch requests. 2604 NullFields []string `json:"-"` 2605} 2606 2607func (s *NetworkInfo) MarshalJSON() ([]byte, error) { 2608 type NoMethod NetworkInfo 2609 raw := NoMethod(*s) 2610 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2611} 2612 2613// NonComplianceDetail: Provides detail about non-compliance with a 2614// policy setting. 2615type NonComplianceDetail struct { 2616 // CurrentValue: If the policy setting could not be applied, the current 2617 // value of the setting on the device. 2618 CurrentValue interface{} `json:"currentValue,omitempty"` 2619 2620 // FieldPath: For settings with nested fields, if a particular nested 2621 // field is out of compliance, this specifies the full path to the 2622 // offending field. The path is formatted in the same way the policy 2623 // JSON field would be referenced in JavaScript, that is: 1) For 2624 // object-typed fields, the field name is followed by a dot then by a 2625 // subfield name. 2) For array-typed fields, the field name is followed 2626 // by the array index enclosed in brackets. For example, to indicate a 2627 // problem with the url field in the externalData field in the 3rd 2628 // application, the path would be applications[2].externalData.url 2629 FieldPath string `json:"fieldPath,omitempty"` 2630 2631 // InstallationFailureReason: If package_name is set and the 2632 // non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the 2633 // detailed reason the app can't be installed or updated. 2634 // 2635 // Possible values: 2636 // "INSTALLATION_FAILURE_REASON_UNSPECIFIED" - This value is 2637 // disallowed. 2638 // "INSTALLATION_FAILURE_REASON_UNKNOWN" - An unknown condition is 2639 // preventing the app from being installed. Some potential reasons are 2640 // that the device doesn't have enough storage, the device network 2641 // connection is unreliable, or the installation is taking longer than 2642 // expected. The installation will be retried automatically. 2643 // "IN_PROGRESS" - The installation is still in progress. 2644 // "NOT_FOUND" - The app was not found in Play. 2645 // "NOT_COMPATIBLE_WITH_DEVICE" - The app is incompatible with the 2646 // device. 2647 // "NOT_APPROVED" - The app has not been approved by the admin. 2648 // "PERMISSIONS_NOT_ACCEPTED" - The app has new permissions that have 2649 // not been accepted by the admin. 2650 // "NOT_AVAILABLE_IN_COUNTRY" - The app is not available in the user's 2651 // country. 2652 // "NO_LICENSES_REMAINING" - There are no licenses available to assign 2653 // to the user. 2654 // "NOT_ENROLLED" - The enterprise is no longer enrolled with Managed 2655 // Google Play or the admin has not accepted the latest Managed Google 2656 // Play Terms of Service. 2657 // "USER_INVALID" - The user is no longer valid. The user may have 2658 // been deleted or disabled. 2659 InstallationFailureReason string `json:"installationFailureReason,omitempty"` 2660 2661 // NonComplianceReason: The reason the device is not in compliance with 2662 // the setting. 2663 // 2664 // Possible values: 2665 // "NON_COMPLIANCE_REASON_UNSPECIFIED" - This value is disallowed. 2666 // "API_LEVEL" - The setting is not supported in the API level of the 2667 // Android version running on the device. 2668 // "MANAGEMENT_MODE" - The management mode (profile owner, device 2669 // owner, etc.) doesn't support the setting. 2670 // "USER_ACTION" - The user has not taken required action to comply 2671 // with the setting. 2672 // "INVALID_VALUE" - The setting has an invalid value. 2673 // "APP_NOT_INSTALLED" - The app required to implement the policy is 2674 // not installed. 2675 // "UNSUPPORTED" - The policy is not supported by the version of 2676 // Android Device Policy on the device. 2677 // "APP_INSTALLED" - A blocked app is installed. 2678 // "PENDING" - The setting hasn't been applied at the time of the 2679 // report, but is expected to be applied shortly. 2680 // "APP_INCOMPATIBLE" - The setting can't be applied to the app 2681 // because the app doesn't support it, for example because its target 2682 // SDK version is not high enough. 2683 // "APP_NOT_UPDATED" - The app is installed, but it hasn't been 2684 // updated to the minimum version code specified by policy. 2685 NonComplianceReason string `json:"nonComplianceReason,omitempty"` 2686 2687 // PackageName: The package name indicating which app is out of 2688 // compliance, if applicable. 2689 PackageName string `json:"packageName,omitempty"` 2690 2691 // SettingName: The name of the policy setting. This is the JSON field 2692 // name of a top-level Policy field. 2693 SettingName string `json:"settingName,omitempty"` 2694 2695 // ForceSendFields is a list of field names (e.g. "CurrentValue") to 2696 // unconditionally include in API requests. By default, fields with 2697 // empty values are omitted from API requests. However, any non-pointer, 2698 // non-interface field appearing in ForceSendFields will be sent to the 2699 // server regardless of whether the field is empty or not. This may be 2700 // used to include empty fields in Patch requests. 2701 ForceSendFields []string `json:"-"` 2702 2703 // NullFields is a list of field names (e.g. "CurrentValue") to include 2704 // in API requests with the JSON null value. By default, fields with 2705 // empty values are omitted from API requests. However, any field with 2706 // an empty value appearing in NullFields will be sent to the server as 2707 // null. It is an error if a field in this list has a non-empty value. 2708 // This may be used to include null fields in Patch requests. 2709 NullFields []string `json:"-"` 2710} 2711 2712func (s *NonComplianceDetail) MarshalJSON() ([]byte, error) { 2713 type NoMethod NonComplianceDetail 2714 raw := NoMethod(*s) 2715 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2716} 2717 2718// NonComplianceDetailCondition: A compliance rule condition which is 2719// satisfied if there exists any matching NonComplianceDetail for the 2720// device. A NonComplianceDetail matches a NonComplianceDetailCondition 2721// if all the fields which are set within the 2722// NonComplianceDetailCondition match the corresponding 2723// NonComplianceDetail fields. 2724type NonComplianceDetailCondition struct { 2725 // NonComplianceReason: The reason the device is not in compliance with 2726 // the setting. If not set, then this condition matches any reason. 2727 // 2728 // Possible values: 2729 // "NON_COMPLIANCE_REASON_UNSPECIFIED" - This value is disallowed. 2730 // "API_LEVEL" - The setting is not supported in the API level of the 2731 // Android version running on the device. 2732 // "MANAGEMENT_MODE" - The management mode (profile owner, device 2733 // owner, etc.) doesn't support the setting. 2734 // "USER_ACTION" - The user has not taken required action to comply 2735 // with the setting. 2736 // "INVALID_VALUE" - The setting has an invalid value. 2737 // "APP_NOT_INSTALLED" - The app required to implement the policy is 2738 // not installed. 2739 // "UNSUPPORTED" - The policy is not supported by the version of 2740 // Android Device Policy on the device. 2741 // "APP_INSTALLED" - A blocked app is installed. 2742 // "PENDING" - The setting hasn't been applied at the time of the 2743 // report, but is expected to be applied shortly. 2744 // "APP_INCOMPATIBLE" - The setting can't be applied to the app 2745 // because the app doesn't support it, for example because its target 2746 // SDK version is not high enough. 2747 // "APP_NOT_UPDATED" - The app is installed, but it hasn't been 2748 // updated to the minimum version code specified by policy. 2749 NonComplianceReason string `json:"nonComplianceReason,omitempty"` 2750 2751 // PackageName: The package name of the app that's out of compliance. If 2752 // not set, then this condition matches any package name. 2753 PackageName string `json:"packageName,omitempty"` 2754 2755 // SettingName: The name of the policy setting. This is the JSON field 2756 // name of a top-level Policy field. If not set, then this condition 2757 // matches any setting name. 2758 SettingName string `json:"settingName,omitempty"` 2759 2760 // ForceSendFields is a list of field names (e.g. "NonComplianceReason") 2761 // to unconditionally include in API requests. By default, fields with 2762 // empty values are omitted from API requests. However, any non-pointer, 2763 // non-interface field appearing in ForceSendFields will be sent to the 2764 // server regardless of whether the field is empty or not. This may be 2765 // used to include empty fields in Patch requests. 2766 ForceSendFields []string `json:"-"` 2767 2768 // NullFields is a list of field names (e.g. "NonComplianceReason") to 2769 // include in API requests with the JSON null value. By default, fields 2770 // with empty values are omitted from API requests. However, any field 2771 // with an empty value appearing in NullFields will be sent to the 2772 // server as null. It is an error if a field in this list has a 2773 // non-empty value. This may be used to include null fields in Patch 2774 // requests. 2775 NullFields []string `json:"-"` 2776} 2777 2778func (s *NonComplianceDetailCondition) MarshalJSON() ([]byte, error) { 2779 type NoMethod NonComplianceDetailCondition 2780 raw := NoMethod(*s) 2781 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2782} 2783 2784// OncCertificateProvider: This feature is not generally available. 2785type OncCertificateProvider struct { 2786 // CertificateReferences: This feature is not generally available. 2787 CertificateReferences []string `json:"certificateReferences,omitempty"` 2788 2789 // ContentProviderEndpoint: This feature is not generally available. 2790 ContentProviderEndpoint *ContentProviderEndpoint `json:"contentProviderEndpoint,omitempty"` 2791 2792 // ForceSendFields is a list of field names (e.g. 2793 // "CertificateReferences") to unconditionally include in API requests. 2794 // By default, fields with empty values are omitted from API requests. 2795 // However, any non-pointer, non-interface field appearing in 2796 // ForceSendFields will be sent to the server regardless of whether the 2797 // field is empty or not. This may be used to include empty fields in 2798 // Patch requests. 2799 ForceSendFields []string `json:"-"` 2800 2801 // NullFields is a list of field names (e.g. "CertificateReferences") to 2802 // include in API requests with the JSON null value. By default, fields 2803 // with empty values are omitted from API requests. However, any field 2804 // with an empty value appearing in NullFields will be sent to the 2805 // server as null. It is an error if a field in this list has a 2806 // non-empty value. This may be used to include null fields in Patch 2807 // requests. 2808 NullFields []string `json:"-"` 2809} 2810 2811func (s *OncCertificateProvider) MarshalJSON() ([]byte, error) { 2812 type NoMethod OncCertificateProvider 2813 raw := NoMethod(*s) 2814 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2815} 2816 2817// Operation: This resource represents a long-running operation that is 2818// the result of a network API call. 2819type Operation struct { 2820 // Done: If the value is false, it means the operation is still in 2821 // progress. If true, the operation is completed, and either error or 2822 // response is available. 2823 Done bool `json:"done,omitempty"` 2824 2825 // Error: The error result of the operation in case of failure or 2826 // cancellation. 2827 Error *Status `json:"error,omitempty"` 2828 2829 // Metadata: Service-specific metadata associated with the operation. It 2830 // typically contains progress information and common metadata such as 2831 // create time. Some services might not provide such metadata. Any 2832 // method that returns a long-running operation should document the 2833 // metadata type, if any. 2834 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2835 2836 // Name: The server-assigned name, which is only unique within the same 2837 // service that originally returns it. If you use the default HTTP 2838 // mapping, the name should be a resource name ending with 2839 // operations/{unique_id}. 2840 Name string `json:"name,omitempty"` 2841 2842 // Response: The normal response of the operation in case of success. If 2843 // the original method returns no data on success, such as Delete, the 2844 // response is google.protobuf.Empty. If the original method is standard 2845 // Get/Create/Update, the response should be the resource. For other 2846 // methods, the response should have the type XxxResponse, where Xxx is 2847 // the original method name. For example, if the original method name is 2848 // TakeSnapshot(), the inferred response type is TakeSnapshotResponse. 2849 Response googleapi.RawMessage `json:"response,omitempty"` 2850 2851 // ServerResponse contains the HTTP response code and headers from the 2852 // server. 2853 googleapi.ServerResponse `json:"-"` 2854 2855 // ForceSendFields is a list of field names (e.g. "Done") to 2856 // unconditionally include in API requests. By default, fields with 2857 // empty values are omitted from API requests. However, any non-pointer, 2858 // non-interface field appearing in ForceSendFields will be sent to the 2859 // server regardless of whether the field is empty or not. This may be 2860 // used to include empty fields in Patch requests. 2861 ForceSendFields []string `json:"-"` 2862 2863 // NullFields is a list of field names (e.g. "Done") to include in API 2864 // requests with the JSON null value. By default, fields with empty 2865 // values are omitted from API requests. However, any field with an 2866 // empty value appearing in NullFields will be sent to the server as 2867 // null. It is an error if a field in this list has a non-empty value. 2868 // This may be used to include null fields in Patch requests. 2869 NullFields []string `json:"-"` 2870} 2871 2872func (s *Operation) MarshalJSON() ([]byte, error) { 2873 type NoMethod Operation 2874 raw := NoMethod(*s) 2875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2876} 2877 2878// PackageNameList: A list of package names. 2879type PackageNameList struct { 2880 // PackageNames: A list of package names. 2881 PackageNames []string `json:"packageNames,omitempty"` 2882 2883 // ForceSendFields is a list of field names (e.g. "PackageNames") to 2884 // unconditionally include in API requests. By default, fields with 2885 // empty values are omitted from API requests. However, any non-pointer, 2886 // non-interface field appearing in ForceSendFields will be sent to the 2887 // server regardless of whether the field is empty or not. This may be 2888 // used to include empty fields in Patch requests. 2889 ForceSendFields []string `json:"-"` 2890 2891 // NullFields is a list of field names (e.g. "PackageNames") to include 2892 // in API requests with the JSON null value. By default, fields with 2893 // empty values are omitted from API requests. However, any field with 2894 // an empty value appearing in NullFields will be sent to the server as 2895 // null. It is an error if a field in this list has a non-empty value. 2896 // This may be used to include null fields in Patch requests. 2897 NullFields []string `json:"-"` 2898} 2899 2900func (s *PackageNameList) MarshalJSON() ([]byte, error) { 2901 type NoMethod PackageNameList 2902 raw := NoMethod(*s) 2903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2904} 2905 2906// PasswordRequirements: Requirements for the password used to unlock a 2907// device. 2908type PasswordRequirements struct { 2909 // MaximumFailedPasswordsForWipe: Number of incorrect device-unlock 2910 // passwords that can be entered before a device is wiped. A value of 0 2911 // means there is no restriction. 2912 MaximumFailedPasswordsForWipe int64 `json:"maximumFailedPasswordsForWipe,omitempty"` 2913 2914 // PasswordExpirationTimeout: Password expiration timeout. 2915 PasswordExpirationTimeout string `json:"passwordExpirationTimeout,omitempty"` 2916 2917 // PasswordHistoryLength: The length of the password history. After 2918 // setting this field, the user won't be able to enter a new password 2919 // that is the same as any password in the history. A value of 0 means 2920 // there is no restriction. 2921 PasswordHistoryLength int64 `json:"passwordHistoryLength,omitempty"` 2922 2923 // PasswordMinimumLength: The minimum allowed password length. A value 2924 // of 0 means there is no restriction. Only enforced when 2925 // password_quality is NUMERIC, NUMERIC_COMPLEX, ALPHABETIC, 2926 // ALPHANUMERIC, or COMPLEX. 2927 PasswordMinimumLength int64 `json:"passwordMinimumLength,omitempty"` 2928 2929 // PasswordMinimumLetters: Minimum number of letters required in the 2930 // password. Only enforced when password_quality is COMPLEX. 2931 PasswordMinimumLetters int64 `json:"passwordMinimumLetters,omitempty"` 2932 2933 // PasswordMinimumLowerCase: Minimum number of lower case letters 2934 // required in the password. Only enforced when password_quality is 2935 // COMPLEX. 2936 PasswordMinimumLowerCase int64 `json:"passwordMinimumLowerCase,omitempty"` 2937 2938 // PasswordMinimumNonLetter: Minimum number of non-letter characters 2939 // (numerical digits or symbols) required in the password. Only enforced 2940 // when password_quality is COMPLEX. 2941 PasswordMinimumNonLetter int64 `json:"passwordMinimumNonLetter,omitempty"` 2942 2943 // PasswordMinimumNumeric: Minimum number of numerical digits required 2944 // in the password. Only enforced when password_quality is COMPLEX. 2945 PasswordMinimumNumeric int64 `json:"passwordMinimumNumeric,omitempty"` 2946 2947 // PasswordMinimumSymbols: Minimum number of symbols required in the 2948 // password. Only enforced when password_quality is COMPLEX. 2949 PasswordMinimumSymbols int64 `json:"passwordMinimumSymbols,omitempty"` 2950 2951 // PasswordMinimumUpperCase: Minimum number of upper case letters 2952 // required in the password. Only enforced when password_quality is 2953 // COMPLEX. 2954 PasswordMinimumUpperCase int64 `json:"passwordMinimumUpperCase,omitempty"` 2955 2956 // PasswordQuality: The required password quality. 2957 // 2958 // Possible values: 2959 // "PASSWORD_QUALITY_UNSPECIFIED" - There are no password 2960 // requirements. 2961 // "BIOMETRIC_WEAK" - The device must be secured with a low-security 2962 // biometric recognition technology, at minimum. This includes 2963 // technologies that can recognize the identity of an individual that 2964 // are roughly equivalent to a 3-digit PIN (false detection is less than 2965 // 1 in 1,000). 2966 // "SOMETHING" - A password is required, but there are no restrictions 2967 // on what the password must contain. 2968 // "NUMERIC" - The password must contain numeric characters. 2969 // "NUMERIC_COMPLEX" - The password must contain numeric characters 2970 // with no repeating (4444) or ordered (1234, 4321, 2468) sequences. 2971 // "ALPHABETIC" - The password must contain alphabetic (or symbol) 2972 // characters. 2973 // "ALPHANUMERIC" - The password must contain both numeric and 2974 // alphabetic (or symbol) characters. 2975 // "COMPLEX" - The password must meet the minimum requirements 2976 // specified in passwordMinimumLength, passwordMinimumLetters, 2977 // passwordMinimumSymbols, etc. For example, if passwordMinimumSymbols 2978 // is 2, the password must contain at least two symbols. 2979 PasswordQuality string `json:"passwordQuality,omitempty"` 2980 2981 // PasswordScope: The scope that the password requirement applies to. 2982 // 2983 // Possible values: 2984 // "SCOPE_UNSPECIFIED" - The scope is unspecified. The password 2985 // requirements are applied to the work profile for work profile devices 2986 // and the whole device for fully managed or dedicated devices. 2987 // "SCOPE_DEVICE" - The password requirements are only applied to the 2988 // device. 2989 // "SCOPE_PROFILE" - The password requirements are only applied to the 2990 // work profile. 2991 PasswordScope string `json:"passwordScope,omitempty"` 2992 2993 // RequirePasswordUnlock: The length of time after a device or work 2994 // profile is unlocked using a strong form of authentication (password, 2995 // PIN, pattern) that it can be unlocked using any other authentication 2996 // method (e.g. fingerprint, trust agents, face). After the specified 2997 // time period elapses, only strong forms of authentication can be used 2998 // to unlock the device or work profile. 2999 // 3000 // Possible values: 3001 // "REQUIRE_PASSWORD_UNLOCK_UNSPECIFIED" - Unspecified. Defaults to 3002 // USE_DEFAULT_DEVICE_TIMEOUT. 3003 // "USE_DEFAULT_DEVICE_TIMEOUT" - The timeout period is set to the 3004 // device’s default. 3005 // "REQUIRE_EVERY_DAY" - The timeout period is set to 24 hours. 3006 RequirePasswordUnlock string `json:"requirePasswordUnlock,omitempty"` 3007 3008 // ForceSendFields is a list of field names (e.g. 3009 // "MaximumFailedPasswordsForWipe") to unconditionally include in API 3010 // requests. By default, fields with empty values are omitted from API 3011 // requests. However, any non-pointer, non-interface field appearing in 3012 // ForceSendFields will be sent to the server regardless of whether the 3013 // field is empty or not. This may be used to include empty fields in 3014 // Patch requests. 3015 ForceSendFields []string `json:"-"` 3016 3017 // NullFields is a list of field names (e.g. 3018 // "MaximumFailedPasswordsForWipe") to include in API requests with the 3019 // JSON null value. By default, fields with empty values are omitted 3020 // from API requests. However, any field with an empty value appearing 3021 // in NullFields will be sent to the server as null. It is an error if a 3022 // field in this list has a non-empty value. This may be used to include 3023 // null fields in Patch requests. 3024 NullFields []string `json:"-"` 3025} 3026 3027func (s *PasswordRequirements) MarshalJSON() ([]byte, error) { 3028 type NoMethod PasswordRequirements 3029 raw := NoMethod(*s) 3030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3031} 3032 3033// PermissionGrant: Configuration for an Android permission and its 3034// grant state. 3035type PermissionGrant struct { 3036 // Permission: The Android permission or group, e.g. 3037 // android.permission.READ_CALENDAR or 3038 // android.permission_group.CALENDAR. 3039 Permission string `json:"permission,omitempty"` 3040 3041 // Policy: The policy for granting the permission. 3042 // 3043 // Possible values: 3044 // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no 3045 // policy is specified for a permission at any level, then the PROMPT 3046 // behavior is used by default. 3047 // "PROMPT" - Prompt the user to grant a permission. 3048 // "GRANT" - Automatically grant a permission. 3049 // "DENY" - Automatically deny a permission. 3050 Policy string `json:"policy,omitempty"` 3051 3052 // ForceSendFields is a list of field names (e.g. "Permission") to 3053 // unconditionally include in API requests. By default, fields with 3054 // empty values are omitted from API requests. However, any non-pointer, 3055 // non-interface field appearing in ForceSendFields will be sent to the 3056 // server regardless of whether the field is empty or not. This may be 3057 // used to include empty fields in Patch requests. 3058 ForceSendFields []string `json:"-"` 3059 3060 // NullFields is a list of field names (e.g. "Permission") to include in 3061 // API requests with the JSON null value. By default, fields with empty 3062 // values are omitted from API requests. However, any field with an 3063 // empty value appearing in NullFields will be sent to the server as 3064 // null. It is an error if a field in this list has a non-empty value. 3065 // This may be used to include null fields in Patch requests. 3066 NullFields []string `json:"-"` 3067} 3068 3069func (s *PermissionGrant) MarshalJSON() ([]byte, error) { 3070 type NoMethod PermissionGrant 3071 raw := NoMethod(*s) 3072 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3073} 3074 3075// PersistentPreferredActivity: A default activity for handling intents 3076// that match a particular intent filter. Note: To set up a kiosk, use 3077// InstallType to KIOSK rather than use persistent preferred activities. 3078type PersistentPreferredActivity struct { 3079 // Actions: The intent actions to match in the filter. If any actions 3080 // are included in the filter, then an intent's action must be one of 3081 // those values for it to match. If no actions are included, the intent 3082 // action is ignored. 3083 Actions []string `json:"actions,omitempty"` 3084 3085 // Categories: The intent categories to match in the filter. An intent 3086 // includes the categories that it requires, all of which must be 3087 // included in the filter in order to match. In other words, adding a 3088 // category to the filter has no impact on matching unless that category 3089 // is specified in the intent. 3090 Categories []string `json:"categories,omitempty"` 3091 3092 // ReceiverActivity: The activity that should be the default intent 3093 // handler. This should be an Android component name, e.g. 3094 // com.android.enterprise.app/.MainActivity. Alternatively, the value 3095 // may be the package name of an app, which causes Android Device Policy 3096 // to choose an appropriate activity from the app to handle the intent. 3097 ReceiverActivity string `json:"receiverActivity,omitempty"` 3098 3099 // ForceSendFields is a list of field names (e.g. "Actions") to 3100 // unconditionally include in API requests. By default, fields with 3101 // empty values are omitted from API requests. However, any non-pointer, 3102 // non-interface field appearing in ForceSendFields will be sent to the 3103 // server regardless of whether the field is empty or not. This may be 3104 // used to include empty fields in Patch requests. 3105 ForceSendFields []string `json:"-"` 3106 3107 // NullFields is a list of field names (e.g. "Actions") to include in 3108 // API requests with the JSON null value. By default, fields with empty 3109 // values are omitted from API requests. However, any field with an 3110 // empty value appearing in NullFields will be sent to the server as 3111 // null. It is an error if a field in this list has a non-empty value. 3112 // This may be used to include null fields in Patch requests. 3113 NullFields []string `json:"-"` 3114} 3115 3116func (s *PersistentPreferredActivity) MarshalJSON() ([]byte, error) { 3117 type NoMethod PersistentPreferredActivity 3118 raw := NoMethod(*s) 3119 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3120} 3121 3122// PersonalApplicationPolicy: Policies for apps in the personal profile 3123// of a company-owned device with a work profile. 3124type PersonalApplicationPolicy struct { 3125 // InstallType: The type of installation to perform. 3126 // 3127 // Possible values: 3128 // "INSTALL_TYPE_UNSPECIFIED" - Unspecified. Defaults to AVAILABLE. 3129 // "BLOCKED" - The app is blocked and can't be installed in the 3130 // personal profile. 3131 // "AVAILABLE" - The app is available to install in the personal 3132 // profile. 3133 InstallType string `json:"installType,omitempty"` 3134 3135 // PackageName: The package name of the application. 3136 PackageName string `json:"packageName,omitempty"` 3137 3138 // ForceSendFields is a list of field names (e.g. "InstallType") to 3139 // unconditionally include in API requests. By default, fields with 3140 // empty values are omitted from API requests. However, any non-pointer, 3141 // non-interface field appearing in ForceSendFields will be sent to the 3142 // server regardless of whether the field is empty or not. This may be 3143 // used to include empty fields in Patch requests. 3144 ForceSendFields []string `json:"-"` 3145 3146 // NullFields is a list of field names (e.g. "InstallType") to include 3147 // in API requests with the JSON null value. By default, fields with 3148 // empty values are omitted from API requests. However, any field with 3149 // an empty value appearing in NullFields will be sent to the server as 3150 // null. It is an error if a field in this list has a non-empty value. 3151 // This may be used to include null fields in Patch requests. 3152 NullFields []string `json:"-"` 3153} 3154 3155func (s *PersonalApplicationPolicy) MarshalJSON() ([]byte, error) { 3156 type NoMethod PersonalApplicationPolicy 3157 raw := NoMethod(*s) 3158 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3159} 3160 3161// PersonalUsagePolicies: Policies controlling personal usage on a 3162// company-owned device with a work profile. 3163type PersonalUsagePolicies struct { 3164 // AccountTypesWithManagementDisabled: Account types that can't be 3165 // managed by the user. 3166 AccountTypesWithManagementDisabled []string `json:"accountTypesWithManagementDisabled,omitempty"` 3167 3168 // CameraDisabled: Whether camera is disabled. 3169 CameraDisabled bool `json:"cameraDisabled,omitempty"` 3170 3171 // MaxDaysWithWorkOff: Controls how long the work profile can stay off. 3172 // The duration must be at least 3 days. 3173 MaxDaysWithWorkOff int64 `json:"maxDaysWithWorkOff,omitempty"` 3174 3175 // PersonalApplications: Policy applied to applications in the personal 3176 // profile. 3177 PersonalApplications []*PersonalApplicationPolicy `json:"personalApplications,omitempty"` 3178 3179 // PersonalPlayStoreMode: Used together with personalApplications to 3180 // control how apps in the personal profile are allowed or blocked. 3181 // 3182 // Possible values: 3183 // "PLAY_STORE_MODE_UNSPECIFIED" - Unspecified. Defaults to BLOCKLIST. 3184 // "BLACKLIST" - All Play Store apps are available for installation in 3185 // the personal profile, except those whose installType is BLOCKED in 3186 // personalApplications. 3187 // "BLOCKLIST" - All Play Store apps are available for installation in 3188 // the personal profile, except those whose installType is BLOCKED in 3189 // personalApplications. 3190 // "ALLOWLIST" - Only apps explicitly specified in 3191 // personalApplications with installType set to AVAILABLE are allowed to 3192 // be installed in the personal profile. 3193 PersonalPlayStoreMode string `json:"personalPlayStoreMode,omitempty"` 3194 3195 // ScreenCaptureDisabled: Whether screen capture is disabled. 3196 ScreenCaptureDisabled bool `json:"screenCaptureDisabled,omitempty"` 3197 3198 // ForceSendFields is a list of field names (e.g. 3199 // "AccountTypesWithManagementDisabled") to unconditionally include in 3200 // API requests. By default, fields with empty values are omitted from 3201 // API requests. However, any non-pointer, non-interface field appearing 3202 // in ForceSendFields will be sent to the server regardless of whether 3203 // the field is empty or not. This may be used to include empty fields 3204 // in Patch requests. 3205 ForceSendFields []string `json:"-"` 3206 3207 // NullFields is a list of field names (e.g. 3208 // "AccountTypesWithManagementDisabled") to include in API requests with 3209 // the JSON null value. By default, fields with empty values are omitted 3210 // from API requests. However, any field with an empty value appearing 3211 // in NullFields will be sent to the server as null. It is an error if a 3212 // field in this list has a non-empty value. This may be used to include 3213 // null fields in Patch requests. 3214 NullFields []string `json:"-"` 3215} 3216 3217func (s *PersonalUsagePolicies) MarshalJSON() ([]byte, error) { 3218 type NoMethod PersonalUsagePolicies 3219 raw := NoMethod(*s) 3220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3221} 3222 3223// Policy: A policy resource represents a group of settings that govern 3224// the behavior of a managed device and the apps installed on it. 3225type Policy struct { 3226 // AccountTypesWithManagementDisabled: Account types that can't be 3227 // managed by the user. 3228 AccountTypesWithManagementDisabled []string `json:"accountTypesWithManagementDisabled,omitempty"` 3229 3230 // AddUserDisabled: Whether adding new users and profiles is disabled. 3231 AddUserDisabled bool `json:"addUserDisabled,omitempty"` 3232 3233 // AdjustVolumeDisabled: Whether adjusting the master volume is 3234 // disabled. Also mutes the device. 3235 AdjustVolumeDisabled bool `json:"adjustVolumeDisabled,omitempty"` 3236 3237 // AdvancedSecurityOverrides: Security policies set to the most secure 3238 // values by default. To maintain the security posture of a device, we 3239 // don't recommend overriding any of the default values. 3240 AdvancedSecurityOverrides *AdvancedSecurityOverrides `json:"advancedSecurityOverrides,omitempty"` 3241 3242 // AlwaysOnVpnPackage: Configuration for an always-on VPN connection. 3243 // Use with vpn_config_disabled to prevent modification of this setting. 3244 AlwaysOnVpnPackage *AlwaysOnVpnPackage `json:"alwaysOnVpnPackage,omitempty"` 3245 3246 // AndroidDevicePolicyTracks: The app tracks for Android Device Policy 3247 // the device can access. The device receives the latest version among 3248 // all accessible tracks. If no tracks are specified, then the device 3249 // only uses the production track. 3250 // 3251 // Possible values: 3252 // "APP_TRACK_UNSPECIFIED" - This value is ignored. 3253 // "PRODUCTION" - The production track, which provides the latest 3254 // stable release. 3255 // "BETA" - The beta track, which provides the latest beta release. 3256 AndroidDevicePolicyTracks []string `json:"androidDevicePolicyTracks,omitempty"` 3257 3258 // AppAutoUpdatePolicy: The app auto update policy, which controls when 3259 // automatic app updates can be applied. 3260 // 3261 // Possible values: 3262 // "APP_AUTO_UPDATE_POLICY_UNSPECIFIED" - The auto-update policy is 3263 // not set. Equivalent to CHOICE_TO_THE_USER. 3264 // "CHOICE_TO_THE_USER" - The user can control auto-updates. 3265 // "NEVER" - Apps are never auto-updated. 3266 // "WIFI_ONLY" - Apps are auto-updated over Wi-Fi only. 3267 // "ALWAYS" - Apps are auto-updated at any time. Data charges may 3268 // apply. 3269 AppAutoUpdatePolicy string `json:"appAutoUpdatePolicy,omitempty"` 3270 3271 // Applications: Policy applied to apps. 3272 Applications []*ApplicationPolicy `json:"applications,omitempty"` 3273 3274 // AutoDateAndTimeZone: Whether auto date, time, and time zone are 3275 // enabled on a company-owned device. If this is set, then 3276 // autoTimeRequired is ignored. 3277 // 3278 // Possible values: 3279 // "AUTO_DATE_AND_TIME_ZONE_UNSPECIFIED" - Unspecified. Defaults to 3280 // AUTO_DATE_AND_TIME_ZONE_USER_CHOICE. 3281 // "AUTO_DATE_AND_TIME_ZONE_USER_CHOICE" - Auto date, time, and time 3282 // zone are left to user's choice. 3283 // "AUTO_DATE_AND_TIME_ZONE_ENFORCED" - Enforce auto date, time, and 3284 // time zone on the device. 3285 AutoDateAndTimeZone string `json:"autoDateAndTimeZone,omitempty"` 3286 3287 // AutoTimeRequired: Whether auto time is required, which prevents the 3288 // user from manually setting the date and time. If autoDateAndTimeZone 3289 // is set, this field is ignored. 3290 AutoTimeRequired bool `json:"autoTimeRequired,omitempty"` 3291 3292 // BlockApplicationsEnabled: Whether applications other than the ones 3293 // configured in applications are blocked from being installed. When 3294 // set, applications that were installed under a previous policy but no 3295 // longer appear in the policy are automatically uninstalled. 3296 BlockApplicationsEnabled bool `json:"blockApplicationsEnabled,omitempty"` 3297 3298 // BluetoothConfigDisabled: Whether configuring bluetooth is disabled. 3299 BluetoothConfigDisabled bool `json:"bluetoothConfigDisabled,omitempty"` 3300 3301 // BluetoothContactSharingDisabled: Whether bluetooth contact sharing is 3302 // disabled. 3303 BluetoothContactSharingDisabled bool `json:"bluetoothContactSharingDisabled,omitempty"` 3304 3305 // BluetoothDisabled: Whether bluetooth is disabled. Prefer this setting 3306 // over bluetooth_config_disabled because bluetooth_config_disabled can 3307 // be bypassed by the user. 3308 BluetoothDisabled bool `json:"bluetoothDisabled,omitempty"` 3309 3310 // CameraDisabled: Whether all cameras on the device are disabled. 3311 CameraDisabled bool `json:"cameraDisabled,omitempty"` 3312 3313 // CellBroadcastsConfigDisabled: Whether configuring cell broadcast is 3314 // disabled. 3315 CellBroadcastsConfigDisabled bool `json:"cellBroadcastsConfigDisabled,omitempty"` 3316 3317 // ChoosePrivateKeyRules: Rules for determining apps' access to private 3318 // keys. See ChoosePrivateKeyRule for details. 3319 ChoosePrivateKeyRules []*ChoosePrivateKeyRule `json:"choosePrivateKeyRules,omitempty"` 3320 3321 // ComplianceRules: Rules declaring which mitigating actions to take 3322 // when a device is not compliant with its policy. When the conditions 3323 // for multiple rules are satisfied, all of the mitigating actions for 3324 // the rules are taken. There is a maximum limit of 100 rules. Use 3325 // policy enforcement rules instead. 3326 ComplianceRules []*ComplianceRule `json:"complianceRules,omitempty"` 3327 3328 // CreateWindowsDisabled: Whether creating windows besides app windows 3329 // is disabled. 3330 CreateWindowsDisabled bool `json:"createWindowsDisabled,omitempty"` 3331 3332 // CredentialsConfigDisabled: Whether configuring user credentials is 3333 // disabled. 3334 CredentialsConfigDisabled bool `json:"credentialsConfigDisabled,omitempty"` 3335 3336 // DataRoamingDisabled: Whether roaming data services are disabled. 3337 DataRoamingDisabled bool `json:"dataRoamingDisabled,omitempty"` 3338 3339 // DebuggingFeaturesAllowed: Whether the user is allowed to enable 3340 // debugging features. 3341 DebuggingFeaturesAllowed bool `json:"debuggingFeaturesAllowed,omitempty"` 3342 3343 // DefaultPermissionPolicy: The default permission policy for runtime 3344 // permission requests. 3345 // 3346 // Possible values: 3347 // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no 3348 // policy is specified for a permission at any level, then the PROMPT 3349 // behavior is used by default. 3350 // "PROMPT" - Prompt the user to grant a permission. 3351 // "GRANT" - Automatically grant a permission. 3352 // "DENY" - Automatically deny a permission. 3353 DefaultPermissionPolicy string `json:"defaultPermissionPolicy,omitempty"` 3354 3355 // DeviceOwnerLockScreenInfo: The device owner information to be shown 3356 // on the lock screen. 3357 DeviceOwnerLockScreenInfo *UserFacingMessage `json:"deviceOwnerLockScreenInfo,omitempty"` 3358 3359 // EncryptionPolicy: Whether encryption is enabled 3360 // 3361 // Possible values: 3362 // "ENCRYPTION_POLICY_UNSPECIFIED" - This value is ignored, i.e. no 3363 // encryption required 3364 // "ENABLED_WITHOUT_PASSWORD" - Encryption required but no password 3365 // required to boot 3366 // "ENABLED_WITH_PASSWORD" - Encryption required with password 3367 // required to boot 3368 EncryptionPolicy string `json:"encryptionPolicy,omitempty"` 3369 3370 // EnsureVerifyAppsEnabled: Whether app verification is force-enabled. 3371 EnsureVerifyAppsEnabled bool `json:"ensureVerifyAppsEnabled,omitempty"` 3372 3373 // FactoryResetDisabled: Whether factory resetting from settings is 3374 // disabled. 3375 FactoryResetDisabled bool `json:"factoryResetDisabled,omitempty"` 3376 3377 // FrpAdminEmails: Email addresses of device administrators for factory 3378 // reset protection. When the device is factory reset, it will require 3379 // one of these admins to log in with the Google account email and 3380 // password to unlock the device. If no admins are specified, the device 3381 // won't provide factory reset protection. 3382 FrpAdminEmails []string `json:"frpAdminEmails,omitempty"` 3383 3384 // FunDisabled: Whether the user is allowed to have fun. Controls 3385 // whether the Easter egg game in Settings is disabled. 3386 FunDisabled bool `json:"funDisabled,omitempty"` 3387 3388 // InstallAppsDisabled: Whether user installation of apps is disabled. 3389 InstallAppsDisabled bool `json:"installAppsDisabled,omitempty"` 3390 3391 // InstallUnknownSourcesAllowed: This field has no effect. 3392 InstallUnknownSourcesAllowed bool `json:"installUnknownSourcesAllowed,omitempty"` 3393 3394 // KeyguardDisabled: Whether the keyguard is disabled. 3395 KeyguardDisabled bool `json:"keyguardDisabled,omitempty"` 3396 3397 // KeyguardDisabledFeatures: Disabled keyguard customizations, such as 3398 // widgets. 3399 // 3400 // Possible values: 3401 // "KEYGUARD_DISABLED_FEATURE_UNSPECIFIED" - This value is ignored. 3402 // "CAMERA" - Disable the camera on secure keyguard screens (e.g. 3403 // PIN). 3404 // "NOTIFICATIONS" - Disable showing all notifications on secure 3405 // keyguard screens. 3406 // "UNREDACTED_NOTIFICATIONS" - Disable unredacted notifications on 3407 // secure keyguard screens. 3408 // "TRUST_AGENTS" - Ignore trust agent state on secure keyguard 3409 // screens. 3410 // "DISABLE_FINGERPRINT" - Disable fingerprint sensor on secure 3411 // keyguard screens. 3412 // "DISABLE_REMOTE_INPUT" - Disable text entry into notifications on 3413 // secure keyguard screens. 3414 // "FACE" - Disable face authentication on secure keyguard screens. 3415 // "IRIS" - Disable iris authentication on secure keyguard screens. 3416 // "BIOMETRICS" - Disable all biometric authentication on secure 3417 // keyguard screens. 3418 // "ALL_FEATURES" - Disable all current and future keyguard 3419 // customizations. 3420 KeyguardDisabledFeatures []string `json:"keyguardDisabledFeatures,omitempty"` 3421 3422 // KioskCustomLauncherEnabled: Whether the kiosk custom launcher is 3423 // enabled. This replaces the home screen with a launcher that locks 3424 // down the device to the apps installed via the applications setting. 3425 // Apps appear on a single page in alphabetical order. Use 3426 // kioskCustomization to further configure the kiosk device behavior. 3427 KioskCustomLauncherEnabled bool `json:"kioskCustomLauncherEnabled,omitempty"` 3428 3429 // KioskCustomization: Settings controlling the behavior of a device in 3430 // kiosk mode. To enable kiosk mode, set kioskCustomLauncherEnabled to 3431 // true or specify an app in the policy with installType KIOSK. 3432 KioskCustomization *KioskCustomization `json:"kioskCustomization,omitempty"` 3433 3434 // LocationMode: The degree of location detection enabled. 3435 // 3436 // Possible values: 3437 // "LOCATION_MODE_UNSPECIFIED" - Defaults to LOCATION_USER_CHOICE. 3438 // "HIGH_ACCURACY" - On Android 8 and below, all location detection 3439 // methods are enabled, including GPS, networks, and other sensors. On 3440 // Android 9 and above, this is equivalent to LOCATION_ENFORCED. 3441 // "SENSORS_ONLY" - On Android 8 and below, only GPS and other sensors 3442 // are enabled. On Android 9 and above, this is equivalent to 3443 // LOCATION_ENFORCED. 3444 // "BATTERY_SAVING" - On Android 8 and below, only the network 3445 // location provider is enabled. On Android 9 and above, this is 3446 // equivalent to LOCATION_ENFORCED. 3447 // "OFF" - On Android 8 and below, location setting and accuracy are 3448 // disabled. On Android 9 and above, this is equivalent to 3449 // LOCATION_DISABLED. 3450 // "LOCATION_USER_CHOICE" - Location setting is not restricted on the 3451 // device. No specific behavior is set or enforced. 3452 // "LOCATION_ENFORCED" - Enable location setting on the device. 3453 // "LOCATION_DISABLED" - Disable location setting on the device. 3454 LocationMode string `json:"locationMode,omitempty"` 3455 3456 // LongSupportMessage: A message displayed to the user in the device 3457 // administators settings screen. 3458 LongSupportMessage *UserFacingMessage `json:"longSupportMessage,omitempty"` 3459 3460 // MaximumTimeToLock: Maximum time in milliseconds for user activity 3461 // until the device locks. A value of 0 means there is no restriction. 3462 MaximumTimeToLock int64 `json:"maximumTimeToLock,omitempty,string"` 3463 3464 // MinimumApiLevel: The minimum allowed Android API level. 3465 MinimumApiLevel int64 `json:"minimumApiLevel,omitempty"` 3466 3467 // MobileNetworksConfigDisabled: Whether configuring mobile networks is 3468 // disabled. 3469 MobileNetworksConfigDisabled bool `json:"mobileNetworksConfigDisabled,omitempty"` 3470 3471 // ModifyAccountsDisabled: Whether adding or removing accounts is 3472 // disabled. 3473 ModifyAccountsDisabled bool `json:"modifyAccountsDisabled,omitempty"` 3474 3475 // MountPhysicalMediaDisabled: Whether the user mounting physical 3476 // external media is disabled. 3477 MountPhysicalMediaDisabled bool `json:"mountPhysicalMediaDisabled,omitempty"` 3478 3479 // Name: The name of the policy in the form 3480 // enterprises/{enterpriseId}/policies/{policyId}. 3481 Name string `json:"name,omitempty"` 3482 3483 // NetworkEscapeHatchEnabled: Whether the network escape hatch is 3484 // enabled. If a network connection can't be made at boot time, the 3485 // escape hatch prompts the user to temporarily connect to a network in 3486 // order to refresh the device policy. After applying policy, the 3487 // temporary network will be forgotten and the device will continue 3488 // booting. This prevents being unable to connect to a network if there 3489 // is no suitable network in the last policy and the device boots into 3490 // an app in lock task mode, or the user is otherwise unable to reach 3491 // device settings. 3492 NetworkEscapeHatchEnabled bool `json:"networkEscapeHatchEnabled,omitempty"` 3493 3494 // NetworkResetDisabled: Whether resetting network settings is disabled. 3495 NetworkResetDisabled bool `json:"networkResetDisabled,omitempty"` 3496 3497 // OncCertificateProviders: This feature is not generally available. 3498 OncCertificateProviders []*OncCertificateProvider `json:"oncCertificateProviders,omitempty"` 3499 3500 // OpenNetworkConfiguration: Network configuration for the device. See 3501 // configure networks for more information. 3502 OpenNetworkConfiguration googleapi.RawMessage `json:"openNetworkConfiguration,omitempty"` 3503 3504 // OutgoingBeamDisabled: Whether using NFC to beam data from apps is 3505 // disabled. 3506 OutgoingBeamDisabled bool `json:"outgoingBeamDisabled,omitempty"` 3507 3508 // OutgoingCallsDisabled: Whether outgoing calls are disabled. 3509 OutgoingCallsDisabled bool `json:"outgoingCallsDisabled,omitempty"` 3510 3511 // PasswordPolicies: Password requirement policies. Different policies 3512 // can be set for work profile or fully managed devices by setting the 3513 // password_scope field in the policy. 3514 PasswordPolicies []*PasswordRequirements `json:"passwordPolicies,omitempty"` 3515 3516 // PasswordRequirements: Password requirements. The field 3517 // password_requirements.require_password_unlock must not be set. 3518 // DEPRECATED - Use password_policies.Note:Complexity-based values of 3519 // PasswordQuality, that is, COMPLEXITY_LOW, COMPLEXITY_MEDIUM, and 3520 // COMPLEXITY_HIGH, cannot be used here. 3521 PasswordRequirements *PasswordRequirements `json:"passwordRequirements,omitempty"` 3522 3523 // PermissionGrants: Explicit permission or group grants or denials for 3524 // all apps. These values override the default_permission_policy. 3525 PermissionGrants []*PermissionGrant `json:"permissionGrants,omitempty"` 3526 3527 // PermittedAccessibilityServices: Specifies permitted accessibility 3528 // services. If the field is not set, any accessibility service can be 3529 // used. If the field is set, only the accessibility services in this 3530 // list and the system's built-in accessibility service can be used. In 3531 // particular, if the field is set to empty, only the system's built-in 3532 // accessibility servicess can be used. 3533 PermittedAccessibilityServices *PackageNameList `json:"permittedAccessibilityServices,omitempty"` 3534 3535 // PermittedInputMethods: If present, only the input methods provided by 3536 // packages in this list are permitted. If this field is present, but 3537 // the list is empty, then only system input methods are permitted. 3538 PermittedInputMethods *PackageNameList `json:"permittedInputMethods,omitempty"` 3539 3540 // PersistentPreferredActivities: Default intent handler activities. 3541 PersistentPreferredActivities []*PersistentPreferredActivity `json:"persistentPreferredActivities,omitempty"` 3542 3543 // PersonalUsagePolicies: Policies managing personal usage on a 3544 // company-owned device. 3545 PersonalUsagePolicies *PersonalUsagePolicies `json:"personalUsagePolicies,omitempty"` 3546 3547 // PlayStoreMode: This mode controls which apps are available to the 3548 // user in the Play Store and the behavior on the device when apps are 3549 // removed from the policy. 3550 // 3551 // Possible values: 3552 // "PLAY_STORE_MODE_UNSPECIFIED" - Unspecified. Defaults to WHITELIST. 3553 // "WHITELIST" - Only apps that are in the policy are available and 3554 // any app not in the policy will be automatically uninstalled from the 3555 // device. 3556 // "BLACKLIST" - All apps are available and any app that should not be 3557 // on the device should be explicitly marked as 'BLOCKED' in the 3558 // applications policy. 3559 PlayStoreMode string `json:"playStoreMode,omitempty"` 3560 3561 // PolicyEnforcementRules: Rules that define the behavior when a 3562 // particular policy can not be applied on device 3563 PolicyEnforcementRules []*PolicyEnforcementRule `json:"policyEnforcementRules,omitempty"` 3564 3565 // PrivateKeySelectionEnabled: Allows showing UI on a device for a user 3566 // to choose a private key alias if there are no matching rules in 3567 // ChoosePrivateKeyRules. For devices below Android P, setting this may 3568 // leave enterprise keys vulnerable. 3569 PrivateKeySelectionEnabled bool `json:"privateKeySelectionEnabled,omitempty"` 3570 3571 // RecommendedGlobalProxy: The network-independent global HTTP proxy. 3572 // Typically proxies should be configured per-network in 3573 // open_network_configuration. However for unusual configurations like 3574 // general internal filtering a global HTTP proxy may be useful. If the 3575 // proxy is not accessible, network access may break. The global proxy 3576 // is only a recommendation and some apps may ignore it. 3577 RecommendedGlobalProxy *ProxyInfo `json:"recommendedGlobalProxy,omitempty"` 3578 3579 // RemoveUserDisabled: Whether removing other users is disabled. 3580 RemoveUserDisabled bool `json:"removeUserDisabled,omitempty"` 3581 3582 // SafeBootDisabled: Whether rebooting the device into safe boot is 3583 // disabled. 3584 SafeBootDisabled bool `json:"safeBootDisabled,omitempty"` 3585 3586 // ScreenCaptureDisabled: Whether screen capture is disabled. 3587 ScreenCaptureDisabled bool `json:"screenCaptureDisabled,omitempty"` 3588 3589 // SetUserIconDisabled: Whether changing the user icon is disabled. 3590 SetUserIconDisabled bool `json:"setUserIconDisabled,omitempty"` 3591 3592 // SetWallpaperDisabled: Whether changing the wallpaper is disabled. 3593 SetWallpaperDisabled bool `json:"setWallpaperDisabled,omitempty"` 3594 3595 // SetupActions: Actions to take during the setup process. 3596 SetupActions []*SetupAction `json:"setupActions,omitempty"` 3597 3598 // ShareLocationDisabled: Whether location sharing is disabled. 3599 ShareLocationDisabled bool `json:"shareLocationDisabled,omitempty"` 3600 3601 // ShortSupportMessage: A message displayed to the user in the settings 3602 // screen wherever functionality has been disabled by the admin. If the 3603 // message is longer than 200 characters it may be truncated. 3604 ShortSupportMessage *UserFacingMessage `json:"shortSupportMessage,omitempty"` 3605 3606 // SkipFirstUseHintsEnabled: Flag to skip hints on the first use. 3607 // Enterprise admin can enable the system recommendation for apps to 3608 // skip their user tutorial and other introductory hints on first 3609 // start-up. 3610 SkipFirstUseHintsEnabled bool `json:"skipFirstUseHintsEnabled,omitempty"` 3611 3612 // SmsDisabled: Whether sending and receiving SMS messages is disabled. 3613 SmsDisabled bool `json:"smsDisabled,omitempty"` 3614 3615 // StatusBarDisabled: Whether the status bar is disabled. This disables 3616 // notifications, quick settings, and other screen overlays that allow 3617 // escape from full-screen mode. DEPRECATED. To disable the status bar 3618 // on a kiosk device, use InstallType KIOSK or 3619 // kioskCustomLauncherEnabled. 3620 StatusBarDisabled bool `json:"statusBarDisabled,omitempty"` 3621 3622 // StatusReportingSettings: Status reporting settings 3623 StatusReportingSettings *StatusReportingSettings `json:"statusReportingSettings,omitempty"` 3624 3625 // StayOnPluggedModes: The battery plugged in modes for which the device 3626 // stays on. When using this setting, it is recommended to clear 3627 // maximum_time_to_lock so that the device doesn't lock itself while it 3628 // stays on. 3629 // 3630 // Possible values: 3631 // "BATTERY_PLUGGED_MODE_UNSPECIFIED" - This value is ignored. 3632 // "AC" - Power source is an AC charger. 3633 // "USB" - Power source is a USB port. 3634 // "WIRELESS" - Power source is wireless. 3635 StayOnPluggedModes []string `json:"stayOnPluggedModes,omitempty"` 3636 3637 // SystemUpdate: The system update policy, which controls how OS updates 3638 // are applied. If the update type is WINDOWED, the update window will 3639 // automatically apply to Play app updates as well. 3640 SystemUpdate *SystemUpdate `json:"systemUpdate,omitempty"` 3641 3642 // TetheringConfigDisabled: Whether configuring tethering and portable 3643 // hotspots is disabled. 3644 TetheringConfigDisabled bool `json:"tetheringConfigDisabled,omitempty"` 3645 3646 // UninstallAppsDisabled: Whether user uninstallation of applications is 3647 // disabled. 3648 UninstallAppsDisabled bool `json:"uninstallAppsDisabled,omitempty"` 3649 3650 // UnmuteMicrophoneDisabled: Whether the microphone is muted and 3651 // adjusting microphone volume is disabled. 3652 UnmuteMicrophoneDisabled bool `json:"unmuteMicrophoneDisabled,omitempty"` 3653 3654 // UsbFileTransferDisabled: Whether transferring files over USB is 3655 // disabled. 3656 UsbFileTransferDisabled bool `json:"usbFileTransferDisabled,omitempty"` 3657 3658 // UsbMassStorageEnabled: Whether USB storage is enabled. Deprecated. 3659 UsbMassStorageEnabled bool `json:"usbMassStorageEnabled,omitempty"` 3660 3661 // Version: The version of the policy. This is a read-only field. The 3662 // version is incremented each time the policy is updated. 3663 Version int64 `json:"version,omitempty,string"` 3664 3665 // VpnConfigDisabled: Whether configuring VPN is disabled. 3666 VpnConfigDisabled bool `json:"vpnConfigDisabled,omitempty"` 3667 3668 // WifiConfigDisabled: Whether configuring Wi-Fi access points is 3669 // disabled. 3670 WifiConfigDisabled bool `json:"wifiConfigDisabled,omitempty"` 3671 3672 // WifiConfigsLockdownEnabled: DEPRECATED - Use wifi_config_disabled. 3673 WifiConfigsLockdownEnabled bool `json:"wifiConfigsLockdownEnabled,omitempty"` 3674 3675 // ServerResponse contains the HTTP response code and headers from the 3676 // server. 3677 googleapi.ServerResponse `json:"-"` 3678 3679 // ForceSendFields is a list of field names (e.g. 3680 // "AccountTypesWithManagementDisabled") to unconditionally include in 3681 // API requests. By default, fields with empty values are omitted from 3682 // API requests. However, any non-pointer, non-interface field appearing 3683 // in ForceSendFields will be sent to the server regardless of whether 3684 // the field is empty or not. This may be used to include empty fields 3685 // in Patch requests. 3686 ForceSendFields []string `json:"-"` 3687 3688 // NullFields is a list of field names (e.g. 3689 // "AccountTypesWithManagementDisabled") to include in API requests with 3690 // the JSON null value. By default, fields with empty values are omitted 3691 // from API requests. However, any field with an empty value appearing 3692 // in NullFields will be sent to the server as null. It is an error if a 3693 // field in this list has a non-empty value. This may be used to include 3694 // null fields in Patch requests. 3695 NullFields []string `json:"-"` 3696} 3697 3698func (s *Policy) MarshalJSON() ([]byte, error) { 3699 type NoMethod Policy 3700 raw := NoMethod(*s) 3701 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3702} 3703 3704// PolicyEnforcementRule: A rule that defines the actions to take if a 3705// device or work profile is not compliant with the policy specified in 3706// settingName. 3707type PolicyEnforcementRule struct { 3708 // BlockAction: An action to block access to apps and data on a fully 3709 // managed device or in a work profile. This action also triggers a 3710 // user-facing notification with information (where possible) on how to 3711 // correct the compliance issue. Note: wipeAction must also be 3712 // specified. 3713 BlockAction *BlockAction `json:"blockAction,omitempty"` 3714 3715 // SettingName: The top-level policy to enforce. For example, 3716 // applications or passwordPolicies. 3717 SettingName string `json:"settingName,omitempty"` 3718 3719 // WipeAction: An action to reset a fully managed device or delete a 3720 // work profile. Note: blockAction must also be specified. 3721 WipeAction *WipeAction `json:"wipeAction,omitempty"` 3722 3723 // ForceSendFields is a list of field names (e.g. "BlockAction") to 3724 // unconditionally include in API requests. By default, fields with 3725 // empty values are omitted from API requests. However, any non-pointer, 3726 // non-interface field appearing in ForceSendFields will be sent to the 3727 // server regardless of whether the field is empty or not. This may be 3728 // used to include empty fields in Patch requests. 3729 ForceSendFields []string `json:"-"` 3730 3731 // NullFields is a list of field names (e.g. "BlockAction") to include 3732 // in API requests with the JSON null value. By default, fields with 3733 // empty values are omitted from API requests. However, any field with 3734 // an empty value appearing in NullFields will be sent to the server as 3735 // null. It is an error if a field in this list has a non-empty value. 3736 // This may be used to include null fields in Patch requests. 3737 NullFields []string `json:"-"` 3738} 3739 3740func (s *PolicyEnforcementRule) MarshalJSON() ([]byte, error) { 3741 type NoMethod PolicyEnforcementRule 3742 raw := NoMethod(*s) 3743 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3744} 3745 3746// PostureDetail: Additional details regarding the security posture of 3747// the device. 3748type PostureDetail struct { 3749 // Advice: Corresponding admin-facing advice to mitigate this security 3750 // risk and improve the security posture of the device. 3751 Advice []*UserFacingMessage `json:"advice,omitempty"` 3752 3753 // SecurityRisk: A specific security risk that negatively affects the 3754 // security posture of the device. 3755 // 3756 // Possible values: 3757 // "SECURITY_RISK_UNSPECIFIED" - Unspecified. 3758 // "UNKNOWN_OS" - SafetyNet detects that the device is running an 3759 // unknown OS (basicIntegrity check succeeds but ctsProfileMatch fails). 3760 // "COMPROMISED_OS" - SafetyNet detects that the device is running a 3761 // compromised OS (basicIntegrity check fails). 3762 SecurityRisk string `json:"securityRisk,omitempty"` 3763 3764 // ForceSendFields is a list of field names (e.g. "Advice") to 3765 // unconditionally include in API requests. By default, fields with 3766 // empty values are omitted from API requests. However, any non-pointer, 3767 // non-interface field appearing in ForceSendFields will be sent to the 3768 // server regardless of whether the field is empty or not. This may be 3769 // used to include empty fields in Patch requests. 3770 ForceSendFields []string `json:"-"` 3771 3772 // NullFields is a list of field names (e.g. "Advice") to include in API 3773 // requests with the JSON null value. By default, fields with empty 3774 // values are omitted from API requests. However, any field with an 3775 // empty value appearing in NullFields will be sent to the server as 3776 // null. It is an error if a field in this list has a non-empty value. 3777 // This may be used to include null fields in Patch requests. 3778 NullFields []string `json:"-"` 3779} 3780 3781func (s *PostureDetail) MarshalJSON() ([]byte, error) { 3782 type NoMethod PostureDetail 3783 raw := NoMethod(*s) 3784 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3785} 3786 3787// PowerManagementEvent: A power management event. 3788type PowerManagementEvent struct { 3789 // BatteryLevel: For BATTERY_LEVEL_COLLECTED events, the battery level 3790 // as a percentage. 3791 BatteryLevel float64 `json:"batteryLevel,omitempty"` 3792 3793 // CreateTime: The creation time of the event. 3794 CreateTime string `json:"createTime,omitempty"` 3795 3796 // EventType: Event type. 3797 // 3798 // Possible values: 3799 // "POWER_MANAGEMENT_EVENT_TYPE_UNSPECIFIED" - Unspecified. No events 3800 // have this type. 3801 // "BATTERY_LEVEL_COLLECTED" - Battery level was measured. 3802 // "POWER_CONNECTED" - The device started charging. 3803 // "POWER_DISCONNECTED" - The device stopped charging. 3804 // "BATTERY_LOW" - The device entered low-power mode. 3805 // "BATTERY_OKAY" - The device exited low-power mode. 3806 // "BOOT_COMPLETED" - The device booted. 3807 // "SHUTDOWN" - The device shut down. 3808 EventType string `json:"eventType,omitempty"` 3809 3810 // ForceSendFields is a list of field names (e.g. "BatteryLevel") to 3811 // unconditionally include in API requests. By default, fields with 3812 // empty values are omitted from API requests. However, any non-pointer, 3813 // non-interface field appearing in ForceSendFields will be sent to the 3814 // server regardless of whether the field is empty or not. This may be 3815 // used to include empty fields in Patch requests. 3816 ForceSendFields []string `json:"-"` 3817 3818 // NullFields is a list of field names (e.g. "BatteryLevel") to include 3819 // in API requests with the JSON null value. By default, fields with 3820 // empty values are omitted from API requests. However, any field with 3821 // an empty value appearing in NullFields will be sent to the server as 3822 // null. It is an error if a field in this list has a non-empty value. 3823 // This may be used to include null fields in Patch requests. 3824 NullFields []string `json:"-"` 3825} 3826 3827func (s *PowerManagementEvent) MarshalJSON() ([]byte, error) { 3828 type NoMethod PowerManagementEvent 3829 raw := NoMethod(*s) 3830 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3831} 3832 3833func (s *PowerManagementEvent) UnmarshalJSON(data []byte) error { 3834 type NoMethod PowerManagementEvent 3835 var s1 struct { 3836 BatteryLevel gensupport.JSONFloat64 `json:"batteryLevel"` 3837 *NoMethod 3838 } 3839 s1.NoMethod = (*NoMethod)(s) 3840 if err := json.Unmarshal(data, &s1); err != nil { 3841 return err 3842 } 3843 s.BatteryLevel = float64(s1.BatteryLevel) 3844 return nil 3845} 3846 3847// ProxyInfo: Configuration info for an HTTP proxy. For a direct proxy, 3848// set the host, port, and excluded_hosts fields. For a PAC script 3849// proxy, set the pac_uri field. 3850type ProxyInfo struct { 3851 // ExcludedHosts: For a direct proxy, the hosts for which the proxy is 3852 // bypassed. The host names may contain wildcards such as *.example.com. 3853 ExcludedHosts []string `json:"excludedHosts,omitempty"` 3854 3855 // Host: The host of the direct proxy. 3856 Host string `json:"host,omitempty"` 3857 3858 // PacUri: The URI of the PAC script used to configure the proxy. 3859 PacUri string `json:"pacUri,omitempty"` 3860 3861 // Port: The port of the direct proxy. 3862 Port int64 `json:"port,omitempty"` 3863 3864 // ForceSendFields is a list of field names (e.g. "ExcludedHosts") to 3865 // unconditionally include in API requests. By default, fields with 3866 // empty values are omitted from API requests. However, any non-pointer, 3867 // non-interface field appearing in ForceSendFields will be sent to the 3868 // server regardless of whether the field is empty or not. This may be 3869 // used to include empty fields in Patch requests. 3870 ForceSendFields []string `json:"-"` 3871 3872 // NullFields is a list of field names (e.g. "ExcludedHosts") to include 3873 // in API requests with the JSON null value. By default, fields with 3874 // empty values are omitted from API requests. However, any field with 3875 // an empty value appearing in NullFields will be sent to the server as 3876 // null. It is an error if a field in this list has a non-empty value. 3877 // This may be used to include null fields in Patch requests. 3878 NullFields []string `json:"-"` 3879} 3880 3881func (s *ProxyInfo) MarshalJSON() ([]byte, error) { 3882 type NoMethod ProxyInfo 3883 raw := NoMethod(*s) 3884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3885} 3886 3887// SecurityPosture: The security posture of the device, as determined by 3888// the current device state and the policies applied. 3889type SecurityPosture struct { 3890 // DevicePosture: Device's security posture value. 3891 // 3892 // Possible values: 3893 // "POSTURE_UNSPECIFIED" - Unspecified. There is no posture detail for 3894 // this posture value. 3895 // "SECURE" - This device is secure. 3896 // "AT_RISK" - This device may be more vulnerable to malicious actors 3897 // than is recommended for use with corporate data. 3898 // "POTENTIALLY_COMPROMISED" - This device may be compromised and 3899 // corporate data may be accessible to unauthorized actors. 3900 DevicePosture string `json:"devicePosture,omitempty"` 3901 3902 // PostureDetails: Additional details regarding the security posture of 3903 // the device. 3904 PostureDetails []*PostureDetail `json:"postureDetails,omitempty"` 3905 3906 // ForceSendFields is a list of field names (e.g. "DevicePosture") to 3907 // unconditionally include in API requests. By default, fields with 3908 // empty values are omitted from API requests. However, any non-pointer, 3909 // non-interface field appearing in ForceSendFields will be sent to the 3910 // server regardless of whether the field is empty or not. This may be 3911 // used to include empty fields in Patch requests. 3912 ForceSendFields []string `json:"-"` 3913 3914 // NullFields is a list of field names (e.g. "DevicePosture") to include 3915 // in API requests with the JSON null value. By default, fields with 3916 // empty values are omitted from API requests. However, any field with 3917 // an empty value appearing in NullFields will be sent to the server as 3918 // null. It is an error if a field in this list has a non-empty value. 3919 // This may be used to include null fields in Patch requests. 3920 NullFields []string `json:"-"` 3921} 3922 3923func (s *SecurityPosture) MarshalJSON() ([]byte, error) { 3924 type NoMethod SecurityPosture 3925 raw := NoMethod(*s) 3926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3927} 3928 3929// SetupAction: An action executed during setup. 3930type SetupAction struct { 3931 // Description: Description of this action. 3932 Description *UserFacingMessage `json:"description,omitempty"` 3933 3934 // LaunchApp: An action to launch an app. 3935 LaunchApp *LaunchAppAction `json:"launchApp,omitempty"` 3936 3937 // Title: Title of this action. 3938 Title *UserFacingMessage `json:"title,omitempty"` 3939 3940 // ForceSendFields is a list of field names (e.g. "Description") to 3941 // unconditionally include in API requests. By default, fields with 3942 // empty values are omitted from API requests. However, any non-pointer, 3943 // non-interface field appearing in ForceSendFields will be sent to the 3944 // server regardless of whether the field is empty or not. This may be 3945 // used to include empty fields in Patch requests. 3946 ForceSendFields []string `json:"-"` 3947 3948 // NullFields is a list of field names (e.g. "Description") to include 3949 // in API requests with the JSON null value. By default, fields with 3950 // empty values are omitted from API requests. However, any field with 3951 // an empty value appearing in NullFields will be sent to the server as 3952 // null. It is an error if a field in this list has a non-empty value. 3953 // This may be used to include null fields in Patch requests. 3954 NullFields []string `json:"-"` 3955} 3956 3957func (s *SetupAction) MarshalJSON() ([]byte, error) { 3958 type NoMethod SetupAction 3959 raw := NoMethod(*s) 3960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3961} 3962 3963// SigninDetail: A resource containing sign in details for an 3964// enterprise. 3965type SigninDetail struct { 3966 // AllowPersonalUsage: Controls whether personal usage is allowed on a 3967 // device provisioned with this enrollment token.For company-owned 3968 // devices: Enabling personal usage allows the user to set up a work 3969 // profile on the device. Disabling personal usage requires the user 3970 // provision the device as a fully managed device.For personally-owned 3971 // devices: Enabling personal usage allows the user to set up a work 3972 // profile on the device. Disabling personal usage will prevent the 3973 // device from provisioning. Personal usage cannot be disabled on 3974 // personally-owned device. 3975 // 3976 // Possible values: 3977 // "ALLOW_PERSONAL_USAGE_UNSPECIFIED" - Personal usage restriction is 3978 // not specified 3979 // "PERSONAL_USAGE_ALLOWED" - Personal usage is allowed 3980 // "PERSONAL_USAGE_DISALLOWED" - Personal usage is disallowed 3981 AllowPersonalUsage string `json:"allowPersonalUsage,omitempty"` 3982 3983 // QrCode: A JSON string whose UTF-8 representation can be used to 3984 // generate a QR code to enroll a device with this enrollment token. To 3985 // enroll a device using NFC, the NFC record must contain a serialized 3986 // java.util.Properties representation of the properties in the JSON. 3987 // This is a read-only field generated by the server. 3988 QrCode string `json:"qrCode,omitempty"` 3989 3990 // SigninEnrollmentToken: An enterprise wide enrollment token used to 3991 // trigger custom sign-in flow. This is a read-only field generated by 3992 // the server. 3993 SigninEnrollmentToken string `json:"signinEnrollmentToken,omitempty"` 3994 3995 // SigninUrl: Sign-in URL for authentication when device is provisioned 3996 // with a sign-in enrollment token. The sign-in endpoint should finish 3997 // authentication flow with a URL in the form of 3998 // https://enterprise.google.com/android/enroll?et= for a successful 3999 // login, or https://enterprise.google.com/android/enroll/invalid for a 4000 // failed login. 4001 SigninUrl string `json:"signinUrl,omitempty"` 4002 4003 // ForceSendFields is a list of field names (e.g. "AllowPersonalUsage") 4004 // to unconditionally include in API requests. By default, fields with 4005 // empty values are omitted from API requests. However, any non-pointer, 4006 // non-interface field appearing in ForceSendFields will be sent to the 4007 // server regardless of whether the field is empty or not. This may be 4008 // used to include empty fields in Patch requests. 4009 ForceSendFields []string `json:"-"` 4010 4011 // NullFields is a list of field names (e.g. "AllowPersonalUsage") to 4012 // include in API requests with the JSON null value. By default, fields 4013 // with empty values are omitted from API requests. However, any field 4014 // with an empty value appearing in NullFields will be sent to the 4015 // server as null. It is an error if a field in this list has a 4016 // non-empty value. This may be used to include null fields in Patch 4017 // requests. 4018 NullFields []string `json:"-"` 4019} 4020 4021func (s *SigninDetail) MarshalJSON() ([]byte, error) { 4022 type NoMethod SigninDetail 4023 raw := NoMethod(*s) 4024 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4025} 4026 4027// SignupUrl: An enterprise signup URL. 4028type SignupUrl struct { 4029 // Name: The name of the resource. Use this value in the signupUrl field 4030 // when calling enterprises.create to complete the enterprise signup 4031 // flow. 4032 Name string `json:"name,omitempty"` 4033 4034 // Url: A URL where an enterprise admin can register their enterprise. 4035 // The page can't be rendered in an iframe. 4036 Url string `json:"url,omitempty"` 4037 4038 // ServerResponse contains the HTTP response code and headers from the 4039 // server. 4040 googleapi.ServerResponse `json:"-"` 4041 4042 // ForceSendFields is a list of field names (e.g. "Name") to 4043 // unconditionally include in API requests. By default, fields with 4044 // empty values are omitted from API requests. However, any non-pointer, 4045 // non-interface field appearing in ForceSendFields will be sent to the 4046 // server regardless of whether the field is empty or not. This may be 4047 // used to include empty fields in Patch requests. 4048 ForceSendFields []string `json:"-"` 4049 4050 // NullFields is a list of field names (e.g. "Name") to include in API 4051 // requests with the JSON null value. By default, fields with empty 4052 // values are omitted from API requests. However, any field with an 4053 // empty value appearing in NullFields will be sent to the server as 4054 // null. It is an error if a field in this list has a non-empty value. 4055 // This may be used to include null fields in Patch requests. 4056 NullFields []string `json:"-"` 4057} 4058 4059func (s *SignupUrl) MarshalJSON() ([]byte, error) { 4060 type NoMethod SignupUrl 4061 raw := NoMethod(*s) 4062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4063} 4064 4065// SoftwareInfo: Information about device software. 4066type SoftwareInfo struct { 4067 // AndroidBuildNumber: Android build ID string meant for displaying to 4068 // the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. 4069 AndroidBuildNumber string `json:"androidBuildNumber,omitempty"` 4070 4071 // AndroidBuildTime: Build time. 4072 AndroidBuildTime string `json:"androidBuildTime,omitempty"` 4073 4074 // AndroidDevicePolicyVersionCode: The Android Device Policy app version 4075 // code. 4076 AndroidDevicePolicyVersionCode int64 `json:"androidDevicePolicyVersionCode,omitempty"` 4077 4078 // AndroidDevicePolicyVersionName: The Android Device Policy app version 4079 // as displayed to the user. 4080 AndroidDevicePolicyVersionName string `json:"androidDevicePolicyVersionName,omitempty"` 4081 4082 // AndroidVersion: The user-visible Android version string. For example, 4083 // 6.0.1. 4084 AndroidVersion string `json:"androidVersion,omitempty"` 4085 4086 // BootloaderVersion: The system bootloader version number, e.g. 0.6.7. 4087 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 4088 4089 // DeviceBuildSignature: SHA-256 hash of android.content.pm.Signature 4090 // (https://developer.android.com/reference/android/content/pm/Signature.html) 4091 // associated with the system package, which can be used to verify that 4092 // the system build hasn't been modified. 4093 DeviceBuildSignature string `json:"deviceBuildSignature,omitempty"` 4094 4095 // DeviceKernelVersion: Kernel version, for example, 2.6.32.9-g103d848. 4096 DeviceKernelVersion string `json:"deviceKernelVersion,omitempty"` 4097 4098 // PrimaryLanguageCode: An IETF BCP 47 language code for the primary 4099 // locale on the device. 4100 PrimaryLanguageCode string `json:"primaryLanguageCode,omitempty"` 4101 4102 // SecurityPatchLevel: Security patch level, e.g. 2016-05-01. 4103 SecurityPatchLevel string `json:"securityPatchLevel,omitempty"` 4104 4105 // SystemUpdateInfo: Information about a potential pending system 4106 // update. 4107 SystemUpdateInfo *SystemUpdateInfo `json:"systemUpdateInfo,omitempty"` 4108 4109 // ForceSendFields is a list of field names (e.g. "AndroidBuildNumber") 4110 // to unconditionally include in API requests. By default, fields with 4111 // empty values are omitted from API requests. However, any non-pointer, 4112 // non-interface field appearing in ForceSendFields will be sent to the 4113 // server regardless of whether the field is empty or not. This may be 4114 // used to include empty fields in Patch requests. 4115 ForceSendFields []string `json:"-"` 4116 4117 // NullFields is a list of field names (e.g. "AndroidBuildNumber") to 4118 // include in API requests with the JSON null value. By default, fields 4119 // with empty values are omitted from API requests. However, any field 4120 // with an empty value appearing in NullFields will be sent to the 4121 // server as null. It is an error if a field in this list has a 4122 // non-empty value. This may be used to include null fields in Patch 4123 // requests. 4124 NullFields []string `json:"-"` 4125} 4126 4127func (s *SoftwareInfo) MarshalJSON() ([]byte, error) { 4128 type NoMethod SoftwareInfo 4129 raw := NoMethod(*s) 4130 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4131} 4132 4133// Status: The Status type defines a logical error model that is 4134// suitable for different programming environments, including REST APIs 4135// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 4136// Status message contains three pieces of data: error code, error 4137// message, and error details.You can find out more about this error 4138// model and how to work with it in the API Design Guide 4139// (https://cloud.google.com/apis/design/errors). 4140type Status struct { 4141 // Code: The status code, which should be an enum value of 4142 // google.rpc.Code. 4143 Code int64 `json:"code,omitempty"` 4144 4145 // Details: A list of messages that carry the error details. There is a 4146 // common set of message types for APIs to use. 4147 Details []googleapi.RawMessage `json:"details,omitempty"` 4148 4149 // Message: A developer-facing error message, which should be in 4150 // English. Any user-facing error message should be localized and sent 4151 // in the google.rpc.Status.details field, or localized by the client. 4152 Message string `json:"message,omitempty"` 4153 4154 // ForceSendFields is a list of field names (e.g. "Code") to 4155 // unconditionally include in API requests. By default, fields with 4156 // empty values are omitted from API requests. However, any non-pointer, 4157 // non-interface field appearing in ForceSendFields will be sent to the 4158 // server regardless of whether the field is empty or not. This may be 4159 // used to include empty fields in Patch requests. 4160 ForceSendFields []string `json:"-"` 4161 4162 // NullFields is a list of field names (e.g. "Code") to include in API 4163 // requests with the JSON null value. By default, fields with empty 4164 // values are omitted from API requests. However, any field with an 4165 // empty value appearing in NullFields will be sent to the server as 4166 // null. It is an error if a field in this list has a non-empty value. 4167 // This may be used to include null fields in Patch requests. 4168 NullFields []string `json:"-"` 4169} 4170 4171func (s *Status) MarshalJSON() ([]byte, error) { 4172 type NoMethod Status 4173 raw := NoMethod(*s) 4174 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4175} 4176 4177// StatusReportingSettings: Settings controlling the behavior of status 4178// reports. 4179type StatusReportingSettings struct { 4180 // ApplicationReportingSettings: Application reporting settings. Only 4181 // applicable if application_reports_enabled is true. 4182 ApplicationReportingSettings *ApplicationReportingSettings `json:"applicationReportingSettings,omitempty"` 4183 4184 // ApplicationReportsEnabled: Whether app reports are enabled. 4185 ApplicationReportsEnabled bool `json:"applicationReportsEnabled,omitempty"` 4186 4187 // CommonCriteriaModeEnabled: Whether Common Criteria Mode reporting is 4188 // enabled. 4189 CommonCriteriaModeEnabled bool `json:"commonCriteriaModeEnabled,omitempty"` 4190 4191 // DeviceSettingsEnabled: Whether device settings reporting is enabled. 4192 DeviceSettingsEnabled bool `json:"deviceSettingsEnabled,omitempty"` 4193 4194 // DisplayInfoEnabled: Whether displays reporting is enabled. Report 4195 // data is not available for personally owned devices with work 4196 // profiles. 4197 DisplayInfoEnabled bool `json:"displayInfoEnabled,omitempty"` 4198 4199 // HardwareStatusEnabled: Whether hardware status reporting is enabled. 4200 // Report data is not available for personally owned devices with work 4201 // profiles. 4202 HardwareStatusEnabled bool `json:"hardwareStatusEnabled,omitempty"` 4203 4204 // MemoryInfoEnabled: Whether memory reporting is enabled. 4205 MemoryInfoEnabled bool `json:"memoryInfoEnabled,omitempty"` 4206 4207 // NetworkInfoEnabled: Whether network info reporting is enabled. 4208 NetworkInfoEnabled bool `json:"networkInfoEnabled,omitempty"` 4209 4210 // PowerManagementEventsEnabled: Whether power management event 4211 // reporting is enabled. Report data is not available for personally 4212 // owned devices with work profiles. 4213 PowerManagementEventsEnabled bool `json:"powerManagementEventsEnabled,omitempty"` 4214 4215 // SoftwareInfoEnabled: Whether software info reporting is enabled. 4216 SoftwareInfoEnabled bool `json:"softwareInfoEnabled,omitempty"` 4217 4218 // SystemPropertiesEnabled: Whether system properties reporting is 4219 // enabled. 4220 SystemPropertiesEnabled bool `json:"systemPropertiesEnabled,omitempty"` 4221 4222 // ForceSendFields is a list of field names (e.g. 4223 // "ApplicationReportingSettings") to unconditionally include in API 4224 // requests. By default, fields with empty values are omitted from API 4225 // requests. However, any non-pointer, non-interface field appearing in 4226 // ForceSendFields will be sent to the server regardless of whether the 4227 // field is empty or not. This may be used to include empty fields in 4228 // Patch requests. 4229 ForceSendFields []string `json:"-"` 4230 4231 // NullFields is a list of field names (e.g. 4232 // "ApplicationReportingSettings") to include in API requests with the 4233 // JSON null value. By default, fields with empty values are omitted 4234 // from API requests. However, any field with an empty value appearing 4235 // in NullFields will be sent to the server as null. It is an error if a 4236 // field in this list has a non-empty value. This may be used to include 4237 // null fields in Patch requests. 4238 NullFields []string `json:"-"` 4239} 4240 4241func (s *StatusReportingSettings) MarshalJSON() ([]byte, error) { 4242 type NoMethod StatusReportingSettings 4243 raw := NoMethod(*s) 4244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4245} 4246 4247// SystemUpdate: Configuration for managing system updates 4248type SystemUpdate struct { 4249 // EndMinutes: If the type is WINDOWED, the end of the maintenance 4250 // window, measured as the number of minutes after midnight in device's 4251 // local time. This value must be between 0 and 1439, inclusive. If this 4252 // value is less than start_minutes, then the maintenance window spans 4253 // midnight. If the maintenance window specified is smaller than 30 4254 // minutes, the actual window is extended to 30 minutes beyond the start 4255 // time. 4256 EndMinutes int64 `json:"endMinutes,omitempty"` 4257 4258 // FreezePeriods: An annually repeating time period in which 4259 // over-the-air (OTA) system updates are postponed to freeze the OS 4260 // version running on a device. To prevent freezing the device 4261 // indefinitely, each freeze period must be separated by at least 60 4262 // days. 4263 FreezePeriods []*FreezePeriod `json:"freezePeriods,omitempty"` 4264 4265 // StartMinutes: If the type is WINDOWED, the start of the maintenance 4266 // window, measured as the number of minutes after midnight in the 4267 // device's local time. This value must be between 0 and 1439, 4268 // inclusive. 4269 StartMinutes int64 `json:"startMinutes,omitempty"` 4270 4271 // Type: The type of system update to configure. 4272 // 4273 // Possible values: 4274 // "SYSTEM_UPDATE_TYPE_UNSPECIFIED" - Follow the default update 4275 // behavior for the device, which typically requires the user to accept 4276 // system updates. 4277 // "AUTOMATIC" - Install automatically as soon as an update is 4278 // available. 4279 // "WINDOWED" - Install automatically within a daily maintenance 4280 // window. This also configures Play apps to be updated within the 4281 // window. This is strongly recommended for kiosk devices because this 4282 // is the only way apps persistently pinned to the foreground can be 4283 // updated by Play. 4284 // "POSTPONE" - Postpone automatic install up to a maximum of 30 days. 4285 Type string `json:"type,omitempty"` 4286 4287 // ForceSendFields is a list of field names (e.g. "EndMinutes") to 4288 // unconditionally include in API requests. By default, fields with 4289 // empty values are omitted from API requests. However, any non-pointer, 4290 // non-interface field appearing in ForceSendFields will be sent to the 4291 // server regardless of whether the field is empty or not. This may be 4292 // used to include empty fields in Patch requests. 4293 ForceSendFields []string `json:"-"` 4294 4295 // NullFields is a list of field names (e.g. "EndMinutes") to include in 4296 // API requests with the JSON null value. By default, fields with empty 4297 // values are omitted from API requests. However, any field with an 4298 // empty value appearing in NullFields will be sent to the server as 4299 // null. It is an error if a field in this list has a non-empty value. 4300 // This may be used to include null fields in Patch requests. 4301 NullFields []string `json:"-"` 4302} 4303 4304func (s *SystemUpdate) MarshalJSON() ([]byte, error) { 4305 type NoMethod SystemUpdate 4306 raw := NoMethod(*s) 4307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4308} 4309 4310// SystemUpdateInfo: Information about a potential pending system 4311// update. 4312type SystemUpdateInfo struct { 4313 // UpdateReceivedTime: The time when the update was first available. A 4314 // zero value indicates that this field is not set. This field is set 4315 // only if an update is available (that is, updateStatus is neither 4316 // UPDATE_STATUS_UNKNOWN nor UP_TO_DATE). 4317 UpdateReceivedTime string `json:"updateReceivedTime,omitempty"` 4318 4319 // UpdateStatus: The status of an update: whether an update exists and 4320 // what type it is. 4321 // 4322 // Possible values: 4323 // "UPDATE_STATUS_UNKNOWN" - It is unknown whether there is a pending 4324 // system update. This happens when, for example, the device API level 4325 // is less than 26, or if the version of Android Device Policy is 4326 // outdated. 4327 // "UP_TO_DATE" - There is no pending system update available on the 4328 // device. 4329 // "UNKNOWN_UPDATE_AVAILABLE" - There is a pending system update 4330 // available, but its type is not known. 4331 // "SECURITY_UPDATE_AVAILABLE" - There is a pending security update 4332 // available. 4333 // "OS_UPDATE_AVAILABLE" - There is a pending OS update available. 4334 UpdateStatus string `json:"updateStatus,omitempty"` 4335 4336 // ForceSendFields is a list of field names (e.g. "UpdateReceivedTime") 4337 // to unconditionally include in API requests. By default, fields with 4338 // empty values are omitted from API requests. However, any non-pointer, 4339 // non-interface field appearing in ForceSendFields will be sent to the 4340 // server regardless of whether the field is empty or not. This may be 4341 // used to include empty fields in Patch requests. 4342 ForceSendFields []string `json:"-"` 4343 4344 // NullFields is a list of field names (e.g. "UpdateReceivedTime") to 4345 // include in API requests with the JSON null value. By default, fields 4346 // with empty values are omitted from API requests. However, any field 4347 // with an empty value appearing in NullFields will be sent to the 4348 // server as null. It is an error if a field in this list has a 4349 // non-empty value. This may be used to include null fields in Patch 4350 // requests. 4351 NullFields []string `json:"-"` 4352} 4353 4354func (s *SystemUpdateInfo) MarshalJSON() ([]byte, error) { 4355 type NoMethod SystemUpdateInfo 4356 raw := NoMethod(*s) 4357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4358} 4359 4360// TelephonyInfo: Telephony information associated with a given SIM card 4361// on the device. Only supported on fully managed devices starting from 4362// Android API level 23. 4363type TelephonyInfo struct { 4364 // CarrierName: The carrier name associated with this SIM card. 4365 CarrierName string `json:"carrierName,omitempty"` 4366 4367 // PhoneNumber: The phone number associated with this SIM card. 4368 PhoneNumber string `json:"phoneNumber,omitempty"` 4369 4370 // ForceSendFields is a list of field names (e.g. "CarrierName") to 4371 // unconditionally include in API requests. By default, fields with 4372 // empty values are omitted from API requests. However, any non-pointer, 4373 // non-interface field appearing in ForceSendFields will be sent to the 4374 // server regardless of whether the field is empty or not. This may be 4375 // used to include empty fields in Patch requests. 4376 ForceSendFields []string `json:"-"` 4377 4378 // NullFields is a list of field names (e.g. "CarrierName") to include 4379 // in API requests with the JSON null value. By default, fields with 4380 // empty values are omitted from API requests. However, any field with 4381 // an empty value appearing in NullFields will be sent to the server as 4382 // null. It is an error if a field in this list has a non-empty value. 4383 // This may be used to include null fields in Patch requests. 4384 NullFields []string `json:"-"` 4385} 4386 4387func (s *TelephonyInfo) MarshalJSON() ([]byte, error) { 4388 type NoMethod TelephonyInfo 4389 raw := NoMethod(*s) 4390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4391} 4392 4393// TermsAndConditions: A terms and conditions page to be accepted during 4394// provisioning. 4395type TermsAndConditions struct { 4396 // Content: A well-formatted HTML string. It will be parsed on the 4397 // client with android.text.Html#fromHtml. 4398 Content *UserFacingMessage `json:"content,omitempty"` 4399 4400 // Header: A short header which appears above the HTML content. 4401 Header *UserFacingMessage `json:"header,omitempty"` 4402 4403 // ForceSendFields is a list of field names (e.g. "Content") to 4404 // unconditionally include in API requests. By default, fields with 4405 // empty values are omitted from API requests. However, any non-pointer, 4406 // non-interface field appearing in ForceSendFields will be sent to the 4407 // server regardless of whether the field is empty or not. This may be 4408 // used to include empty fields in Patch requests. 4409 ForceSendFields []string `json:"-"` 4410 4411 // NullFields is a list of field names (e.g. "Content") to include in 4412 // API requests with the JSON null value. By default, fields with empty 4413 // values are omitted from API requests. However, any field with an 4414 // empty value appearing in NullFields will be sent to the server as 4415 // null. It is an error if a field in this list has a non-empty value. 4416 // This may be used to include null fields in Patch requests. 4417 NullFields []string `json:"-"` 4418} 4419 4420func (s *TermsAndConditions) MarshalJSON() ([]byte, error) { 4421 type NoMethod TermsAndConditions 4422 raw := NoMethod(*s) 4423 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4424} 4425 4426// User: A user belonging to an enterprise. 4427type User struct { 4428 // AccountIdentifier: A unique identifier you create for this user, such 4429 // as user342 or asset#44418. This field must be set when the user is 4430 // created and can't be updated. This field must not contain personally 4431 // identifiable information (PII). This identifier must be 1024 4432 // characters or less; otherwise, the update policy request will fail. 4433 AccountIdentifier string `json:"accountIdentifier,omitempty"` 4434 4435 // ForceSendFields is a list of field names (e.g. "AccountIdentifier") 4436 // to unconditionally include in API requests. By default, fields with 4437 // empty values are omitted from API requests. However, any non-pointer, 4438 // non-interface field appearing in ForceSendFields will be sent to the 4439 // server regardless of whether the field is empty or not. This may be 4440 // used to include empty fields in Patch requests. 4441 ForceSendFields []string `json:"-"` 4442 4443 // NullFields is a list of field names (e.g. "AccountIdentifier") to 4444 // include in API requests with the JSON null value. By default, fields 4445 // with empty values are omitted from API requests. However, any field 4446 // with an empty value appearing in NullFields will be sent to the 4447 // server as null. It is an error if a field in this list has a 4448 // non-empty value. This may be used to include null fields in Patch 4449 // requests. 4450 NullFields []string `json:"-"` 4451} 4452 4453func (s *User) MarshalJSON() ([]byte, error) { 4454 type NoMethod User 4455 raw := NoMethod(*s) 4456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4457} 4458 4459// UserFacingMessage: Provides a user-facing message with locale info. 4460// The maximum message length is 4096 characters. 4461type UserFacingMessage struct { 4462 // DefaultMessage: The default message displayed if no localized message 4463 // is specified or the user's locale doesn't match with any of the 4464 // localized messages. A default message must be provided if any 4465 // localized messages are provided. 4466 DefaultMessage string `json:"defaultMessage,omitempty"` 4467 4468 // LocalizedMessages: A map containing pairs, where locale is a 4469 // well-formed BCP 47 language 4470 // (https://www.w3.org/International/articles/language-tags/) code, such 4471 // as en-US, es-ES, or fr. 4472 LocalizedMessages map[string]string `json:"localizedMessages,omitempty"` 4473 4474 // ForceSendFields is a list of field names (e.g. "DefaultMessage") to 4475 // unconditionally include in API requests. By default, fields with 4476 // empty values are omitted from API requests. However, any non-pointer, 4477 // non-interface field appearing in ForceSendFields will be sent to the 4478 // server regardless of whether the field is empty or not. This may be 4479 // used to include empty fields in Patch requests. 4480 ForceSendFields []string `json:"-"` 4481 4482 // NullFields is a list of field names (e.g. "DefaultMessage") to 4483 // include in API requests with the JSON null value. By default, fields 4484 // with empty values are omitted from API requests. However, any field 4485 // with an empty value appearing in NullFields will be sent to the 4486 // server as null. It is an error if a field in this list has a 4487 // non-empty value. This may be used to include null fields in Patch 4488 // requests. 4489 NullFields []string `json:"-"` 4490} 4491 4492func (s *UserFacingMessage) MarshalJSON() ([]byte, error) { 4493 type NoMethod UserFacingMessage 4494 raw := NoMethod(*s) 4495 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4496} 4497 4498// WebApp: A web app. 4499type WebApp struct { 4500 // DisplayMode: The display mode of the web app. 4501 // 4502 // Possible values: 4503 // "DISPLAY_MODE_UNSPECIFIED" - Not used. 4504 // "MINIMAL_UI" - Opens the web app with a minimal set of browser UI 4505 // elements for controlling navigation and viewing the page URL. 4506 // "STANDALONE" - Opens the web app to look and feel like a standalone 4507 // native application. The browser UI elements and page URL are not 4508 // visible, however the system status bar and back button are visible. 4509 // "FULL_SCREEN" - Opens the web app in full screen without any 4510 // visible controls. The browser UI elements, page URL, system status 4511 // bar and back button are not visible, and the web app takes up the 4512 // entirety of the available display area. 4513 DisplayMode string `json:"displayMode,omitempty"` 4514 4515 // Icons: A list of icons for the web app. Must have at least one 4516 // element. 4517 Icons []*WebAppIcon `json:"icons,omitempty"` 4518 4519 // Name: The name of the web app, which is generated by the server 4520 // during creation in the form 4521 // enterprises/{enterpriseId}/webApps/{packageName}. 4522 Name string `json:"name,omitempty"` 4523 4524 // StartUrl: The start URL, i.e. the URL that should load when the user 4525 // opens the application. 4526 StartUrl string `json:"startUrl,omitempty"` 4527 4528 // Title: The title of the web app as displayed to the user (e.g., 4529 // amongst a list of other applications, or as a label for an icon). 4530 Title string `json:"title,omitempty"` 4531 4532 // VersionCode: The current version of the app.Note that the version can 4533 // automatically increase during the lifetime of the web app, while 4534 // Google does internal housekeeping to keep the web app up-to-date. 4535 VersionCode int64 `json:"versionCode,omitempty,string"` 4536 4537 // ServerResponse contains the HTTP response code and headers from the 4538 // server. 4539 googleapi.ServerResponse `json:"-"` 4540 4541 // ForceSendFields is a list of field names (e.g. "DisplayMode") to 4542 // unconditionally include in API requests. By default, fields with 4543 // empty values are omitted from API requests. However, any non-pointer, 4544 // non-interface field appearing in ForceSendFields will be sent to the 4545 // server regardless of whether the field is empty or not. This may be 4546 // used to include empty fields in Patch requests. 4547 ForceSendFields []string `json:"-"` 4548 4549 // NullFields is a list of field names (e.g. "DisplayMode") to include 4550 // in API requests with the JSON null value. By default, fields with 4551 // empty values are omitted from API requests. However, any field with 4552 // an empty value appearing in NullFields will be sent to the server as 4553 // null. It is an error if a field in this list has a non-empty value. 4554 // This may be used to include null fields in Patch requests. 4555 NullFields []string `json:"-"` 4556} 4557 4558func (s *WebApp) MarshalJSON() ([]byte, error) { 4559 type NoMethod WebApp 4560 raw := NoMethod(*s) 4561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4562} 4563 4564// WebAppIcon: An icon for a web app. Supported formats are: png, jpg 4565// and webp. 4566type WebAppIcon struct { 4567 // ImageData: The actual bytes of the image in a base64url encoded 4568 // string (c.f. RFC4648, section 5 "Base 64 Encoding with URL and 4569 // Filename Safe Alphabet"). - The image type can be png or jpg. - The 4570 // image should ideally be square. - The image should ideally have a 4571 // size of 512x512. 4572 ImageData string `json:"imageData,omitempty"` 4573 4574 // ForceSendFields is a list of field names (e.g. "ImageData") to 4575 // unconditionally include in API requests. By default, fields with 4576 // empty values are omitted from API requests. However, any non-pointer, 4577 // non-interface field appearing in ForceSendFields will be sent to the 4578 // server regardless of whether the field is empty or not. This may be 4579 // used to include empty fields in Patch requests. 4580 ForceSendFields []string `json:"-"` 4581 4582 // NullFields is a list of field names (e.g. "ImageData") to include in 4583 // API requests with the JSON null value. By default, fields with empty 4584 // values are omitted from API requests. However, any field with an 4585 // empty value appearing in NullFields will be sent to the server as 4586 // null. It is an error if a field in this list has a non-empty value. 4587 // This may be used to include null fields in Patch requests. 4588 NullFields []string `json:"-"` 4589} 4590 4591func (s *WebAppIcon) MarshalJSON() ([]byte, error) { 4592 type NoMethod WebAppIcon 4593 raw := NoMethod(*s) 4594 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4595} 4596 4597// WebToken: A web token used to access the managed Google Play iframe. 4598type WebToken struct { 4599 // EnabledFeatures: The features to enable. Use this if you want to 4600 // control exactly which feature(s) will be activated; leave empty to 4601 // allow all features.Restrictions / things to note: - If no features 4602 // are listed here, all features are enabled — this is the default 4603 // behavior where you give access to all features to your admins. - This 4604 // must not contain any FEATURE_UNSPECIFIED values. - Repeated values 4605 // are ignored 4606 // 4607 // Possible values: 4608 // "FEATURE_UNSPECIFIED" - Unspecified feature. 4609 // "PLAY_SEARCH" - The Managed Play search apps page 4610 // (https://developers.google.com/android/management/apps#search-apps). 4611 // "PRIVATE_APPS" - The private apps page 4612 // (https://developers.google.com/android/management/apps#private-apps). 4613 // "WEB_APPS" - The Web Apps page 4614 // (https://developers.google.com/android/management/apps#web-apps). 4615 // "STORE_BUILDER" - The organize apps page 4616 // (https://developers.google.com/android/management/apps#organize-apps). 4617 // "MANAGED_CONFIGURATIONS" - The managed configurations page 4618 // (https://developers.google.com/android/management/managed-configurations-iframe). 4619 EnabledFeatures []string `json:"enabledFeatures,omitempty"` 4620 4621 // Name: The name of the web token, which is generated by the server 4622 // during creation in the form 4623 // enterprises/{enterpriseId}/webTokens/{webTokenId}. 4624 Name string `json:"name,omitempty"` 4625 4626 // ParentFrameUrl: The URL of the parent frame hosting the iframe with 4627 // the embedded UI. To prevent XSS, the iframe may not be hosted at 4628 // other URLs. The URL must use the https scheme. 4629 ParentFrameUrl string `json:"parentFrameUrl,omitempty"` 4630 4631 // Permissions: Permissions available to an admin in the embedded UI. An 4632 // admin must have all of these permissions in order to view the UI. 4633 // This field is deprecated. 4634 // 4635 // Possible values: 4636 // "WEB_TOKEN_PERMISSION_UNSPECIFIED" - This value is ignored. 4637 // "APPROVE_APPS" - The permission to approve apps for the enterprise. 4638 Permissions []string `json:"permissions,omitempty"` 4639 4640 // Value: The token value which is used in the hosting page to generate 4641 // the iframe with the embedded UI. This is a read-only field generated 4642 // by the server. 4643 Value string `json:"value,omitempty"` 4644 4645 // ServerResponse contains the HTTP response code and headers from the 4646 // server. 4647 googleapi.ServerResponse `json:"-"` 4648 4649 // ForceSendFields is a list of field names (e.g. "EnabledFeatures") to 4650 // unconditionally include in API requests. By default, fields with 4651 // empty values are omitted from API requests. However, any non-pointer, 4652 // non-interface field appearing in ForceSendFields will be sent to the 4653 // server regardless of whether the field is empty or not. This may be 4654 // used to include empty fields in Patch requests. 4655 ForceSendFields []string `json:"-"` 4656 4657 // NullFields is a list of field names (e.g. "EnabledFeatures") to 4658 // include in API requests with the JSON null value. By default, fields 4659 // with empty values are omitted from API requests. However, any field 4660 // with an empty value appearing in NullFields will be sent to the 4661 // server as null. It is an error if a field in this list has a 4662 // non-empty value. This may be used to include null fields in Patch 4663 // requests. 4664 NullFields []string `json:"-"` 4665} 4666 4667func (s *WebToken) MarshalJSON() ([]byte, error) { 4668 type NoMethod WebToken 4669 raw := NoMethod(*s) 4670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4671} 4672 4673// WipeAction: An action to reset a fully managed device or delete a 4674// work profile. Note: blockAction must also be specified. 4675type WipeAction struct { 4676 // PreserveFrp: Whether the factory-reset protection data is preserved 4677 // on the device. This setting doesn’t apply to work profiles. 4678 PreserveFrp bool `json:"preserveFrp,omitempty"` 4679 4680 // WipeAfterDays: Number of days the policy is non-compliant before the 4681 // device or work profile is wiped. wipeAfterDays must be greater than 4682 // blockAfterDays. 4683 WipeAfterDays int64 `json:"wipeAfterDays,omitempty"` 4684 4685 // ForceSendFields is a list of field names (e.g. "PreserveFrp") to 4686 // unconditionally include in API requests. By default, fields with 4687 // empty values are omitted from API requests. However, any non-pointer, 4688 // non-interface field appearing in ForceSendFields will be sent to the 4689 // server regardless of whether the field is empty or not. This may be 4690 // used to include empty fields in Patch requests. 4691 ForceSendFields []string `json:"-"` 4692 4693 // NullFields is a list of field names (e.g. "PreserveFrp") to include 4694 // in API requests with the JSON null value. By default, fields with 4695 // empty values are omitted from API requests. However, any field with 4696 // an empty value appearing in NullFields will be sent to the server as 4697 // null. It is an error if a field in this list has a non-empty value. 4698 // This may be used to include null fields in Patch requests. 4699 NullFields []string `json:"-"` 4700} 4701 4702func (s *WipeAction) MarshalJSON() ([]byte, error) { 4703 type NoMethod WipeAction 4704 raw := NoMethod(*s) 4705 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4706} 4707 4708// method id "androidmanagement.enterprises.create": 4709 4710type EnterprisesCreateCall struct { 4711 s *Service 4712 enterprise *Enterprise 4713 urlParams_ gensupport.URLParams 4714 ctx_ context.Context 4715 header_ http.Header 4716} 4717 4718// Create: Creates an enterprise. This is the last step in the 4719// enterprise signup flow. 4720func (r *EnterprisesService) Create(enterprise *Enterprise) *EnterprisesCreateCall { 4721 c := &EnterprisesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4722 c.enterprise = enterprise 4723 return c 4724} 4725 4726// AgreementAccepted sets the optional parameter "agreementAccepted": 4727// This feature is not generally available yet. Whether the managed 4728// Google Play Agreement is presented and agreed. 4729func (c *EnterprisesCreateCall) AgreementAccepted(agreementAccepted bool) *EnterprisesCreateCall { 4730 c.urlParams_.Set("agreementAccepted", fmt.Sprint(agreementAccepted)) 4731 return c 4732} 4733 4734// EnterpriseToken sets the optional parameter "enterpriseToken": The 4735// enterprise token appended to the callback URL. 4736func (c *EnterprisesCreateCall) EnterpriseToken(enterpriseToken string) *EnterprisesCreateCall { 4737 c.urlParams_.Set("enterpriseToken", enterpriseToken) 4738 return c 4739} 4740 4741// ProjectId sets the optional parameter "projectId": The ID of the 4742// Google Cloud Platform project which will own the enterprise. 4743func (c *EnterprisesCreateCall) ProjectId(projectId string) *EnterprisesCreateCall { 4744 c.urlParams_.Set("projectId", projectId) 4745 return c 4746} 4747 4748// SignupUrlName sets the optional parameter "signupUrlName": The name 4749// of the SignupUrl used to sign up for the enterprise. 4750func (c *EnterprisesCreateCall) SignupUrlName(signupUrlName string) *EnterprisesCreateCall { 4751 c.urlParams_.Set("signupUrlName", signupUrlName) 4752 return c 4753} 4754 4755// Fields allows partial responses to be retrieved. See 4756// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4757// for more information. 4758func (c *EnterprisesCreateCall) Fields(s ...googleapi.Field) *EnterprisesCreateCall { 4759 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4760 return c 4761} 4762 4763// Context sets the context to be used in this call's Do method. Any 4764// pending HTTP request will be aborted if the provided context is 4765// canceled. 4766func (c *EnterprisesCreateCall) Context(ctx context.Context) *EnterprisesCreateCall { 4767 c.ctx_ = ctx 4768 return c 4769} 4770 4771// Header returns an http.Header that can be modified by the caller to 4772// add HTTP headers to the request. 4773func (c *EnterprisesCreateCall) Header() http.Header { 4774 if c.header_ == nil { 4775 c.header_ = make(http.Header) 4776 } 4777 return c.header_ 4778} 4779 4780func (c *EnterprisesCreateCall) doRequest(alt string) (*http.Response, error) { 4781 reqHeaders := make(http.Header) 4782 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4783 for k, v := range c.header_ { 4784 reqHeaders[k] = v 4785 } 4786 reqHeaders.Set("User-Agent", c.s.userAgent()) 4787 var body io.Reader = nil 4788 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) 4789 if err != nil { 4790 return nil, err 4791 } 4792 reqHeaders.Set("Content-Type", "application/json") 4793 c.urlParams_.Set("alt", alt) 4794 c.urlParams_.Set("prettyPrint", "false") 4795 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/enterprises") 4796 urls += "?" + c.urlParams_.Encode() 4797 req, err := http.NewRequest("POST", urls, body) 4798 if err != nil { 4799 return nil, err 4800 } 4801 req.Header = reqHeaders 4802 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4803} 4804 4805// Do executes the "androidmanagement.enterprises.create" call. 4806// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 4807// status code is an error. Response headers are in either 4808// *Enterprise.ServerResponse.Header or (if a response was returned at 4809// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4810// to check whether the returned error was because 4811// http.StatusNotModified was returned. 4812func (c *EnterprisesCreateCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 4813 gensupport.SetOptions(c.urlParams_, opts...) 4814 res, err := c.doRequest("json") 4815 if res != nil && res.StatusCode == http.StatusNotModified { 4816 if res.Body != nil { 4817 res.Body.Close() 4818 } 4819 return nil, &googleapi.Error{ 4820 Code: res.StatusCode, 4821 Header: res.Header, 4822 } 4823 } 4824 if err != nil { 4825 return nil, err 4826 } 4827 defer googleapi.CloseBody(res) 4828 if err := googleapi.CheckResponse(res); err != nil { 4829 return nil, err 4830 } 4831 ret := &Enterprise{ 4832 ServerResponse: googleapi.ServerResponse{ 4833 Header: res.Header, 4834 HTTPStatusCode: res.StatusCode, 4835 }, 4836 } 4837 target := &ret 4838 if err := gensupport.DecodeResponse(target, res); err != nil { 4839 return nil, err 4840 } 4841 return ret, nil 4842 // { 4843 // "description": "Creates an enterprise. This is the last step in the enterprise signup flow.", 4844 // "flatPath": "v1/enterprises", 4845 // "httpMethod": "POST", 4846 // "id": "androidmanagement.enterprises.create", 4847 // "parameterOrder": [], 4848 // "parameters": { 4849 // "agreementAccepted": { 4850 // "description": "This feature is not generally available yet. Whether the managed Google Play Agreement is presented and agreed.", 4851 // "location": "query", 4852 // "type": "boolean" 4853 // }, 4854 // "enterpriseToken": { 4855 // "description": "The enterprise token appended to the callback URL.", 4856 // "location": "query", 4857 // "type": "string" 4858 // }, 4859 // "projectId": { 4860 // "description": "The ID of the Google Cloud Platform project which will own the enterprise.", 4861 // "location": "query", 4862 // "type": "string" 4863 // }, 4864 // "signupUrlName": { 4865 // "description": "The name of the SignupUrl used to sign up for the enterprise.", 4866 // "location": "query", 4867 // "type": "string" 4868 // } 4869 // }, 4870 // "path": "v1/enterprises", 4871 // "request": { 4872 // "$ref": "Enterprise" 4873 // }, 4874 // "response": { 4875 // "$ref": "Enterprise" 4876 // }, 4877 // "scopes": [ 4878 // "https://www.googleapis.com/auth/androidmanagement" 4879 // ] 4880 // } 4881 4882} 4883 4884// method id "androidmanagement.enterprises.delete": 4885 4886type EnterprisesDeleteCall struct { 4887 s *Service 4888 name string 4889 urlParams_ gensupport.URLParams 4890 ctx_ context.Context 4891 header_ http.Header 4892} 4893 4894// Delete: This feature is not generally available yet. Deletes an 4895// enterprise. 4896// 4897// - name: This feature is not generally available yet. The name of the 4898// enterprise in the form enterprises/{enterpriseId}. 4899func (r *EnterprisesService) Delete(name string) *EnterprisesDeleteCall { 4900 c := &EnterprisesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4901 c.name = name 4902 return c 4903} 4904 4905// Fields allows partial responses to be retrieved. See 4906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4907// for more information. 4908func (c *EnterprisesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDeleteCall { 4909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4910 return c 4911} 4912 4913// Context sets the context to be used in this call's Do method. Any 4914// pending HTTP request will be aborted if the provided context is 4915// canceled. 4916func (c *EnterprisesDeleteCall) Context(ctx context.Context) *EnterprisesDeleteCall { 4917 c.ctx_ = ctx 4918 return c 4919} 4920 4921// Header returns an http.Header that can be modified by the caller to 4922// add HTTP headers to the request. 4923func (c *EnterprisesDeleteCall) Header() http.Header { 4924 if c.header_ == nil { 4925 c.header_ = make(http.Header) 4926 } 4927 return c.header_ 4928} 4929 4930func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) { 4931 reqHeaders := make(http.Header) 4932 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4933 for k, v := range c.header_ { 4934 reqHeaders[k] = v 4935 } 4936 reqHeaders.Set("User-Agent", c.s.userAgent()) 4937 var body io.Reader = nil 4938 c.urlParams_.Set("alt", alt) 4939 c.urlParams_.Set("prettyPrint", "false") 4940 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4941 urls += "?" + c.urlParams_.Encode() 4942 req, err := http.NewRequest("DELETE", urls, body) 4943 if err != nil { 4944 return nil, err 4945 } 4946 req.Header = reqHeaders 4947 googleapi.Expand(req.URL, map[string]string{ 4948 "name": c.name, 4949 }) 4950 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4951} 4952 4953// Do executes the "androidmanagement.enterprises.delete" call. 4954// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4955// code is an error. Response headers are in either 4956// *Empty.ServerResponse.Header or (if a response was returned at all) 4957// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4958// check whether the returned error was because http.StatusNotModified 4959// was returned. 4960func (c *EnterprisesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4961 gensupport.SetOptions(c.urlParams_, opts...) 4962 res, err := c.doRequest("json") 4963 if res != nil && res.StatusCode == http.StatusNotModified { 4964 if res.Body != nil { 4965 res.Body.Close() 4966 } 4967 return nil, &googleapi.Error{ 4968 Code: res.StatusCode, 4969 Header: res.Header, 4970 } 4971 } 4972 if err != nil { 4973 return nil, err 4974 } 4975 defer googleapi.CloseBody(res) 4976 if err := googleapi.CheckResponse(res); err != nil { 4977 return nil, err 4978 } 4979 ret := &Empty{ 4980 ServerResponse: googleapi.ServerResponse{ 4981 Header: res.Header, 4982 HTTPStatusCode: res.StatusCode, 4983 }, 4984 } 4985 target := &ret 4986 if err := gensupport.DecodeResponse(target, res); err != nil { 4987 return nil, err 4988 } 4989 return ret, nil 4990 // { 4991 // "description": "This feature is not generally available yet. Deletes an enterprise.", 4992 // "flatPath": "v1/enterprises/{enterprisesId}", 4993 // "httpMethod": "DELETE", 4994 // "id": "androidmanagement.enterprises.delete", 4995 // "parameterOrder": [ 4996 // "name" 4997 // ], 4998 // "parameters": { 4999 // "name": { 5000 // "description": "This feature is not generally available yet. The name of the enterprise in the form enterprises/{enterpriseId}.", 5001 // "location": "path", 5002 // "pattern": "^enterprises/[^/]+$", 5003 // "required": true, 5004 // "type": "string" 5005 // } 5006 // }, 5007 // "path": "v1/{+name}", 5008 // "response": { 5009 // "$ref": "Empty" 5010 // }, 5011 // "scopes": [ 5012 // "https://www.googleapis.com/auth/androidmanagement" 5013 // ] 5014 // } 5015 5016} 5017 5018// method id "androidmanagement.enterprises.get": 5019 5020type EnterprisesGetCall struct { 5021 s *Service 5022 name string 5023 urlParams_ gensupport.URLParams 5024 ifNoneMatch_ string 5025 ctx_ context.Context 5026 header_ http.Header 5027} 5028 5029// Get: Gets an enterprise. 5030// 5031// - name: The name of the enterprise in the form 5032// enterprises/{enterpriseId}. 5033func (r *EnterprisesService) Get(name string) *EnterprisesGetCall { 5034 c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5035 c.name = name 5036 return c 5037} 5038 5039// Fields allows partial responses to be retrieved. See 5040// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5041// for more information. 5042func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall { 5043 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5044 return c 5045} 5046 5047// IfNoneMatch sets the optional parameter which makes the operation 5048// fail if the object's ETag matches the given value. This is useful for 5049// getting updates only after the object has changed since the last 5050// request. Use googleapi.IsNotModified to check whether the response 5051// error from Do is the result of In-None-Match. 5052func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall { 5053 c.ifNoneMatch_ = entityTag 5054 return c 5055} 5056 5057// Context sets the context to be used in this call's Do method. Any 5058// pending HTTP request will be aborted if the provided context is 5059// canceled. 5060func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall { 5061 c.ctx_ = ctx 5062 return c 5063} 5064 5065// Header returns an http.Header that can be modified by the caller to 5066// add HTTP headers to the request. 5067func (c *EnterprisesGetCall) Header() http.Header { 5068 if c.header_ == nil { 5069 c.header_ = make(http.Header) 5070 } 5071 return c.header_ 5072} 5073 5074func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { 5075 reqHeaders := make(http.Header) 5076 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5077 for k, v := range c.header_ { 5078 reqHeaders[k] = v 5079 } 5080 reqHeaders.Set("User-Agent", c.s.userAgent()) 5081 if c.ifNoneMatch_ != "" { 5082 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5083 } 5084 var body io.Reader = nil 5085 c.urlParams_.Set("alt", alt) 5086 c.urlParams_.Set("prettyPrint", "false") 5087 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5088 urls += "?" + c.urlParams_.Encode() 5089 req, err := http.NewRequest("GET", urls, body) 5090 if err != nil { 5091 return nil, err 5092 } 5093 req.Header = reqHeaders 5094 googleapi.Expand(req.URL, map[string]string{ 5095 "name": c.name, 5096 }) 5097 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5098} 5099 5100// Do executes the "androidmanagement.enterprises.get" call. 5101// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5102// status code is an error. Response headers are in either 5103// *Enterprise.ServerResponse.Header or (if a response was returned at 5104// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5105// to check whether the returned error was because 5106// http.StatusNotModified was returned. 5107func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5108 gensupport.SetOptions(c.urlParams_, opts...) 5109 res, err := c.doRequest("json") 5110 if res != nil && res.StatusCode == http.StatusNotModified { 5111 if res.Body != nil { 5112 res.Body.Close() 5113 } 5114 return nil, &googleapi.Error{ 5115 Code: res.StatusCode, 5116 Header: res.Header, 5117 } 5118 } 5119 if err != nil { 5120 return nil, err 5121 } 5122 defer googleapi.CloseBody(res) 5123 if err := googleapi.CheckResponse(res); err != nil { 5124 return nil, err 5125 } 5126 ret := &Enterprise{ 5127 ServerResponse: googleapi.ServerResponse{ 5128 Header: res.Header, 5129 HTTPStatusCode: res.StatusCode, 5130 }, 5131 } 5132 target := &ret 5133 if err := gensupport.DecodeResponse(target, res); err != nil { 5134 return nil, err 5135 } 5136 return ret, nil 5137 // { 5138 // "description": "Gets an enterprise.", 5139 // "flatPath": "v1/enterprises/{enterprisesId}", 5140 // "httpMethod": "GET", 5141 // "id": "androidmanagement.enterprises.get", 5142 // "parameterOrder": [ 5143 // "name" 5144 // ], 5145 // "parameters": { 5146 // "name": { 5147 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 5148 // "location": "path", 5149 // "pattern": "^enterprises/[^/]+$", 5150 // "required": true, 5151 // "type": "string" 5152 // } 5153 // }, 5154 // "path": "v1/{+name}", 5155 // "response": { 5156 // "$ref": "Enterprise" 5157 // }, 5158 // "scopes": [ 5159 // "https://www.googleapis.com/auth/androidmanagement" 5160 // ] 5161 // } 5162 5163} 5164 5165// method id "androidmanagement.enterprises.list": 5166 5167type EnterprisesListCall struct { 5168 s *Service 5169 urlParams_ gensupport.URLParams 5170 ifNoneMatch_ string 5171 ctx_ context.Context 5172 header_ http.Header 5173} 5174 5175// List: This feature is not generally available yet. Lists enterprises 5176// that are managed by an EMM. Only partial views are returned. 5177func (r *EnterprisesService) List() *EnterprisesListCall { 5178 c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5179 return c 5180} 5181 5182// PageSize sets the optional parameter "pageSize": This feature is not 5183// generally available yet. The requested page size. The actual page 5184// size may be fixed to a min or max value. 5185func (c *EnterprisesListCall) PageSize(pageSize int64) *EnterprisesListCall { 5186 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5187 return c 5188} 5189 5190// PageToken sets the optional parameter "pageToken": This feature is 5191// not generally available yet. A token identifying a page of results 5192// returned by the server. 5193func (c *EnterprisesListCall) PageToken(pageToken string) *EnterprisesListCall { 5194 c.urlParams_.Set("pageToken", pageToken) 5195 return c 5196} 5197 5198// ProjectId sets the optional parameter "projectId": Required. This 5199// feature is not generally available yet. The ID of the Cloud project 5200// of the EMM the enterprises belongs to. 5201func (c *EnterprisesListCall) ProjectId(projectId string) *EnterprisesListCall { 5202 c.urlParams_.Set("projectId", projectId) 5203 return c 5204} 5205 5206// View sets the optional parameter "view": This feature is not 5207// generally available yet. View that specify that partial response 5208// should be returned. 5209// 5210// Possible values: 5211// "ENTERPRISE_VIEW_UNSPECIFIED" - This feature is not generally 5212// available yet. The API will default to the BASIC view for the List 5213// method. 5214// "BASIC" - This feature is not generally available yet. Includes 5215// name and enterprise_display_name fields. 5216func (c *EnterprisesListCall) View(view string) *EnterprisesListCall { 5217 c.urlParams_.Set("view", view) 5218 return c 5219} 5220 5221// Fields allows partial responses to be retrieved. See 5222// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5223// for more information. 5224func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall { 5225 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5226 return c 5227} 5228 5229// IfNoneMatch sets the optional parameter which makes the operation 5230// fail if the object's ETag matches the given value. This is useful for 5231// getting updates only after the object has changed since the last 5232// request. Use googleapi.IsNotModified to check whether the response 5233// error from Do is the result of In-None-Match. 5234func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall { 5235 c.ifNoneMatch_ = entityTag 5236 return c 5237} 5238 5239// Context sets the context to be used in this call's Do method. Any 5240// pending HTTP request will be aborted if the provided context is 5241// canceled. 5242func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall { 5243 c.ctx_ = ctx 5244 return c 5245} 5246 5247// Header returns an http.Header that can be modified by the caller to 5248// add HTTP headers to the request. 5249func (c *EnterprisesListCall) Header() http.Header { 5250 if c.header_ == nil { 5251 c.header_ = make(http.Header) 5252 } 5253 return c.header_ 5254} 5255 5256func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { 5257 reqHeaders := make(http.Header) 5258 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5259 for k, v := range c.header_ { 5260 reqHeaders[k] = v 5261 } 5262 reqHeaders.Set("User-Agent", c.s.userAgent()) 5263 if c.ifNoneMatch_ != "" { 5264 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5265 } 5266 var body io.Reader = nil 5267 c.urlParams_.Set("alt", alt) 5268 c.urlParams_.Set("prettyPrint", "false") 5269 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/enterprises") 5270 urls += "?" + c.urlParams_.Encode() 5271 req, err := http.NewRequest("GET", urls, body) 5272 if err != nil { 5273 return nil, err 5274 } 5275 req.Header = reqHeaders 5276 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5277} 5278 5279// Do executes the "androidmanagement.enterprises.list" call. 5280// Exactly one of *ListEnterprisesResponse or error will be non-nil. Any 5281// non-2xx status code is an error. Response headers are in either 5282// *ListEnterprisesResponse.ServerResponse.Header or (if a response was 5283// returned at all) in error.(*googleapi.Error).Header. Use 5284// googleapi.IsNotModified to check whether the returned error was 5285// because http.StatusNotModified was returned. 5286func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*ListEnterprisesResponse, error) { 5287 gensupport.SetOptions(c.urlParams_, opts...) 5288 res, err := c.doRequest("json") 5289 if res != nil && res.StatusCode == http.StatusNotModified { 5290 if res.Body != nil { 5291 res.Body.Close() 5292 } 5293 return nil, &googleapi.Error{ 5294 Code: res.StatusCode, 5295 Header: res.Header, 5296 } 5297 } 5298 if err != nil { 5299 return nil, err 5300 } 5301 defer googleapi.CloseBody(res) 5302 if err := googleapi.CheckResponse(res); err != nil { 5303 return nil, err 5304 } 5305 ret := &ListEnterprisesResponse{ 5306 ServerResponse: googleapi.ServerResponse{ 5307 Header: res.Header, 5308 HTTPStatusCode: res.StatusCode, 5309 }, 5310 } 5311 target := &ret 5312 if err := gensupport.DecodeResponse(target, res); err != nil { 5313 return nil, err 5314 } 5315 return ret, nil 5316 // { 5317 // "description": "This feature is not generally available yet. Lists enterprises that are managed by an EMM. Only partial views are returned.", 5318 // "flatPath": "v1/enterprises", 5319 // "httpMethod": "GET", 5320 // "id": "androidmanagement.enterprises.list", 5321 // "parameterOrder": [], 5322 // "parameters": { 5323 // "pageSize": { 5324 // "description": "This feature is not generally available yet. The requested page size. The actual page size may be fixed to a min or max value.", 5325 // "format": "int32", 5326 // "location": "query", 5327 // "type": "integer" 5328 // }, 5329 // "pageToken": { 5330 // "description": "This feature is not generally available yet. A token identifying a page of results returned by the server.", 5331 // "location": "query", 5332 // "type": "string" 5333 // }, 5334 // "projectId": { 5335 // "description": "Required. This feature is not generally available yet. The ID of the Cloud project of the EMM the enterprises belongs to.", 5336 // "location": "query", 5337 // "type": "string" 5338 // }, 5339 // "view": { 5340 // "description": "This feature is not generally available yet. View that specify that partial response should be returned.", 5341 // "enum": [ 5342 // "ENTERPRISE_VIEW_UNSPECIFIED", 5343 // "BASIC" 5344 // ], 5345 // "enumDescriptions": [ 5346 // "This feature is not generally available yet. The API will default to the BASIC view for the List method.", 5347 // "This feature is not generally available yet. Includes name and enterprise_display_name fields." 5348 // ], 5349 // "location": "query", 5350 // "type": "string" 5351 // } 5352 // }, 5353 // "path": "v1/enterprises", 5354 // "response": { 5355 // "$ref": "ListEnterprisesResponse" 5356 // }, 5357 // "scopes": [ 5358 // "https://www.googleapis.com/auth/androidmanagement" 5359 // ] 5360 // } 5361 5362} 5363 5364// Pages invokes f for each page of results. 5365// A non-nil error returned from f will halt the iteration. 5366// The provided context supersedes any context provided to the Context method. 5367func (c *EnterprisesListCall) Pages(ctx context.Context, f func(*ListEnterprisesResponse) error) error { 5368 c.ctx_ = ctx 5369 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5370 for { 5371 x, err := c.Do() 5372 if err != nil { 5373 return err 5374 } 5375 if err := f(x); err != nil { 5376 return err 5377 } 5378 if x.NextPageToken == "" { 5379 return nil 5380 } 5381 c.PageToken(x.NextPageToken) 5382 } 5383} 5384 5385// method id "androidmanagement.enterprises.patch": 5386 5387type EnterprisesPatchCall struct { 5388 s *Service 5389 name string 5390 enterprise *Enterprise 5391 urlParams_ gensupport.URLParams 5392 ctx_ context.Context 5393 header_ http.Header 5394} 5395 5396// Patch: Updates an enterprise. 5397// 5398// - name: The name of the enterprise in the form 5399// enterprises/{enterpriseId}. 5400func (r *EnterprisesService) Patch(name string, enterprise *Enterprise) *EnterprisesPatchCall { 5401 c := &EnterprisesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5402 c.name = name 5403 c.enterprise = enterprise 5404 return c 5405} 5406 5407// UpdateMask sets the optional parameter "updateMask": The field mask 5408// indicating the fields to update. If not set, all modifiable fields 5409// will be modified. 5410func (c *EnterprisesPatchCall) UpdateMask(updateMask string) *EnterprisesPatchCall { 5411 c.urlParams_.Set("updateMask", updateMask) 5412 return c 5413} 5414 5415// Fields allows partial responses to be retrieved. See 5416// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5417// for more information. 5418func (c *EnterprisesPatchCall) Fields(s ...googleapi.Field) *EnterprisesPatchCall { 5419 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5420 return c 5421} 5422 5423// Context sets the context to be used in this call's Do method. Any 5424// pending HTTP request will be aborted if the provided context is 5425// canceled. 5426func (c *EnterprisesPatchCall) Context(ctx context.Context) *EnterprisesPatchCall { 5427 c.ctx_ = ctx 5428 return c 5429} 5430 5431// Header returns an http.Header that can be modified by the caller to 5432// add HTTP headers to the request. 5433func (c *EnterprisesPatchCall) Header() http.Header { 5434 if c.header_ == nil { 5435 c.header_ = make(http.Header) 5436 } 5437 return c.header_ 5438} 5439 5440func (c *EnterprisesPatchCall) doRequest(alt string) (*http.Response, error) { 5441 reqHeaders := make(http.Header) 5442 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5443 for k, v := range c.header_ { 5444 reqHeaders[k] = v 5445 } 5446 reqHeaders.Set("User-Agent", c.s.userAgent()) 5447 var body io.Reader = nil 5448 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) 5449 if err != nil { 5450 return nil, err 5451 } 5452 reqHeaders.Set("Content-Type", "application/json") 5453 c.urlParams_.Set("alt", alt) 5454 c.urlParams_.Set("prettyPrint", "false") 5455 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5456 urls += "?" + c.urlParams_.Encode() 5457 req, err := http.NewRequest("PATCH", urls, body) 5458 if err != nil { 5459 return nil, err 5460 } 5461 req.Header = reqHeaders 5462 googleapi.Expand(req.URL, map[string]string{ 5463 "name": c.name, 5464 }) 5465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5466} 5467 5468// Do executes the "androidmanagement.enterprises.patch" call. 5469// Exactly one of *Enterprise or error will be non-nil. Any non-2xx 5470// status code is an error. Response headers are in either 5471// *Enterprise.ServerResponse.Header or (if a response was returned at 5472// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5473// to check whether the returned error was because 5474// http.StatusNotModified was returned. 5475func (c *EnterprisesPatchCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) { 5476 gensupport.SetOptions(c.urlParams_, opts...) 5477 res, err := c.doRequest("json") 5478 if res != nil && res.StatusCode == http.StatusNotModified { 5479 if res.Body != nil { 5480 res.Body.Close() 5481 } 5482 return nil, &googleapi.Error{ 5483 Code: res.StatusCode, 5484 Header: res.Header, 5485 } 5486 } 5487 if err != nil { 5488 return nil, err 5489 } 5490 defer googleapi.CloseBody(res) 5491 if err := googleapi.CheckResponse(res); err != nil { 5492 return nil, err 5493 } 5494 ret := &Enterprise{ 5495 ServerResponse: googleapi.ServerResponse{ 5496 Header: res.Header, 5497 HTTPStatusCode: res.StatusCode, 5498 }, 5499 } 5500 target := &ret 5501 if err := gensupport.DecodeResponse(target, res); err != nil { 5502 return nil, err 5503 } 5504 return ret, nil 5505 // { 5506 // "description": "Updates an enterprise.", 5507 // "flatPath": "v1/enterprises/{enterprisesId}", 5508 // "httpMethod": "PATCH", 5509 // "id": "androidmanagement.enterprises.patch", 5510 // "parameterOrder": [ 5511 // "name" 5512 // ], 5513 // "parameters": { 5514 // "name": { 5515 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 5516 // "location": "path", 5517 // "pattern": "^enterprises/[^/]+$", 5518 // "required": true, 5519 // "type": "string" 5520 // }, 5521 // "updateMask": { 5522 // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", 5523 // "format": "google-fieldmask", 5524 // "location": "query", 5525 // "type": "string" 5526 // } 5527 // }, 5528 // "path": "v1/{+name}", 5529 // "request": { 5530 // "$ref": "Enterprise" 5531 // }, 5532 // "response": { 5533 // "$ref": "Enterprise" 5534 // }, 5535 // "scopes": [ 5536 // "https://www.googleapis.com/auth/androidmanagement" 5537 // ] 5538 // } 5539 5540} 5541 5542// method id "androidmanagement.enterprises.applications.get": 5543 5544type EnterprisesApplicationsGetCall struct { 5545 s *Service 5546 name string 5547 urlParams_ gensupport.URLParams 5548 ifNoneMatch_ string 5549 ctx_ context.Context 5550 header_ http.Header 5551} 5552 5553// Get: Gets info about an application. 5554// 5555// - name: The name of the application in the form 5556// enterprises/{enterpriseId}/applications/{package_name}. 5557func (r *EnterprisesApplicationsService) Get(name string) *EnterprisesApplicationsGetCall { 5558 c := &EnterprisesApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5559 c.name = name 5560 return c 5561} 5562 5563// LanguageCode sets the optional parameter "languageCode": The 5564// preferred language for localized application info, as a BCP47 tag 5565// (e.g. "en-US", "de"). If not specified the default language of the 5566// application will be used. 5567func (c *EnterprisesApplicationsGetCall) LanguageCode(languageCode string) *EnterprisesApplicationsGetCall { 5568 c.urlParams_.Set("languageCode", languageCode) 5569 return c 5570} 5571 5572// Fields allows partial responses to be retrieved. See 5573// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5574// for more information. 5575func (c *EnterprisesApplicationsGetCall) Fields(s ...googleapi.Field) *EnterprisesApplicationsGetCall { 5576 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5577 return c 5578} 5579 5580// IfNoneMatch sets the optional parameter which makes the operation 5581// fail if the object's ETag matches the given value. This is useful for 5582// getting updates only after the object has changed since the last 5583// request. Use googleapi.IsNotModified to check whether the response 5584// error from Do is the result of In-None-Match. 5585func (c *EnterprisesApplicationsGetCall) IfNoneMatch(entityTag string) *EnterprisesApplicationsGetCall { 5586 c.ifNoneMatch_ = entityTag 5587 return c 5588} 5589 5590// Context sets the context to be used in this call's Do method. Any 5591// pending HTTP request will be aborted if the provided context is 5592// canceled. 5593func (c *EnterprisesApplicationsGetCall) Context(ctx context.Context) *EnterprisesApplicationsGetCall { 5594 c.ctx_ = ctx 5595 return c 5596} 5597 5598// Header returns an http.Header that can be modified by the caller to 5599// add HTTP headers to the request. 5600func (c *EnterprisesApplicationsGetCall) Header() http.Header { 5601 if c.header_ == nil { 5602 c.header_ = make(http.Header) 5603 } 5604 return c.header_ 5605} 5606 5607func (c *EnterprisesApplicationsGetCall) doRequest(alt string) (*http.Response, error) { 5608 reqHeaders := make(http.Header) 5609 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5610 for k, v := range c.header_ { 5611 reqHeaders[k] = v 5612 } 5613 reqHeaders.Set("User-Agent", c.s.userAgent()) 5614 if c.ifNoneMatch_ != "" { 5615 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5616 } 5617 var body io.Reader = nil 5618 c.urlParams_.Set("alt", alt) 5619 c.urlParams_.Set("prettyPrint", "false") 5620 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5621 urls += "?" + c.urlParams_.Encode() 5622 req, err := http.NewRequest("GET", urls, body) 5623 if err != nil { 5624 return nil, err 5625 } 5626 req.Header = reqHeaders 5627 googleapi.Expand(req.URL, map[string]string{ 5628 "name": c.name, 5629 }) 5630 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5631} 5632 5633// Do executes the "androidmanagement.enterprises.applications.get" call. 5634// Exactly one of *Application or error will be non-nil. Any non-2xx 5635// status code is an error. Response headers are in either 5636// *Application.ServerResponse.Header or (if a response was returned at 5637// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5638// to check whether the returned error was because 5639// http.StatusNotModified was returned. 5640func (c *EnterprisesApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) { 5641 gensupport.SetOptions(c.urlParams_, opts...) 5642 res, err := c.doRequest("json") 5643 if res != nil && res.StatusCode == http.StatusNotModified { 5644 if res.Body != nil { 5645 res.Body.Close() 5646 } 5647 return nil, &googleapi.Error{ 5648 Code: res.StatusCode, 5649 Header: res.Header, 5650 } 5651 } 5652 if err != nil { 5653 return nil, err 5654 } 5655 defer googleapi.CloseBody(res) 5656 if err := googleapi.CheckResponse(res); err != nil { 5657 return nil, err 5658 } 5659 ret := &Application{ 5660 ServerResponse: googleapi.ServerResponse{ 5661 Header: res.Header, 5662 HTTPStatusCode: res.StatusCode, 5663 }, 5664 } 5665 target := &ret 5666 if err := gensupport.DecodeResponse(target, res); err != nil { 5667 return nil, err 5668 } 5669 return ret, nil 5670 // { 5671 // "description": "Gets info about an application.", 5672 // "flatPath": "v1/enterprises/{enterprisesId}/applications/{applicationsId}", 5673 // "httpMethod": "GET", 5674 // "id": "androidmanagement.enterprises.applications.get", 5675 // "parameterOrder": [ 5676 // "name" 5677 // ], 5678 // "parameters": { 5679 // "languageCode": { 5680 // "description": "The preferred language for localized application info, as a BCP47 tag (e.g. \"en-US\", \"de\"). If not specified the default language of the application will be used.", 5681 // "location": "query", 5682 // "type": "string" 5683 // }, 5684 // "name": { 5685 // "description": "The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}.", 5686 // "location": "path", 5687 // "pattern": "^enterprises/[^/]+/applications/[^/]+$", 5688 // "required": true, 5689 // "type": "string" 5690 // } 5691 // }, 5692 // "path": "v1/{+name}", 5693 // "response": { 5694 // "$ref": "Application" 5695 // }, 5696 // "scopes": [ 5697 // "https://www.googleapis.com/auth/androidmanagement" 5698 // ] 5699 // } 5700 5701} 5702 5703// method id "androidmanagement.enterprises.devices.delete": 5704 5705type EnterprisesDevicesDeleteCall struct { 5706 s *Service 5707 name string 5708 urlParams_ gensupport.URLParams 5709 ctx_ context.Context 5710 header_ http.Header 5711} 5712 5713// Delete: Deletes a device. This operation wipes the device. 5714// 5715// - name: The name of the device in the form 5716// enterprises/{enterpriseId}/devices/{deviceId}. 5717func (r *EnterprisesDevicesService) Delete(name string) *EnterprisesDevicesDeleteCall { 5718 c := &EnterprisesDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5719 c.name = name 5720 return c 5721} 5722 5723// WipeDataFlags sets the optional parameter "wipeDataFlags": Optional 5724// flags that control the device wiping behavior. 5725// 5726// Possible values: 5727// "WIPE_DATA_FLAG_UNSPECIFIED" - This value is ignored. 5728// "PRESERVE_RESET_PROTECTION_DATA" - Preserve the factory reset 5729// protection data on the device. 5730// "WIPE_EXTERNAL_STORAGE" - Additionally wipe the device's external 5731// storage (such as SD cards). 5732func (c *EnterprisesDevicesDeleteCall) WipeDataFlags(wipeDataFlags ...string) *EnterprisesDevicesDeleteCall { 5733 c.urlParams_.SetMulti("wipeDataFlags", append([]string{}, wipeDataFlags...)) 5734 return c 5735} 5736 5737// WipeReasonMessage sets the optional parameter "wipeReasonMessage": A 5738// short message displayed to the user before wiping the work profile on 5739// personal devices. This has no effect on company owned devices. The 5740// maximum message length is 200 characters. 5741func (c *EnterprisesDevicesDeleteCall) WipeReasonMessage(wipeReasonMessage string) *EnterprisesDevicesDeleteCall { 5742 c.urlParams_.Set("wipeReasonMessage", wipeReasonMessage) 5743 return c 5744} 5745 5746// Fields allows partial responses to be retrieved. See 5747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5748// for more information. 5749func (c *EnterprisesDevicesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDevicesDeleteCall { 5750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5751 return c 5752} 5753 5754// Context sets the context to be used in this call's Do method. Any 5755// pending HTTP request will be aborted if the provided context is 5756// canceled. 5757func (c *EnterprisesDevicesDeleteCall) Context(ctx context.Context) *EnterprisesDevicesDeleteCall { 5758 c.ctx_ = ctx 5759 return c 5760} 5761 5762// Header returns an http.Header that can be modified by the caller to 5763// add HTTP headers to the request. 5764func (c *EnterprisesDevicesDeleteCall) Header() http.Header { 5765 if c.header_ == nil { 5766 c.header_ = make(http.Header) 5767 } 5768 return c.header_ 5769} 5770 5771func (c *EnterprisesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) { 5772 reqHeaders := make(http.Header) 5773 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5774 for k, v := range c.header_ { 5775 reqHeaders[k] = v 5776 } 5777 reqHeaders.Set("User-Agent", c.s.userAgent()) 5778 var body io.Reader = nil 5779 c.urlParams_.Set("alt", alt) 5780 c.urlParams_.Set("prettyPrint", "false") 5781 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5782 urls += "?" + c.urlParams_.Encode() 5783 req, err := http.NewRequest("DELETE", urls, body) 5784 if err != nil { 5785 return nil, err 5786 } 5787 req.Header = reqHeaders 5788 googleapi.Expand(req.URL, map[string]string{ 5789 "name": c.name, 5790 }) 5791 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5792} 5793 5794// Do executes the "androidmanagement.enterprises.devices.delete" call. 5795// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5796// code is an error. Response headers are in either 5797// *Empty.ServerResponse.Header or (if a response was returned at all) 5798// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5799// check whether the returned error was because http.StatusNotModified 5800// was returned. 5801func (c *EnterprisesDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5802 gensupport.SetOptions(c.urlParams_, opts...) 5803 res, err := c.doRequest("json") 5804 if res != nil && res.StatusCode == http.StatusNotModified { 5805 if res.Body != nil { 5806 res.Body.Close() 5807 } 5808 return nil, &googleapi.Error{ 5809 Code: res.StatusCode, 5810 Header: res.Header, 5811 } 5812 } 5813 if err != nil { 5814 return nil, err 5815 } 5816 defer googleapi.CloseBody(res) 5817 if err := googleapi.CheckResponse(res); err != nil { 5818 return nil, err 5819 } 5820 ret := &Empty{ 5821 ServerResponse: googleapi.ServerResponse{ 5822 Header: res.Header, 5823 HTTPStatusCode: res.StatusCode, 5824 }, 5825 } 5826 target := &ret 5827 if err := gensupport.DecodeResponse(target, res); err != nil { 5828 return nil, err 5829 } 5830 return ret, nil 5831 // { 5832 // "description": "Deletes a device. This operation wipes the device.", 5833 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", 5834 // "httpMethod": "DELETE", 5835 // "id": "androidmanagement.enterprises.devices.delete", 5836 // "parameterOrder": [ 5837 // "name" 5838 // ], 5839 // "parameters": { 5840 // "name": { 5841 // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.", 5842 // "location": "path", 5843 // "pattern": "^enterprises/[^/]+/devices/[^/]+$", 5844 // "required": true, 5845 // "type": "string" 5846 // }, 5847 // "wipeDataFlags": { 5848 // "description": "Optional flags that control the device wiping behavior.", 5849 // "enum": [ 5850 // "WIPE_DATA_FLAG_UNSPECIFIED", 5851 // "PRESERVE_RESET_PROTECTION_DATA", 5852 // "WIPE_EXTERNAL_STORAGE" 5853 // ], 5854 // "enumDescriptions": [ 5855 // "This value is ignored.", 5856 // "Preserve the factory reset protection data on the device.", 5857 // "Additionally wipe the device's external storage (such as SD cards)." 5858 // ], 5859 // "location": "query", 5860 // "repeated": true, 5861 // "type": "string" 5862 // }, 5863 // "wipeReasonMessage": { 5864 // "description": "Optional. A short message displayed to the user before wiping the work profile on personal devices. This has no effect on company owned devices. The maximum message length is 200 characters.", 5865 // "location": "query", 5866 // "type": "string" 5867 // } 5868 // }, 5869 // "path": "v1/{+name}", 5870 // "response": { 5871 // "$ref": "Empty" 5872 // }, 5873 // "scopes": [ 5874 // "https://www.googleapis.com/auth/androidmanagement" 5875 // ] 5876 // } 5877 5878} 5879 5880// method id "androidmanagement.enterprises.devices.get": 5881 5882type EnterprisesDevicesGetCall struct { 5883 s *Service 5884 name string 5885 urlParams_ gensupport.URLParams 5886 ifNoneMatch_ string 5887 ctx_ context.Context 5888 header_ http.Header 5889} 5890 5891// Get: Gets a device. 5892// 5893// - name: The name of the device in the form 5894// enterprises/{enterpriseId}/devices/{deviceId}. 5895func (r *EnterprisesDevicesService) Get(name string) *EnterprisesDevicesGetCall { 5896 c := &EnterprisesDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5897 c.name = name 5898 return c 5899} 5900 5901// Fields allows partial responses to be retrieved. See 5902// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5903// for more information. 5904func (c *EnterprisesDevicesGetCall) Fields(s ...googleapi.Field) *EnterprisesDevicesGetCall { 5905 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5906 return c 5907} 5908 5909// IfNoneMatch sets the optional parameter which makes the operation 5910// fail if the object's ETag matches the given value. This is useful for 5911// getting updates only after the object has changed since the last 5912// request. Use googleapi.IsNotModified to check whether the response 5913// error from Do is the result of In-None-Match. 5914func (c *EnterprisesDevicesGetCall) IfNoneMatch(entityTag string) *EnterprisesDevicesGetCall { 5915 c.ifNoneMatch_ = entityTag 5916 return c 5917} 5918 5919// Context sets the context to be used in this call's Do method. Any 5920// pending HTTP request will be aborted if the provided context is 5921// canceled. 5922func (c *EnterprisesDevicesGetCall) Context(ctx context.Context) *EnterprisesDevicesGetCall { 5923 c.ctx_ = ctx 5924 return c 5925} 5926 5927// Header returns an http.Header that can be modified by the caller to 5928// add HTTP headers to the request. 5929func (c *EnterprisesDevicesGetCall) Header() http.Header { 5930 if c.header_ == nil { 5931 c.header_ = make(http.Header) 5932 } 5933 return c.header_ 5934} 5935 5936func (c *EnterprisesDevicesGetCall) doRequest(alt string) (*http.Response, error) { 5937 reqHeaders := make(http.Header) 5938 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5939 for k, v := range c.header_ { 5940 reqHeaders[k] = v 5941 } 5942 reqHeaders.Set("User-Agent", c.s.userAgent()) 5943 if c.ifNoneMatch_ != "" { 5944 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5945 } 5946 var body io.Reader = nil 5947 c.urlParams_.Set("alt", alt) 5948 c.urlParams_.Set("prettyPrint", "false") 5949 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5950 urls += "?" + c.urlParams_.Encode() 5951 req, err := http.NewRequest("GET", urls, body) 5952 if err != nil { 5953 return nil, err 5954 } 5955 req.Header = reqHeaders 5956 googleapi.Expand(req.URL, map[string]string{ 5957 "name": c.name, 5958 }) 5959 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5960} 5961 5962// Do executes the "androidmanagement.enterprises.devices.get" call. 5963// Exactly one of *Device or error will be non-nil. Any non-2xx status 5964// code is an error. Response headers are in either 5965// *Device.ServerResponse.Header or (if a response was returned at all) 5966// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5967// check whether the returned error was because http.StatusNotModified 5968// was returned. 5969func (c *EnterprisesDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) { 5970 gensupport.SetOptions(c.urlParams_, opts...) 5971 res, err := c.doRequest("json") 5972 if res != nil && res.StatusCode == http.StatusNotModified { 5973 if res.Body != nil { 5974 res.Body.Close() 5975 } 5976 return nil, &googleapi.Error{ 5977 Code: res.StatusCode, 5978 Header: res.Header, 5979 } 5980 } 5981 if err != nil { 5982 return nil, err 5983 } 5984 defer googleapi.CloseBody(res) 5985 if err := googleapi.CheckResponse(res); err != nil { 5986 return nil, err 5987 } 5988 ret := &Device{ 5989 ServerResponse: googleapi.ServerResponse{ 5990 Header: res.Header, 5991 HTTPStatusCode: res.StatusCode, 5992 }, 5993 } 5994 target := &ret 5995 if err := gensupport.DecodeResponse(target, res); err != nil { 5996 return nil, err 5997 } 5998 return ret, nil 5999 // { 6000 // "description": "Gets a device.", 6001 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", 6002 // "httpMethod": "GET", 6003 // "id": "androidmanagement.enterprises.devices.get", 6004 // "parameterOrder": [ 6005 // "name" 6006 // ], 6007 // "parameters": { 6008 // "name": { 6009 // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.", 6010 // "location": "path", 6011 // "pattern": "^enterprises/[^/]+/devices/[^/]+$", 6012 // "required": true, 6013 // "type": "string" 6014 // } 6015 // }, 6016 // "path": "v1/{+name}", 6017 // "response": { 6018 // "$ref": "Device" 6019 // }, 6020 // "scopes": [ 6021 // "https://www.googleapis.com/auth/androidmanagement" 6022 // ] 6023 // } 6024 6025} 6026 6027// method id "androidmanagement.enterprises.devices.issueCommand": 6028 6029type EnterprisesDevicesIssueCommandCall struct { 6030 s *Service 6031 name string 6032 command *Command 6033 urlParams_ gensupport.URLParams 6034 ctx_ context.Context 6035 header_ http.Header 6036} 6037 6038// IssueCommand: Issues a command to a device. The Operation resource 6039// returned contains a Command in its metadata field. Use the get 6040// operation method to get the status of the command. 6041// 6042// - name: The name of the device in the form 6043// enterprises/{enterpriseId}/devices/{deviceId}. 6044func (r *EnterprisesDevicesService) IssueCommand(name string, command *Command) *EnterprisesDevicesIssueCommandCall { 6045 c := &EnterprisesDevicesIssueCommandCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6046 c.name = name 6047 c.command = command 6048 return c 6049} 6050 6051// Fields allows partial responses to be retrieved. See 6052// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6053// for more information. 6054func (c *EnterprisesDevicesIssueCommandCall) Fields(s ...googleapi.Field) *EnterprisesDevicesIssueCommandCall { 6055 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6056 return c 6057} 6058 6059// Context sets the context to be used in this call's Do method. Any 6060// pending HTTP request will be aborted if the provided context is 6061// canceled. 6062func (c *EnterprisesDevicesIssueCommandCall) Context(ctx context.Context) *EnterprisesDevicesIssueCommandCall { 6063 c.ctx_ = ctx 6064 return c 6065} 6066 6067// Header returns an http.Header that can be modified by the caller to 6068// add HTTP headers to the request. 6069func (c *EnterprisesDevicesIssueCommandCall) Header() http.Header { 6070 if c.header_ == nil { 6071 c.header_ = make(http.Header) 6072 } 6073 return c.header_ 6074} 6075 6076func (c *EnterprisesDevicesIssueCommandCall) doRequest(alt string) (*http.Response, error) { 6077 reqHeaders := make(http.Header) 6078 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6079 for k, v := range c.header_ { 6080 reqHeaders[k] = v 6081 } 6082 reqHeaders.Set("User-Agent", c.s.userAgent()) 6083 var body io.Reader = nil 6084 body, err := googleapi.WithoutDataWrapper.JSONReader(c.command) 6085 if err != nil { 6086 return nil, err 6087 } 6088 reqHeaders.Set("Content-Type", "application/json") 6089 c.urlParams_.Set("alt", alt) 6090 c.urlParams_.Set("prettyPrint", "false") 6091 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:issueCommand") 6092 urls += "?" + c.urlParams_.Encode() 6093 req, err := http.NewRequest("POST", urls, body) 6094 if err != nil { 6095 return nil, err 6096 } 6097 req.Header = reqHeaders 6098 googleapi.Expand(req.URL, map[string]string{ 6099 "name": c.name, 6100 }) 6101 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6102} 6103 6104// Do executes the "androidmanagement.enterprises.devices.issueCommand" call. 6105// Exactly one of *Operation or error will be non-nil. Any non-2xx 6106// status code is an error. Response headers are in either 6107// *Operation.ServerResponse.Header or (if a response was returned at 6108// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6109// to check whether the returned error was because 6110// http.StatusNotModified was returned. 6111func (c *EnterprisesDevicesIssueCommandCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6112 gensupport.SetOptions(c.urlParams_, opts...) 6113 res, err := c.doRequest("json") 6114 if res != nil && res.StatusCode == http.StatusNotModified { 6115 if res.Body != nil { 6116 res.Body.Close() 6117 } 6118 return nil, &googleapi.Error{ 6119 Code: res.StatusCode, 6120 Header: res.Header, 6121 } 6122 } 6123 if err != nil { 6124 return nil, err 6125 } 6126 defer googleapi.CloseBody(res) 6127 if err := googleapi.CheckResponse(res); err != nil { 6128 return nil, err 6129 } 6130 ret := &Operation{ 6131 ServerResponse: googleapi.ServerResponse{ 6132 Header: res.Header, 6133 HTTPStatusCode: res.StatusCode, 6134 }, 6135 } 6136 target := &ret 6137 if err := gensupport.DecodeResponse(target, res); err != nil { 6138 return nil, err 6139 } 6140 return ret, nil 6141 // { 6142 // "description": "Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command.", 6143 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}:issueCommand", 6144 // "httpMethod": "POST", 6145 // "id": "androidmanagement.enterprises.devices.issueCommand", 6146 // "parameterOrder": [ 6147 // "name" 6148 // ], 6149 // "parameters": { 6150 // "name": { 6151 // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.", 6152 // "location": "path", 6153 // "pattern": "^enterprises/[^/]+/devices/[^/]+$", 6154 // "required": true, 6155 // "type": "string" 6156 // } 6157 // }, 6158 // "path": "v1/{+name}:issueCommand", 6159 // "request": { 6160 // "$ref": "Command" 6161 // }, 6162 // "response": { 6163 // "$ref": "Operation" 6164 // }, 6165 // "scopes": [ 6166 // "https://www.googleapis.com/auth/androidmanagement" 6167 // ] 6168 // } 6169 6170} 6171 6172// method id "androidmanagement.enterprises.devices.list": 6173 6174type EnterprisesDevicesListCall struct { 6175 s *Service 6176 parent string 6177 urlParams_ gensupport.URLParams 6178 ifNoneMatch_ string 6179 ctx_ context.Context 6180 header_ http.Header 6181} 6182 6183// List: Lists devices for a given enterprise. 6184// 6185// - parent: The name of the enterprise in the form 6186// enterprises/{enterpriseId}. 6187func (r *EnterprisesDevicesService) List(parent string) *EnterprisesDevicesListCall { 6188 c := &EnterprisesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6189 c.parent = parent 6190 return c 6191} 6192 6193// PageSize sets the optional parameter "pageSize": The requested page 6194// size. The actual page size may be fixed to a min or max value. 6195func (c *EnterprisesDevicesListCall) PageSize(pageSize int64) *EnterprisesDevicesListCall { 6196 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6197 return c 6198} 6199 6200// PageToken sets the optional parameter "pageToken": A token 6201// identifying a page of results returned by the server. 6202func (c *EnterprisesDevicesListCall) PageToken(pageToken string) *EnterprisesDevicesListCall { 6203 c.urlParams_.Set("pageToken", pageToken) 6204 return c 6205} 6206 6207// Fields allows partial responses to be retrieved. See 6208// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6209// for more information. 6210func (c *EnterprisesDevicesListCall) Fields(s ...googleapi.Field) *EnterprisesDevicesListCall { 6211 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6212 return c 6213} 6214 6215// IfNoneMatch sets the optional parameter which makes the operation 6216// fail if the object's ETag matches the given value. This is useful for 6217// getting updates only after the object has changed since the last 6218// request. Use googleapi.IsNotModified to check whether the response 6219// error from Do is the result of In-None-Match. 6220func (c *EnterprisesDevicesListCall) IfNoneMatch(entityTag string) *EnterprisesDevicesListCall { 6221 c.ifNoneMatch_ = entityTag 6222 return c 6223} 6224 6225// Context sets the context to be used in this call's Do method. Any 6226// pending HTTP request will be aborted if the provided context is 6227// canceled. 6228func (c *EnterprisesDevicesListCall) Context(ctx context.Context) *EnterprisesDevicesListCall { 6229 c.ctx_ = ctx 6230 return c 6231} 6232 6233// Header returns an http.Header that can be modified by the caller to 6234// add HTTP headers to the request. 6235func (c *EnterprisesDevicesListCall) Header() http.Header { 6236 if c.header_ == nil { 6237 c.header_ = make(http.Header) 6238 } 6239 return c.header_ 6240} 6241 6242func (c *EnterprisesDevicesListCall) doRequest(alt string) (*http.Response, error) { 6243 reqHeaders := make(http.Header) 6244 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6245 for k, v := range c.header_ { 6246 reqHeaders[k] = v 6247 } 6248 reqHeaders.Set("User-Agent", c.s.userAgent()) 6249 if c.ifNoneMatch_ != "" { 6250 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6251 } 6252 var body io.Reader = nil 6253 c.urlParams_.Set("alt", alt) 6254 c.urlParams_.Set("prettyPrint", "false") 6255 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices") 6256 urls += "?" + c.urlParams_.Encode() 6257 req, err := http.NewRequest("GET", urls, body) 6258 if err != nil { 6259 return nil, err 6260 } 6261 req.Header = reqHeaders 6262 googleapi.Expand(req.URL, map[string]string{ 6263 "parent": c.parent, 6264 }) 6265 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6266} 6267 6268// Do executes the "androidmanagement.enterprises.devices.list" call. 6269// Exactly one of *ListDevicesResponse or error will be non-nil. Any 6270// non-2xx status code is an error. Response headers are in either 6271// *ListDevicesResponse.ServerResponse.Header or (if a response was 6272// returned at all) in error.(*googleapi.Error).Header. Use 6273// googleapi.IsNotModified to check whether the returned error was 6274// because http.StatusNotModified was returned. 6275func (c *EnterprisesDevicesListCall) Do(opts ...googleapi.CallOption) (*ListDevicesResponse, error) { 6276 gensupport.SetOptions(c.urlParams_, opts...) 6277 res, err := c.doRequest("json") 6278 if res != nil && res.StatusCode == http.StatusNotModified { 6279 if res.Body != nil { 6280 res.Body.Close() 6281 } 6282 return nil, &googleapi.Error{ 6283 Code: res.StatusCode, 6284 Header: res.Header, 6285 } 6286 } 6287 if err != nil { 6288 return nil, err 6289 } 6290 defer googleapi.CloseBody(res) 6291 if err := googleapi.CheckResponse(res); err != nil { 6292 return nil, err 6293 } 6294 ret := &ListDevicesResponse{ 6295 ServerResponse: googleapi.ServerResponse{ 6296 Header: res.Header, 6297 HTTPStatusCode: res.StatusCode, 6298 }, 6299 } 6300 target := &ret 6301 if err := gensupport.DecodeResponse(target, res); err != nil { 6302 return nil, err 6303 } 6304 return ret, nil 6305 // { 6306 // "description": "Lists devices for a given enterprise.", 6307 // "flatPath": "v1/enterprises/{enterprisesId}/devices", 6308 // "httpMethod": "GET", 6309 // "id": "androidmanagement.enterprises.devices.list", 6310 // "parameterOrder": [ 6311 // "parent" 6312 // ], 6313 // "parameters": { 6314 // "pageSize": { 6315 // "description": "The requested page size. The actual page size may be fixed to a min or max value.", 6316 // "format": "int32", 6317 // "location": "query", 6318 // "type": "integer" 6319 // }, 6320 // "pageToken": { 6321 // "description": "A token identifying a page of results returned by the server.", 6322 // "location": "query", 6323 // "type": "string" 6324 // }, 6325 // "parent": { 6326 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 6327 // "location": "path", 6328 // "pattern": "^enterprises/[^/]+$", 6329 // "required": true, 6330 // "type": "string" 6331 // } 6332 // }, 6333 // "path": "v1/{+parent}/devices", 6334 // "response": { 6335 // "$ref": "ListDevicesResponse" 6336 // }, 6337 // "scopes": [ 6338 // "https://www.googleapis.com/auth/androidmanagement" 6339 // ] 6340 // } 6341 6342} 6343 6344// Pages invokes f for each page of results. 6345// A non-nil error returned from f will halt the iteration. 6346// The provided context supersedes any context provided to the Context method. 6347func (c *EnterprisesDevicesListCall) Pages(ctx context.Context, f func(*ListDevicesResponse) error) error { 6348 c.ctx_ = ctx 6349 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6350 for { 6351 x, err := c.Do() 6352 if err != nil { 6353 return err 6354 } 6355 if err := f(x); err != nil { 6356 return err 6357 } 6358 if x.NextPageToken == "" { 6359 return nil 6360 } 6361 c.PageToken(x.NextPageToken) 6362 } 6363} 6364 6365// method id "androidmanagement.enterprises.devices.patch": 6366 6367type EnterprisesDevicesPatchCall struct { 6368 s *Service 6369 name string 6370 device *Device 6371 urlParams_ gensupport.URLParams 6372 ctx_ context.Context 6373 header_ http.Header 6374} 6375 6376// Patch: Updates a device. 6377// 6378// - name: The name of the device in the form 6379// enterprises/{enterpriseId}/devices/{deviceId}. 6380func (r *EnterprisesDevicesService) Patch(name string, device *Device) *EnterprisesDevicesPatchCall { 6381 c := &EnterprisesDevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6382 c.name = name 6383 c.device = device 6384 return c 6385} 6386 6387// UpdateMask sets the optional parameter "updateMask": The field mask 6388// indicating the fields to update. If not set, all modifiable fields 6389// will be modified. 6390func (c *EnterprisesDevicesPatchCall) UpdateMask(updateMask string) *EnterprisesDevicesPatchCall { 6391 c.urlParams_.Set("updateMask", updateMask) 6392 return c 6393} 6394 6395// Fields allows partial responses to be retrieved. See 6396// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6397// for more information. 6398func (c *EnterprisesDevicesPatchCall) Fields(s ...googleapi.Field) *EnterprisesDevicesPatchCall { 6399 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6400 return c 6401} 6402 6403// Context sets the context to be used in this call's Do method. Any 6404// pending HTTP request will be aborted if the provided context is 6405// canceled. 6406func (c *EnterprisesDevicesPatchCall) Context(ctx context.Context) *EnterprisesDevicesPatchCall { 6407 c.ctx_ = ctx 6408 return c 6409} 6410 6411// Header returns an http.Header that can be modified by the caller to 6412// add HTTP headers to the request. 6413func (c *EnterprisesDevicesPatchCall) Header() http.Header { 6414 if c.header_ == nil { 6415 c.header_ = make(http.Header) 6416 } 6417 return c.header_ 6418} 6419 6420func (c *EnterprisesDevicesPatchCall) doRequest(alt string) (*http.Response, error) { 6421 reqHeaders := make(http.Header) 6422 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6423 for k, v := range c.header_ { 6424 reqHeaders[k] = v 6425 } 6426 reqHeaders.Set("User-Agent", c.s.userAgent()) 6427 var body io.Reader = nil 6428 body, err := googleapi.WithoutDataWrapper.JSONReader(c.device) 6429 if err != nil { 6430 return nil, err 6431 } 6432 reqHeaders.Set("Content-Type", "application/json") 6433 c.urlParams_.Set("alt", alt) 6434 c.urlParams_.Set("prettyPrint", "false") 6435 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6436 urls += "?" + c.urlParams_.Encode() 6437 req, err := http.NewRequest("PATCH", urls, body) 6438 if err != nil { 6439 return nil, err 6440 } 6441 req.Header = reqHeaders 6442 googleapi.Expand(req.URL, map[string]string{ 6443 "name": c.name, 6444 }) 6445 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6446} 6447 6448// Do executes the "androidmanagement.enterprises.devices.patch" call. 6449// Exactly one of *Device or error will be non-nil. Any non-2xx status 6450// code is an error. Response headers are in either 6451// *Device.ServerResponse.Header or (if a response was returned at all) 6452// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6453// check whether the returned error was because http.StatusNotModified 6454// was returned. 6455func (c *EnterprisesDevicesPatchCall) Do(opts ...googleapi.CallOption) (*Device, error) { 6456 gensupport.SetOptions(c.urlParams_, opts...) 6457 res, err := c.doRequest("json") 6458 if res != nil && res.StatusCode == http.StatusNotModified { 6459 if res.Body != nil { 6460 res.Body.Close() 6461 } 6462 return nil, &googleapi.Error{ 6463 Code: res.StatusCode, 6464 Header: res.Header, 6465 } 6466 } 6467 if err != nil { 6468 return nil, err 6469 } 6470 defer googleapi.CloseBody(res) 6471 if err := googleapi.CheckResponse(res); err != nil { 6472 return nil, err 6473 } 6474 ret := &Device{ 6475 ServerResponse: googleapi.ServerResponse{ 6476 Header: res.Header, 6477 HTTPStatusCode: res.StatusCode, 6478 }, 6479 } 6480 target := &ret 6481 if err := gensupport.DecodeResponse(target, res); err != nil { 6482 return nil, err 6483 } 6484 return ret, nil 6485 // { 6486 // "description": "Updates a device.", 6487 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}", 6488 // "httpMethod": "PATCH", 6489 // "id": "androidmanagement.enterprises.devices.patch", 6490 // "parameterOrder": [ 6491 // "name" 6492 // ], 6493 // "parameters": { 6494 // "name": { 6495 // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.", 6496 // "location": "path", 6497 // "pattern": "^enterprises/[^/]+/devices/[^/]+$", 6498 // "required": true, 6499 // "type": "string" 6500 // }, 6501 // "updateMask": { 6502 // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", 6503 // "format": "google-fieldmask", 6504 // "location": "query", 6505 // "type": "string" 6506 // } 6507 // }, 6508 // "path": "v1/{+name}", 6509 // "request": { 6510 // "$ref": "Device" 6511 // }, 6512 // "response": { 6513 // "$ref": "Device" 6514 // }, 6515 // "scopes": [ 6516 // "https://www.googleapis.com/auth/androidmanagement" 6517 // ] 6518 // } 6519 6520} 6521 6522// method id "androidmanagement.enterprises.devices.operations.cancel": 6523 6524type EnterprisesDevicesOperationsCancelCall struct { 6525 s *Service 6526 name string 6527 urlParams_ gensupport.URLParams 6528 ctx_ context.Context 6529 header_ http.Header 6530} 6531 6532// Cancel: Starts asynchronous cancellation on a long-running operation. 6533// The server makes a best effort to cancel the operation, but success 6534// is not guaranteed. If the server doesn't support this method, it 6535// returns google.rpc.Code.UNIMPLEMENTED. Clients can use 6536// Operations.GetOperation or other methods to check whether the 6537// cancellation succeeded or whether the operation completed despite 6538// cancellation. On successful cancellation, the operation is not 6539// deleted; instead, it becomes an operation with an Operation.error 6540// value with a google.rpc.Status.code of 1, corresponding to 6541// Code.CANCELLED. 6542// 6543// - name: The name of the operation resource to be cancelled. 6544func (r *EnterprisesDevicesOperationsService) Cancel(name string) *EnterprisesDevicesOperationsCancelCall { 6545 c := &EnterprisesDevicesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6546 c.name = name 6547 return c 6548} 6549 6550// Fields allows partial responses to be retrieved. See 6551// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6552// for more information. 6553func (c *EnterprisesDevicesOperationsCancelCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsCancelCall { 6554 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6555 return c 6556} 6557 6558// Context sets the context to be used in this call's Do method. Any 6559// pending HTTP request will be aborted if the provided context is 6560// canceled. 6561func (c *EnterprisesDevicesOperationsCancelCall) Context(ctx context.Context) *EnterprisesDevicesOperationsCancelCall { 6562 c.ctx_ = ctx 6563 return c 6564} 6565 6566// Header returns an http.Header that can be modified by the caller to 6567// add HTTP headers to the request. 6568func (c *EnterprisesDevicesOperationsCancelCall) Header() http.Header { 6569 if c.header_ == nil { 6570 c.header_ = make(http.Header) 6571 } 6572 return c.header_ 6573} 6574 6575func (c *EnterprisesDevicesOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 6576 reqHeaders := make(http.Header) 6577 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6578 for k, v := range c.header_ { 6579 reqHeaders[k] = v 6580 } 6581 reqHeaders.Set("User-Agent", c.s.userAgent()) 6582 var body io.Reader = nil 6583 c.urlParams_.Set("alt", alt) 6584 c.urlParams_.Set("prettyPrint", "false") 6585 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 6586 urls += "?" + c.urlParams_.Encode() 6587 req, err := http.NewRequest("POST", urls, body) 6588 if err != nil { 6589 return nil, err 6590 } 6591 req.Header = reqHeaders 6592 googleapi.Expand(req.URL, map[string]string{ 6593 "name": c.name, 6594 }) 6595 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6596} 6597 6598// Do executes the "androidmanagement.enterprises.devices.operations.cancel" call. 6599// Exactly one of *Empty or error will be non-nil. Any non-2xx status 6600// code is an error. Response headers are in either 6601// *Empty.ServerResponse.Header or (if a response was returned at all) 6602// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6603// check whether the returned error was because http.StatusNotModified 6604// was returned. 6605func (c *EnterprisesDevicesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6606 gensupport.SetOptions(c.urlParams_, opts...) 6607 res, err := c.doRequest("json") 6608 if res != nil && res.StatusCode == http.StatusNotModified { 6609 if res.Body != nil { 6610 res.Body.Close() 6611 } 6612 return nil, &googleapi.Error{ 6613 Code: res.StatusCode, 6614 Header: res.Header, 6615 } 6616 } 6617 if err != nil { 6618 return nil, err 6619 } 6620 defer googleapi.CloseBody(res) 6621 if err := googleapi.CheckResponse(res); err != nil { 6622 return nil, err 6623 } 6624 ret := &Empty{ 6625 ServerResponse: googleapi.ServerResponse{ 6626 Header: res.Header, 6627 HTTPStatusCode: res.StatusCode, 6628 }, 6629 } 6630 target := &ret 6631 if err := gensupport.DecodeResponse(target, res); err != nil { 6632 return nil, err 6633 } 6634 return ret, nil 6635 // { 6636 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.", 6637 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}:cancel", 6638 // "httpMethod": "POST", 6639 // "id": "androidmanagement.enterprises.devices.operations.cancel", 6640 // "parameterOrder": [ 6641 // "name" 6642 // ], 6643 // "parameters": { 6644 // "name": { 6645 // "description": "The name of the operation resource to be cancelled.", 6646 // "location": "path", 6647 // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", 6648 // "required": true, 6649 // "type": "string" 6650 // } 6651 // }, 6652 // "path": "v1/{+name}:cancel", 6653 // "response": { 6654 // "$ref": "Empty" 6655 // }, 6656 // "scopes": [ 6657 // "https://www.googleapis.com/auth/androidmanagement" 6658 // ] 6659 // } 6660 6661} 6662 6663// method id "androidmanagement.enterprises.devices.operations.delete": 6664 6665type EnterprisesDevicesOperationsDeleteCall struct { 6666 s *Service 6667 name string 6668 urlParams_ gensupport.URLParams 6669 ctx_ context.Context 6670 header_ http.Header 6671} 6672 6673// Delete: Deletes a long-running operation. This method indicates that 6674// the client is no longer interested in the operation result. It does 6675// not cancel the operation. If the server doesn't support this method, 6676// it returns google.rpc.Code.UNIMPLEMENTED. 6677// 6678// - name: The name of the operation resource to be deleted. 6679func (r *EnterprisesDevicesOperationsService) Delete(name string) *EnterprisesDevicesOperationsDeleteCall { 6680 c := &EnterprisesDevicesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6681 c.name = name 6682 return c 6683} 6684 6685// Fields allows partial responses to be retrieved. See 6686// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6687// for more information. 6688func (c *EnterprisesDevicesOperationsDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsDeleteCall { 6689 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6690 return c 6691} 6692 6693// Context sets the context to be used in this call's Do method. Any 6694// pending HTTP request will be aborted if the provided context is 6695// canceled. 6696func (c *EnterprisesDevicesOperationsDeleteCall) Context(ctx context.Context) *EnterprisesDevicesOperationsDeleteCall { 6697 c.ctx_ = ctx 6698 return c 6699} 6700 6701// Header returns an http.Header that can be modified by the caller to 6702// add HTTP headers to the request. 6703func (c *EnterprisesDevicesOperationsDeleteCall) Header() http.Header { 6704 if c.header_ == nil { 6705 c.header_ = make(http.Header) 6706 } 6707 return c.header_ 6708} 6709 6710func (c *EnterprisesDevicesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 6711 reqHeaders := make(http.Header) 6712 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6713 for k, v := range c.header_ { 6714 reqHeaders[k] = v 6715 } 6716 reqHeaders.Set("User-Agent", c.s.userAgent()) 6717 var body io.Reader = nil 6718 c.urlParams_.Set("alt", alt) 6719 c.urlParams_.Set("prettyPrint", "false") 6720 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6721 urls += "?" + c.urlParams_.Encode() 6722 req, err := http.NewRequest("DELETE", urls, body) 6723 if err != nil { 6724 return nil, err 6725 } 6726 req.Header = reqHeaders 6727 googleapi.Expand(req.URL, map[string]string{ 6728 "name": c.name, 6729 }) 6730 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6731} 6732 6733// Do executes the "androidmanagement.enterprises.devices.operations.delete" call. 6734// Exactly one of *Empty or error will be non-nil. Any non-2xx status 6735// code is an error. Response headers are in either 6736// *Empty.ServerResponse.Header or (if a response was returned at all) 6737// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6738// check whether the returned error was because http.StatusNotModified 6739// was returned. 6740func (c *EnterprisesDevicesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6741 gensupport.SetOptions(c.urlParams_, opts...) 6742 res, err := c.doRequest("json") 6743 if res != nil && res.StatusCode == http.StatusNotModified { 6744 if res.Body != nil { 6745 res.Body.Close() 6746 } 6747 return nil, &googleapi.Error{ 6748 Code: res.StatusCode, 6749 Header: res.Header, 6750 } 6751 } 6752 if err != nil { 6753 return nil, err 6754 } 6755 defer googleapi.CloseBody(res) 6756 if err := googleapi.CheckResponse(res); err != nil { 6757 return nil, err 6758 } 6759 ret := &Empty{ 6760 ServerResponse: googleapi.ServerResponse{ 6761 Header: res.Header, 6762 HTTPStatusCode: res.StatusCode, 6763 }, 6764 } 6765 target := &ret 6766 if err := gensupport.DecodeResponse(target, res); err != nil { 6767 return nil, err 6768 } 6769 return ret, nil 6770 // { 6771 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.", 6772 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}", 6773 // "httpMethod": "DELETE", 6774 // "id": "androidmanagement.enterprises.devices.operations.delete", 6775 // "parameterOrder": [ 6776 // "name" 6777 // ], 6778 // "parameters": { 6779 // "name": { 6780 // "description": "The name of the operation resource to be deleted.", 6781 // "location": "path", 6782 // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", 6783 // "required": true, 6784 // "type": "string" 6785 // } 6786 // }, 6787 // "path": "v1/{+name}", 6788 // "response": { 6789 // "$ref": "Empty" 6790 // }, 6791 // "scopes": [ 6792 // "https://www.googleapis.com/auth/androidmanagement" 6793 // ] 6794 // } 6795 6796} 6797 6798// method id "androidmanagement.enterprises.devices.operations.get": 6799 6800type EnterprisesDevicesOperationsGetCall struct { 6801 s *Service 6802 name string 6803 urlParams_ gensupport.URLParams 6804 ifNoneMatch_ string 6805 ctx_ context.Context 6806 header_ http.Header 6807} 6808 6809// Get: Gets the latest state of a long-running operation. Clients can 6810// use this method to poll the operation result at intervals as 6811// recommended by the API service. 6812// 6813// - name: The name of the operation resource. 6814func (r *EnterprisesDevicesOperationsService) Get(name string) *EnterprisesDevicesOperationsGetCall { 6815 c := &EnterprisesDevicesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6816 c.name = name 6817 return c 6818} 6819 6820// Fields allows partial responses to be retrieved. See 6821// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6822// for more information. 6823func (c *EnterprisesDevicesOperationsGetCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsGetCall { 6824 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6825 return c 6826} 6827 6828// IfNoneMatch sets the optional parameter which makes the operation 6829// fail if the object's ETag matches the given value. This is useful for 6830// getting updates only after the object has changed since the last 6831// request. Use googleapi.IsNotModified to check whether the response 6832// error from Do is the result of In-None-Match. 6833func (c *EnterprisesDevicesOperationsGetCall) IfNoneMatch(entityTag string) *EnterprisesDevicesOperationsGetCall { 6834 c.ifNoneMatch_ = entityTag 6835 return c 6836} 6837 6838// Context sets the context to be used in this call's Do method. Any 6839// pending HTTP request will be aborted if the provided context is 6840// canceled. 6841func (c *EnterprisesDevicesOperationsGetCall) Context(ctx context.Context) *EnterprisesDevicesOperationsGetCall { 6842 c.ctx_ = ctx 6843 return c 6844} 6845 6846// Header returns an http.Header that can be modified by the caller to 6847// add HTTP headers to the request. 6848func (c *EnterprisesDevicesOperationsGetCall) Header() http.Header { 6849 if c.header_ == nil { 6850 c.header_ = make(http.Header) 6851 } 6852 return c.header_ 6853} 6854 6855func (c *EnterprisesDevicesOperationsGetCall) doRequest(alt string) (*http.Response, error) { 6856 reqHeaders := make(http.Header) 6857 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6858 for k, v := range c.header_ { 6859 reqHeaders[k] = v 6860 } 6861 reqHeaders.Set("User-Agent", c.s.userAgent()) 6862 if c.ifNoneMatch_ != "" { 6863 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6864 } 6865 var body io.Reader = nil 6866 c.urlParams_.Set("alt", alt) 6867 c.urlParams_.Set("prettyPrint", "false") 6868 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6869 urls += "?" + c.urlParams_.Encode() 6870 req, err := http.NewRequest("GET", urls, body) 6871 if err != nil { 6872 return nil, err 6873 } 6874 req.Header = reqHeaders 6875 googleapi.Expand(req.URL, map[string]string{ 6876 "name": c.name, 6877 }) 6878 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6879} 6880 6881// Do executes the "androidmanagement.enterprises.devices.operations.get" call. 6882// Exactly one of *Operation or error will be non-nil. Any non-2xx 6883// status code is an error. Response headers are in either 6884// *Operation.ServerResponse.Header or (if a response was returned at 6885// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6886// to check whether the returned error was because 6887// http.StatusNotModified was returned. 6888func (c *EnterprisesDevicesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6889 gensupport.SetOptions(c.urlParams_, opts...) 6890 res, err := c.doRequest("json") 6891 if res != nil && res.StatusCode == http.StatusNotModified { 6892 if res.Body != nil { 6893 res.Body.Close() 6894 } 6895 return nil, &googleapi.Error{ 6896 Code: res.StatusCode, 6897 Header: res.Header, 6898 } 6899 } 6900 if err != nil { 6901 return nil, err 6902 } 6903 defer googleapi.CloseBody(res) 6904 if err := googleapi.CheckResponse(res); err != nil { 6905 return nil, err 6906 } 6907 ret := &Operation{ 6908 ServerResponse: googleapi.ServerResponse{ 6909 Header: res.Header, 6910 HTTPStatusCode: res.StatusCode, 6911 }, 6912 } 6913 target := &ret 6914 if err := gensupport.DecodeResponse(target, res); err != nil { 6915 return nil, err 6916 } 6917 return ret, nil 6918 // { 6919 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 6920 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}", 6921 // "httpMethod": "GET", 6922 // "id": "androidmanagement.enterprises.devices.operations.get", 6923 // "parameterOrder": [ 6924 // "name" 6925 // ], 6926 // "parameters": { 6927 // "name": { 6928 // "description": "The name of the operation resource.", 6929 // "location": "path", 6930 // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$", 6931 // "required": true, 6932 // "type": "string" 6933 // } 6934 // }, 6935 // "path": "v1/{+name}", 6936 // "response": { 6937 // "$ref": "Operation" 6938 // }, 6939 // "scopes": [ 6940 // "https://www.googleapis.com/auth/androidmanagement" 6941 // ] 6942 // } 6943 6944} 6945 6946// method id "androidmanagement.enterprises.devices.operations.list": 6947 6948type EnterprisesDevicesOperationsListCall struct { 6949 s *Service 6950 name string 6951 urlParams_ gensupport.URLParams 6952 ifNoneMatch_ string 6953 ctx_ context.Context 6954 header_ http.Header 6955} 6956 6957// List: Lists operations that match the specified filter in the 6958// request. If the server doesn't support this method, it returns 6959// UNIMPLEMENTED.NOTE: the name binding allows API services to override 6960// the binding to use different resource name schemes, such as 6961// users/*/operations. To override the binding, API services can add a 6962// binding such as "/v1/{name=users/*}/operations" to their service 6963// configuration. For backwards compatibility, the default name includes 6964// the operations collection id, however overriding users must ensure 6965// the name binding is the parent resource, without the operations 6966// collection id. 6967// 6968// - name: The name of the operation's parent resource. 6969func (r *EnterprisesDevicesOperationsService) List(name string) *EnterprisesDevicesOperationsListCall { 6970 c := &EnterprisesDevicesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6971 c.name = name 6972 return c 6973} 6974 6975// Filter sets the optional parameter "filter": The standard list 6976// filter. 6977func (c *EnterprisesDevicesOperationsListCall) Filter(filter string) *EnterprisesDevicesOperationsListCall { 6978 c.urlParams_.Set("filter", filter) 6979 return c 6980} 6981 6982// PageSize sets the optional parameter "pageSize": The standard list 6983// page size. 6984func (c *EnterprisesDevicesOperationsListCall) PageSize(pageSize int64) *EnterprisesDevicesOperationsListCall { 6985 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6986 return c 6987} 6988 6989// PageToken sets the optional parameter "pageToken": The standard list 6990// page token. 6991func (c *EnterprisesDevicesOperationsListCall) PageToken(pageToken string) *EnterprisesDevicesOperationsListCall { 6992 c.urlParams_.Set("pageToken", pageToken) 6993 return c 6994} 6995 6996// Fields allows partial responses to be retrieved. See 6997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6998// for more information. 6999func (c *EnterprisesDevicesOperationsListCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsListCall { 7000 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7001 return c 7002} 7003 7004// IfNoneMatch sets the optional parameter which makes the operation 7005// fail if the object's ETag matches the given value. This is useful for 7006// getting updates only after the object has changed since the last 7007// request. Use googleapi.IsNotModified to check whether the response 7008// error from Do is the result of In-None-Match. 7009func (c *EnterprisesDevicesOperationsListCall) IfNoneMatch(entityTag string) *EnterprisesDevicesOperationsListCall { 7010 c.ifNoneMatch_ = entityTag 7011 return c 7012} 7013 7014// Context sets the context to be used in this call's Do method. Any 7015// pending HTTP request will be aborted if the provided context is 7016// canceled. 7017func (c *EnterprisesDevicesOperationsListCall) Context(ctx context.Context) *EnterprisesDevicesOperationsListCall { 7018 c.ctx_ = ctx 7019 return c 7020} 7021 7022// Header returns an http.Header that can be modified by the caller to 7023// add HTTP headers to the request. 7024func (c *EnterprisesDevicesOperationsListCall) Header() http.Header { 7025 if c.header_ == nil { 7026 c.header_ = make(http.Header) 7027 } 7028 return c.header_ 7029} 7030 7031func (c *EnterprisesDevicesOperationsListCall) doRequest(alt string) (*http.Response, error) { 7032 reqHeaders := make(http.Header) 7033 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7034 for k, v := range c.header_ { 7035 reqHeaders[k] = v 7036 } 7037 reqHeaders.Set("User-Agent", c.s.userAgent()) 7038 if c.ifNoneMatch_ != "" { 7039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7040 } 7041 var body io.Reader = nil 7042 c.urlParams_.Set("alt", alt) 7043 c.urlParams_.Set("prettyPrint", "false") 7044 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7045 urls += "?" + c.urlParams_.Encode() 7046 req, err := http.NewRequest("GET", urls, body) 7047 if err != nil { 7048 return nil, err 7049 } 7050 req.Header = reqHeaders 7051 googleapi.Expand(req.URL, map[string]string{ 7052 "name": c.name, 7053 }) 7054 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7055} 7056 7057// Do executes the "androidmanagement.enterprises.devices.operations.list" call. 7058// Exactly one of *ListOperationsResponse or error will be non-nil. Any 7059// non-2xx status code is an error. Response headers are in either 7060// *ListOperationsResponse.ServerResponse.Header or (if a response was 7061// returned at all) in error.(*googleapi.Error).Header. Use 7062// googleapi.IsNotModified to check whether the returned error was 7063// because http.StatusNotModified was returned. 7064func (c *EnterprisesDevicesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 7065 gensupport.SetOptions(c.urlParams_, opts...) 7066 res, err := c.doRequest("json") 7067 if res != nil && res.StatusCode == http.StatusNotModified { 7068 if res.Body != nil { 7069 res.Body.Close() 7070 } 7071 return nil, &googleapi.Error{ 7072 Code: res.StatusCode, 7073 Header: res.Header, 7074 } 7075 } 7076 if err != nil { 7077 return nil, err 7078 } 7079 defer googleapi.CloseBody(res) 7080 if err := googleapi.CheckResponse(res); err != nil { 7081 return nil, err 7082 } 7083 ret := &ListOperationsResponse{ 7084 ServerResponse: googleapi.ServerResponse{ 7085 Header: res.Header, 7086 HTTPStatusCode: res.StatusCode, 7087 }, 7088 } 7089 target := &ret 7090 if err := gensupport.DecodeResponse(target, res); err != nil { 7091 return nil, err 7092 } 7093 return ret, nil 7094 // { 7095 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 7096 // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations", 7097 // "httpMethod": "GET", 7098 // "id": "androidmanagement.enterprises.devices.operations.list", 7099 // "parameterOrder": [ 7100 // "name" 7101 // ], 7102 // "parameters": { 7103 // "filter": { 7104 // "description": "The standard list filter.", 7105 // "location": "query", 7106 // "type": "string" 7107 // }, 7108 // "name": { 7109 // "description": "The name of the operation's parent resource.", 7110 // "location": "path", 7111 // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations$", 7112 // "required": true, 7113 // "type": "string" 7114 // }, 7115 // "pageSize": { 7116 // "description": "The standard list page size.", 7117 // "format": "int32", 7118 // "location": "query", 7119 // "type": "integer" 7120 // }, 7121 // "pageToken": { 7122 // "description": "The standard list page token.", 7123 // "location": "query", 7124 // "type": "string" 7125 // } 7126 // }, 7127 // "path": "v1/{+name}", 7128 // "response": { 7129 // "$ref": "ListOperationsResponse" 7130 // }, 7131 // "scopes": [ 7132 // "https://www.googleapis.com/auth/androidmanagement" 7133 // ] 7134 // } 7135 7136} 7137 7138// Pages invokes f for each page of results. 7139// A non-nil error returned from f will halt the iteration. 7140// The provided context supersedes any context provided to the Context method. 7141func (c *EnterprisesDevicesOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 7142 c.ctx_ = ctx 7143 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7144 for { 7145 x, err := c.Do() 7146 if err != nil { 7147 return err 7148 } 7149 if err := f(x); err != nil { 7150 return err 7151 } 7152 if x.NextPageToken == "" { 7153 return nil 7154 } 7155 c.PageToken(x.NextPageToken) 7156 } 7157} 7158 7159// method id "androidmanagement.enterprises.enrollmentTokens.create": 7160 7161type EnterprisesEnrollmentTokensCreateCall struct { 7162 s *Service 7163 parent string 7164 enrollmenttoken *EnrollmentToken 7165 urlParams_ gensupport.URLParams 7166 ctx_ context.Context 7167 header_ http.Header 7168} 7169 7170// Create: Creates an enrollment token for a given enterprise. 7171// 7172// - parent: The name of the enterprise in the form 7173// enterprises/{enterpriseId}. 7174func (r *EnterprisesEnrollmentTokensService) Create(parent string, enrollmenttoken *EnrollmentToken) *EnterprisesEnrollmentTokensCreateCall { 7175 c := &EnterprisesEnrollmentTokensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7176 c.parent = parent 7177 c.enrollmenttoken = enrollmenttoken 7178 return c 7179} 7180 7181// Fields allows partial responses to be retrieved. See 7182// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7183// for more information. 7184func (c *EnterprisesEnrollmentTokensCreateCall) Fields(s ...googleapi.Field) *EnterprisesEnrollmentTokensCreateCall { 7185 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7186 return c 7187} 7188 7189// Context sets the context to be used in this call's Do method. Any 7190// pending HTTP request will be aborted if the provided context is 7191// canceled. 7192func (c *EnterprisesEnrollmentTokensCreateCall) Context(ctx context.Context) *EnterprisesEnrollmentTokensCreateCall { 7193 c.ctx_ = ctx 7194 return c 7195} 7196 7197// Header returns an http.Header that can be modified by the caller to 7198// add HTTP headers to the request. 7199func (c *EnterprisesEnrollmentTokensCreateCall) Header() http.Header { 7200 if c.header_ == nil { 7201 c.header_ = make(http.Header) 7202 } 7203 return c.header_ 7204} 7205 7206func (c *EnterprisesEnrollmentTokensCreateCall) doRequest(alt string) (*http.Response, error) { 7207 reqHeaders := make(http.Header) 7208 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7209 for k, v := range c.header_ { 7210 reqHeaders[k] = v 7211 } 7212 reqHeaders.Set("User-Agent", c.s.userAgent()) 7213 var body io.Reader = nil 7214 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollmenttoken) 7215 if err != nil { 7216 return nil, err 7217 } 7218 reqHeaders.Set("Content-Type", "application/json") 7219 c.urlParams_.Set("alt", alt) 7220 c.urlParams_.Set("prettyPrint", "false") 7221 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/enrollmentTokens") 7222 urls += "?" + c.urlParams_.Encode() 7223 req, err := http.NewRequest("POST", urls, body) 7224 if err != nil { 7225 return nil, err 7226 } 7227 req.Header = reqHeaders 7228 googleapi.Expand(req.URL, map[string]string{ 7229 "parent": c.parent, 7230 }) 7231 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7232} 7233 7234// Do executes the "androidmanagement.enterprises.enrollmentTokens.create" call. 7235// Exactly one of *EnrollmentToken or error will be non-nil. Any non-2xx 7236// status code is an error. Response headers are in either 7237// *EnrollmentToken.ServerResponse.Header or (if a response was returned 7238// at all) in error.(*googleapi.Error).Header. Use 7239// googleapi.IsNotModified to check whether the returned error was 7240// because http.StatusNotModified was returned. 7241func (c *EnterprisesEnrollmentTokensCreateCall) Do(opts ...googleapi.CallOption) (*EnrollmentToken, error) { 7242 gensupport.SetOptions(c.urlParams_, opts...) 7243 res, err := c.doRequest("json") 7244 if res != nil && res.StatusCode == http.StatusNotModified { 7245 if res.Body != nil { 7246 res.Body.Close() 7247 } 7248 return nil, &googleapi.Error{ 7249 Code: res.StatusCode, 7250 Header: res.Header, 7251 } 7252 } 7253 if err != nil { 7254 return nil, err 7255 } 7256 defer googleapi.CloseBody(res) 7257 if err := googleapi.CheckResponse(res); err != nil { 7258 return nil, err 7259 } 7260 ret := &EnrollmentToken{ 7261 ServerResponse: googleapi.ServerResponse{ 7262 Header: res.Header, 7263 HTTPStatusCode: res.StatusCode, 7264 }, 7265 } 7266 target := &ret 7267 if err := gensupport.DecodeResponse(target, res); err != nil { 7268 return nil, err 7269 } 7270 return ret, nil 7271 // { 7272 // "description": "Creates an enrollment token for a given enterprise.", 7273 // "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens", 7274 // "httpMethod": "POST", 7275 // "id": "androidmanagement.enterprises.enrollmentTokens.create", 7276 // "parameterOrder": [ 7277 // "parent" 7278 // ], 7279 // "parameters": { 7280 // "parent": { 7281 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 7282 // "location": "path", 7283 // "pattern": "^enterprises/[^/]+$", 7284 // "required": true, 7285 // "type": "string" 7286 // } 7287 // }, 7288 // "path": "v1/{+parent}/enrollmentTokens", 7289 // "request": { 7290 // "$ref": "EnrollmentToken" 7291 // }, 7292 // "response": { 7293 // "$ref": "EnrollmentToken" 7294 // }, 7295 // "scopes": [ 7296 // "https://www.googleapis.com/auth/androidmanagement" 7297 // ] 7298 // } 7299 7300} 7301 7302// method id "androidmanagement.enterprises.enrollmentTokens.delete": 7303 7304type EnterprisesEnrollmentTokensDeleteCall struct { 7305 s *Service 7306 name string 7307 urlParams_ gensupport.URLParams 7308 ctx_ context.Context 7309 header_ http.Header 7310} 7311 7312// Delete: Deletes an enrollment token. This operation invalidates the 7313// token, preventing its future use. 7314// 7315// - name: The name of the enrollment token in the form 7316// enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. 7317func (r *EnterprisesEnrollmentTokensService) Delete(name string) *EnterprisesEnrollmentTokensDeleteCall { 7318 c := &EnterprisesEnrollmentTokensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7319 c.name = name 7320 return c 7321} 7322 7323// Fields allows partial responses to be retrieved. See 7324// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7325// for more information. 7326func (c *EnterprisesEnrollmentTokensDeleteCall) Fields(s ...googleapi.Field) *EnterprisesEnrollmentTokensDeleteCall { 7327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7328 return c 7329} 7330 7331// Context sets the context to be used in this call's Do method. Any 7332// pending HTTP request will be aborted if the provided context is 7333// canceled. 7334func (c *EnterprisesEnrollmentTokensDeleteCall) Context(ctx context.Context) *EnterprisesEnrollmentTokensDeleteCall { 7335 c.ctx_ = ctx 7336 return c 7337} 7338 7339// Header returns an http.Header that can be modified by the caller to 7340// add HTTP headers to the request. 7341func (c *EnterprisesEnrollmentTokensDeleteCall) Header() http.Header { 7342 if c.header_ == nil { 7343 c.header_ = make(http.Header) 7344 } 7345 return c.header_ 7346} 7347 7348func (c *EnterprisesEnrollmentTokensDeleteCall) doRequest(alt string) (*http.Response, error) { 7349 reqHeaders := make(http.Header) 7350 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7351 for k, v := range c.header_ { 7352 reqHeaders[k] = v 7353 } 7354 reqHeaders.Set("User-Agent", c.s.userAgent()) 7355 var body io.Reader = nil 7356 c.urlParams_.Set("alt", alt) 7357 c.urlParams_.Set("prettyPrint", "false") 7358 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7359 urls += "?" + c.urlParams_.Encode() 7360 req, err := http.NewRequest("DELETE", urls, body) 7361 if err != nil { 7362 return nil, err 7363 } 7364 req.Header = reqHeaders 7365 googleapi.Expand(req.URL, map[string]string{ 7366 "name": c.name, 7367 }) 7368 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7369} 7370 7371// Do executes the "androidmanagement.enterprises.enrollmentTokens.delete" call. 7372// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7373// code is an error. Response headers are in either 7374// *Empty.ServerResponse.Header or (if a response was returned at all) 7375// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7376// check whether the returned error was because http.StatusNotModified 7377// was returned. 7378func (c *EnterprisesEnrollmentTokensDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7379 gensupport.SetOptions(c.urlParams_, opts...) 7380 res, err := c.doRequest("json") 7381 if res != nil && res.StatusCode == http.StatusNotModified { 7382 if res.Body != nil { 7383 res.Body.Close() 7384 } 7385 return nil, &googleapi.Error{ 7386 Code: res.StatusCode, 7387 Header: res.Header, 7388 } 7389 } 7390 if err != nil { 7391 return nil, err 7392 } 7393 defer googleapi.CloseBody(res) 7394 if err := googleapi.CheckResponse(res); err != nil { 7395 return nil, err 7396 } 7397 ret := &Empty{ 7398 ServerResponse: googleapi.ServerResponse{ 7399 Header: res.Header, 7400 HTTPStatusCode: res.StatusCode, 7401 }, 7402 } 7403 target := &ret 7404 if err := gensupport.DecodeResponse(target, res); err != nil { 7405 return nil, err 7406 } 7407 return ret, nil 7408 // { 7409 // "description": "Deletes an enrollment token. This operation invalidates the token, preventing its future use.", 7410 // "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens/{enrollmentTokensId}", 7411 // "httpMethod": "DELETE", 7412 // "id": "androidmanagement.enterprises.enrollmentTokens.delete", 7413 // "parameterOrder": [ 7414 // "name" 7415 // ], 7416 // "parameters": { 7417 // "name": { 7418 // "description": "The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}.", 7419 // "location": "path", 7420 // "pattern": "^enterprises/[^/]+/enrollmentTokens/[^/]+$", 7421 // "required": true, 7422 // "type": "string" 7423 // } 7424 // }, 7425 // "path": "v1/{+name}", 7426 // "response": { 7427 // "$ref": "Empty" 7428 // }, 7429 // "scopes": [ 7430 // "https://www.googleapis.com/auth/androidmanagement" 7431 // ] 7432 // } 7433 7434} 7435 7436// method id "androidmanagement.enterprises.policies.delete": 7437 7438type EnterprisesPoliciesDeleteCall struct { 7439 s *Service 7440 name string 7441 urlParams_ gensupport.URLParams 7442 ctx_ context.Context 7443 header_ http.Header 7444} 7445 7446// Delete: Deletes a policy. This operation is only permitted if no 7447// devices are currently referencing the policy. 7448// 7449// - name: The name of the policy in the form 7450// enterprises/{enterpriseId}/policies/{policyId}. 7451func (r *EnterprisesPoliciesService) Delete(name string) *EnterprisesPoliciesDeleteCall { 7452 c := &EnterprisesPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7453 c.name = name 7454 return c 7455} 7456 7457// Fields allows partial responses to be retrieved. See 7458// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7459// for more information. 7460func (c *EnterprisesPoliciesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesDeleteCall { 7461 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7462 return c 7463} 7464 7465// Context sets the context to be used in this call's Do method. Any 7466// pending HTTP request will be aborted if the provided context is 7467// canceled. 7468func (c *EnterprisesPoliciesDeleteCall) Context(ctx context.Context) *EnterprisesPoliciesDeleteCall { 7469 c.ctx_ = ctx 7470 return c 7471} 7472 7473// Header returns an http.Header that can be modified by the caller to 7474// add HTTP headers to the request. 7475func (c *EnterprisesPoliciesDeleteCall) Header() http.Header { 7476 if c.header_ == nil { 7477 c.header_ = make(http.Header) 7478 } 7479 return c.header_ 7480} 7481 7482func (c *EnterprisesPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 7483 reqHeaders := make(http.Header) 7484 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7485 for k, v := range c.header_ { 7486 reqHeaders[k] = v 7487 } 7488 reqHeaders.Set("User-Agent", c.s.userAgent()) 7489 var body io.Reader = nil 7490 c.urlParams_.Set("alt", alt) 7491 c.urlParams_.Set("prettyPrint", "false") 7492 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7493 urls += "?" + c.urlParams_.Encode() 7494 req, err := http.NewRequest("DELETE", urls, body) 7495 if err != nil { 7496 return nil, err 7497 } 7498 req.Header = reqHeaders 7499 googleapi.Expand(req.URL, map[string]string{ 7500 "name": c.name, 7501 }) 7502 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7503} 7504 7505// Do executes the "androidmanagement.enterprises.policies.delete" call. 7506// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7507// code is an error. Response headers are in either 7508// *Empty.ServerResponse.Header or (if a response was returned at all) 7509// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7510// check whether the returned error was because http.StatusNotModified 7511// was returned. 7512func (c *EnterprisesPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7513 gensupport.SetOptions(c.urlParams_, opts...) 7514 res, err := c.doRequest("json") 7515 if res != nil && res.StatusCode == http.StatusNotModified { 7516 if res.Body != nil { 7517 res.Body.Close() 7518 } 7519 return nil, &googleapi.Error{ 7520 Code: res.StatusCode, 7521 Header: res.Header, 7522 } 7523 } 7524 if err != nil { 7525 return nil, err 7526 } 7527 defer googleapi.CloseBody(res) 7528 if err := googleapi.CheckResponse(res); err != nil { 7529 return nil, err 7530 } 7531 ret := &Empty{ 7532 ServerResponse: googleapi.ServerResponse{ 7533 Header: res.Header, 7534 HTTPStatusCode: res.StatusCode, 7535 }, 7536 } 7537 target := &ret 7538 if err := gensupport.DecodeResponse(target, res); err != nil { 7539 return nil, err 7540 } 7541 return ret, nil 7542 // { 7543 // "description": "Deletes a policy. This operation is only permitted if no devices are currently referencing the policy.", 7544 // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", 7545 // "httpMethod": "DELETE", 7546 // "id": "androidmanagement.enterprises.policies.delete", 7547 // "parameterOrder": [ 7548 // "name" 7549 // ], 7550 // "parameters": { 7551 // "name": { 7552 // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.", 7553 // "location": "path", 7554 // "pattern": "^enterprises/[^/]+/policies/[^/]+$", 7555 // "required": true, 7556 // "type": "string" 7557 // } 7558 // }, 7559 // "path": "v1/{+name}", 7560 // "response": { 7561 // "$ref": "Empty" 7562 // }, 7563 // "scopes": [ 7564 // "https://www.googleapis.com/auth/androidmanagement" 7565 // ] 7566 // } 7567 7568} 7569 7570// method id "androidmanagement.enterprises.policies.get": 7571 7572type EnterprisesPoliciesGetCall struct { 7573 s *Service 7574 name string 7575 urlParams_ gensupport.URLParams 7576 ifNoneMatch_ string 7577 ctx_ context.Context 7578 header_ http.Header 7579} 7580 7581// Get: Gets a policy. 7582// 7583// - name: The name of the policy in the form 7584// enterprises/{enterpriseId}/policies/{policyId}. 7585func (r *EnterprisesPoliciesService) Get(name string) *EnterprisesPoliciesGetCall { 7586 c := &EnterprisesPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7587 c.name = name 7588 return c 7589} 7590 7591// Fields allows partial responses to be retrieved. See 7592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7593// for more information. 7594func (c *EnterprisesPoliciesGetCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesGetCall { 7595 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7596 return c 7597} 7598 7599// IfNoneMatch sets the optional parameter which makes the operation 7600// fail if the object's ETag matches the given value. This is useful for 7601// getting updates only after the object has changed since the last 7602// request. Use googleapi.IsNotModified to check whether the response 7603// error from Do is the result of In-None-Match. 7604func (c *EnterprisesPoliciesGetCall) IfNoneMatch(entityTag string) *EnterprisesPoliciesGetCall { 7605 c.ifNoneMatch_ = entityTag 7606 return c 7607} 7608 7609// Context sets the context to be used in this call's Do method. Any 7610// pending HTTP request will be aborted if the provided context is 7611// canceled. 7612func (c *EnterprisesPoliciesGetCall) Context(ctx context.Context) *EnterprisesPoliciesGetCall { 7613 c.ctx_ = ctx 7614 return c 7615} 7616 7617// Header returns an http.Header that can be modified by the caller to 7618// add HTTP headers to the request. 7619func (c *EnterprisesPoliciesGetCall) Header() http.Header { 7620 if c.header_ == nil { 7621 c.header_ = make(http.Header) 7622 } 7623 return c.header_ 7624} 7625 7626func (c *EnterprisesPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 7627 reqHeaders := make(http.Header) 7628 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7629 for k, v := range c.header_ { 7630 reqHeaders[k] = v 7631 } 7632 reqHeaders.Set("User-Agent", c.s.userAgent()) 7633 if c.ifNoneMatch_ != "" { 7634 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7635 } 7636 var body io.Reader = nil 7637 c.urlParams_.Set("alt", alt) 7638 c.urlParams_.Set("prettyPrint", "false") 7639 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7640 urls += "?" + c.urlParams_.Encode() 7641 req, err := http.NewRequest("GET", urls, body) 7642 if err != nil { 7643 return nil, err 7644 } 7645 req.Header = reqHeaders 7646 googleapi.Expand(req.URL, map[string]string{ 7647 "name": c.name, 7648 }) 7649 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7650} 7651 7652// Do executes the "androidmanagement.enterprises.policies.get" call. 7653// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7654// code is an error. Response headers are in either 7655// *Policy.ServerResponse.Header or (if a response was returned at all) 7656// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7657// check whether the returned error was because http.StatusNotModified 7658// was returned. 7659func (c *EnterprisesPoliciesGetCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7660 gensupport.SetOptions(c.urlParams_, opts...) 7661 res, err := c.doRequest("json") 7662 if res != nil && res.StatusCode == http.StatusNotModified { 7663 if res.Body != nil { 7664 res.Body.Close() 7665 } 7666 return nil, &googleapi.Error{ 7667 Code: res.StatusCode, 7668 Header: res.Header, 7669 } 7670 } 7671 if err != nil { 7672 return nil, err 7673 } 7674 defer googleapi.CloseBody(res) 7675 if err := googleapi.CheckResponse(res); err != nil { 7676 return nil, err 7677 } 7678 ret := &Policy{ 7679 ServerResponse: googleapi.ServerResponse{ 7680 Header: res.Header, 7681 HTTPStatusCode: res.StatusCode, 7682 }, 7683 } 7684 target := &ret 7685 if err := gensupport.DecodeResponse(target, res); err != nil { 7686 return nil, err 7687 } 7688 return ret, nil 7689 // { 7690 // "description": "Gets a policy.", 7691 // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", 7692 // "httpMethod": "GET", 7693 // "id": "androidmanagement.enterprises.policies.get", 7694 // "parameterOrder": [ 7695 // "name" 7696 // ], 7697 // "parameters": { 7698 // "name": { 7699 // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.", 7700 // "location": "path", 7701 // "pattern": "^enterprises/[^/]+/policies/[^/]+$", 7702 // "required": true, 7703 // "type": "string" 7704 // } 7705 // }, 7706 // "path": "v1/{+name}", 7707 // "response": { 7708 // "$ref": "Policy" 7709 // }, 7710 // "scopes": [ 7711 // "https://www.googleapis.com/auth/androidmanagement" 7712 // ] 7713 // } 7714 7715} 7716 7717// method id "androidmanagement.enterprises.policies.list": 7718 7719type EnterprisesPoliciesListCall struct { 7720 s *Service 7721 parent string 7722 urlParams_ gensupport.URLParams 7723 ifNoneMatch_ string 7724 ctx_ context.Context 7725 header_ http.Header 7726} 7727 7728// List: Lists policies for a given enterprise. 7729// 7730// - parent: The name of the enterprise in the form 7731// enterprises/{enterpriseId}. 7732func (r *EnterprisesPoliciesService) List(parent string) *EnterprisesPoliciesListCall { 7733 c := &EnterprisesPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7734 c.parent = parent 7735 return c 7736} 7737 7738// PageSize sets the optional parameter "pageSize": The requested page 7739// size. The actual page size may be fixed to a min or max value. 7740func (c *EnterprisesPoliciesListCall) PageSize(pageSize int64) *EnterprisesPoliciesListCall { 7741 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7742 return c 7743} 7744 7745// PageToken sets the optional parameter "pageToken": A token 7746// identifying a page of results returned by the server. 7747func (c *EnterprisesPoliciesListCall) PageToken(pageToken string) *EnterprisesPoliciesListCall { 7748 c.urlParams_.Set("pageToken", pageToken) 7749 return c 7750} 7751 7752// Fields allows partial responses to be retrieved. See 7753// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7754// for more information. 7755func (c *EnterprisesPoliciesListCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesListCall { 7756 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7757 return c 7758} 7759 7760// IfNoneMatch sets the optional parameter which makes the operation 7761// fail if the object's ETag matches the given value. This is useful for 7762// getting updates only after the object has changed since the last 7763// request. Use googleapi.IsNotModified to check whether the response 7764// error from Do is the result of In-None-Match. 7765func (c *EnterprisesPoliciesListCall) IfNoneMatch(entityTag string) *EnterprisesPoliciesListCall { 7766 c.ifNoneMatch_ = entityTag 7767 return c 7768} 7769 7770// Context sets the context to be used in this call's Do method. Any 7771// pending HTTP request will be aborted if the provided context is 7772// canceled. 7773func (c *EnterprisesPoliciesListCall) Context(ctx context.Context) *EnterprisesPoliciesListCall { 7774 c.ctx_ = ctx 7775 return c 7776} 7777 7778// Header returns an http.Header that can be modified by the caller to 7779// add HTTP headers to the request. 7780func (c *EnterprisesPoliciesListCall) Header() http.Header { 7781 if c.header_ == nil { 7782 c.header_ = make(http.Header) 7783 } 7784 return c.header_ 7785} 7786 7787func (c *EnterprisesPoliciesListCall) doRequest(alt string) (*http.Response, error) { 7788 reqHeaders := make(http.Header) 7789 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7790 for k, v := range c.header_ { 7791 reqHeaders[k] = v 7792 } 7793 reqHeaders.Set("User-Agent", c.s.userAgent()) 7794 if c.ifNoneMatch_ != "" { 7795 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7796 } 7797 var body io.Reader = nil 7798 c.urlParams_.Set("alt", alt) 7799 c.urlParams_.Set("prettyPrint", "false") 7800 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policies") 7801 urls += "?" + c.urlParams_.Encode() 7802 req, err := http.NewRequest("GET", urls, body) 7803 if err != nil { 7804 return nil, err 7805 } 7806 req.Header = reqHeaders 7807 googleapi.Expand(req.URL, map[string]string{ 7808 "parent": c.parent, 7809 }) 7810 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7811} 7812 7813// Do executes the "androidmanagement.enterprises.policies.list" call. 7814// Exactly one of *ListPoliciesResponse or error will be non-nil. Any 7815// non-2xx status code is an error. Response headers are in either 7816// *ListPoliciesResponse.ServerResponse.Header or (if a response was 7817// returned at all) in error.(*googleapi.Error).Header. Use 7818// googleapi.IsNotModified to check whether the returned error was 7819// because http.StatusNotModified was returned. 7820func (c *EnterprisesPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListPoliciesResponse, error) { 7821 gensupport.SetOptions(c.urlParams_, opts...) 7822 res, err := c.doRequest("json") 7823 if res != nil && res.StatusCode == http.StatusNotModified { 7824 if res.Body != nil { 7825 res.Body.Close() 7826 } 7827 return nil, &googleapi.Error{ 7828 Code: res.StatusCode, 7829 Header: res.Header, 7830 } 7831 } 7832 if err != nil { 7833 return nil, err 7834 } 7835 defer googleapi.CloseBody(res) 7836 if err := googleapi.CheckResponse(res); err != nil { 7837 return nil, err 7838 } 7839 ret := &ListPoliciesResponse{ 7840 ServerResponse: googleapi.ServerResponse{ 7841 Header: res.Header, 7842 HTTPStatusCode: res.StatusCode, 7843 }, 7844 } 7845 target := &ret 7846 if err := gensupport.DecodeResponse(target, res); err != nil { 7847 return nil, err 7848 } 7849 return ret, nil 7850 // { 7851 // "description": "Lists policies for a given enterprise.", 7852 // "flatPath": "v1/enterprises/{enterprisesId}/policies", 7853 // "httpMethod": "GET", 7854 // "id": "androidmanagement.enterprises.policies.list", 7855 // "parameterOrder": [ 7856 // "parent" 7857 // ], 7858 // "parameters": { 7859 // "pageSize": { 7860 // "description": "The requested page size. The actual page size may be fixed to a min or max value.", 7861 // "format": "int32", 7862 // "location": "query", 7863 // "type": "integer" 7864 // }, 7865 // "pageToken": { 7866 // "description": "A token identifying a page of results returned by the server.", 7867 // "location": "query", 7868 // "type": "string" 7869 // }, 7870 // "parent": { 7871 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 7872 // "location": "path", 7873 // "pattern": "^enterprises/[^/]+$", 7874 // "required": true, 7875 // "type": "string" 7876 // } 7877 // }, 7878 // "path": "v1/{+parent}/policies", 7879 // "response": { 7880 // "$ref": "ListPoliciesResponse" 7881 // }, 7882 // "scopes": [ 7883 // "https://www.googleapis.com/auth/androidmanagement" 7884 // ] 7885 // } 7886 7887} 7888 7889// Pages invokes f for each page of results. 7890// A non-nil error returned from f will halt the iteration. 7891// The provided context supersedes any context provided to the Context method. 7892func (c *EnterprisesPoliciesListCall) Pages(ctx context.Context, f func(*ListPoliciesResponse) error) error { 7893 c.ctx_ = ctx 7894 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7895 for { 7896 x, err := c.Do() 7897 if err != nil { 7898 return err 7899 } 7900 if err := f(x); err != nil { 7901 return err 7902 } 7903 if x.NextPageToken == "" { 7904 return nil 7905 } 7906 c.PageToken(x.NextPageToken) 7907 } 7908} 7909 7910// method id "androidmanagement.enterprises.policies.patch": 7911 7912type EnterprisesPoliciesPatchCall struct { 7913 s *Service 7914 name string 7915 policy *Policy 7916 urlParams_ gensupport.URLParams 7917 ctx_ context.Context 7918 header_ http.Header 7919} 7920 7921// Patch: Updates or creates a policy. 7922// 7923// - name: The name of the policy in the form 7924// enterprises/{enterpriseId}/policies/{policyId}. 7925func (r *EnterprisesPoliciesService) Patch(name string, policy *Policy) *EnterprisesPoliciesPatchCall { 7926 c := &EnterprisesPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7927 c.name = name 7928 c.policy = policy 7929 return c 7930} 7931 7932// UpdateMask sets the optional parameter "updateMask": The field mask 7933// indicating the fields to update. If not set, all modifiable fields 7934// will be modified. 7935func (c *EnterprisesPoliciesPatchCall) UpdateMask(updateMask string) *EnterprisesPoliciesPatchCall { 7936 c.urlParams_.Set("updateMask", updateMask) 7937 return c 7938} 7939 7940// Fields allows partial responses to be retrieved. See 7941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7942// for more information. 7943func (c *EnterprisesPoliciesPatchCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesPatchCall { 7944 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7945 return c 7946} 7947 7948// Context sets the context to be used in this call's Do method. Any 7949// pending HTTP request will be aborted if the provided context is 7950// canceled. 7951func (c *EnterprisesPoliciesPatchCall) Context(ctx context.Context) *EnterprisesPoliciesPatchCall { 7952 c.ctx_ = ctx 7953 return c 7954} 7955 7956// Header returns an http.Header that can be modified by the caller to 7957// add HTTP headers to the request. 7958func (c *EnterprisesPoliciesPatchCall) Header() http.Header { 7959 if c.header_ == nil { 7960 c.header_ = make(http.Header) 7961 } 7962 return c.header_ 7963} 7964 7965func (c *EnterprisesPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { 7966 reqHeaders := make(http.Header) 7967 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7968 for k, v := range c.header_ { 7969 reqHeaders[k] = v 7970 } 7971 reqHeaders.Set("User-Agent", c.s.userAgent()) 7972 var body io.Reader = nil 7973 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) 7974 if err != nil { 7975 return nil, err 7976 } 7977 reqHeaders.Set("Content-Type", "application/json") 7978 c.urlParams_.Set("alt", alt) 7979 c.urlParams_.Set("prettyPrint", "false") 7980 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7981 urls += "?" + c.urlParams_.Encode() 7982 req, err := http.NewRequest("PATCH", urls, body) 7983 if err != nil { 7984 return nil, err 7985 } 7986 req.Header = reqHeaders 7987 googleapi.Expand(req.URL, map[string]string{ 7988 "name": c.name, 7989 }) 7990 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7991} 7992 7993// Do executes the "androidmanagement.enterprises.policies.patch" call. 7994// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7995// code is an error. Response headers are in either 7996// *Policy.ServerResponse.Header or (if a response was returned at all) 7997// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7998// check whether the returned error was because http.StatusNotModified 7999// was returned. 8000func (c *EnterprisesPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8001 gensupport.SetOptions(c.urlParams_, opts...) 8002 res, err := c.doRequest("json") 8003 if res != nil && res.StatusCode == http.StatusNotModified { 8004 if res.Body != nil { 8005 res.Body.Close() 8006 } 8007 return nil, &googleapi.Error{ 8008 Code: res.StatusCode, 8009 Header: res.Header, 8010 } 8011 } 8012 if err != nil { 8013 return nil, err 8014 } 8015 defer googleapi.CloseBody(res) 8016 if err := googleapi.CheckResponse(res); err != nil { 8017 return nil, err 8018 } 8019 ret := &Policy{ 8020 ServerResponse: googleapi.ServerResponse{ 8021 Header: res.Header, 8022 HTTPStatusCode: res.StatusCode, 8023 }, 8024 } 8025 target := &ret 8026 if err := gensupport.DecodeResponse(target, res); err != nil { 8027 return nil, err 8028 } 8029 return ret, nil 8030 // { 8031 // "description": "Updates or creates a policy.", 8032 // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}", 8033 // "httpMethod": "PATCH", 8034 // "id": "androidmanagement.enterprises.policies.patch", 8035 // "parameterOrder": [ 8036 // "name" 8037 // ], 8038 // "parameters": { 8039 // "name": { 8040 // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.", 8041 // "location": "path", 8042 // "pattern": "^enterprises/[^/]+/policies/[^/]+$", 8043 // "required": true, 8044 // "type": "string" 8045 // }, 8046 // "updateMask": { 8047 // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", 8048 // "format": "google-fieldmask", 8049 // "location": "query", 8050 // "type": "string" 8051 // } 8052 // }, 8053 // "path": "v1/{+name}", 8054 // "request": { 8055 // "$ref": "Policy" 8056 // }, 8057 // "response": { 8058 // "$ref": "Policy" 8059 // }, 8060 // "scopes": [ 8061 // "https://www.googleapis.com/auth/androidmanagement" 8062 // ] 8063 // } 8064 8065} 8066 8067// method id "androidmanagement.enterprises.webApps.create": 8068 8069type EnterprisesWebAppsCreateCall struct { 8070 s *Service 8071 parent string 8072 webapp *WebApp 8073 urlParams_ gensupport.URLParams 8074 ctx_ context.Context 8075 header_ http.Header 8076} 8077 8078// Create: Creates a web app. 8079// 8080// - parent: The name of the enterprise in the form 8081// enterprises/{enterpriseId}. 8082func (r *EnterprisesWebAppsService) Create(parent string, webapp *WebApp) *EnterprisesWebAppsCreateCall { 8083 c := &EnterprisesWebAppsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8084 c.parent = parent 8085 c.webapp = webapp 8086 return c 8087} 8088 8089// Fields allows partial responses to be retrieved. See 8090// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8091// for more information. 8092func (c *EnterprisesWebAppsCreateCall) Fields(s ...googleapi.Field) *EnterprisesWebAppsCreateCall { 8093 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8094 return c 8095} 8096 8097// Context sets the context to be used in this call's Do method. Any 8098// pending HTTP request will be aborted if the provided context is 8099// canceled. 8100func (c *EnterprisesWebAppsCreateCall) Context(ctx context.Context) *EnterprisesWebAppsCreateCall { 8101 c.ctx_ = ctx 8102 return c 8103} 8104 8105// Header returns an http.Header that can be modified by the caller to 8106// add HTTP headers to the request. 8107func (c *EnterprisesWebAppsCreateCall) Header() http.Header { 8108 if c.header_ == nil { 8109 c.header_ = make(http.Header) 8110 } 8111 return c.header_ 8112} 8113 8114func (c *EnterprisesWebAppsCreateCall) doRequest(alt string) (*http.Response, error) { 8115 reqHeaders := make(http.Header) 8116 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8117 for k, v := range c.header_ { 8118 reqHeaders[k] = v 8119 } 8120 reqHeaders.Set("User-Agent", c.s.userAgent()) 8121 var body io.Reader = nil 8122 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 8123 if err != nil { 8124 return nil, err 8125 } 8126 reqHeaders.Set("Content-Type", "application/json") 8127 c.urlParams_.Set("alt", alt) 8128 c.urlParams_.Set("prettyPrint", "false") 8129 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/webApps") 8130 urls += "?" + c.urlParams_.Encode() 8131 req, err := http.NewRequest("POST", urls, body) 8132 if err != nil { 8133 return nil, err 8134 } 8135 req.Header = reqHeaders 8136 googleapi.Expand(req.URL, map[string]string{ 8137 "parent": c.parent, 8138 }) 8139 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8140} 8141 8142// Do executes the "androidmanagement.enterprises.webApps.create" call. 8143// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 8144// code is an error. Response headers are in either 8145// *WebApp.ServerResponse.Header or (if a response was returned at all) 8146// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8147// check whether the returned error was because http.StatusNotModified 8148// was returned. 8149func (c *EnterprisesWebAppsCreateCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 8150 gensupport.SetOptions(c.urlParams_, opts...) 8151 res, err := c.doRequest("json") 8152 if res != nil && res.StatusCode == http.StatusNotModified { 8153 if res.Body != nil { 8154 res.Body.Close() 8155 } 8156 return nil, &googleapi.Error{ 8157 Code: res.StatusCode, 8158 Header: res.Header, 8159 } 8160 } 8161 if err != nil { 8162 return nil, err 8163 } 8164 defer googleapi.CloseBody(res) 8165 if err := googleapi.CheckResponse(res); err != nil { 8166 return nil, err 8167 } 8168 ret := &WebApp{ 8169 ServerResponse: googleapi.ServerResponse{ 8170 Header: res.Header, 8171 HTTPStatusCode: res.StatusCode, 8172 }, 8173 } 8174 target := &ret 8175 if err := gensupport.DecodeResponse(target, res); err != nil { 8176 return nil, err 8177 } 8178 return ret, nil 8179 // { 8180 // "description": "Creates a web app.", 8181 // "flatPath": "v1/enterprises/{enterprisesId}/webApps", 8182 // "httpMethod": "POST", 8183 // "id": "androidmanagement.enterprises.webApps.create", 8184 // "parameterOrder": [ 8185 // "parent" 8186 // ], 8187 // "parameters": { 8188 // "parent": { 8189 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 8190 // "location": "path", 8191 // "pattern": "^enterprises/[^/]+$", 8192 // "required": true, 8193 // "type": "string" 8194 // } 8195 // }, 8196 // "path": "v1/{+parent}/webApps", 8197 // "request": { 8198 // "$ref": "WebApp" 8199 // }, 8200 // "response": { 8201 // "$ref": "WebApp" 8202 // }, 8203 // "scopes": [ 8204 // "https://www.googleapis.com/auth/androidmanagement" 8205 // ] 8206 // } 8207 8208} 8209 8210// method id "androidmanagement.enterprises.webApps.delete": 8211 8212type EnterprisesWebAppsDeleteCall struct { 8213 s *Service 8214 name string 8215 urlParams_ gensupport.URLParams 8216 ctx_ context.Context 8217 header_ http.Header 8218} 8219 8220// Delete: Deletes a web app. 8221// 8222// - name: The name of the web app in the form 8223// enterprises/{enterpriseId}/webApps/{packageName}. 8224func (r *EnterprisesWebAppsService) Delete(name string) *EnterprisesWebAppsDeleteCall { 8225 c := &EnterprisesWebAppsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8226 c.name = name 8227 return c 8228} 8229 8230// Fields allows partial responses to be retrieved. See 8231// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8232// for more information. 8233func (c *EnterprisesWebAppsDeleteCall) Fields(s ...googleapi.Field) *EnterprisesWebAppsDeleteCall { 8234 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8235 return c 8236} 8237 8238// Context sets the context to be used in this call's Do method. Any 8239// pending HTTP request will be aborted if the provided context is 8240// canceled. 8241func (c *EnterprisesWebAppsDeleteCall) Context(ctx context.Context) *EnterprisesWebAppsDeleteCall { 8242 c.ctx_ = ctx 8243 return c 8244} 8245 8246// Header returns an http.Header that can be modified by the caller to 8247// add HTTP headers to the request. 8248func (c *EnterprisesWebAppsDeleteCall) Header() http.Header { 8249 if c.header_ == nil { 8250 c.header_ = make(http.Header) 8251 } 8252 return c.header_ 8253} 8254 8255func (c *EnterprisesWebAppsDeleteCall) doRequest(alt string) (*http.Response, error) { 8256 reqHeaders := make(http.Header) 8257 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8258 for k, v := range c.header_ { 8259 reqHeaders[k] = v 8260 } 8261 reqHeaders.Set("User-Agent", c.s.userAgent()) 8262 var body io.Reader = nil 8263 c.urlParams_.Set("alt", alt) 8264 c.urlParams_.Set("prettyPrint", "false") 8265 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8266 urls += "?" + c.urlParams_.Encode() 8267 req, err := http.NewRequest("DELETE", urls, body) 8268 if err != nil { 8269 return nil, err 8270 } 8271 req.Header = reqHeaders 8272 googleapi.Expand(req.URL, map[string]string{ 8273 "name": c.name, 8274 }) 8275 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8276} 8277 8278// Do executes the "androidmanagement.enterprises.webApps.delete" call. 8279// Exactly one of *Empty or error will be non-nil. Any non-2xx status 8280// code is an error. Response headers are in either 8281// *Empty.ServerResponse.Header or (if a response was returned at all) 8282// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8283// check whether the returned error was because http.StatusNotModified 8284// was returned. 8285func (c *EnterprisesWebAppsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8286 gensupport.SetOptions(c.urlParams_, opts...) 8287 res, err := c.doRequest("json") 8288 if res != nil && res.StatusCode == http.StatusNotModified { 8289 if res.Body != nil { 8290 res.Body.Close() 8291 } 8292 return nil, &googleapi.Error{ 8293 Code: res.StatusCode, 8294 Header: res.Header, 8295 } 8296 } 8297 if err != nil { 8298 return nil, err 8299 } 8300 defer googleapi.CloseBody(res) 8301 if err := googleapi.CheckResponse(res); err != nil { 8302 return nil, err 8303 } 8304 ret := &Empty{ 8305 ServerResponse: googleapi.ServerResponse{ 8306 Header: res.Header, 8307 HTTPStatusCode: res.StatusCode, 8308 }, 8309 } 8310 target := &ret 8311 if err := gensupport.DecodeResponse(target, res); err != nil { 8312 return nil, err 8313 } 8314 return ret, nil 8315 // { 8316 // "description": "Deletes a web app.", 8317 // "flatPath": "v1/enterprises/{enterprisesId}/webApps/{webAppsId}", 8318 // "httpMethod": "DELETE", 8319 // "id": "androidmanagement.enterprises.webApps.delete", 8320 // "parameterOrder": [ 8321 // "name" 8322 // ], 8323 // "parameters": { 8324 // "name": { 8325 // "description": "The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}.", 8326 // "location": "path", 8327 // "pattern": "^enterprises/[^/]+/webApps/[^/]+$", 8328 // "required": true, 8329 // "type": "string" 8330 // } 8331 // }, 8332 // "path": "v1/{+name}", 8333 // "response": { 8334 // "$ref": "Empty" 8335 // }, 8336 // "scopes": [ 8337 // "https://www.googleapis.com/auth/androidmanagement" 8338 // ] 8339 // } 8340 8341} 8342 8343// method id "androidmanagement.enterprises.webApps.get": 8344 8345type EnterprisesWebAppsGetCall struct { 8346 s *Service 8347 name string 8348 urlParams_ gensupport.URLParams 8349 ifNoneMatch_ string 8350 ctx_ context.Context 8351 header_ http.Header 8352} 8353 8354// Get: Gets a web app. 8355// 8356// - name: The name of the web app in the form 8357// enterprises/{enterpriseId}/webApp/{packageName}. 8358func (r *EnterprisesWebAppsService) Get(name string) *EnterprisesWebAppsGetCall { 8359 c := &EnterprisesWebAppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8360 c.name = name 8361 return c 8362} 8363 8364// Fields allows partial responses to be retrieved. See 8365// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8366// for more information. 8367func (c *EnterprisesWebAppsGetCall) Fields(s ...googleapi.Field) *EnterprisesWebAppsGetCall { 8368 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8369 return c 8370} 8371 8372// IfNoneMatch sets the optional parameter which makes the operation 8373// fail if the object's ETag matches the given value. This is useful for 8374// getting updates only after the object has changed since the last 8375// request. Use googleapi.IsNotModified to check whether the response 8376// error from Do is the result of In-None-Match. 8377func (c *EnterprisesWebAppsGetCall) IfNoneMatch(entityTag string) *EnterprisesWebAppsGetCall { 8378 c.ifNoneMatch_ = entityTag 8379 return c 8380} 8381 8382// Context sets the context to be used in this call's Do method. Any 8383// pending HTTP request will be aborted if the provided context is 8384// canceled. 8385func (c *EnterprisesWebAppsGetCall) Context(ctx context.Context) *EnterprisesWebAppsGetCall { 8386 c.ctx_ = ctx 8387 return c 8388} 8389 8390// Header returns an http.Header that can be modified by the caller to 8391// add HTTP headers to the request. 8392func (c *EnterprisesWebAppsGetCall) Header() http.Header { 8393 if c.header_ == nil { 8394 c.header_ = make(http.Header) 8395 } 8396 return c.header_ 8397} 8398 8399func (c *EnterprisesWebAppsGetCall) doRequest(alt string) (*http.Response, error) { 8400 reqHeaders := make(http.Header) 8401 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8402 for k, v := range c.header_ { 8403 reqHeaders[k] = v 8404 } 8405 reqHeaders.Set("User-Agent", c.s.userAgent()) 8406 if c.ifNoneMatch_ != "" { 8407 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8408 } 8409 var body io.Reader = nil 8410 c.urlParams_.Set("alt", alt) 8411 c.urlParams_.Set("prettyPrint", "false") 8412 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8413 urls += "?" + c.urlParams_.Encode() 8414 req, err := http.NewRequest("GET", urls, body) 8415 if err != nil { 8416 return nil, err 8417 } 8418 req.Header = reqHeaders 8419 googleapi.Expand(req.URL, map[string]string{ 8420 "name": c.name, 8421 }) 8422 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8423} 8424 8425// Do executes the "androidmanagement.enterprises.webApps.get" call. 8426// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 8427// code is an error. Response headers are in either 8428// *WebApp.ServerResponse.Header or (if a response was returned at all) 8429// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8430// check whether the returned error was because http.StatusNotModified 8431// was returned. 8432func (c *EnterprisesWebAppsGetCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 8433 gensupport.SetOptions(c.urlParams_, opts...) 8434 res, err := c.doRequest("json") 8435 if res != nil && res.StatusCode == http.StatusNotModified { 8436 if res.Body != nil { 8437 res.Body.Close() 8438 } 8439 return nil, &googleapi.Error{ 8440 Code: res.StatusCode, 8441 Header: res.Header, 8442 } 8443 } 8444 if err != nil { 8445 return nil, err 8446 } 8447 defer googleapi.CloseBody(res) 8448 if err := googleapi.CheckResponse(res); err != nil { 8449 return nil, err 8450 } 8451 ret := &WebApp{ 8452 ServerResponse: googleapi.ServerResponse{ 8453 Header: res.Header, 8454 HTTPStatusCode: res.StatusCode, 8455 }, 8456 } 8457 target := &ret 8458 if err := gensupport.DecodeResponse(target, res); err != nil { 8459 return nil, err 8460 } 8461 return ret, nil 8462 // { 8463 // "description": "Gets a web app.", 8464 // "flatPath": "v1/enterprises/{enterprisesId}/webApps/{webAppsId}", 8465 // "httpMethod": "GET", 8466 // "id": "androidmanagement.enterprises.webApps.get", 8467 // "parameterOrder": [ 8468 // "name" 8469 // ], 8470 // "parameters": { 8471 // "name": { 8472 // "description": "The name of the web app in the form enterprises/{enterpriseId}/webApp/{packageName}.", 8473 // "location": "path", 8474 // "pattern": "^enterprises/[^/]+/webApps/[^/]+$", 8475 // "required": true, 8476 // "type": "string" 8477 // } 8478 // }, 8479 // "path": "v1/{+name}", 8480 // "response": { 8481 // "$ref": "WebApp" 8482 // }, 8483 // "scopes": [ 8484 // "https://www.googleapis.com/auth/androidmanagement" 8485 // ] 8486 // } 8487 8488} 8489 8490// method id "androidmanagement.enterprises.webApps.list": 8491 8492type EnterprisesWebAppsListCall struct { 8493 s *Service 8494 parent string 8495 urlParams_ gensupport.URLParams 8496 ifNoneMatch_ string 8497 ctx_ context.Context 8498 header_ http.Header 8499} 8500 8501// List: Lists web apps for a given enterprise. 8502// 8503// - parent: The name of the enterprise in the form 8504// enterprises/{enterpriseId}. 8505func (r *EnterprisesWebAppsService) List(parent string) *EnterprisesWebAppsListCall { 8506 c := &EnterprisesWebAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8507 c.parent = parent 8508 return c 8509} 8510 8511// PageSize sets the optional parameter "pageSize": The requested page 8512// size. The actual page size may be fixed to a min or max value. 8513func (c *EnterprisesWebAppsListCall) PageSize(pageSize int64) *EnterprisesWebAppsListCall { 8514 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8515 return c 8516} 8517 8518// PageToken sets the optional parameter "pageToken": A token 8519// identifying a page of results returned by the server. 8520func (c *EnterprisesWebAppsListCall) PageToken(pageToken string) *EnterprisesWebAppsListCall { 8521 c.urlParams_.Set("pageToken", pageToken) 8522 return c 8523} 8524 8525// Fields allows partial responses to be retrieved. See 8526// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8527// for more information. 8528func (c *EnterprisesWebAppsListCall) Fields(s ...googleapi.Field) *EnterprisesWebAppsListCall { 8529 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8530 return c 8531} 8532 8533// IfNoneMatch sets the optional parameter which makes the operation 8534// fail if the object's ETag matches the given value. This is useful for 8535// getting updates only after the object has changed since the last 8536// request. Use googleapi.IsNotModified to check whether the response 8537// error from Do is the result of In-None-Match. 8538func (c *EnterprisesWebAppsListCall) IfNoneMatch(entityTag string) *EnterprisesWebAppsListCall { 8539 c.ifNoneMatch_ = entityTag 8540 return c 8541} 8542 8543// Context sets the context to be used in this call's Do method. Any 8544// pending HTTP request will be aborted if the provided context is 8545// canceled. 8546func (c *EnterprisesWebAppsListCall) Context(ctx context.Context) *EnterprisesWebAppsListCall { 8547 c.ctx_ = ctx 8548 return c 8549} 8550 8551// Header returns an http.Header that can be modified by the caller to 8552// add HTTP headers to the request. 8553func (c *EnterprisesWebAppsListCall) Header() http.Header { 8554 if c.header_ == nil { 8555 c.header_ = make(http.Header) 8556 } 8557 return c.header_ 8558} 8559 8560func (c *EnterprisesWebAppsListCall) doRequest(alt string) (*http.Response, error) { 8561 reqHeaders := make(http.Header) 8562 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8563 for k, v := range c.header_ { 8564 reqHeaders[k] = v 8565 } 8566 reqHeaders.Set("User-Agent", c.s.userAgent()) 8567 if c.ifNoneMatch_ != "" { 8568 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8569 } 8570 var body io.Reader = nil 8571 c.urlParams_.Set("alt", alt) 8572 c.urlParams_.Set("prettyPrint", "false") 8573 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/webApps") 8574 urls += "?" + c.urlParams_.Encode() 8575 req, err := http.NewRequest("GET", urls, body) 8576 if err != nil { 8577 return nil, err 8578 } 8579 req.Header = reqHeaders 8580 googleapi.Expand(req.URL, map[string]string{ 8581 "parent": c.parent, 8582 }) 8583 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8584} 8585 8586// Do executes the "androidmanagement.enterprises.webApps.list" call. 8587// Exactly one of *ListWebAppsResponse or error will be non-nil. Any 8588// non-2xx status code is an error. Response headers are in either 8589// *ListWebAppsResponse.ServerResponse.Header or (if a response was 8590// returned at all) in error.(*googleapi.Error).Header. Use 8591// googleapi.IsNotModified to check whether the returned error was 8592// because http.StatusNotModified was returned. 8593func (c *EnterprisesWebAppsListCall) Do(opts ...googleapi.CallOption) (*ListWebAppsResponse, error) { 8594 gensupport.SetOptions(c.urlParams_, opts...) 8595 res, err := c.doRequest("json") 8596 if res != nil && res.StatusCode == http.StatusNotModified { 8597 if res.Body != nil { 8598 res.Body.Close() 8599 } 8600 return nil, &googleapi.Error{ 8601 Code: res.StatusCode, 8602 Header: res.Header, 8603 } 8604 } 8605 if err != nil { 8606 return nil, err 8607 } 8608 defer googleapi.CloseBody(res) 8609 if err := googleapi.CheckResponse(res); err != nil { 8610 return nil, err 8611 } 8612 ret := &ListWebAppsResponse{ 8613 ServerResponse: googleapi.ServerResponse{ 8614 Header: res.Header, 8615 HTTPStatusCode: res.StatusCode, 8616 }, 8617 } 8618 target := &ret 8619 if err := gensupport.DecodeResponse(target, res); err != nil { 8620 return nil, err 8621 } 8622 return ret, nil 8623 // { 8624 // "description": "Lists web apps for a given enterprise.", 8625 // "flatPath": "v1/enterprises/{enterprisesId}/webApps", 8626 // "httpMethod": "GET", 8627 // "id": "androidmanagement.enterprises.webApps.list", 8628 // "parameterOrder": [ 8629 // "parent" 8630 // ], 8631 // "parameters": { 8632 // "pageSize": { 8633 // "description": "The requested page size. The actual page size may be fixed to a min or max value.", 8634 // "format": "int32", 8635 // "location": "query", 8636 // "type": "integer" 8637 // }, 8638 // "pageToken": { 8639 // "description": "A token identifying a page of results returned by the server.", 8640 // "location": "query", 8641 // "type": "string" 8642 // }, 8643 // "parent": { 8644 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 8645 // "location": "path", 8646 // "pattern": "^enterprises/[^/]+$", 8647 // "required": true, 8648 // "type": "string" 8649 // } 8650 // }, 8651 // "path": "v1/{+parent}/webApps", 8652 // "response": { 8653 // "$ref": "ListWebAppsResponse" 8654 // }, 8655 // "scopes": [ 8656 // "https://www.googleapis.com/auth/androidmanagement" 8657 // ] 8658 // } 8659 8660} 8661 8662// Pages invokes f for each page of results. 8663// A non-nil error returned from f will halt the iteration. 8664// The provided context supersedes any context provided to the Context method. 8665func (c *EnterprisesWebAppsListCall) Pages(ctx context.Context, f func(*ListWebAppsResponse) error) error { 8666 c.ctx_ = ctx 8667 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8668 for { 8669 x, err := c.Do() 8670 if err != nil { 8671 return err 8672 } 8673 if err := f(x); err != nil { 8674 return err 8675 } 8676 if x.NextPageToken == "" { 8677 return nil 8678 } 8679 c.PageToken(x.NextPageToken) 8680 } 8681} 8682 8683// method id "androidmanagement.enterprises.webApps.patch": 8684 8685type EnterprisesWebAppsPatchCall struct { 8686 s *Service 8687 name string 8688 webapp *WebApp 8689 urlParams_ gensupport.URLParams 8690 ctx_ context.Context 8691 header_ http.Header 8692} 8693 8694// Patch: Updates a web app. 8695// 8696// - name: The name of the web app in the form 8697// enterprises/{enterpriseId}/webApps/{packageName}. 8698func (r *EnterprisesWebAppsService) Patch(name string, webapp *WebApp) *EnterprisesWebAppsPatchCall { 8699 c := &EnterprisesWebAppsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8700 c.name = name 8701 c.webapp = webapp 8702 return c 8703} 8704 8705// UpdateMask sets the optional parameter "updateMask": The field mask 8706// indicating the fields to update. If not set, all modifiable fields 8707// will be modified. 8708func (c *EnterprisesWebAppsPatchCall) UpdateMask(updateMask string) *EnterprisesWebAppsPatchCall { 8709 c.urlParams_.Set("updateMask", updateMask) 8710 return c 8711} 8712 8713// Fields allows partial responses to be retrieved. See 8714// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8715// for more information. 8716func (c *EnterprisesWebAppsPatchCall) Fields(s ...googleapi.Field) *EnterprisesWebAppsPatchCall { 8717 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8718 return c 8719} 8720 8721// Context sets the context to be used in this call's Do method. Any 8722// pending HTTP request will be aborted if the provided context is 8723// canceled. 8724func (c *EnterprisesWebAppsPatchCall) Context(ctx context.Context) *EnterprisesWebAppsPatchCall { 8725 c.ctx_ = ctx 8726 return c 8727} 8728 8729// Header returns an http.Header that can be modified by the caller to 8730// add HTTP headers to the request. 8731func (c *EnterprisesWebAppsPatchCall) Header() http.Header { 8732 if c.header_ == nil { 8733 c.header_ = make(http.Header) 8734 } 8735 return c.header_ 8736} 8737 8738func (c *EnterprisesWebAppsPatchCall) doRequest(alt string) (*http.Response, error) { 8739 reqHeaders := make(http.Header) 8740 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8741 for k, v := range c.header_ { 8742 reqHeaders[k] = v 8743 } 8744 reqHeaders.Set("User-Agent", c.s.userAgent()) 8745 var body io.Reader = nil 8746 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp) 8747 if err != nil { 8748 return nil, err 8749 } 8750 reqHeaders.Set("Content-Type", "application/json") 8751 c.urlParams_.Set("alt", alt) 8752 c.urlParams_.Set("prettyPrint", "false") 8753 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8754 urls += "?" + c.urlParams_.Encode() 8755 req, err := http.NewRequest("PATCH", urls, body) 8756 if err != nil { 8757 return nil, err 8758 } 8759 req.Header = reqHeaders 8760 googleapi.Expand(req.URL, map[string]string{ 8761 "name": c.name, 8762 }) 8763 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8764} 8765 8766// Do executes the "androidmanagement.enterprises.webApps.patch" call. 8767// Exactly one of *WebApp or error will be non-nil. Any non-2xx status 8768// code is an error. Response headers are in either 8769// *WebApp.ServerResponse.Header or (if a response was returned at all) 8770// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8771// check whether the returned error was because http.StatusNotModified 8772// was returned. 8773func (c *EnterprisesWebAppsPatchCall) Do(opts ...googleapi.CallOption) (*WebApp, error) { 8774 gensupport.SetOptions(c.urlParams_, opts...) 8775 res, err := c.doRequest("json") 8776 if res != nil && res.StatusCode == http.StatusNotModified { 8777 if res.Body != nil { 8778 res.Body.Close() 8779 } 8780 return nil, &googleapi.Error{ 8781 Code: res.StatusCode, 8782 Header: res.Header, 8783 } 8784 } 8785 if err != nil { 8786 return nil, err 8787 } 8788 defer googleapi.CloseBody(res) 8789 if err := googleapi.CheckResponse(res); err != nil { 8790 return nil, err 8791 } 8792 ret := &WebApp{ 8793 ServerResponse: googleapi.ServerResponse{ 8794 Header: res.Header, 8795 HTTPStatusCode: res.StatusCode, 8796 }, 8797 } 8798 target := &ret 8799 if err := gensupport.DecodeResponse(target, res); err != nil { 8800 return nil, err 8801 } 8802 return ret, nil 8803 // { 8804 // "description": "Updates a web app.", 8805 // "flatPath": "v1/enterprises/{enterprisesId}/webApps/{webAppsId}", 8806 // "httpMethod": "PATCH", 8807 // "id": "androidmanagement.enterprises.webApps.patch", 8808 // "parameterOrder": [ 8809 // "name" 8810 // ], 8811 // "parameters": { 8812 // "name": { 8813 // "description": "The name of the web app in the form enterprises/{enterpriseId}/webApps/{packageName}.", 8814 // "location": "path", 8815 // "pattern": "^enterprises/[^/]+/webApps/[^/]+$", 8816 // "required": true, 8817 // "type": "string" 8818 // }, 8819 // "updateMask": { 8820 // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.", 8821 // "format": "google-fieldmask", 8822 // "location": "query", 8823 // "type": "string" 8824 // } 8825 // }, 8826 // "path": "v1/{+name}", 8827 // "request": { 8828 // "$ref": "WebApp" 8829 // }, 8830 // "response": { 8831 // "$ref": "WebApp" 8832 // }, 8833 // "scopes": [ 8834 // "https://www.googleapis.com/auth/androidmanagement" 8835 // ] 8836 // } 8837 8838} 8839 8840// method id "androidmanagement.enterprises.webTokens.create": 8841 8842type EnterprisesWebTokensCreateCall struct { 8843 s *Service 8844 parent string 8845 webtoken *WebToken 8846 urlParams_ gensupport.URLParams 8847 ctx_ context.Context 8848 header_ http.Header 8849} 8850 8851// Create: Creates a web token to access an embeddable managed Google 8852// Play web UI for a given enterprise. 8853// 8854// - parent: The name of the enterprise in the form 8855// enterprises/{enterpriseId}. 8856func (r *EnterprisesWebTokensService) Create(parent string, webtoken *WebToken) *EnterprisesWebTokensCreateCall { 8857 c := &EnterprisesWebTokensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8858 c.parent = parent 8859 c.webtoken = webtoken 8860 return c 8861} 8862 8863// Fields allows partial responses to be retrieved. See 8864// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8865// for more information. 8866func (c *EnterprisesWebTokensCreateCall) Fields(s ...googleapi.Field) *EnterprisesWebTokensCreateCall { 8867 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8868 return c 8869} 8870 8871// Context sets the context to be used in this call's Do method. Any 8872// pending HTTP request will be aborted if the provided context is 8873// canceled. 8874func (c *EnterprisesWebTokensCreateCall) Context(ctx context.Context) *EnterprisesWebTokensCreateCall { 8875 c.ctx_ = ctx 8876 return c 8877} 8878 8879// Header returns an http.Header that can be modified by the caller to 8880// add HTTP headers to the request. 8881func (c *EnterprisesWebTokensCreateCall) Header() http.Header { 8882 if c.header_ == nil { 8883 c.header_ = make(http.Header) 8884 } 8885 return c.header_ 8886} 8887 8888func (c *EnterprisesWebTokensCreateCall) doRequest(alt string) (*http.Response, error) { 8889 reqHeaders := make(http.Header) 8890 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8891 for k, v := range c.header_ { 8892 reqHeaders[k] = v 8893 } 8894 reqHeaders.Set("User-Agent", c.s.userAgent()) 8895 var body io.Reader = nil 8896 body, err := googleapi.WithoutDataWrapper.JSONReader(c.webtoken) 8897 if err != nil { 8898 return nil, err 8899 } 8900 reqHeaders.Set("Content-Type", "application/json") 8901 c.urlParams_.Set("alt", alt) 8902 c.urlParams_.Set("prettyPrint", "false") 8903 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/webTokens") 8904 urls += "?" + c.urlParams_.Encode() 8905 req, err := http.NewRequest("POST", urls, body) 8906 if err != nil { 8907 return nil, err 8908 } 8909 req.Header = reqHeaders 8910 googleapi.Expand(req.URL, map[string]string{ 8911 "parent": c.parent, 8912 }) 8913 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8914} 8915 8916// Do executes the "androidmanagement.enterprises.webTokens.create" call. 8917// Exactly one of *WebToken or error will be non-nil. Any non-2xx status 8918// code is an error. Response headers are in either 8919// *WebToken.ServerResponse.Header or (if a response was returned at 8920// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8921// to check whether the returned error was because 8922// http.StatusNotModified was returned. 8923func (c *EnterprisesWebTokensCreateCall) Do(opts ...googleapi.CallOption) (*WebToken, error) { 8924 gensupport.SetOptions(c.urlParams_, opts...) 8925 res, err := c.doRequest("json") 8926 if res != nil && res.StatusCode == http.StatusNotModified { 8927 if res.Body != nil { 8928 res.Body.Close() 8929 } 8930 return nil, &googleapi.Error{ 8931 Code: res.StatusCode, 8932 Header: res.Header, 8933 } 8934 } 8935 if err != nil { 8936 return nil, err 8937 } 8938 defer googleapi.CloseBody(res) 8939 if err := googleapi.CheckResponse(res); err != nil { 8940 return nil, err 8941 } 8942 ret := &WebToken{ 8943 ServerResponse: googleapi.ServerResponse{ 8944 Header: res.Header, 8945 HTTPStatusCode: res.StatusCode, 8946 }, 8947 } 8948 target := &ret 8949 if err := gensupport.DecodeResponse(target, res); err != nil { 8950 return nil, err 8951 } 8952 return ret, nil 8953 // { 8954 // "description": "Creates a web token to access an embeddable managed Google Play web UI for a given enterprise.", 8955 // "flatPath": "v1/enterprises/{enterprisesId}/webTokens", 8956 // "httpMethod": "POST", 8957 // "id": "androidmanagement.enterprises.webTokens.create", 8958 // "parameterOrder": [ 8959 // "parent" 8960 // ], 8961 // "parameters": { 8962 // "parent": { 8963 // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.", 8964 // "location": "path", 8965 // "pattern": "^enterprises/[^/]+$", 8966 // "required": true, 8967 // "type": "string" 8968 // } 8969 // }, 8970 // "path": "v1/{+parent}/webTokens", 8971 // "request": { 8972 // "$ref": "WebToken" 8973 // }, 8974 // "response": { 8975 // "$ref": "WebToken" 8976 // }, 8977 // "scopes": [ 8978 // "https://www.googleapis.com/auth/androidmanagement" 8979 // ] 8980 // } 8981 8982} 8983 8984// method id "androidmanagement.signupUrls.create": 8985 8986type SignupUrlsCreateCall struct { 8987 s *Service 8988 urlParams_ gensupport.URLParams 8989 ctx_ context.Context 8990 header_ http.Header 8991} 8992 8993// Create: Creates an enterprise signup URL. 8994func (r *SignupUrlsService) Create() *SignupUrlsCreateCall { 8995 c := &SignupUrlsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8996 return c 8997} 8998 8999// CallbackUrl sets the optional parameter "callbackUrl": The callback 9000// URL that the admin will be redirected to after successfully creating 9001// an enterprise. Before redirecting there the system will add a query 9002// parameter to this URL named enterpriseToken which will contain an 9003// opaque token to be used for the create enterprise request. The URL 9004// will be parsed then reformatted in order to add the enterpriseToken 9005// parameter, so there may be some minor formatting changes. 9006func (c *SignupUrlsCreateCall) CallbackUrl(callbackUrl string) *SignupUrlsCreateCall { 9007 c.urlParams_.Set("callbackUrl", callbackUrl) 9008 return c 9009} 9010 9011// ProjectId sets the optional parameter "projectId": The ID of the 9012// Google Cloud Platform project which will own the enterprise. 9013func (c *SignupUrlsCreateCall) ProjectId(projectId string) *SignupUrlsCreateCall { 9014 c.urlParams_.Set("projectId", projectId) 9015 return c 9016} 9017 9018// Fields allows partial responses to be retrieved. See 9019// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9020// for more information. 9021func (c *SignupUrlsCreateCall) Fields(s ...googleapi.Field) *SignupUrlsCreateCall { 9022 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9023 return c 9024} 9025 9026// Context sets the context to be used in this call's Do method. Any 9027// pending HTTP request will be aborted if the provided context is 9028// canceled. 9029func (c *SignupUrlsCreateCall) Context(ctx context.Context) *SignupUrlsCreateCall { 9030 c.ctx_ = ctx 9031 return c 9032} 9033 9034// Header returns an http.Header that can be modified by the caller to 9035// add HTTP headers to the request. 9036func (c *SignupUrlsCreateCall) Header() http.Header { 9037 if c.header_ == nil { 9038 c.header_ = make(http.Header) 9039 } 9040 return c.header_ 9041} 9042 9043func (c *SignupUrlsCreateCall) doRequest(alt string) (*http.Response, error) { 9044 reqHeaders := make(http.Header) 9045 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9046 for k, v := range c.header_ { 9047 reqHeaders[k] = v 9048 } 9049 reqHeaders.Set("User-Agent", c.s.userAgent()) 9050 var body io.Reader = nil 9051 c.urlParams_.Set("alt", alt) 9052 c.urlParams_.Set("prettyPrint", "false") 9053 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/signupUrls") 9054 urls += "?" + c.urlParams_.Encode() 9055 req, err := http.NewRequest("POST", urls, body) 9056 if err != nil { 9057 return nil, err 9058 } 9059 req.Header = reqHeaders 9060 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9061} 9062 9063// Do executes the "androidmanagement.signupUrls.create" call. 9064// Exactly one of *SignupUrl or error will be non-nil. Any non-2xx 9065// status code is an error. Response headers are in either 9066// *SignupUrl.ServerResponse.Header or (if a response was returned at 9067// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9068// to check whether the returned error was because 9069// http.StatusNotModified was returned. 9070func (c *SignupUrlsCreateCall) Do(opts ...googleapi.CallOption) (*SignupUrl, error) { 9071 gensupport.SetOptions(c.urlParams_, opts...) 9072 res, err := c.doRequest("json") 9073 if res != nil && res.StatusCode == http.StatusNotModified { 9074 if res.Body != nil { 9075 res.Body.Close() 9076 } 9077 return nil, &googleapi.Error{ 9078 Code: res.StatusCode, 9079 Header: res.Header, 9080 } 9081 } 9082 if err != nil { 9083 return nil, err 9084 } 9085 defer googleapi.CloseBody(res) 9086 if err := googleapi.CheckResponse(res); err != nil { 9087 return nil, err 9088 } 9089 ret := &SignupUrl{ 9090 ServerResponse: googleapi.ServerResponse{ 9091 Header: res.Header, 9092 HTTPStatusCode: res.StatusCode, 9093 }, 9094 } 9095 target := &ret 9096 if err := gensupport.DecodeResponse(target, res); err != nil { 9097 return nil, err 9098 } 9099 return ret, nil 9100 // { 9101 // "description": "Creates an enterprise signup URL.", 9102 // "flatPath": "v1/signupUrls", 9103 // "httpMethod": "POST", 9104 // "id": "androidmanagement.signupUrls.create", 9105 // "parameterOrder": [], 9106 // "parameters": { 9107 // "callbackUrl": { 9108 // "description": "The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.", 9109 // "location": "query", 9110 // "type": "string" 9111 // }, 9112 // "projectId": { 9113 // "description": "The ID of the Google Cloud Platform project which will own the enterprise.", 9114 // "location": "query", 9115 // "type": "string" 9116 // } 9117 // }, 9118 // "path": "v1/signupUrls", 9119 // "response": { 9120 // "$ref": "SignupUrl" 9121 // }, 9122 // "scopes": [ 9123 // "https://www.googleapis.com/auth/androidmanagement" 9124 // ] 9125 // } 9126 9127} 9128