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 cloudidentity provides access to the Cloud Identity API. 8// 9// For product documentation, see: https://cloud.google.com/identity/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/cloudidentity/v1beta1" 16// ... 17// ctx := context.Background() 18// cloudidentityService, err := cloudidentity.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// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithScopes(cloudidentity.CloudPlatformScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package cloudidentity // import "google.golang.org/api/cloudidentity/v1beta1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "cloudidentity:v1beta1" 79const apiName = "cloudidentity" 80const apiVersion = "v1beta1" 81const basePath = "https://cloudidentity.googleapis.com/" 82const mtlsBasePath = "https://cloudidentity.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See your device details 87 CloudIdentityDevicesLookupScope = "https://www.googleapis.com/auth/cloud-identity.devices.lookup" 88 89 // See, change, create, and delete any of the Cloud Identity Groups that 90 // you can access, including the members of each group 91 CloudIdentityGroupsScope = "https://www.googleapis.com/auth/cloud-identity.groups" 92 93 // See any Cloud Identity Groups that you can access, including group 94 // members and their emails 95 CloudIdentityGroupsReadonlyScope = "https://www.googleapis.com/auth/cloud-identity.groups.readonly" 96 97 // See, edit, configure, and delete your Google Cloud data and see the 98 // email address for your Google Account. 99 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 100) 101 102// NewService creates a new Service. 103func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 104 scopesOption := option.WithScopes( 105 "https://www.googleapis.com/auth/cloud-identity.devices.lookup", 106 "https://www.googleapis.com/auth/cloud-identity.groups", 107 "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 108 "https://www.googleapis.com/auth/cloud-platform", 109 ) 110 // NOTE: prepend, so we don't override user-specified scopes. 111 opts = append([]option.ClientOption{scopesOption}, opts...) 112 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 113 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126} 127 128// New creates a new Service. It uses the provided http.Client for requests. 129// 130// Deprecated: please use NewService instead. 131// To provide a custom HTTP client, use option.WithHTTPClient. 132// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133func New(client *http.Client) (*Service, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &Service{client: client, BasePath: basePath} 138 s.Customers = NewCustomersService(s) 139 s.Devices = NewDevicesService(s) 140 s.Groups = NewGroupsService(s) 141 return s, nil 142} 143 144type Service struct { 145 client *http.Client 146 BasePath string // API endpoint base URL 147 UserAgent string // optional additional User-Agent fragment 148 149 Customers *CustomersService 150 151 Devices *DevicesService 152 153 Groups *GroupsService 154} 155 156func (s *Service) userAgent() string { 157 if s.UserAgent == "" { 158 return googleapi.UserAgent 159 } 160 return googleapi.UserAgent + " " + s.UserAgent 161} 162 163func NewCustomersService(s *Service) *CustomersService { 164 rs := &CustomersService{s: s} 165 rs.Userinvitations = NewCustomersUserinvitationsService(s) 166 return rs 167} 168 169type CustomersService struct { 170 s *Service 171 172 Userinvitations *CustomersUserinvitationsService 173} 174 175func NewCustomersUserinvitationsService(s *Service) *CustomersUserinvitationsService { 176 rs := &CustomersUserinvitationsService{s: s} 177 return rs 178} 179 180type CustomersUserinvitationsService struct { 181 s *Service 182} 183 184func NewDevicesService(s *Service) *DevicesService { 185 rs := &DevicesService{s: s} 186 rs.DeviceUsers = NewDevicesDeviceUsersService(s) 187 return rs 188} 189 190type DevicesService struct { 191 s *Service 192 193 DeviceUsers *DevicesDeviceUsersService 194} 195 196func NewDevicesDeviceUsersService(s *Service) *DevicesDeviceUsersService { 197 rs := &DevicesDeviceUsersService{s: s} 198 rs.ClientStates = NewDevicesDeviceUsersClientStatesService(s) 199 return rs 200} 201 202type DevicesDeviceUsersService struct { 203 s *Service 204 205 ClientStates *DevicesDeviceUsersClientStatesService 206} 207 208func NewDevicesDeviceUsersClientStatesService(s *Service) *DevicesDeviceUsersClientStatesService { 209 rs := &DevicesDeviceUsersClientStatesService{s: s} 210 return rs 211} 212 213type DevicesDeviceUsersClientStatesService struct { 214 s *Service 215} 216 217func NewGroupsService(s *Service) *GroupsService { 218 rs := &GroupsService{s: s} 219 rs.Memberships = NewGroupsMembershipsService(s) 220 return rs 221} 222 223type GroupsService struct { 224 s *Service 225 226 Memberships *GroupsMembershipsService 227} 228 229func NewGroupsMembershipsService(s *Service) *GroupsMembershipsService { 230 rs := &GroupsMembershipsService{s: s} 231 return rs 232} 233 234type GroupsMembershipsService struct { 235 s *Service 236} 237 238// AndroidAttributes: Resource representing the Android specific 239// attributes of a Device. 240type AndroidAttributes struct { 241 // EnabledUnknownSources: Whether applications from unknown sources can 242 // be installed on device. 243 EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"` 244 245 // OwnerProfileAccount: Whether this account is on an owner/primary 246 // profile. For phones, only true for owner profiles. Android 4+ devices 247 // can have secondary or restricted user profiles. 248 OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"` 249 250 // OwnershipPrivilege: Ownership privileges on device. 251 // 252 // Possible values: 253 // "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set. 254 // "DEVICE_ADMINISTRATOR" - Active device administrator privileges on 255 // the device. 256 // "PROFILE_OWNER" - Profile Owner privileges. The account is in a 257 // managed corporate profile. 258 // "DEVICE_OWNER" - Device Owner privileges on the device. 259 OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"` 260 261 // SupportsWorkProfile: Whether device supports Android work profiles. 262 // If false, this service will not block access to corp data even if an 263 // administrator turns on the "Enforce Work Profile" policy. 264 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 265 266 // ForceSendFields is a list of field names (e.g. 267 // "EnabledUnknownSources") to unconditionally include in API requests. 268 // By default, fields with empty or default values are omitted from API 269 // requests. However, any non-pointer, non-interface field appearing in 270 // ForceSendFields will be sent to the server regardless of whether the 271 // field is empty or not. This may be used to include empty fields in 272 // Patch requests. 273 ForceSendFields []string `json:"-"` 274 275 // NullFields is a list of field names (e.g. "EnabledUnknownSources") to 276 // include in API requests with the JSON null value. By default, fields 277 // with empty values are omitted from API requests. However, any field 278 // with an empty value appearing in NullFields will be sent to the 279 // server as null. It is an error if a field in this list has a 280 // non-empty value. This may be used to include null fields in Patch 281 // requests. 282 NullFields []string `json:"-"` 283} 284 285func (s *AndroidAttributes) MarshalJSON() ([]byte, error) { 286 type NoMethod AndroidAttributes 287 raw := NoMethod(*s) 288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 289} 290 291// ApproveDeviceUserRequest: Request message for approving the device to 292// access user data. 293type ApproveDeviceUserRequest struct { 294} 295 296// ApproveDeviceUserResponse: Response message for approving the device 297// to access user data. 298type ApproveDeviceUserResponse struct { 299 // DeviceUser: Resultant DeviceUser object for the action. 300 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 301 302 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 303 // unconditionally include in API requests. By default, fields with 304 // empty or default values are omitted from API requests. However, any 305 // non-pointer, non-interface field appearing in ForceSendFields will be 306 // sent to the server regardless of whether the field is empty or not. 307 // This may be used to include empty fields in Patch requests. 308 ForceSendFields []string `json:"-"` 309 310 // NullFields is a list of field names (e.g. "DeviceUser") to include in 311 // API requests with the JSON null value. By default, fields with empty 312 // values are omitted from API requests. However, any field with an 313 // empty value appearing in NullFields will be sent to the server as 314 // null. It is an error if a field in this list has a non-empty value. 315 // This may be used to include null fields in Patch requests. 316 NullFields []string `json:"-"` 317} 318 319func (s *ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) { 320 type NoMethod ApproveDeviceUserResponse 321 raw := NoMethod(*s) 322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 323} 324 325// BlockDeviceUserRequest: Request message for blocking account on 326// device. 327type BlockDeviceUserRequest struct { 328} 329 330// BlockDeviceUserResponse: Response message for blocking the device 331// from accessing user data. 332type BlockDeviceUserResponse struct { 333 // DeviceUser: Resultant DeviceUser object for the action. 334 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 335 336 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 337 // unconditionally include in API requests. By default, fields with 338 // empty or default values are omitted from API requests. However, any 339 // non-pointer, non-interface field appearing in ForceSendFields will be 340 // sent to the server regardless of whether the field is empty or not. 341 // This may be used to include empty fields in Patch requests. 342 ForceSendFields []string `json:"-"` 343 344 // NullFields is a list of field names (e.g. "DeviceUser") to include in 345 // API requests with the JSON null value. By default, fields with empty 346 // values are omitted from API requests. However, any field with an 347 // empty value appearing in NullFields will be sent to the server as 348 // null. It is an error if a field in this list has a non-empty value. 349 // This may be used to include null fields in Patch requests. 350 NullFields []string `json:"-"` 351} 352 353func (s *BlockDeviceUserResponse) MarshalJSON() ([]byte, error) { 354 type NoMethod BlockDeviceUserResponse 355 raw := NoMethod(*s) 356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 357} 358 359// CancelUserInvitationRequest: Request to cancel sent invitation for 360// target email in UserInvitation. 361type CancelUserInvitationRequest struct { 362} 363 364// CancelWipeDeviceRequest: Request message for cancelling an unfinished 365// device wipe. 366type CancelWipeDeviceRequest struct { 367} 368 369// CancelWipeDeviceResponse: Response message for cancelling an 370// unfinished device wipe. 371type CancelWipeDeviceResponse struct { 372 // Device: Resultant Device object for the action. Note that asset tags 373 // will not be returned in the device object. 374 Device *Device `json:"device,omitempty"` 375 376 // ForceSendFields is a list of field names (e.g. "Device") to 377 // unconditionally include in API requests. By default, fields with 378 // empty or default values are omitted from API requests. However, any 379 // non-pointer, non-interface field appearing in ForceSendFields will be 380 // sent to the server regardless of whether the field is empty or not. 381 // This may be used to include empty fields in Patch requests. 382 ForceSendFields []string `json:"-"` 383 384 // NullFields is a list of field names (e.g. "Device") to include in API 385 // requests with the JSON null value. By default, fields with empty 386 // values are omitted from API requests. However, any field with an 387 // empty value appearing in NullFields will be sent to the server as 388 // null. It is an error if a field in this list has a non-empty value. 389 // This may be used to include null fields in Patch requests. 390 NullFields []string `json:"-"` 391} 392 393func (s *CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) { 394 type NoMethod CancelWipeDeviceResponse 395 raw := NoMethod(*s) 396 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 397} 398 399// CancelWipeDeviceUserRequest: Request message for cancelling an 400// unfinished user account wipe. 401type CancelWipeDeviceUserRequest struct { 402} 403 404// CancelWipeDeviceUserResponse: Response message for cancelling an 405// unfinished user account wipe. 406type CancelWipeDeviceUserResponse struct { 407 // DeviceUser: Resultant DeviceUser object for the action. 408 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 409 410 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 411 // unconditionally include in API requests. By default, fields with 412 // empty or default values are omitted from API requests. However, any 413 // non-pointer, non-interface field appearing in ForceSendFields will be 414 // sent to the server regardless of whether the field is empty or not. 415 // This may be used to include empty fields in Patch requests. 416 ForceSendFields []string `json:"-"` 417 418 // NullFields is a list of field names (e.g. "DeviceUser") to include in 419 // API requests with the JSON null value. By default, fields with empty 420 // values are omitted from API requests. However, any field with an 421 // empty value appearing in NullFields will be sent to the server as 422 // null. It is an error if a field in this list has a non-empty value. 423 // This may be used to include null fields in Patch requests. 424 NullFields []string `json:"-"` 425} 426 427func (s *CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 428 type NoMethod CancelWipeDeviceUserResponse 429 raw := NoMethod(*s) 430 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 431} 432 433// CheckTransitiveMembershipResponse: The response message for 434// MembershipsService.CheckTransitiveMembership. 435type CheckTransitiveMembershipResponse struct { 436 // HasMembership: Response does not include the possible roles of a 437 // member since the behavior of this rpc is not all-or-nothing unlike 438 // the other rpcs. So, it may not be possible to list all the roles 439 // definitively, due to possible lack of authorization in some of the 440 // paths. 441 HasMembership bool `json:"hasMembership,omitempty"` 442 443 // ServerResponse contains the HTTP response code and headers from the 444 // server. 445 googleapi.ServerResponse `json:"-"` 446 447 // ForceSendFields is a list of field names (e.g. "HasMembership") to 448 // unconditionally include in API requests. By default, fields with 449 // empty or default values are omitted from API requests. However, any 450 // non-pointer, non-interface field appearing in ForceSendFields will be 451 // sent to the server regardless of whether the field is empty or not. 452 // This may be used to include empty fields in Patch requests. 453 ForceSendFields []string `json:"-"` 454 455 // NullFields is a list of field names (e.g. "HasMembership") to include 456 // in API requests with the JSON null value. By default, fields with 457 // empty values are omitted from API requests. However, any field with 458 // an empty value appearing in NullFields will be sent to the server as 459 // null. It is an error if a field in this list has a non-empty value. 460 // This may be used to include null fields in Patch requests. 461 NullFields []string `json:"-"` 462} 463 464func (s *CheckTransitiveMembershipResponse) MarshalJSON() ([]byte, error) { 465 type NoMethod CheckTransitiveMembershipResponse 466 raw := NoMethod(*s) 467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 468} 469 470// ClientState: Represents the state associated with an API client 471// calling the Devices API. Resource representing ClientState and 472// supports updates from API users 473type ClientState struct { 474 // AssetTags: The caller can specify asset tags for this resource 475 AssetTags []string `json:"assetTags,omitempty"` 476 477 // ComplianceState: The compliance state of the resource as specified by 478 // the API client. 479 // 480 // Possible values: 481 // "COMPLIANCE_STATE_UNSPECIFIED" - The compliance state of the 482 // resource is unknown or unspecified. 483 // "COMPLIANT" - Device is compliant with third party policies 484 // "NON_COMPLIANT" - Device is not compliant with third party policies 485 ComplianceState string `json:"complianceState,omitempty"` 486 487 // CreateTime: Output only. The time the client state data was created. 488 CreateTime string `json:"createTime,omitempty"` 489 490 // CustomId: This field may be used to store a unique identifier for the 491 // API resource within which these CustomAttributes are a field. 492 CustomId string `json:"customId,omitempty"` 493 494 // Etag: The token that needs to be passed back for concurrency control 495 // in updates. Token needs to be passed back in UpdateRequest 496 Etag string `json:"etag,omitempty"` 497 498 // HealthScore: The Health score of the resource 499 // 500 // Possible values: 501 // "HEALTH_SCORE_UNSPECIFIED" - Default value 502 // "VERY_POOR" - The object is in very poor health as defined by the 503 // caller. 504 // "POOR" - The object is in poor health as defined by the caller. 505 // "NEUTRAL" - The object health is neither good nor poor, as defined 506 // by the caller. 507 // "GOOD" - The object is in good health as defined by the caller. 508 // "VERY_GOOD" - The object is in very good health as defined by the 509 // caller. 510 HealthScore string `json:"healthScore,omitempty"` 511 512 // KeyValuePairs: The map of key-value attributes stored by callers 513 // specific to a device. The total serialized length of this map may not 514 // exceed 10KB. No limit is placed on the number of attributes in a map. 515 KeyValuePairs map[string]CustomAttributeValue `json:"keyValuePairs,omitempty"` 516 517 // LastUpdateTime: Output only. The time the client state data was last 518 // updated. 519 LastUpdateTime string `json:"lastUpdateTime,omitempty"` 520 521 // Managed: The management state of the resource as specified by the API 522 // client. 523 // 524 // Possible values: 525 // "MANAGED_STATE_UNSPECIFIED" - The management state of the resource 526 // is unknown or unspecified. 527 // "MANAGED" - The resource is managed. 528 // "UNMANAGED" - The resource is not managed. 529 Managed string `json:"managed,omitempty"` 530 531 // Name: Output only. Resource name 532 // (https://cloud.google.com/apis/design/resource_names) of the 533 // ClientState in format: 534 // `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partner 535 // _id}`, where partner_id corresponds to the partner storing the data. 536 Name string `json:"name,omitempty"` 537 538 // OwnerType: Output only. The owner of the ClientState 539 // 540 // Possible values: 541 // "OWNER_TYPE_UNSPECIFIED" - Unknown owner type 542 // "OWNER_TYPE_CUSTOMER" - Customer is the owner 543 // "OWNER_TYPE_PARTNER" - Partner is the owner 544 OwnerType string `json:"ownerType,omitempty"` 545 546 // ScoreReason: A descriptive cause of the health score. 547 ScoreReason string `json:"scoreReason,omitempty"` 548 549 // ServerResponse contains the HTTP response code and headers from the 550 // server. 551 googleapi.ServerResponse `json:"-"` 552 553 // ForceSendFields is a list of field names (e.g. "AssetTags") to 554 // unconditionally include in API requests. By default, fields with 555 // empty or default values are omitted from API requests. However, any 556 // non-pointer, non-interface field appearing in ForceSendFields will be 557 // sent to the server regardless of whether the field is empty or not. 558 // This may be used to include empty fields in Patch requests. 559 ForceSendFields []string `json:"-"` 560 561 // NullFields is a list of field names (e.g. "AssetTags") to include in 562 // API requests with the JSON null value. By default, fields with empty 563 // values are omitted from API requests. However, any field with an 564 // empty value appearing in NullFields will be sent to the server as 565 // null. It is an error if a field in this list has a non-empty value. 566 // This may be used to include null fields in Patch requests. 567 NullFields []string `json:"-"` 568} 569 570func (s *ClientState) MarshalJSON() ([]byte, error) { 571 type NoMethod ClientState 572 raw := NoMethod(*s) 573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 574} 575 576// CreateDeviceRequest: Request message for creating a Company Owned 577// device. 578type CreateDeviceRequest struct { 579 // Device: Required. The device to be created. The name field within 580 // this device is ignored in the create method. A new name is created by 581 // the method, and returned within the response. Only the fields 582 // `device_type`, `serial_number` and `asset_tag` (if present) are used 583 // to create the device. All other fields are ignored. The `device_type` 584 // and `serial_number` fields are required. 585 Device *Device `json:"device,omitempty"` 586 587 // ForceSendFields is a list of field names (e.g. "Device") to 588 // unconditionally include in API requests. By default, fields with 589 // empty or default values are omitted from API requests. However, any 590 // non-pointer, non-interface field appearing in ForceSendFields will be 591 // sent to the server regardless of whether the field is empty or not. 592 // This may be used to include empty fields in Patch requests. 593 ForceSendFields []string `json:"-"` 594 595 // NullFields is a list of field names (e.g. "Device") to include in API 596 // requests with the JSON null value. By default, fields with empty 597 // values are omitted from API requests. However, any field with an 598 // empty value appearing in NullFields will be sent to the server as 599 // null. It is an error if a field in this list has a non-empty value. 600 // This may be used to include null fields in Patch requests. 601 NullFields []string `json:"-"` 602} 603 604func (s *CreateDeviceRequest) MarshalJSON() ([]byte, error) { 605 type NoMethod CreateDeviceRequest 606 raw := NoMethod(*s) 607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 608} 609 610// CustomAttributeValue: Additional custom attribute values may be one 611// of these types 612type CustomAttributeValue struct { 613 // BoolValue: Represents a boolean value. 614 BoolValue bool `json:"boolValue,omitempty"` 615 616 // NumberValue: Represents a double value. 617 NumberValue float64 `json:"numberValue,omitempty"` 618 619 // StringValue: Represents a string value. 620 StringValue string `json:"stringValue,omitempty"` 621 622 // ForceSendFields is a list of field names (e.g. "BoolValue") to 623 // unconditionally include in API requests. By default, fields with 624 // empty or default values are omitted from API requests. However, any 625 // non-pointer, non-interface field appearing in ForceSendFields will be 626 // sent to the server regardless of whether the field is empty or not. 627 // This may be used to include empty fields in Patch requests. 628 ForceSendFields []string `json:"-"` 629 630 // NullFields is a list of field names (e.g. "BoolValue") to include in 631 // API requests with the JSON null value. By default, fields with empty 632 // values are omitted from API requests. However, any field with an 633 // empty value appearing in NullFields will be sent to the server as 634 // null. It is an error if a field in this list has a non-empty value. 635 // This may be used to include null fields in Patch requests. 636 NullFields []string `json:"-"` 637} 638 639func (s *CustomAttributeValue) MarshalJSON() ([]byte, error) { 640 type NoMethod CustomAttributeValue 641 raw := NoMethod(*s) 642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 643} 644 645func (s *CustomAttributeValue) UnmarshalJSON(data []byte) error { 646 type NoMethod CustomAttributeValue 647 var s1 struct { 648 NumberValue gensupport.JSONFloat64 `json:"numberValue"` 649 *NoMethod 650 } 651 s1.NoMethod = (*NoMethod)(s) 652 if err := json.Unmarshal(data, &s1); err != nil { 653 return err 654 } 655 s.NumberValue = float64(s1.NumberValue) 656 return nil 657} 658 659// Device: A Device within the Cloud Identity Devices API. Represents a 660// Device known to Google Cloud, independent of the device ownership, 661// type, and whether it is assigned or in use by a user. 662type Device struct { 663 // AndroidSpecificAttributes: Output only. Attributes specific to 664 // Android devices. 665 AndroidSpecificAttributes *AndroidAttributes `json:"androidSpecificAttributes,omitempty"` 666 667 // AssetTag: Asset tag of the device. 668 AssetTag string `json:"assetTag,omitempty"` 669 670 // BasebandVersion: Output only. Baseband version of the device. 671 BasebandVersion string `json:"basebandVersion,omitempty"` 672 673 // BootloaderVersion: Output only. Device bootloader version. Example: 674 // 0.6.7. 675 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 676 677 // Brand: Output only. Device brand. Example: Samsung. 678 Brand string `json:"brand,omitempty"` 679 680 // BuildNumber: Output only. Build number of the device. 681 BuildNumber string `json:"buildNumber,omitempty"` 682 683 // CompromisedState: Output only. Represents whether the Device is 684 // compromised. 685 // 686 // Possible values: 687 // "COMPROMISED_STATE_UNSPECIFIED" - Default value. 688 // "COMPROMISED" - The device is compromised (currently, this means 689 // Android device is rooted). 690 // "UNCOMPROMISED" - The device is safe (currently, this means Android 691 // device is unrooted). 692 CompromisedState string `json:"compromisedState,omitempty"` 693 694 // CreateTime: Output only. When the Company-Owned device was imported. 695 // This field is empty for BYOD devices. 696 CreateTime string `json:"createTime,omitempty"` 697 698 // DeviceType: Output only. Type of device. 699 // 700 // Possible values: 701 // "DEVICE_TYPE_UNSPECIFIED" - Unknown device type 702 // "ANDROID" - Device is an Android device 703 // "IOS" - Device is an iOS device 704 // "GOOGLE_SYNC" - Device is a Google Sync device. 705 // "WINDOWS" - Device is a Windows device. 706 // "MAC_OS" - Device is a MacOS device. 707 // "LINUX" - Device is a Linux device. 708 // "CHROME_OS" - Device is a ChromeOS device. 709 DeviceType string `json:"deviceType,omitempty"` 710 711 // EnabledDeveloperOptions: Output only. Whether developer options is 712 // enabled on device. 713 EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"` 714 715 // EnabledUsbDebugging: Output only. Whether USB debugging is enabled on 716 // device. 717 EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"` 718 719 // EncryptionState: Output only. Device encryption state. 720 // 721 // Possible values: 722 // "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set. 723 // "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption. 724 // "ENCRYPTED" - Device is encrypted. 725 // "NOT_ENCRYPTED" - Device is not encrypted. 726 EncryptionState string `json:"encryptionState,omitempty"` 727 728 // Imei: Output only. IMEI number of device if GSM device; empty 729 // otherwise. 730 Imei string `json:"imei,omitempty"` 731 732 // KernelVersion: Output only. Kernel version of the device. 733 KernelVersion string `json:"kernelVersion,omitempty"` 734 735 // LastSyncTime: Most recent time when device synced with this service. 736 LastSyncTime string `json:"lastSyncTime,omitempty"` 737 738 // ManagementState: Output only. Management state of the device 739 // 740 // Possible values: 741 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 742 // unused. 743 // "APPROVED" - Device is approved. 744 // "BLOCKED" - Device is blocked. 745 // "PENDING" - Device is pending approval. 746 // "UNPROVISIONED" - The device is not provisioned. Device will start 747 // from this state until some action is taken (i.e. a user starts using 748 // the device). 749 // "WIPING" - Data and settings on the device are being removed. 750 // "WIPED" - All data and settings on the device are removed. 751 ManagementState string `json:"managementState,omitempty"` 752 753 // Manufacturer: Output only. Device manufacturer. Example: Motorola. 754 Manufacturer string `json:"manufacturer,omitempty"` 755 756 // Meid: Output only. MEID number of device if CDMA device; empty 757 // otherwise. 758 Meid string `json:"meid,omitempty"` 759 760 // Model: Output only. Model name of device. Example: Pixel 3. 761 Model string `json:"model,omitempty"` 762 763 // Name: Output only. Resource name 764 // (https://cloud.google.com/apis/design/resource_names) of the Device 765 // in format: `devices/{device_id}`, where device_id is the unique id 766 // assigned to the Device. 767 Name string `json:"name,omitempty"` 768 769 // NetworkOperator: Output only. Mobile or network operator of device, 770 // if available. 771 NetworkOperator string `json:"networkOperator,omitempty"` 772 773 // OsVersion: Output only. OS version of the device. Example: Android 774 // 8.1.0. 775 OsVersion string `json:"osVersion,omitempty"` 776 777 // OtherAccounts: Output only. Domain name for Google accounts on 778 // device. Type for other accounts on device. On Android, will only be 779 // populated if |ownership_privilege| is |PROFILE_OWNER| or 780 // |DEVICE_OWNER|. Does not include the account signed in to the device 781 // policy app if that account's domain has only one account. Examples: 782 // "com.example", "xyz.com". 783 OtherAccounts []string `json:"otherAccounts,omitempty"` 784 785 // OwnerType: Output only. Whether the device is owned by the company or 786 // an individual 787 // 788 // Possible values: 789 // "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is 790 // unused. 791 // "COMPANY" - Company owns the device. 792 // "BYOD" - Bring Your Own Device (i.e. individual owns the device) 793 OwnerType string `json:"ownerType,omitempty"` 794 795 // ReleaseVersion: Output only. OS release version. Example: 6.0. 796 ReleaseVersion string `json:"releaseVersion,omitempty"` 797 798 // SecurityPatchTime: Output only. OS security patch update time on 799 // device. 800 SecurityPatchTime string `json:"securityPatchTime,omitempty"` 801 802 // SerialNumber: Serial Number of device. Example: HT82V1A01076. 803 SerialNumber string `json:"serialNumber,omitempty"` 804 805 // WifiMacAddresses: WiFi MAC addresses of device. 806 WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"` 807 808 // ServerResponse contains the HTTP response code and headers from the 809 // server. 810 googleapi.ServerResponse `json:"-"` 811 812 // ForceSendFields is a list of field names (e.g. 813 // "AndroidSpecificAttributes") to unconditionally include in API 814 // requests. By default, fields with empty or default values are omitted 815 // from API requests. However, any non-pointer, non-interface field 816 // appearing in ForceSendFields will be sent to the server regardless of 817 // whether the field is empty or not. This may be used to include empty 818 // fields in Patch requests. 819 ForceSendFields []string `json:"-"` 820 821 // NullFields is a list of field names (e.g. 822 // "AndroidSpecificAttributes") to include in API requests with the JSON 823 // null value. By default, fields with empty values are omitted from API 824 // requests. However, any field with an empty value appearing in 825 // NullFields will be sent to the server as null. It is an error if a 826 // field in this list has a non-empty value. This may be used to include 827 // null fields in Patch requests. 828 NullFields []string `json:"-"` 829} 830 831func (s *Device) MarshalJSON() ([]byte, error) { 832 type NoMethod Device 833 raw := NoMethod(*s) 834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 835} 836 837// DeviceUser: Represents a user's use of a Device in the Cloud Identity 838// Devices API. A DeviceUser is a resource representing a user's use of 839// a Device 840type DeviceUser struct { 841 // CompromisedState: Compromised State of the DeviceUser object 842 // 843 // Possible values: 844 // "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User 845 // account is unknown or unspecified. 846 // "COMPROMISED" - Device User Account is compromised. 847 // "NOT_COMPROMISED" - Device User Account is not compromised. 848 CompromisedState string `json:"compromisedState,omitempty"` 849 850 // CreateTime: When the user first signed in to the device 851 CreateTime string `json:"createTime,omitempty"` 852 853 // FirstSyncTime: Output only. Most recent time when user registered 854 // with this service. 855 FirstSyncTime string `json:"firstSyncTime,omitempty"` 856 857 // LanguageCode: Output only. Default locale used on device, in IETF 858 // BCP-47 format. 859 LanguageCode string `json:"languageCode,omitempty"` 860 861 // LastSyncTime: Output only. Last time when user synced with policies. 862 LastSyncTime string `json:"lastSyncTime,omitempty"` 863 864 // ManagementState: Output only. Management state of the user on the 865 // device. 866 // 867 // Possible values: 868 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 869 // unused. 870 // "WIPING" - This user's data and profile is being removed from the 871 // device. 872 // "WIPED" - This user's data and profile is removed from the device. 873 // "APPROVED" - User is approved to access data on the device. 874 // "BLOCKED" - User is blocked from accessing data on the device. 875 // "PENDING_APPROVAL" - User is awaiting approval. 876 // "UNENROLLED" - User is unenrolled from Advanced Windows Management, 877 // but the Windows account is still intact. 878 ManagementState string `json:"managementState,omitempty"` 879 880 // Name: Output only. Resource name 881 // (https://cloud.google.com/apis/design/resource_names) of the 882 // DeviceUser in format: 883 // `devices/{device_id}/deviceUsers/{device_user_id}`, where 884 // `device_user_id` uniquely identifies a user's use of a device. 885 Name string `json:"name,omitempty"` 886 887 // PasswordState: Password state of the DeviceUser object 888 // 889 // Possible values: 890 // "PASSWORD_STATE_UNSPECIFIED" - Password state not set. 891 // "PASSWORD_SET" - Password set in object. 892 // "PASSWORD_NOT_SET" - Password not set in object. 893 PasswordState string `json:"passwordState,omitempty"` 894 895 // UserAgent: Output only. User agent on the device for this specific 896 // user 897 UserAgent string `json:"userAgent,omitempty"` 898 899 // UserEmail: Email address of the user registered on the device. 900 UserEmail string `json:"userEmail,omitempty"` 901 902 // ServerResponse contains the HTTP response code and headers from the 903 // server. 904 googleapi.ServerResponse `json:"-"` 905 906 // ForceSendFields is a list of field names (e.g. "CompromisedState") to 907 // unconditionally include in API requests. By default, fields with 908 // empty or default values are omitted from API requests. However, any 909 // non-pointer, non-interface field appearing in ForceSendFields will be 910 // sent to the server regardless of whether the field is empty or not. 911 // This may be used to include empty fields in Patch requests. 912 ForceSendFields []string `json:"-"` 913 914 // NullFields is a list of field names (e.g. "CompromisedState") to 915 // include in API requests with the JSON null value. By default, fields 916 // with empty values are omitted from API requests. However, any field 917 // with an empty value appearing in NullFields will be sent to the 918 // server as null. It is an error if a field in this list has a 919 // non-empty value. This may be used to include null fields in Patch 920 // requests. 921 NullFields []string `json:"-"` 922} 923 924func (s *DeviceUser) MarshalJSON() ([]byte, error) { 925 type NoMethod DeviceUser 926 raw := NoMethod(*s) 927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 928} 929 930// DynamicGroupMetadata: Dynamic group metadata like queries and status. 931type DynamicGroupMetadata struct { 932 // Queries: Memberships will be the union of all queries. Only one entry 933 // with USER resource is currently supported. Customers can create up to 934 // 100 dynamic groups. 935 Queries []*DynamicGroupQuery `json:"queries,omitempty"` 936 937 // Status: Output only. Status of the dynamic group. 938 Status *DynamicGroupStatus `json:"status,omitempty"` 939 940 // ForceSendFields is a list of field names (e.g. "Queries") to 941 // unconditionally include in API requests. By default, fields with 942 // empty or default values are omitted from API requests. However, any 943 // non-pointer, non-interface field appearing in ForceSendFields will be 944 // sent to the server regardless of whether the field is empty or not. 945 // This may be used to include empty fields in Patch requests. 946 ForceSendFields []string `json:"-"` 947 948 // NullFields is a list of field names (e.g. "Queries") to include in 949 // API requests with the JSON null value. By default, fields with empty 950 // values are omitted from API requests. However, any field with an 951 // empty value appearing in NullFields will be sent to the server as 952 // null. It is an error if a field in this list has a non-empty value. 953 // This may be used to include null fields in Patch requests. 954 NullFields []string `json:"-"` 955} 956 957func (s *DynamicGroupMetadata) MarshalJSON() ([]byte, error) { 958 type NoMethod DynamicGroupMetadata 959 raw := NoMethod(*s) 960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 961} 962 963// DynamicGroupQuery: Defines a query on a resource. 964type DynamicGroupQuery struct { 965 // Query: Query that determines the memberships of the dynamic group. 966 // Examples: All users with at least one `organizations.department` of 967 // engineering. `user.organizations.exists(org, 968 // org.department=='engineering')` All users with at least one location 969 // that has `area` of `foo` and `building_id` of `bar`. 970 // `user.locations.exists(loc, loc.area=='foo' && 971 // loc.building_id=='bar')` All users with any variation of the name 972 // John Doe (case-insensitive queries add `equalsIgnoreCase()` to the 973 // value being queried). `user.name.value.equalsIgnoreCase('jOhn DoE')` 974 Query string `json:"query,omitempty"` 975 976 // Possible values: 977 // "RESOURCE_TYPE_UNSPECIFIED" - Default value (not valid) 978 // "USER" - For queries on User 979 ResourceType string `json:"resourceType,omitempty"` 980 981 // ForceSendFields is a list of field names (e.g. "Query") to 982 // unconditionally include in API requests. By default, fields with 983 // empty or default values are omitted from API requests. However, any 984 // non-pointer, non-interface field appearing in ForceSendFields will be 985 // sent to the server regardless of whether the field is empty or not. 986 // This may be used to include empty fields in Patch requests. 987 ForceSendFields []string `json:"-"` 988 989 // NullFields is a list of field names (e.g. "Query") to include in API 990 // requests with the JSON null value. By default, fields with empty 991 // values are omitted from API requests. However, any field with an 992 // empty value appearing in NullFields will be sent to the server as 993 // null. It is an error if a field in this list has a non-empty value. 994 // This may be used to include null fields in Patch requests. 995 NullFields []string `json:"-"` 996} 997 998func (s *DynamicGroupQuery) MarshalJSON() ([]byte, error) { 999 type NoMethod DynamicGroupQuery 1000 raw := NoMethod(*s) 1001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1002} 1003 1004// DynamicGroupStatus: The current status of a dynamic group along with 1005// timestamp. 1006type DynamicGroupStatus struct { 1007 // Status: Status of the dynamic group. 1008 // 1009 // Possible values: 1010 // "STATUS_UNSPECIFIED" - Default. 1011 // "UP_TO_DATE" - The dynamic group is up-to-date. 1012 // "UPDATING_MEMBERSHIPS" - The dynamic group has just been created 1013 // and memberships are being updated. 1014 // "INVALID_QUERY" - Group is in an unrecoverable state and its 1015 // memberships can't be updated. 1016 Status string `json:"status,omitempty"` 1017 1018 // StatusTime: The latest time at which the dynamic group is guaranteed 1019 // to be in the given status. If status is `UP_TO_DATE`, the latest time 1020 // at which the dynamic group was confirmed to be up-to-date. If status 1021 // is `UPDATING_MEMBERSHIPS`, the time at which dynamic group was 1022 // created. 1023 StatusTime string `json:"statusTime,omitempty"` 1024 1025 // ForceSendFields is a list of field names (e.g. "Status") to 1026 // unconditionally include in API requests. By default, fields with 1027 // empty or default values are omitted from API requests. However, any 1028 // non-pointer, non-interface field appearing in ForceSendFields will be 1029 // sent to the server regardless of whether the field is empty or not. 1030 // This may be used to include empty fields in Patch requests. 1031 ForceSendFields []string `json:"-"` 1032 1033 // NullFields is a list of field names (e.g. "Status") to include in API 1034 // requests with the JSON null value. By default, fields with empty 1035 // values are omitted from API requests. However, any field with an 1036 // empty value appearing in NullFields will be sent to the server as 1037 // null. It is an error if a field in this list has a non-empty value. 1038 // This may be used to include null fields in Patch requests. 1039 NullFields []string `json:"-"` 1040} 1041 1042func (s *DynamicGroupStatus) MarshalJSON() ([]byte, error) { 1043 type NoMethod DynamicGroupStatus 1044 raw := NoMethod(*s) 1045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1046} 1047 1048// EntityKey: A unique identifier for an entity in the Cloud Identity 1049// Groups API. An entity can represent either a group with an optional 1050// `namespace` or a user without a `namespace`. The combination of `id` 1051// and `namespace` must be unique; however, the same `id` can be used 1052// with different `namespace`s. 1053type EntityKey struct { 1054 // Id: The ID of the entity. For Google-managed entities, the `id` must 1055 // be the email address of an existing group or user. For 1056 // external-identity-mapped entities, the `id` must be a string 1057 // conforming to the Identity Source's requirements. Must be unique 1058 // within a `namespace`. 1059 Id string `json:"id,omitempty"` 1060 1061 // Namespace: The namespace in which the entity exists. If not 1062 // specified, the `EntityKey` represents a Google-managed entity such as 1063 // a Google user or a Google Group. If specified, the `EntityKey` 1064 // represents an external-identity-mapped group. The namespace must 1065 // correspond to an identity source created in Admin Console and must be 1066 // in the form of `identitysources/{identity_source_id}`. 1067 Namespace string `json:"namespace,omitempty"` 1068 1069 // ForceSendFields is a list of field names (e.g. "Id") to 1070 // unconditionally include in API requests. By default, fields with 1071 // empty or default values are omitted from API requests. However, any 1072 // non-pointer, non-interface field appearing in ForceSendFields will be 1073 // sent to the server regardless of whether the field is empty or not. 1074 // This may be used to include empty fields in Patch requests. 1075 ForceSendFields []string `json:"-"` 1076 1077 // NullFields is a list of field names (e.g. "Id") to include in API 1078 // requests with the JSON null value. By default, fields with empty 1079 // values are omitted from API requests. However, any field with an 1080 // empty value appearing in NullFields will be sent to the server as 1081 // null. It is an error if a field in this list has a non-empty value. 1082 // This may be used to include null fields in Patch requests. 1083 NullFields []string `json:"-"` 1084} 1085 1086func (s *EntityKey) MarshalJSON() ([]byte, error) { 1087 type NoMethod EntityKey 1088 raw := NoMethod(*s) 1089 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1090} 1091 1092// ExpiryDetail: The `MembershipRole` expiry details. 1093type ExpiryDetail struct { 1094 // ExpireTime: The time at which the `MembershipRole` will expire. 1095 ExpireTime string `json:"expireTime,omitempty"` 1096 1097 // ForceSendFields is a list of field names (e.g. "ExpireTime") to 1098 // unconditionally include in API requests. By default, fields with 1099 // empty or default values are omitted from API requests. However, any 1100 // non-pointer, non-interface field appearing in ForceSendFields will be 1101 // sent to the server regardless of whether the field is empty or not. 1102 // This may be used to include empty fields in Patch requests. 1103 ForceSendFields []string `json:"-"` 1104 1105 // NullFields is a list of field names (e.g. "ExpireTime") to include in 1106 // API requests with the JSON null value. By default, fields with empty 1107 // values are omitted from API requests. However, any field with an 1108 // empty value appearing in NullFields will be sent to the server as 1109 // null. It is an error if a field in this list has a non-empty value. 1110 // This may be used to include null fields in Patch requests. 1111 NullFields []string `json:"-"` 1112} 1113 1114func (s *ExpiryDetail) MarshalJSON() ([]byte, error) { 1115 type NoMethod ExpiryDetail 1116 raw := NoMethod(*s) 1117 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1118} 1119 1120// GetMembershipGraphResponse: The response message for 1121// MembershipsService.GetMembershipGraph. 1122type GetMembershipGraphResponse struct { 1123 // AdjacencyList: The membership graph's path information represented as 1124 // an adjacency list. 1125 AdjacencyList []*MembershipAdjacencyList `json:"adjacencyList,omitempty"` 1126 1127 // Groups: The resources representing each group in the adjacency list. 1128 // Each group in this list can be correlated to a 'group' of the 1129 // MembershipAdjacencyList using the 'name' of the Group resource. 1130 Groups []*Group `json:"groups,omitempty"` 1131 1132 // ForceSendFields is a list of field names (e.g. "AdjacencyList") to 1133 // unconditionally include in API requests. By default, fields with 1134 // empty or default values are omitted from API requests. However, any 1135 // non-pointer, non-interface field appearing in ForceSendFields will be 1136 // sent to the server regardless of whether the field is empty or not. 1137 // This may be used to include empty fields in Patch requests. 1138 ForceSendFields []string `json:"-"` 1139 1140 // NullFields is a list of field names (e.g. "AdjacencyList") to include 1141 // in API requests with the JSON null value. By default, fields with 1142 // empty values are omitted from API requests. However, any field with 1143 // an empty value appearing in NullFields will be sent to the server as 1144 // null. It is an error if a field in this list has a non-empty value. 1145 // This may be used to include null fields in Patch requests. 1146 NullFields []string `json:"-"` 1147} 1148 1149func (s *GetMembershipGraphResponse) MarshalJSON() ([]byte, error) { 1150 type NoMethod GetMembershipGraphResponse 1151 raw := NoMethod(*s) 1152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1153} 1154 1155// GoogleAppsCloudidentityDevicesV1AndroidAttributes: Resource 1156// representing the Android specific attributes of a Device. 1157type GoogleAppsCloudidentityDevicesV1AndroidAttributes struct { 1158 // EnabledUnknownSources: Whether applications from unknown sources can 1159 // be installed on device. 1160 EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"` 1161 1162 // OwnerProfileAccount: Whether this account is on an owner/primary 1163 // profile. For phones, only true for owner profiles. Android 4+ devices 1164 // can have secondary or restricted user profiles. 1165 OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"` 1166 1167 // OwnershipPrivilege: Ownership privileges on device. 1168 // 1169 // Possible values: 1170 // "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set. 1171 // "DEVICE_ADMINISTRATOR" - Active device administrator privileges on 1172 // the device. 1173 // "PROFILE_OWNER" - Profile Owner privileges. The account is in a 1174 // managed corporate profile. 1175 // "DEVICE_OWNER" - Device Owner privileges on the device. 1176 OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"` 1177 1178 // SupportsWorkProfile: Whether device supports Android work profiles. 1179 // If false, this service will not block access to corp data even if an 1180 // administrator turns on the "Enforce Work Profile" policy. 1181 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 1182 1183 // ForceSendFields is a list of field names (e.g. 1184 // "EnabledUnknownSources") to unconditionally include in API requests. 1185 // By default, fields with empty or default values are omitted from API 1186 // requests. However, any non-pointer, non-interface field appearing in 1187 // ForceSendFields will be sent to the server regardless of whether the 1188 // field is empty or not. This may be used to include empty fields in 1189 // Patch requests. 1190 ForceSendFields []string `json:"-"` 1191 1192 // NullFields is a list of field names (e.g. "EnabledUnknownSources") to 1193 // include in API requests with the JSON null value. By default, fields 1194 // with empty values are omitted from API requests. However, any field 1195 // with an empty value appearing in NullFields will be sent to the 1196 // server as null. It is an error if a field in this list has a 1197 // non-empty value. This may be used to include null fields in Patch 1198 // requests. 1199 NullFields []string `json:"-"` 1200} 1201 1202func (s *GoogleAppsCloudidentityDevicesV1AndroidAttributes) MarshalJSON() ([]byte, error) { 1203 type NoMethod GoogleAppsCloudidentityDevicesV1AndroidAttributes 1204 raw := NoMethod(*s) 1205 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1206} 1207 1208// GoogleAppsCloudidentityDevicesV1ApproveDeviceUserMetadata: Metadata 1209// for ApproveDeviceUser LRO. 1210type GoogleAppsCloudidentityDevicesV1ApproveDeviceUserMetadata struct { 1211} 1212 1213// GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse: Response 1214// message for approving the device to access user data. 1215type GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse struct { 1216 // DeviceUser: Resultant DeviceUser object for the action. 1217 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1218 1219 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1220 // unconditionally include in API requests. By default, fields with 1221 // empty or default values are omitted from API requests. However, any 1222 // non-pointer, non-interface field appearing in ForceSendFields will be 1223 // sent to the server regardless of whether the field is empty or not. 1224 // This may be used to include empty fields in Patch requests. 1225 ForceSendFields []string `json:"-"` 1226 1227 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1228 // API requests with the JSON null value. By default, fields with empty 1229 // values are omitted from API requests. However, any field with an 1230 // empty value appearing in NullFields will be sent to the server as 1231 // null. It is an error if a field in this list has a non-empty value. 1232 // This may be used to include null fields in Patch requests. 1233 NullFields []string `json:"-"` 1234} 1235 1236func (s *GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) { 1237 type NoMethod GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse 1238 raw := NoMethod(*s) 1239 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1240} 1241 1242// GoogleAppsCloudidentityDevicesV1BlockDeviceUserMetadata: Metadata for 1243// BlockDeviceUser LRO. 1244type GoogleAppsCloudidentityDevicesV1BlockDeviceUserMetadata struct { 1245} 1246 1247// GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse: Response 1248// message for blocking the device from accessing user data. 1249type GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse struct { 1250 // DeviceUser: Resultant DeviceUser object for the action. 1251 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1252 1253 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1254 // unconditionally include in API requests. By default, fields with 1255 // empty or default values are omitted from API requests. However, any 1256 // non-pointer, non-interface field appearing in ForceSendFields will be 1257 // sent to the server regardless of whether the field is empty or not. 1258 // This may be used to include empty fields in Patch requests. 1259 ForceSendFields []string `json:"-"` 1260 1261 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1262 // API requests with the JSON null value. By default, fields with empty 1263 // values are omitted from API requests. However, any field with an 1264 // empty value appearing in NullFields will be sent to the server as 1265 // null. It is an error if a field in this list has a non-empty value. 1266 // This may be used to include null fields in Patch requests. 1267 NullFields []string `json:"-"` 1268} 1269 1270func (s *GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse) MarshalJSON() ([]byte, error) { 1271 type NoMethod GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse 1272 raw := NoMethod(*s) 1273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1274} 1275 1276// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceMetadata: Metadata 1277// for CancelWipeDevice LRO. 1278type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceMetadata struct { 1279} 1280 1281// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse: Response 1282// message for cancelling an unfinished device wipe. 1283type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse struct { 1284 // Device: Resultant Device object for the action. Note that asset tags 1285 // will not be returned in the device object. 1286 Device *GoogleAppsCloudidentityDevicesV1Device `json:"device,omitempty"` 1287 1288 // ForceSendFields is a list of field names (e.g. "Device") to 1289 // unconditionally include in API requests. By default, fields with 1290 // empty or default values are omitted from API requests. However, any 1291 // non-pointer, non-interface field appearing in ForceSendFields will be 1292 // sent to the server regardless of whether the field is empty or not. 1293 // This may be used to include empty fields in Patch requests. 1294 ForceSendFields []string `json:"-"` 1295 1296 // NullFields is a list of field names (e.g. "Device") to include in API 1297 // requests with the JSON null value. By default, fields with empty 1298 // values are omitted from API requests. However, any field with an 1299 // empty value appearing in NullFields will be sent to the server as 1300 // null. It is an error if a field in this list has a non-empty value. 1301 // This may be used to include null fields in Patch requests. 1302 NullFields []string `json:"-"` 1303} 1304 1305func (s *GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) { 1306 type NoMethod GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse 1307 raw := NoMethod(*s) 1308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1309} 1310 1311// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserMetadata: 1312// Metadata for CancelWipeDeviceUser LRO. 1313type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserMetadata struct { 1314} 1315 1316// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse: 1317// Response message for cancelling an unfinished user account wipe. 1318type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse struct { 1319 // DeviceUser: Resultant DeviceUser object for the action. 1320 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1321 1322 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1323 // unconditionally include in API requests. By default, fields with 1324 // empty or default values are omitted from API requests. However, any 1325 // non-pointer, non-interface field appearing in ForceSendFields will be 1326 // sent to the server regardless of whether the field is empty or not. 1327 // This may be used to include empty fields in Patch requests. 1328 ForceSendFields []string `json:"-"` 1329 1330 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1331 // API requests with the JSON null value. By default, fields with empty 1332 // values are omitted from API requests. However, any field with an 1333 // empty value appearing in NullFields will be sent to the server as 1334 // null. It is an error if a field in this list has a non-empty value. 1335 // This may be used to include null fields in Patch requests. 1336 NullFields []string `json:"-"` 1337} 1338 1339func (s *GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 1340 type NoMethod GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse 1341 raw := NoMethod(*s) 1342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1343} 1344 1345// GoogleAppsCloudidentityDevicesV1ClientState: Represents the state 1346// associated with an API client calling the Devices API. Resource 1347// representing ClientState and supports updates from API users 1348type GoogleAppsCloudidentityDevicesV1ClientState struct { 1349 // AssetTags: The caller can specify asset tags for this resource 1350 AssetTags []string `json:"assetTags,omitempty"` 1351 1352 // ComplianceState: The compliance state of the resource as specified by 1353 // the API client. 1354 // 1355 // Possible values: 1356 // "COMPLIANCE_STATE_UNSPECIFIED" - The compliance state of the 1357 // resource is unknown or unspecified. 1358 // "COMPLIANT" - Device is compliant with third party policies 1359 // "NON_COMPLIANT" - Device is not compliant with third party policies 1360 ComplianceState string `json:"complianceState,omitempty"` 1361 1362 // CreateTime: Output only. The time the client state data was created. 1363 CreateTime string `json:"createTime,omitempty"` 1364 1365 // CustomId: This field may be used to store a unique identifier for the 1366 // API resource within which these CustomAttributes are a field. 1367 CustomId string `json:"customId,omitempty"` 1368 1369 // Etag: The token that needs to be passed back for concurrency control 1370 // in updates. Token needs to be passed back in UpdateRequest 1371 Etag string `json:"etag,omitempty"` 1372 1373 // HealthScore: The Health score of the resource. The Health score is 1374 // the callers specification of the condition of the device from a 1375 // usability point of view. For example, a third-party device management 1376 // provider may specify a health score based on its compliance with 1377 // organizational policies. 1378 // 1379 // Possible values: 1380 // "HEALTH_SCORE_UNSPECIFIED" - Default value 1381 // "VERY_POOR" - The object is in very poor health as defined by the 1382 // caller. 1383 // "POOR" - The object is in poor health as defined by the caller. 1384 // "NEUTRAL" - The object health is neither good nor poor, as defined 1385 // by the caller. 1386 // "GOOD" - The object is in good health as defined by the caller. 1387 // "VERY_GOOD" - The object is in very good health as defined by the 1388 // caller. 1389 HealthScore string `json:"healthScore,omitempty"` 1390 1391 // KeyValuePairs: The map of key-value attributes stored by callers 1392 // specific to a device. The total serialized length of this map may not 1393 // exceed 10KB. No limit is placed on the number of attributes in a map. 1394 KeyValuePairs map[string]GoogleAppsCloudidentityDevicesV1CustomAttributeValue `json:"keyValuePairs,omitempty"` 1395 1396 // LastUpdateTime: Output only. The time the client state data was last 1397 // updated. 1398 LastUpdateTime string `json:"lastUpdateTime,omitempty"` 1399 1400 // Managed: The management state of the resource as specified by the API 1401 // client. 1402 // 1403 // Possible values: 1404 // "MANAGED_STATE_UNSPECIFIED" - The management state of the resource 1405 // is unknown or unspecified. 1406 // "MANAGED" - The resource is managed. 1407 // "UNMANAGED" - The resource is not managed. 1408 Managed string `json:"managed,omitempty"` 1409 1410 // Name: Output only. Resource name 1411 // (https://cloud.google.com/apis/design/resource_names) of the 1412 // ClientState in format: 1413 // `devices/{device}/deviceUsers/{device_user}/clientState/{partner}`, 1414 // where partner corresponds to the partner storing the data. For 1415 // partners belonging to the "BeyondCorp Alliance", this is the partner 1416 // ID specified to you by Google. For all other callers, this is a 1417 // string of the form: `{customer}-suffix`, where `customer` is your 1418 // customer ID. The *suffix* is any string the caller specifies. This 1419 // string will be displayed verbatim in the administration console. This 1420 // suffix is used in setting up Custom Access Levels in Context-Aware 1421 // Access. Your organization's customer ID can be obtained from the URL: 1422 // `GET 1423 // https://www.googleapis.com/admin/directory/v1/customers/my_customer` 1424 // The `id` field in the response contains the customer ID starting with 1425 // the letter 'C'. The customer ID to be used in this API is the string 1426 // after the letter 'C' (not including 'C') 1427 Name string `json:"name,omitempty"` 1428 1429 // OwnerType: Output only. The owner of the ClientState 1430 // 1431 // Possible values: 1432 // "OWNER_TYPE_UNSPECIFIED" - Unknown owner type 1433 // "OWNER_TYPE_CUSTOMER" - Customer is the owner 1434 // "OWNER_TYPE_PARTNER" - Partner is the owner 1435 OwnerType string `json:"ownerType,omitempty"` 1436 1437 // ScoreReason: A descriptive cause of the health score. 1438 ScoreReason string `json:"scoreReason,omitempty"` 1439 1440 // ForceSendFields is a list of field names (e.g. "AssetTags") to 1441 // unconditionally include in API requests. By default, fields with 1442 // empty or default values are omitted from API requests. However, any 1443 // non-pointer, non-interface field appearing in ForceSendFields will be 1444 // sent to the server regardless of whether the field is empty or not. 1445 // This may be used to include empty fields in Patch requests. 1446 ForceSendFields []string `json:"-"` 1447 1448 // NullFields is a list of field names (e.g. "AssetTags") to include in 1449 // API requests with the JSON null value. By default, fields with empty 1450 // values are omitted from API requests. However, any field with an 1451 // empty value appearing in NullFields will be sent to the server as 1452 // null. It is an error if a field in this list has a non-empty value. 1453 // This may be used to include null fields in Patch requests. 1454 NullFields []string `json:"-"` 1455} 1456 1457func (s *GoogleAppsCloudidentityDevicesV1ClientState) MarshalJSON() ([]byte, error) { 1458 type NoMethod GoogleAppsCloudidentityDevicesV1ClientState 1459 raw := NoMethod(*s) 1460 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1461} 1462 1463// GoogleAppsCloudidentityDevicesV1CreateDeviceMetadata: Metadata for 1464// CreateDevice LRO. 1465type GoogleAppsCloudidentityDevicesV1CreateDeviceMetadata struct { 1466} 1467 1468// GoogleAppsCloudidentityDevicesV1CustomAttributeValue: Additional 1469// custom attribute values may be one of these types 1470type GoogleAppsCloudidentityDevicesV1CustomAttributeValue struct { 1471 // BoolValue: Represents a boolean value. 1472 BoolValue bool `json:"boolValue,omitempty"` 1473 1474 // NumberValue: Represents a double value. 1475 NumberValue float64 `json:"numberValue,omitempty"` 1476 1477 // StringValue: Represents a string value. 1478 StringValue string `json:"stringValue,omitempty"` 1479 1480 // ForceSendFields is a list of field names (e.g. "BoolValue") to 1481 // unconditionally include in API requests. By default, fields with 1482 // empty or default values are omitted from API requests. However, any 1483 // non-pointer, non-interface field appearing in ForceSendFields will be 1484 // sent to the server regardless of whether the field is empty or not. 1485 // This may be used to include empty fields in Patch requests. 1486 ForceSendFields []string `json:"-"` 1487 1488 // NullFields is a list of field names (e.g. "BoolValue") to include in 1489 // API requests with the JSON null value. By default, fields with empty 1490 // values are omitted from API requests. However, any field with an 1491 // empty value appearing in NullFields will be sent to the server as 1492 // null. It is an error if a field in this list has a non-empty value. 1493 // This may be used to include null fields in Patch requests. 1494 NullFields []string `json:"-"` 1495} 1496 1497func (s *GoogleAppsCloudidentityDevicesV1CustomAttributeValue) MarshalJSON() ([]byte, error) { 1498 type NoMethod GoogleAppsCloudidentityDevicesV1CustomAttributeValue 1499 raw := NoMethod(*s) 1500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1501} 1502 1503func (s *GoogleAppsCloudidentityDevicesV1CustomAttributeValue) UnmarshalJSON(data []byte) error { 1504 type NoMethod GoogleAppsCloudidentityDevicesV1CustomAttributeValue 1505 var s1 struct { 1506 NumberValue gensupport.JSONFloat64 `json:"numberValue"` 1507 *NoMethod 1508 } 1509 s1.NoMethod = (*NoMethod)(s) 1510 if err := json.Unmarshal(data, &s1); err != nil { 1511 return err 1512 } 1513 s.NumberValue = float64(s1.NumberValue) 1514 return nil 1515} 1516 1517// GoogleAppsCloudidentityDevicesV1DeleteDeviceMetadata: Metadata for 1518// DeleteDevice LRO. 1519type GoogleAppsCloudidentityDevicesV1DeleteDeviceMetadata struct { 1520} 1521 1522// GoogleAppsCloudidentityDevicesV1DeleteDeviceUserMetadata: Metadata 1523// for DeleteDeviceUser LRO. 1524type GoogleAppsCloudidentityDevicesV1DeleteDeviceUserMetadata struct { 1525} 1526 1527// GoogleAppsCloudidentityDevicesV1Device: A Device within the Cloud 1528// Identity Devices API. Represents a Device known to Google Cloud, 1529// independent of the device ownership, type, and whether it is assigned 1530// or in use by a user. 1531type GoogleAppsCloudidentityDevicesV1Device struct { 1532 // AndroidSpecificAttributes: Output only. Attributes specific to 1533 // Android devices. 1534 AndroidSpecificAttributes *GoogleAppsCloudidentityDevicesV1AndroidAttributes `json:"androidSpecificAttributes,omitempty"` 1535 1536 // AssetTag: Asset tag of the device. 1537 AssetTag string `json:"assetTag,omitempty"` 1538 1539 // BasebandVersion: Output only. Baseband version of the device. 1540 BasebandVersion string `json:"basebandVersion,omitempty"` 1541 1542 // BootloaderVersion: Output only. Device bootloader version. Example: 1543 // 0.6.7. 1544 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 1545 1546 // Brand: Output only. Device brand. Example: Samsung. 1547 Brand string `json:"brand,omitempty"` 1548 1549 // BuildNumber: Output only. Build number of the device. 1550 BuildNumber string `json:"buildNumber,omitempty"` 1551 1552 // CompromisedState: Output only. Represents whether the Device is 1553 // compromised. 1554 // 1555 // Possible values: 1556 // "COMPROMISED_STATE_UNSPECIFIED" - Default value. 1557 // "COMPROMISED" - The device is compromised (currently, this means 1558 // Android device is rooted). 1559 // "UNCOMPROMISED" - The device is safe (currently, this means Android 1560 // device is unrooted). 1561 CompromisedState string `json:"compromisedState,omitempty"` 1562 1563 // CreateTime: Output only. When the Company-Owned device was imported. 1564 // This field is empty for BYOD devices. 1565 CreateTime string `json:"createTime,omitempty"` 1566 1567 // DeviceType: Output only. Type of device. 1568 // 1569 // Possible values: 1570 // "DEVICE_TYPE_UNSPECIFIED" - Unknown device type 1571 // "ANDROID" - Device is an Android device 1572 // "IOS" - Device is an iOS device 1573 // "GOOGLE_SYNC" - Device is a Google Sync device. 1574 // "WINDOWS" - Device is a Windows device. 1575 // "MAC_OS" - Device is a MacOS device. 1576 // "LINUX" - Device is a Linux device. 1577 // "CHROME_OS" - Device is a ChromeOS device. 1578 DeviceType string `json:"deviceType,omitempty"` 1579 1580 // EnabledDeveloperOptions: Output only. Whether developer options is 1581 // enabled on device. 1582 EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"` 1583 1584 // EnabledUsbDebugging: Output only. Whether USB debugging is enabled on 1585 // device. 1586 EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"` 1587 1588 // EncryptionState: Output only. Device encryption state. 1589 // 1590 // Possible values: 1591 // "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set. 1592 // "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption. 1593 // "ENCRYPTED" - Device is encrypted. 1594 // "NOT_ENCRYPTED" - Device is not encrypted. 1595 EncryptionState string `json:"encryptionState,omitempty"` 1596 1597 // Imei: Output only. IMEI number of device if GSM device; empty 1598 // otherwise. 1599 Imei string `json:"imei,omitempty"` 1600 1601 // KernelVersion: Output only. Kernel version of the device. 1602 KernelVersion string `json:"kernelVersion,omitempty"` 1603 1604 // LastSyncTime: Most recent time when device synced with this service. 1605 LastSyncTime string `json:"lastSyncTime,omitempty"` 1606 1607 // ManagementState: Output only. Management state of the device 1608 // 1609 // Possible values: 1610 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 1611 // unused. 1612 // "APPROVED" - Device is approved. 1613 // "BLOCKED" - Device is blocked. 1614 // "PENDING" - Device is pending approval. 1615 // "UNPROVISIONED" - The device is not provisioned. Device will start 1616 // from this state until some action is taken (i.e. a user starts using 1617 // the device). 1618 // "WIPING" - Data and settings on the device are being removed. 1619 // "WIPED" - All data and settings on the device are removed. 1620 ManagementState string `json:"managementState,omitempty"` 1621 1622 // Manufacturer: Output only. Device manufacturer. Example: Motorola. 1623 Manufacturer string `json:"manufacturer,omitempty"` 1624 1625 // Meid: Output only. MEID number of device if CDMA device; empty 1626 // otherwise. 1627 Meid string `json:"meid,omitempty"` 1628 1629 // Model: Output only. Model name of device. Example: Pixel 3. 1630 Model string `json:"model,omitempty"` 1631 1632 // Name: Output only. Resource name 1633 // (https://cloud.google.com/apis/design/resource_names) of the Device 1634 // in format: `devices/{device}`, where device is the unique id assigned 1635 // to the Device. 1636 Name string `json:"name,omitempty"` 1637 1638 // NetworkOperator: Output only. Mobile or network operator of device, 1639 // if available. 1640 NetworkOperator string `json:"networkOperator,omitempty"` 1641 1642 // OsVersion: Output only. OS version of the device. Example: Android 1643 // 8.1.0. 1644 OsVersion string `json:"osVersion,omitempty"` 1645 1646 // OtherAccounts: Output only. Domain name for Google accounts on 1647 // device. Type for other accounts on device. On Android, will only be 1648 // populated if |ownership_privilege| is |PROFILE_OWNER| or 1649 // |DEVICE_OWNER|. Does not include the account signed in to the device 1650 // policy app if that account's domain has only one account. Examples: 1651 // "com.example", "xyz.com". 1652 OtherAccounts []string `json:"otherAccounts,omitempty"` 1653 1654 // OwnerType: Output only. Whether the device is owned by the company or 1655 // an individual 1656 // 1657 // Possible values: 1658 // "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is 1659 // unused. 1660 // "COMPANY" - Company owns the device. 1661 // "BYOD" - Bring Your Own Device (i.e. individual owns the device) 1662 OwnerType string `json:"ownerType,omitempty"` 1663 1664 // ReleaseVersion: Output only. OS release version. Example: 6.0. 1665 ReleaseVersion string `json:"releaseVersion,omitempty"` 1666 1667 // SecurityPatchTime: Output only. OS security patch update time on 1668 // device. 1669 SecurityPatchTime string `json:"securityPatchTime,omitempty"` 1670 1671 // SerialNumber: Serial Number of device. Example: HT82V1A01076. 1672 SerialNumber string `json:"serialNumber,omitempty"` 1673 1674 // WifiMacAddresses: WiFi MAC addresses of device. 1675 WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"` 1676 1677 // ForceSendFields is a list of field names (e.g. 1678 // "AndroidSpecificAttributes") to unconditionally include in API 1679 // requests. By default, fields with empty or default values are omitted 1680 // from API requests. However, any non-pointer, non-interface field 1681 // appearing in ForceSendFields will be sent to the server regardless of 1682 // whether the field is empty or not. This may be used to include empty 1683 // fields in Patch requests. 1684 ForceSendFields []string `json:"-"` 1685 1686 // NullFields is a list of field names (e.g. 1687 // "AndroidSpecificAttributes") to include in API requests with the JSON 1688 // null value. By default, fields with empty values are omitted from API 1689 // requests. However, any field with an empty value appearing in 1690 // NullFields will be sent to the server as null. It is an error if a 1691 // field in this list has a non-empty value. This may be used to include 1692 // null fields in Patch requests. 1693 NullFields []string `json:"-"` 1694} 1695 1696func (s *GoogleAppsCloudidentityDevicesV1Device) MarshalJSON() ([]byte, error) { 1697 type NoMethod GoogleAppsCloudidentityDevicesV1Device 1698 raw := NoMethod(*s) 1699 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1700} 1701 1702// GoogleAppsCloudidentityDevicesV1DeviceUser: Represents a user's use 1703// of a Device in the Cloud Identity Devices API. A DeviceUser is a 1704// resource representing a user's use of a Device 1705type GoogleAppsCloudidentityDevicesV1DeviceUser struct { 1706 // CompromisedState: Compromised State of the DeviceUser object 1707 // 1708 // Possible values: 1709 // "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User 1710 // account is unknown or unspecified. 1711 // "COMPROMISED" - Device User Account is compromised. 1712 // "NOT_COMPROMISED" - Device User Account is not compromised. 1713 CompromisedState string `json:"compromisedState,omitempty"` 1714 1715 // CreateTime: When the user first signed in to the device 1716 CreateTime string `json:"createTime,omitempty"` 1717 1718 // FirstSyncTime: Output only. Most recent time when user registered 1719 // with this service. 1720 FirstSyncTime string `json:"firstSyncTime,omitempty"` 1721 1722 // LanguageCode: Output only. Default locale used on device, in IETF 1723 // BCP-47 format. 1724 LanguageCode string `json:"languageCode,omitempty"` 1725 1726 // LastSyncTime: Output only. Last time when user synced with policies. 1727 LastSyncTime string `json:"lastSyncTime,omitempty"` 1728 1729 // ManagementState: Output only. Management state of the user on the 1730 // device. 1731 // 1732 // Possible values: 1733 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 1734 // unused. 1735 // "WIPING" - This user's data and profile is being removed from the 1736 // device. 1737 // "WIPED" - This user's data and profile is removed from the device. 1738 // "APPROVED" - User is approved to access data on the device. 1739 // "BLOCKED" - User is blocked from accessing data on the device. 1740 // "PENDING_APPROVAL" - User is awaiting approval. 1741 // "UNENROLLED" - User is unenrolled from Advanced Windows Management, 1742 // but the Windows account is still intact. 1743 ManagementState string `json:"managementState,omitempty"` 1744 1745 // Name: Output only. Resource name 1746 // (https://cloud.google.com/apis/design/resource_names) of the 1747 // DeviceUser in format: `devices/{device}/deviceUsers/{device_user}`, 1748 // where `device_user` uniquely identifies a user's use of a device. 1749 Name string `json:"name,omitempty"` 1750 1751 // PasswordState: Password state of the DeviceUser object 1752 // 1753 // Possible values: 1754 // "PASSWORD_STATE_UNSPECIFIED" - Password state not set. 1755 // "PASSWORD_SET" - Password set in object. 1756 // "PASSWORD_NOT_SET" - Password not set in object. 1757 PasswordState string `json:"passwordState,omitempty"` 1758 1759 // UserAgent: Output only. User agent on the device for this specific 1760 // user 1761 UserAgent string `json:"userAgent,omitempty"` 1762 1763 // UserEmail: Email address of the user registered on the device. 1764 UserEmail string `json:"userEmail,omitempty"` 1765 1766 // ForceSendFields is a list of field names (e.g. "CompromisedState") to 1767 // unconditionally include in API requests. By default, fields with 1768 // empty or default values are omitted from API requests. However, any 1769 // non-pointer, non-interface field appearing in ForceSendFields will be 1770 // sent to the server regardless of whether the field is empty or not. 1771 // This may be used to include empty fields in Patch requests. 1772 ForceSendFields []string `json:"-"` 1773 1774 // NullFields is a list of field names (e.g. "CompromisedState") to 1775 // include in API requests with the JSON null value. By default, fields 1776 // with empty values are omitted from API requests. However, any field 1777 // with an empty value appearing in NullFields will be sent to the 1778 // server as null. It is an error if a field in this list has a 1779 // non-empty value. This may be used to include null fields in Patch 1780 // requests. 1781 NullFields []string `json:"-"` 1782} 1783 1784func (s *GoogleAppsCloudidentityDevicesV1DeviceUser) MarshalJSON() ([]byte, error) { 1785 type NoMethod GoogleAppsCloudidentityDevicesV1DeviceUser 1786 raw := NoMethod(*s) 1787 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1788} 1789 1790// GoogleAppsCloudidentityDevicesV1ListEndpointAppsMetadata: Metadata 1791// for ListEndpointApps LRO. 1792type GoogleAppsCloudidentityDevicesV1ListEndpointAppsMetadata struct { 1793} 1794 1795// GoogleAppsCloudidentityDevicesV1SignoutDeviceUserMetadata: Metadata 1796// for SignoutDeviceUser LRO. 1797type GoogleAppsCloudidentityDevicesV1SignoutDeviceUserMetadata struct { 1798} 1799 1800// GoogleAppsCloudidentityDevicesV1UpdateClientStateMetadata: Metadata 1801// for UpdateClientState LRO. 1802type GoogleAppsCloudidentityDevicesV1UpdateClientStateMetadata struct { 1803} 1804 1805// GoogleAppsCloudidentityDevicesV1UpdateDeviceMetadata: Metadata for 1806// UpdateDevice LRO. 1807type GoogleAppsCloudidentityDevicesV1UpdateDeviceMetadata struct { 1808} 1809 1810// GoogleAppsCloudidentityDevicesV1WipeDeviceMetadata: Metadata for 1811// WipeDevice LRO. 1812type GoogleAppsCloudidentityDevicesV1WipeDeviceMetadata struct { 1813} 1814 1815// GoogleAppsCloudidentityDevicesV1WipeDeviceResponse: Response message 1816// for wiping all data on the device. 1817type GoogleAppsCloudidentityDevicesV1WipeDeviceResponse struct { 1818 // Device: Resultant Device object for the action. Note that asset tags 1819 // will not be returned in the device object. 1820 Device *GoogleAppsCloudidentityDevicesV1Device `json:"device,omitempty"` 1821 1822 // ForceSendFields is a list of field names (e.g. "Device") to 1823 // unconditionally include in API requests. By default, fields with 1824 // empty or default values are omitted from API requests. However, any 1825 // non-pointer, non-interface field appearing in ForceSendFields will be 1826 // sent to the server regardless of whether the field is empty or not. 1827 // This may be used to include empty fields in Patch requests. 1828 ForceSendFields []string `json:"-"` 1829 1830 // NullFields is a list of field names (e.g. "Device") to include in API 1831 // requests with the JSON null value. By default, fields with empty 1832 // values are omitted from API requests. However, any field with an 1833 // empty value appearing in NullFields will be sent to the server as 1834 // null. It is an error if a field in this list has a non-empty value. 1835 // This may be used to include null fields in Patch requests. 1836 NullFields []string `json:"-"` 1837} 1838 1839func (s *GoogleAppsCloudidentityDevicesV1WipeDeviceResponse) MarshalJSON() ([]byte, error) { 1840 type NoMethod GoogleAppsCloudidentityDevicesV1WipeDeviceResponse 1841 raw := NoMethod(*s) 1842 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1843} 1844 1845// GoogleAppsCloudidentityDevicesV1WipeDeviceUserMetadata: Metadata for 1846// WipeDeviceUser LRO. 1847type GoogleAppsCloudidentityDevicesV1WipeDeviceUserMetadata struct { 1848} 1849 1850// GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse: Response 1851// message for wiping the user's account from the device. 1852type GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse struct { 1853 // DeviceUser: Resultant DeviceUser object for the action. 1854 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1855 1856 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1857 // unconditionally include in API requests. By default, fields with 1858 // empty or default values are omitted from API requests. However, any 1859 // non-pointer, non-interface field appearing in ForceSendFields will be 1860 // sent to the server regardless of whether the field is empty or not. 1861 // This may be used to include empty fields in Patch requests. 1862 ForceSendFields []string `json:"-"` 1863 1864 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1865 // API requests with the JSON null value. By default, fields with empty 1866 // values are omitted from API requests. However, any field with an 1867 // empty value appearing in NullFields will be sent to the server as 1868 // null. It is an error if a field in this list has a non-empty value. 1869 // This may be used to include null fields in Patch requests. 1870 NullFields []string `json:"-"` 1871} 1872 1873func (s *GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 1874 type NoMethod GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse 1875 raw := NoMethod(*s) 1876 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1877} 1878 1879// Group: A group within the Cloud Identity Groups API. A `Group` is a 1880// collection of entities, where each entity is either a user, another 1881// group, or a service account. 1882type Group struct { 1883 // AdditionalGroupKeys: Additional entity key aliases for a Group. 1884 AdditionalGroupKeys []*EntityKey `json:"additionalGroupKeys,omitempty"` 1885 1886 // CreateTime: Output only. The time when the `Group` was created. 1887 CreateTime string `json:"createTime,omitempty"` 1888 1889 // Description: An extended description to help users determine the 1890 // purpose of a `Group`. Must not be longer than 4,096 characters. 1891 Description string `json:"description,omitempty"` 1892 1893 // DisplayName: The display name of the `Group`. 1894 DisplayName string `json:"displayName,omitempty"` 1895 1896 // DynamicGroupMetadata: Optional. Dynamic group metadata like queries 1897 // and status. 1898 DynamicGroupMetadata *DynamicGroupMetadata `json:"dynamicGroupMetadata,omitempty"` 1899 1900 // GroupKey: Required. Immutable. The `EntityKey` of the `Group`. 1901 GroupKey *EntityKey `json:"groupKey,omitempty"` 1902 1903 // Labels: Required. One or more label entries that apply to the Group. 1904 // Currently supported labels contain a key with an empty value. Google 1905 // Groups are the default type of group and have a label with a key of 1906 // `cloudidentity.googleapis.com/groups.discussion_forum` and an empty 1907 // value. Existing Google Groups can have an additional label with a key 1908 // of `cloudidentity.googleapis.com/groups.security` and an empty value 1909 // added to them. **This is an immutable change and the security label 1910 // cannot be removed once added.** Dynamic groups have a label with a 1911 // key of `cloudidentity.googleapis.com/groups.dynamic`. Identity-mapped 1912 // groups for Cloud Search have a label with a key of 1913 // `system/groups/external` and an empty value. 1914 Labels map[string]string `json:"labels,omitempty"` 1915 1916 // Name: Output only. The resource name 1917 // (https://cloud.google.com/apis/design/resource_names) of the `Group`. 1918 // Shall be of the form `groups/{group_id}`. 1919 Name string `json:"name,omitempty"` 1920 1921 // Parent: Required. Immutable. The resource name of the entity under 1922 // which this `Group` resides in the Cloud Identity resource hierarchy. 1923 // Must be of the form `identitysources/{identity_source_id}` for 1924 // external- identity-mapped groups or `customers/{customer_id}` for 1925 // Google Groups. The `customer_id` must begin with "C" (for example, 1926 // 'C046psxkn'). 1927 Parent string `json:"parent,omitempty"` 1928 1929 // PosixGroups: Optional. The POSIX groups associated with the `Group`. 1930 PosixGroups []*PosixGroup `json:"posixGroups,omitempty"` 1931 1932 // UpdateTime: Output only. The time when the `Group` was last updated. 1933 UpdateTime string `json:"updateTime,omitempty"` 1934 1935 // ServerResponse contains the HTTP response code and headers from the 1936 // server. 1937 googleapi.ServerResponse `json:"-"` 1938 1939 // ForceSendFields is a list of field names (e.g. "AdditionalGroupKeys") 1940 // to unconditionally include in API requests. By default, fields with 1941 // empty or default values are omitted from API requests. However, any 1942 // non-pointer, non-interface field appearing in ForceSendFields will be 1943 // sent to the server regardless of whether the field is empty or not. 1944 // This may be used to include empty fields in Patch requests. 1945 ForceSendFields []string `json:"-"` 1946 1947 // NullFields is a list of field names (e.g. "AdditionalGroupKeys") to 1948 // include in API requests with the JSON null value. By default, fields 1949 // with empty values are omitted from API requests. However, any field 1950 // with an empty value appearing in NullFields will be sent to the 1951 // server as null. It is an error if a field in this list has a 1952 // non-empty value. This may be used to include null fields in Patch 1953 // requests. 1954 NullFields []string `json:"-"` 1955} 1956 1957func (s *Group) MarshalJSON() ([]byte, error) { 1958 type NoMethod Group 1959 raw := NoMethod(*s) 1960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1961} 1962 1963// GroupRelation: Message representing a transitive group of a user or a 1964// group. 1965type GroupRelation struct { 1966 // DisplayName: Display name for this group. 1967 DisplayName string `json:"displayName,omitempty"` 1968 1969 // Group: Resource name for this group. 1970 Group string `json:"group,omitempty"` 1971 1972 // GroupKey: Entity key has an id and a namespace. In case of discussion 1973 // forums, the id will be an email address without a namespace. 1974 GroupKey *EntityKey `json:"groupKey,omitempty"` 1975 1976 // Labels: Labels for Group resource. 1977 Labels map[string]string `json:"labels,omitempty"` 1978 1979 // RelationType: The relation between the member and the transitive 1980 // group. 1981 // 1982 // Possible values: 1983 // "RELATION_TYPE_UNSPECIFIED" - The relation type is undefined or 1984 // undetermined. 1985 // "DIRECT" - The two entities have only a direct membership with each 1986 // other. 1987 // "INDIRECT" - The two entities have only an indirect membership with 1988 // each other. 1989 // "DIRECT_AND_INDIRECT" - The two entities have both a direct and an 1990 // indirect membership with each other. 1991 RelationType string `json:"relationType,omitempty"` 1992 1993 // Roles: Membership roles of the member for the group. 1994 Roles []*TransitiveMembershipRole `json:"roles,omitempty"` 1995 1996 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1997 // unconditionally include in API requests. By default, fields with 1998 // empty or default values are omitted from API requests. However, any 1999 // non-pointer, non-interface field appearing in ForceSendFields will be 2000 // sent to the server regardless of whether the field is empty or not. 2001 // This may be used to include empty fields in Patch requests. 2002 ForceSendFields []string `json:"-"` 2003 2004 // NullFields is a list of field names (e.g. "DisplayName") to include 2005 // in API requests with the JSON null value. By default, fields with 2006 // empty values are omitted from API requests. However, any field with 2007 // an empty value appearing in NullFields will be sent to the server as 2008 // null. It is an error if a field in this list has a non-empty value. 2009 // This may be used to include null fields in Patch requests. 2010 NullFields []string `json:"-"` 2011} 2012 2013func (s *GroupRelation) MarshalJSON() ([]byte, error) { 2014 type NoMethod GroupRelation 2015 raw := NoMethod(*s) 2016 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2017} 2018 2019// IsInvitableUserResponse: Response for IsInvitableUser RPC. 2020type IsInvitableUserResponse struct { 2021 // IsInvitableUser: Returns true if the email address is invitable. 2022 IsInvitableUser bool `json:"isInvitableUser,omitempty"` 2023 2024 // ServerResponse contains the HTTP response code and headers from the 2025 // server. 2026 googleapi.ServerResponse `json:"-"` 2027 2028 // ForceSendFields is a list of field names (e.g. "IsInvitableUser") to 2029 // unconditionally include in API requests. By default, fields with 2030 // empty or default values are omitted from API requests. However, any 2031 // non-pointer, non-interface field appearing in ForceSendFields will be 2032 // sent to the server regardless of whether the field is empty or not. 2033 // This may be used to include empty fields in Patch requests. 2034 ForceSendFields []string `json:"-"` 2035 2036 // NullFields is a list of field names (e.g. "IsInvitableUser") to 2037 // include in API requests with the JSON null value. By default, fields 2038 // with empty values are omitted from API requests. However, any field 2039 // with an empty value appearing in NullFields will be sent to the 2040 // server as null. It is an error if a field in this list has a 2041 // non-empty value. This may be used to include null fields in Patch 2042 // requests. 2043 NullFields []string `json:"-"` 2044} 2045 2046func (s *IsInvitableUserResponse) MarshalJSON() ([]byte, error) { 2047 type NoMethod IsInvitableUserResponse 2048 raw := NoMethod(*s) 2049 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2050} 2051 2052// ListClientStatesResponse: Response message that is returned in LRO 2053// result of ListClientStates Operation. 2054type ListClientStatesResponse struct { 2055 // ClientStates: Client states meeting the list restrictions. 2056 ClientStates []*ClientState `json:"clientStates,omitempty"` 2057 2058 // NextPageToken: Token to retrieve the next page of results. Empty if 2059 // there are no more results. 2060 NextPageToken string `json:"nextPageToken,omitempty"` 2061 2062 // ForceSendFields is a list of field names (e.g. "ClientStates") to 2063 // unconditionally include in API requests. By default, fields with 2064 // empty or default values are omitted from API requests. However, any 2065 // non-pointer, non-interface field appearing in ForceSendFields will be 2066 // sent to the server regardless of whether the field is empty or not. 2067 // This may be used to include empty fields in Patch requests. 2068 ForceSendFields []string `json:"-"` 2069 2070 // NullFields is a list of field names (e.g. "ClientStates") to include 2071 // in API requests with the JSON null value. By default, fields with 2072 // empty values are omitted from API requests. However, any field with 2073 // an empty value appearing in NullFields will be sent to the server as 2074 // null. It is an error if a field in this list has a non-empty value. 2075 // This may be used to include null fields in Patch requests. 2076 NullFields []string `json:"-"` 2077} 2078 2079func (s *ListClientStatesResponse) MarshalJSON() ([]byte, error) { 2080 type NoMethod ListClientStatesResponse 2081 raw := NoMethod(*s) 2082 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2083} 2084 2085// ListDeviceUsersResponse: Response message that is returned from the 2086// ListDeviceUsers method. 2087type ListDeviceUsersResponse struct { 2088 // DeviceUsers: Devices meeting the list restrictions. 2089 DeviceUsers []*DeviceUser `json:"deviceUsers,omitempty"` 2090 2091 // NextPageToken: Token to retrieve the next page of results. Empty if 2092 // there are no more results. 2093 NextPageToken string `json:"nextPageToken,omitempty"` 2094 2095 // ServerResponse contains the HTTP response code and headers from the 2096 // server. 2097 googleapi.ServerResponse `json:"-"` 2098 2099 // ForceSendFields is a list of field names (e.g. "DeviceUsers") to 2100 // unconditionally include in API requests. By default, fields with 2101 // empty or default values are omitted from API requests. However, any 2102 // non-pointer, non-interface field appearing in ForceSendFields will be 2103 // sent to the server regardless of whether the field is empty or not. 2104 // This may be used to include empty fields in Patch requests. 2105 ForceSendFields []string `json:"-"` 2106 2107 // NullFields is a list of field names (e.g. "DeviceUsers") to include 2108 // in API requests with the JSON null value. By default, fields with 2109 // empty values are omitted from API requests. However, any field with 2110 // an empty value appearing in NullFields will be sent to the server as 2111 // null. It is an error if a field in this list has a non-empty value. 2112 // This may be used to include null fields in Patch requests. 2113 NullFields []string `json:"-"` 2114} 2115 2116func (s *ListDeviceUsersResponse) MarshalJSON() ([]byte, error) { 2117 type NoMethod ListDeviceUsersResponse 2118 raw := NoMethod(*s) 2119 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2120} 2121 2122// ListDevicesResponse: Response message that is returned from the 2123// ListDevices method. 2124type ListDevicesResponse struct { 2125 // Devices: Devices meeting the list restrictions. 2126 Devices []*Device `json:"devices,omitempty"` 2127 2128 // NextPageToken: Token to retrieve the next page of results. Empty if 2129 // there are no more results. 2130 NextPageToken string `json:"nextPageToken,omitempty"` 2131 2132 // ServerResponse contains the HTTP response code and headers from the 2133 // server. 2134 googleapi.ServerResponse `json:"-"` 2135 2136 // ForceSendFields is a list of field names (e.g. "Devices") to 2137 // unconditionally include in API requests. By default, fields with 2138 // empty or default values are omitted from API requests. However, any 2139 // non-pointer, non-interface field appearing in ForceSendFields will be 2140 // sent to the server regardless of whether the field is empty or not. 2141 // This may be used to include empty fields in Patch requests. 2142 ForceSendFields []string `json:"-"` 2143 2144 // NullFields is a list of field names (e.g. "Devices") to include in 2145 // API requests with the JSON null value. By default, fields with empty 2146 // values are omitted from API requests. However, any field with an 2147 // empty value appearing in NullFields will be sent to the server as 2148 // null. It is an error if a field in this list has a non-empty value. 2149 // This may be used to include null fields in Patch requests. 2150 NullFields []string `json:"-"` 2151} 2152 2153func (s *ListDevicesResponse) MarshalJSON() ([]byte, error) { 2154 type NoMethod ListDevicesResponse 2155 raw := NoMethod(*s) 2156 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2157} 2158 2159// ListGroupsResponse: The response message for 2160// GroupsService.ListGroups. 2161type ListGroupsResponse struct { 2162 // Groups: The `Group` resources under the specified `parent`. 2163 Groups []*Group `json:"groups,omitempty"` 2164 2165 // NextPageToken: A continuation token to retrieve the next page of 2166 // results, or empty if there are no more results available. 2167 NextPageToken string `json:"nextPageToken,omitempty"` 2168 2169 // ServerResponse contains the HTTP response code and headers from the 2170 // server. 2171 googleapi.ServerResponse `json:"-"` 2172 2173 // ForceSendFields is a list of field names (e.g. "Groups") to 2174 // unconditionally include in API requests. By default, fields with 2175 // empty or default values are omitted from API requests. However, any 2176 // non-pointer, non-interface field appearing in ForceSendFields will be 2177 // sent to the server regardless of whether the field is empty or not. 2178 // This may be used to include empty fields in Patch requests. 2179 ForceSendFields []string `json:"-"` 2180 2181 // NullFields is a list of field names (e.g. "Groups") to include in API 2182 // requests with the JSON null value. By default, fields with empty 2183 // values are omitted from API requests. However, any field with an 2184 // empty value appearing in NullFields will be sent to the server as 2185 // null. It is an error if a field in this list has a non-empty value. 2186 // This may be used to include null fields in Patch requests. 2187 NullFields []string `json:"-"` 2188} 2189 2190func (s *ListGroupsResponse) MarshalJSON() ([]byte, error) { 2191 type NoMethod ListGroupsResponse 2192 raw := NoMethod(*s) 2193 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2194} 2195 2196// ListMembershipsResponse: The response message for 2197// MembershipsService.ListMemberships. 2198type ListMembershipsResponse struct { 2199 // Memberships: The `Membership`s under the specified `parent`. 2200 Memberships []*Membership `json:"memberships,omitempty"` 2201 2202 // NextPageToken: A continuation token to retrieve the next page of 2203 // results, or empty if there are no more results available. 2204 NextPageToken string `json:"nextPageToken,omitempty"` 2205 2206 // ServerResponse contains the HTTP response code and headers from the 2207 // server. 2208 googleapi.ServerResponse `json:"-"` 2209 2210 // ForceSendFields is a list of field names (e.g. "Memberships") to 2211 // unconditionally include in API requests. By default, fields with 2212 // empty or default values are omitted from API requests. However, any 2213 // non-pointer, non-interface field appearing in ForceSendFields will be 2214 // sent to the server regardless of whether the field is empty or not. 2215 // This may be used to include empty fields in Patch requests. 2216 ForceSendFields []string `json:"-"` 2217 2218 // NullFields is a list of field names (e.g. "Memberships") to include 2219 // in API requests with the JSON null value. By default, fields with 2220 // empty values are omitted from API requests. However, any field with 2221 // an empty value appearing in NullFields will be sent to the server as 2222 // null. It is an error if a field in this list has a non-empty value. 2223 // This may be used to include null fields in Patch requests. 2224 NullFields []string `json:"-"` 2225} 2226 2227func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) { 2228 type NoMethod ListMembershipsResponse 2229 raw := NoMethod(*s) 2230 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2231} 2232 2233// ListUserInvitationsResponse: Response message for UserInvitation 2234// listing request. 2235type ListUserInvitationsResponse struct { 2236 // NextPageToken: The token for the next page. If not empty, indicates 2237 // that there may be more `UserInvitation` resources that match the 2238 // listing request; this value can be used in a subsequent 2239 // ListUserInvitationsRequest to get continued results with the current 2240 // list call. 2241 NextPageToken string `json:"nextPageToken,omitempty"` 2242 2243 // UserInvitations: The list of UserInvitation resources. 2244 UserInvitations []*UserInvitation `json:"userInvitations,omitempty"` 2245 2246 // ServerResponse contains the HTTP response code and headers from the 2247 // server. 2248 googleapi.ServerResponse `json:"-"` 2249 2250 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2251 // unconditionally include in API requests. By default, fields with 2252 // empty or default values are omitted from API requests. However, any 2253 // non-pointer, non-interface field appearing in ForceSendFields will be 2254 // sent to the server regardless of whether the field is empty or not. 2255 // This may be used to include empty fields in Patch requests. 2256 ForceSendFields []string `json:"-"` 2257 2258 // NullFields is a list of field names (e.g. "NextPageToken") to include 2259 // in API requests with the JSON null value. By default, fields with 2260 // empty values are omitted from API requests. However, any field with 2261 // an empty value appearing in NullFields will be sent to the server as 2262 // null. It is an error if a field in this list has a non-empty value. 2263 // This may be used to include null fields in Patch requests. 2264 NullFields []string `json:"-"` 2265} 2266 2267func (s *ListUserInvitationsResponse) MarshalJSON() ([]byte, error) { 2268 type NoMethod ListUserInvitationsResponse 2269 raw := NoMethod(*s) 2270 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2271} 2272 2273// LookupGroupNameResponse: The response message for 2274// GroupsService.LookupGroupName. 2275type LookupGroupNameResponse struct { 2276 // Name: Output only. The resource name 2277 // (https://cloud.google.com/apis/design/resource_names) of the 2278 // looked-up `Group`. 2279 Name string `json:"name,omitempty"` 2280 2281 // ServerResponse contains the HTTP response code and headers from the 2282 // server. 2283 googleapi.ServerResponse `json:"-"` 2284 2285 // ForceSendFields is a list of field names (e.g. "Name") to 2286 // unconditionally include in API requests. By default, fields with 2287 // empty or default values are omitted from API requests. However, any 2288 // non-pointer, non-interface field appearing in ForceSendFields will be 2289 // sent to the server regardless of whether the field is empty or not. 2290 // This may be used to include empty fields in Patch requests. 2291 ForceSendFields []string `json:"-"` 2292 2293 // NullFields is a list of field names (e.g. "Name") to include in API 2294 // requests with the JSON null value. By default, fields with empty 2295 // values are omitted from API requests. However, any field with an 2296 // empty value appearing in NullFields will be sent to the server as 2297 // null. It is an error if a field in this list has a non-empty value. 2298 // This may be used to include null fields in Patch requests. 2299 NullFields []string `json:"-"` 2300} 2301 2302func (s *LookupGroupNameResponse) MarshalJSON() ([]byte, error) { 2303 type NoMethod LookupGroupNameResponse 2304 raw := NoMethod(*s) 2305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2306} 2307 2308// LookupMembershipNameResponse: The response message for 2309// MembershipsService.LookupMembershipName. 2310type LookupMembershipNameResponse struct { 2311 // Name: The resource name 2312 // (https://cloud.google.com/apis/design/resource_names) of the 2313 // looked-up `Membership`. Must be of the form 2314 // `groups/{group_id}/memberships/{membership_id}`. 2315 Name string `json:"name,omitempty"` 2316 2317 // ServerResponse contains the HTTP response code and headers from the 2318 // server. 2319 googleapi.ServerResponse `json:"-"` 2320 2321 // ForceSendFields is a list of field names (e.g. "Name") to 2322 // unconditionally include in API requests. By default, fields with 2323 // empty or default values are omitted from API requests. However, any 2324 // non-pointer, non-interface field appearing in ForceSendFields will be 2325 // sent to the server regardless of whether the field is empty or not. 2326 // This may be used to include empty fields in Patch requests. 2327 ForceSendFields []string `json:"-"` 2328 2329 // NullFields is a list of field names (e.g. "Name") to include in API 2330 // requests with the JSON null value. By default, fields with empty 2331 // values are omitted from API requests. However, any field with an 2332 // empty value appearing in NullFields will be sent to the server as 2333 // null. It is an error if a field in this list has a non-empty value. 2334 // This may be used to include null fields in Patch requests. 2335 NullFields []string `json:"-"` 2336} 2337 2338func (s *LookupMembershipNameResponse) MarshalJSON() ([]byte, error) { 2339 type NoMethod LookupMembershipNameResponse 2340 raw := NoMethod(*s) 2341 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2342} 2343 2344// LookupSelfDeviceUsersResponse: Response containing resource names of 2345// the DeviceUsers associated with the caller's credentials. 2346type LookupSelfDeviceUsersResponse struct { 2347 // Customer: The obfuscated customer Id that may be passed back to other 2348 // Devices API methods such as List, Get, etc. 2349 Customer string `json:"customer,omitempty"` 2350 2351 // Names: Resource names 2352 // (https://cloud.google.com/apis/design/resource_names) of the 2353 // DeviceUsers in the format: 2354 // `devices/{device_id}/deviceUsers/{user_resource_id}`, where device_id 2355 // is the unique ID assigned to a Device and user_resource_id is the 2356 // unique user ID 2357 Names []string `json:"names,omitempty"` 2358 2359 // NextPageToken: Token to retrieve the next page of results. Empty if 2360 // there are no more results. 2361 NextPageToken string `json:"nextPageToken,omitempty"` 2362 2363 // ServerResponse contains the HTTP response code and headers from the 2364 // server. 2365 googleapi.ServerResponse `json:"-"` 2366 2367 // ForceSendFields is a list of field names (e.g. "Customer") to 2368 // unconditionally include in API requests. By default, fields with 2369 // empty or default values are omitted from API requests. However, any 2370 // non-pointer, non-interface field appearing in ForceSendFields will be 2371 // sent to the server regardless of whether the field is empty or not. 2372 // This may be used to include empty fields in Patch requests. 2373 ForceSendFields []string `json:"-"` 2374 2375 // NullFields is a list of field names (e.g. "Customer") to include in 2376 // API requests with the JSON null value. By default, fields with empty 2377 // values are omitted from API requests. However, any field with an 2378 // empty value appearing in NullFields will be sent to the server as 2379 // null. It is an error if a field in this list has a non-empty value. 2380 // This may be used to include null fields in Patch requests. 2381 NullFields []string `json:"-"` 2382} 2383 2384func (s *LookupSelfDeviceUsersResponse) MarshalJSON() ([]byte, error) { 2385 type NoMethod LookupSelfDeviceUsersResponse 2386 raw := NoMethod(*s) 2387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2388} 2389 2390// MemberRelation: Message representing a transitive membership of a 2391// group. 2392type MemberRelation struct { 2393 // Member: Resource name for this member. 2394 Member string `json:"member,omitempty"` 2395 2396 // PreferredMemberKey: Entity key has an id and a namespace. In case of 2397 // discussion forums, the id will be an email address without a 2398 // namespace. 2399 PreferredMemberKey []*EntityKey `json:"preferredMemberKey,omitempty"` 2400 2401 // RelationType: The relation between the group and the transitive 2402 // membership. 2403 // 2404 // Possible values: 2405 // "RELATION_TYPE_UNSPECIFIED" - The relation type is undefined or 2406 // undetermined. 2407 // "DIRECT" - The two entities have only a direct membership with each 2408 // other. 2409 // "INDIRECT" - The two entities have only an indirect membership with 2410 // each other. 2411 // "DIRECT_AND_INDIRECT" - The two entities have both a direct and an 2412 // indirect membership with each other. 2413 RelationType string `json:"relationType,omitempty"` 2414 2415 // Roles: The membership role details (i.e name of role and expiry 2416 // time). 2417 Roles []*TransitiveMembershipRole `json:"roles,omitempty"` 2418 2419 // ForceSendFields is a list of field names (e.g. "Member") to 2420 // unconditionally include in API requests. By default, fields with 2421 // empty or default values are omitted from API requests. However, any 2422 // non-pointer, non-interface field appearing in ForceSendFields will be 2423 // sent to the server regardless of whether the field is empty or not. 2424 // This may be used to include empty fields in Patch requests. 2425 ForceSendFields []string `json:"-"` 2426 2427 // NullFields is a list of field names (e.g. "Member") to include in API 2428 // requests with the JSON null value. By default, fields with empty 2429 // values are omitted from API requests. However, any field with an 2430 // empty value appearing in NullFields will be sent to the server as 2431 // null. It is an error if a field in this list has a non-empty value. 2432 // This may be used to include null fields in Patch requests. 2433 NullFields []string `json:"-"` 2434} 2435 2436func (s *MemberRelation) MarshalJSON() ([]byte, error) { 2437 type NoMethod MemberRelation 2438 raw := NoMethod(*s) 2439 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2440} 2441 2442// MemberRestriction: The definition of MemberRestriction 2443type MemberRestriction struct { 2444 // Evaluation: The evaluated state of this restriction on a group. 2445 Evaluation *RestrictionEvaluation `json:"evaluation,omitempty"` 2446 2447 // Query: Member Restriction as defined by CEL expression. Supported 2448 // restrictions are: `member.customer_id` and `member.type`. Valid 2449 // values for `member.type` are `1`, `2` and `3`. They correspond to 2450 // USER, SERVICE_ACCOUNT, and GROUP respectively. The value for 2451 // `member.customer_id` only supports `groupCustomerId()` currently 2452 // which means the customer id of the group will be used for 2453 // restriction. Supported operators are `&&`, `||` and `==`, 2454 // corresponding to AND, OR, and EQUAL. Examples: Allow only service 2455 // accounts of given customer to be members. `member.type == 2 && 2456 // member.customer_id == groupCustomerId()` Allow only users or groups 2457 // to be members. `member.type == 1 || member.type == 3` 2458 Query string `json:"query,omitempty"` 2459 2460 // ForceSendFields is a list of field names (e.g. "Evaluation") to 2461 // unconditionally include in API requests. By default, fields with 2462 // empty or default values are omitted from API requests. However, any 2463 // non-pointer, non-interface field appearing in ForceSendFields will be 2464 // sent to the server regardless of whether the field is empty or not. 2465 // This may be used to include empty fields in Patch requests. 2466 ForceSendFields []string `json:"-"` 2467 2468 // NullFields is a list of field names (e.g. "Evaluation") to include in 2469 // API requests with the JSON null value. By default, fields with empty 2470 // values are omitted from API requests. However, any field with an 2471 // empty value appearing in NullFields will be sent to the server as 2472 // null. It is an error if a field in this list has a non-empty value. 2473 // This may be used to include null fields in Patch requests. 2474 NullFields []string `json:"-"` 2475} 2476 2477func (s *MemberRestriction) MarshalJSON() ([]byte, error) { 2478 type NoMethod MemberRestriction 2479 raw := NoMethod(*s) 2480 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2481} 2482 2483// Membership: A membership within the Cloud Identity Groups API. A 2484// `Membership` defines a relationship between a `Group` and an entity 2485// belonging to that `Group`, referred to as a "member". 2486type Membership struct { 2487 // CreateTime: Output only. The time when the `Membership` was created. 2488 CreateTime string `json:"createTime,omitempty"` 2489 2490 // MemberKey: Immutable. The `EntityKey` of the member. Either 2491 // `member_key` or `preferred_member_key` must be set when calling 2492 // MembershipsService.CreateMembership but not both; both shall be set 2493 // when returned. 2494 MemberKey *EntityKey `json:"memberKey,omitempty"` 2495 2496 // Name: Output only. The resource name 2497 // (https://cloud.google.com/apis/design/resource_names) of the 2498 // `Membership`. Shall be of the form 2499 // `groups/{group_id}/memberships/{membership_id}`. 2500 Name string `json:"name,omitempty"` 2501 2502 // PreferredMemberKey: Required. Immutable. The `EntityKey` of the 2503 // member. Either `member_key` or `preferred_member_key` must be set 2504 // when calling MembershipsService.CreateMembership but not both; both 2505 // shall be set when returned. 2506 PreferredMemberKey *EntityKey `json:"preferredMemberKey,omitempty"` 2507 2508 // Roles: The `MembershipRole`s that apply to the `Membership`. If 2509 // unspecified, defaults to a single `MembershipRole` with `name` 2510 // `MEMBER`. Must not contain duplicate `MembershipRole`s with the same 2511 // `name`. 2512 Roles []*MembershipRole `json:"roles,omitempty"` 2513 2514 // Type: Output only. The type of the membership. 2515 // 2516 // Possible values: 2517 // "TYPE_UNSPECIFIED" - Default. Should not be used. 2518 // "USER" - Represents user type. 2519 // "SERVICE_ACCOUNT" - Represents service account type. 2520 // "GROUP" - Represents group type. 2521 // "SHARED_DRIVE" - Represents Shared drive. 2522 // "OTHER" - Represents other type. 2523 Type string `json:"type,omitempty"` 2524 2525 // UpdateTime: Output only. The time when the `Membership` was last 2526 // updated. 2527 UpdateTime string `json:"updateTime,omitempty"` 2528 2529 // ServerResponse contains the HTTP response code and headers from the 2530 // server. 2531 googleapi.ServerResponse `json:"-"` 2532 2533 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2534 // unconditionally include in API requests. By default, fields with 2535 // empty or default values are omitted from API requests. However, any 2536 // non-pointer, non-interface field appearing in ForceSendFields will be 2537 // sent to the server regardless of whether the field is empty or not. 2538 // This may be used to include empty fields in Patch requests. 2539 ForceSendFields []string `json:"-"` 2540 2541 // NullFields is a list of field names (e.g. "CreateTime") to include in 2542 // API requests with the JSON null value. By default, fields with empty 2543 // values are omitted from API requests. However, any field with an 2544 // empty value appearing in NullFields will be sent to the server as 2545 // null. It is an error if a field in this list has a non-empty value. 2546 // This may be used to include null fields in Patch requests. 2547 NullFields []string `json:"-"` 2548} 2549 2550func (s *Membership) MarshalJSON() ([]byte, error) { 2551 type NoMethod Membership 2552 raw := NoMethod(*s) 2553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2554} 2555 2556// MembershipAdjacencyList: Membership graph's path information as an 2557// adjacency list. 2558type MembershipAdjacencyList struct { 2559 // Edges: Each edge contains information about the member that belongs 2560 // to this group. Note: Fields returned here will help identify the 2561 // specific Membership resource (e.g name, preferred_member_key and 2562 // role), but may not be a comprehensive list of all fields. 2563 Edges []*Membership `json:"edges,omitempty"` 2564 2565 // Group: Resource name of the group that the members belong to. 2566 Group string `json:"group,omitempty"` 2567 2568 // ForceSendFields is a list of field names (e.g. "Edges") to 2569 // unconditionally include in API requests. By default, fields with 2570 // empty or default values are omitted from API requests. However, any 2571 // non-pointer, non-interface field appearing in ForceSendFields will be 2572 // sent to the server regardless of whether the field is empty or not. 2573 // This may be used to include empty fields in Patch requests. 2574 ForceSendFields []string `json:"-"` 2575 2576 // NullFields is a list of field names (e.g. "Edges") to include in API 2577 // requests with the JSON null value. By default, fields with empty 2578 // values are omitted from API requests. However, any field with an 2579 // empty value appearing in NullFields will be sent to the server as 2580 // null. It is an error if a field in this list has a non-empty value. 2581 // This may be used to include null fields in Patch requests. 2582 NullFields []string `json:"-"` 2583} 2584 2585func (s *MembershipAdjacencyList) MarshalJSON() ([]byte, error) { 2586 type NoMethod MembershipAdjacencyList 2587 raw := NoMethod(*s) 2588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2589} 2590 2591// MembershipRole: A membership role within the Cloud Identity Groups 2592// API. A `MembershipRole` defines the privileges granted to a 2593// `Membership`. 2594type MembershipRole struct { 2595 // ExpiryDetail: The expiry details of the `MembershipRole`. Expiry 2596 // details are only supported for `MEMBER` `MembershipRoles`. May be set 2597 // if `name` is `MEMBER`. Must not be set if `name` is any other value. 2598 ExpiryDetail *ExpiryDetail `json:"expiryDetail,omitempty"` 2599 2600 // Name: The name of the `MembershipRole`. Must be one of `OWNER`, 2601 // `MANAGER`, `MEMBER`. 2602 Name string `json:"name,omitempty"` 2603 2604 // RestrictionEvaluations: Evaluations of restrictions applied to parent 2605 // group on this membership. 2606 RestrictionEvaluations *RestrictionEvaluations `json:"restrictionEvaluations,omitempty"` 2607 2608 // ForceSendFields is a list of field names (e.g. "ExpiryDetail") to 2609 // unconditionally include in API requests. By default, fields with 2610 // empty or default values are omitted from API requests. However, any 2611 // non-pointer, non-interface field appearing in ForceSendFields will be 2612 // sent to the server regardless of whether the field is empty or not. 2613 // This may be used to include empty fields in Patch requests. 2614 ForceSendFields []string `json:"-"` 2615 2616 // NullFields is a list of field names (e.g. "ExpiryDetail") to include 2617 // in API requests with the JSON null value. By default, fields with 2618 // empty values are omitted from API requests. However, any field with 2619 // an empty value appearing in NullFields will be sent to the server as 2620 // null. It is an error if a field in this list has a non-empty value. 2621 // This may be used to include null fields in Patch requests. 2622 NullFields []string `json:"-"` 2623} 2624 2625func (s *MembershipRole) MarshalJSON() ([]byte, error) { 2626 type NoMethod MembershipRole 2627 raw := NoMethod(*s) 2628 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2629} 2630 2631// MembershipRoleRestrictionEvaluation: The evaluated state of this 2632// restriction. 2633type MembershipRoleRestrictionEvaluation struct { 2634 // State: Output only. The current state of the restriction 2635 // 2636 // Possible values: 2637 // "STATE_UNSPECIFIED" - Default. Should not be used. 2638 // "COMPLIANT" - The member adheres to the parent group's restriction. 2639 // "FORWARD_COMPLIANT" - The group-group membership might be currently 2640 // violating some parent group's restriction but in future, it will 2641 // never allow any new member in the child group which can violate 2642 // parent group's restriction. 2643 // "NON_COMPLIANT" - The member violates the parent group's 2644 // restriction. 2645 // "EVALUATING" - The state of the membership is under evaluation. 2646 State string `json:"state,omitempty"` 2647 2648 // ForceSendFields is a list of field names (e.g. "State") to 2649 // unconditionally include in API requests. By default, fields with 2650 // empty or default values are omitted from API requests. However, any 2651 // non-pointer, non-interface field appearing in ForceSendFields will be 2652 // sent to the server regardless of whether the field is empty or not. 2653 // This may be used to include empty fields in Patch requests. 2654 ForceSendFields []string `json:"-"` 2655 2656 // NullFields is a list of field names (e.g. "State") to include in API 2657 // requests with the JSON null value. By default, fields with empty 2658 // values are omitted from API requests. However, any field with an 2659 // empty value appearing in NullFields will be sent to the server as 2660 // null. It is an error if a field in this list has a non-empty value. 2661 // This may be used to include null fields in Patch requests. 2662 NullFields []string `json:"-"` 2663} 2664 2665func (s *MembershipRoleRestrictionEvaluation) MarshalJSON() ([]byte, error) { 2666 type NoMethod MembershipRoleRestrictionEvaluation 2667 raw := NoMethod(*s) 2668 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2669} 2670 2671// ModifyMembershipRolesRequest: The request message for 2672// MembershipsService.ModifyMembershipRoles. 2673type ModifyMembershipRolesRequest struct { 2674 // AddRoles: The `MembershipRole`s to be added. Adding or removing roles 2675 // in the same request as updating roles is not supported. Must not be 2676 // set if `update_roles_params` is set. 2677 AddRoles []*MembershipRole `json:"addRoles,omitempty"` 2678 2679 // RemoveRoles: The `name`s of the `MembershipRole`s to be removed. 2680 // Adding or removing roles in the same request as updating roles is not 2681 // supported. It is not possible to remove the `MEMBER` 2682 // `MembershipRole`. If you wish to delete a `Membership`, call 2683 // MembershipsService.DeleteMembership instead. Must not contain 2684 // `MEMBER`. Must not be set if `update_roles_params` is set. 2685 RemoveRoles []string `json:"removeRoles,omitempty"` 2686 2687 // UpdateRolesParams: The `MembershipRole`s to be updated. Updating 2688 // roles in the same request as adding or removing roles is not 2689 // supported. Must not be set if either `add_roles` or `remove_roles` is 2690 // set. 2691 UpdateRolesParams []*UpdateMembershipRolesParams `json:"updateRolesParams,omitempty"` 2692 2693 // ForceSendFields is a list of field names (e.g. "AddRoles") to 2694 // unconditionally include in API requests. By default, fields with 2695 // empty or default values are omitted from API requests. However, any 2696 // non-pointer, non-interface field appearing in ForceSendFields will be 2697 // sent to the server regardless of whether the field is empty or not. 2698 // This may be used to include empty fields in Patch requests. 2699 ForceSendFields []string `json:"-"` 2700 2701 // NullFields is a list of field names (e.g. "AddRoles") to include in 2702 // API requests with the JSON null value. By default, fields with empty 2703 // values are omitted from API requests. However, any field with an 2704 // empty value appearing in NullFields will be sent to the server as 2705 // null. It is an error if a field in this list has a non-empty value. 2706 // This may be used to include null fields in Patch requests. 2707 NullFields []string `json:"-"` 2708} 2709 2710func (s *ModifyMembershipRolesRequest) MarshalJSON() ([]byte, error) { 2711 type NoMethod ModifyMembershipRolesRequest 2712 raw := NoMethod(*s) 2713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2714} 2715 2716// ModifyMembershipRolesResponse: The response message for 2717// MembershipsService.ModifyMembershipRoles. 2718type ModifyMembershipRolesResponse struct { 2719 // Membership: The `Membership` resource after modifying its 2720 // `MembershipRole`s. 2721 Membership *Membership `json:"membership,omitempty"` 2722 2723 // ServerResponse contains the HTTP response code and headers from the 2724 // server. 2725 googleapi.ServerResponse `json:"-"` 2726 2727 // ForceSendFields is a list of field names (e.g. "Membership") to 2728 // unconditionally include in API requests. By default, fields with 2729 // empty or default values are omitted from API requests. However, any 2730 // non-pointer, non-interface field appearing in ForceSendFields will be 2731 // sent to the server regardless of whether the field is empty or not. 2732 // This may be used to include empty fields in Patch requests. 2733 ForceSendFields []string `json:"-"` 2734 2735 // NullFields is a list of field names (e.g. "Membership") to include in 2736 // API requests with the JSON null value. By default, fields with empty 2737 // values are omitted from API requests. However, any field with an 2738 // empty value appearing in NullFields will be sent to the server as 2739 // null. It is an error if a field in this list has a non-empty value. 2740 // This may be used to include null fields in Patch requests. 2741 NullFields []string `json:"-"` 2742} 2743 2744func (s *ModifyMembershipRolesResponse) MarshalJSON() ([]byte, error) { 2745 type NoMethod ModifyMembershipRolesResponse 2746 raw := NoMethod(*s) 2747 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2748} 2749 2750// Operation: This resource represents a long-running operation that is 2751// the result of a network API call. 2752type Operation struct { 2753 // Done: If the value is `false`, it means the operation is still in 2754 // progress. If `true`, the operation is completed, and either `error` 2755 // or `response` is available. 2756 Done bool `json:"done,omitempty"` 2757 2758 // Error: The error result of the operation in case of failure or 2759 // cancellation. 2760 Error *Status `json:"error,omitempty"` 2761 2762 // Metadata: Service-specific metadata associated with the operation. It 2763 // typically contains progress information and common metadata such as 2764 // create time. Some services might not provide such metadata. Any 2765 // method that returns a long-running operation should document the 2766 // metadata type, if any. 2767 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2768 2769 // Name: The server-assigned name, which is only unique within the same 2770 // service that originally returns it. If you use the default HTTP 2771 // mapping, the `name` should be a resource name ending with 2772 // `operations/{unique_id}`. 2773 Name string `json:"name,omitempty"` 2774 2775 // Response: The normal response of the operation in case of success. If 2776 // the original method returns no data on success, such as `Delete`, the 2777 // response is `google.protobuf.Empty`. If the original method is 2778 // standard `Get`/`Create`/`Update`, the response should be the 2779 // resource. For other methods, the response should have the type 2780 // `XxxResponse`, where `Xxx` is the original method name. For example, 2781 // if the original method name is `TakeSnapshot()`, the inferred 2782 // response type is `TakeSnapshotResponse`. 2783 Response googleapi.RawMessage `json:"response,omitempty"` 2784 2785 // ServerResponse contains the HTTP response code and headers from the 2786 // server. 2787 googleapi.ServerResponse `json:"-"` 2788 2789 // ForceSendFields is a list of field names (e.g. "Done") to 2790 // unconditionally include in API requests. By default, fields with 2791 // empty or default values are omitted from API requests. However, any 2792 // non-pointer, non-interface field appearing in ForceSendFields will be 2793 // sent to the server regardless of whether the field is empty or not. 2794 // This may be used to include empty fields in Patch requests. 2795 ForceSendFields []string `json:"-"` 2796 2797 // NullFields is a list of field names (e.g. "Done") to include in API 2798 // requests with the JSON null value. By default, fields with empty 2799 // values are omitted from API requests. However, any field with an 2800 // empty value appearing in NullFields will be sent to the server as 2801 // null. It is an error if a field in this list has a non-empty value. 2802 // This may be used to include null fields in Patch requests. 2803 NullFields []string `json:"-"` 2804} 2805 2806func (s *Operation) MarshalJSON() ([]byte, error) { 2807 type NoMethod Operation 2808 raw := NoMethod(*s) 2809 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2810} 2811 2812// PosixGroup: POSIX Group definition to represent a group in a POSIX 2813// compliant system. 2814type PosixGroup struct { 2815 // Gid: GID of the POSIX group. 2816 Gid uint64 `json:"gid,omitempty,string"` 2817 2818 // Name: Name of the POSIX group. 2819 Name string `json:"name,omitempty"` 2820 2821 // SystemId: System identifier for which group name and gid apply to. If 2822 // not specified it will default to empty value. 2823 SystemId string `json:"systemId,omitempty"` 2824 2825 // ForceSendFields is a list of field names (e.g. "Gid") to 2826 // unconditionally include in API requests. By default, fields with 2827 // empty or default values are omitted from API requests. However, any 2828 // non-pointer, non-interface field appearing in ForceSendFields will be 2829 // sent to the server regardless of whether the field is empty or not. 2830 // This may be used to include empty fields in Patch requests. 2831 ForceSendFields []string `json:"-"` 2832 2833 // NullFields is a list of field names (e.g. "Gid") to include in API 2834 // requests with the JSON null value. By default, fields with empty 2835 // values are omitted from API requests. However, any field with an 2836 // empty value appearing in NullFields will be sent to the server as 2837 // null. It is an error if a field in this list has a non-empty value. 2838 // This may be used to include null fields in Patch requests. 2839 NullFields []string `json:"-"` 2840} 2841 2842func (s *PosixGroup) MarshalJSON() ([]byte, error) { 2843 type NoMethod PosixGroup 2844 raw := NoMethod(*s) 2845 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2846} 2847 2848// RestrictionEvaluation: The evaluated state of this restriction. 2849type RestrictionEvaluation struct { 2850 // State: Output only. The current state of the restriction 2851 // 2852 // Possible values: 2853 // "STATE_UNSPECIFIED" - Default. Should not be used. 2854 // "EVALUATING" - The restriction state is currently being evaluated. 2855 // "COMPLIANT" - All transitive memberships are adhering to 2856 // restriction. 2857 // "FORWARD_COMPLIANT" - Some transitive memberships violate the 2858 // restriction. No new violating memberships can be added. 2859 // "NON_COMPLIANT" - Some transitive memberships violate the 2860 // restriction. New violating direct memberships will be denied while 2861 // indirect memberships may be added. 2862 State string `json:"state,omitempty"` 2863 2864 // ForceSendFields is a list of field names (e.g. "State") to 2865 // unconditionally include in API requests. By default, fields with 2866 // empty or default values are omitted from API requests. However, any 2867 // non-pointer, non-interface field appearing in ForceSendFields will be 2868 // sent to the server regardless of whether the field is empty or not. 2869 // This may be used to include empty fields in Patch requests. 2870 ForceSendFields []string `json:"-"` 2871 2872 // NullFields is a list of field names (e.g. "State") to include in API 2873 // requests with the JSON null value. By default, fields with empty 2874 // values are omitted from API requests. However, any field with an 2875 // empty value appearing in NullFields will be sent to the server as 2876 // null. It is an error if a field in this list has a non-empty value. 2877 // This may be used to include null fields in Patch requests. 2878 NullFields []string `json:"-"` 2879} 2880 2881func (s *RestrictionEvaluation) MarshalJSON() ([]byte, error) { 2882 type NoMethod RestrictionEvaluation 2883 raw := NoMethod(*s) 2884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2885} 2886 2887// RestrictionEvaluations: Evaluations of restrictions applied to parent 2888// group on this membership. 2889type RestrictionEvaluations struct { 2890 // MemberRestrictionEvaluation: Evaluation of the member restriction 2891 // applied to this membership. Empty if the user lacks permission to 2892 // view the restriction evaluation. 2893 MemberRestrictionEvaluation *MembershipRoleRestrictionEvaluation `json:"memberRestrictionEvaluation,omitempty"` 2894 2895 // ForceSendFields is a list of field names (e.g. 2896 // "MemberRestrictionEvaluation") to unconditionally include in API 2897 // requests. By default, fields with empty or default values are omitted 2898 // from API requests. However, any non-pointer, non-interface field 2899 // appearing in ForceSendFields will be sent to the server regardless of 2900 // whether the field is empty or not. This may be used to include empty 2901 // fields in Patch requests. 2902 ForceSendFields []string `json:"-"` 2903 2904 // NullFields is a list of field names (e.g. 2905 // "MemberRestrictionEvaluation") to include in API requests with the 2906 // JSON null value. By default, fields with empty values are omitted 2907 // from API requests. However, any field with an empty value appearing 2908 // in NullFields will be sent to the server as null. It is an error if a 2909 // field in this list has a non-empty value. This may be used to include 2910 // null fields in Patch requests. 2911 NullFields []string `json:"-"` 2912} 2913 2914func (s *RestrictionEvaluations) MarshalJSON() ([]byte, error) { 2915 type NoMethod RestrictionEvaluations 2916 raw := NoMethod(*s) 2917 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2918} 2919 2920// SearchGroupsResponse: The response message for 2921// GroupsService.SearchGroups. 2922type SearchGroupsResponse struct { 2923 // Groups: The `Group` resources that match the search query. 2924 Groups []*Group `json:"groups,omitempty"` 2925 2926 // NextPageToken: A continuation token to retrieve the next page of 2927 // results, or empty if there are no more results available. 2928 NextPageToken string `json:"nextPageToken,omitempty"` 2929 2930 // ServerResponse contains the HTTP response code and headers from the 2931 // server. 2932 googleapi.ServerResponse `json:"-"` 2933 2934 // ForceSendFields is a list of field names (e.g. "Groups") to 2935 // unconditionally include in API requests. By default, fields with 2936 // empty or default values are omitted from API requests. However, any 2937 // non-pointer, non-interface field appearing in ForceSendFields will be 2938 // sent to the server regardless of whether the field is empty or not. 2939 // This may be used to include empty fields in Patch requests. 2940 ForceSendFields []string `json:"-"` 2941 2942 // NullFields is a list of field names (e.g. "Groups") to include in API 2943 // requests with the JSON null value. By default, fields with empty 2944 // values are omitted from API requests. However, any field with an 2945 // empty value appearing in NullFields will be sent to the server as 2946 // null. It is an error if a field in this list has a non-empty value. 2947 // This may be used to include null fields in Patch requests. 2948 NullFields []string `json:"-"` 2949} 2950 2951func (s *SearchGroupsResponse) MarshalJSON() ([]byte, error) { 2952 type NoMethod SearchGroupsResponse 2953 raw := NoMethod(*s) 2954 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2955} 2956 2957// SearchTransitiveGroupsResponse: The response message for 2958// MembershipsService.SearchTransitiveGroups. 2959type SearchTransitiveGroupsResponse struct { 2960 // Memberships: List of transitive groups satisfying the query. 2961 Memberships []*GroupRelation `json:"memberships,omitempty"` 2962 2963 // NextPageToken: Token to retrieve the next page of results, or empty 2964 // if there are no more results available for listing. 2965 NextPageToken string `json:"nextPageToken,omitempty"` 2966 2967 // ServerResponse contains the HTTP response code and headers from the 2968 // server. 2969 googleapi.ServerResponse `json:"-"` 2970 2971 // ForceSendFields is a list of field names (e.g. "Memberships") to 2972 // unconditionally include in API requests. By default, fields with 2973 // empty or default values are omitted from API requests. However, any 2974 // non-pointer, non-interface field appearing in ForceSendFields will be 2975 // sent to the server regardless of whether the field is empty or not. 2976 // This may be used to include empty fields in Patch requests. 2977 ForceSendFields []string `json:"-"` 2978 2979 // NullFields is a list of field names (e.g. "Memberships") to include 2980 // in API requests with the JSON null value. By default, fields with 2981 // empty values are omitted from API requests. However, any field with 2982 // an empty value appearing in NullFields will be sent to the server as 2983 // null. It is an error if a field in this list has a non-empty value. 2984 // This may be used to include null fields in Patch requests. 2985 NullFields []string `json:"-"` 2986} 2987 2988func (s *SearchTransitiveGroupsResponse) MarshalJSON() ([]byte, error) { 2989 type NoMethod SearchTransitiveGroupsResponse 2990 raw := NoMethod(*s) 2991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2992} 2993 2994// SearchTransitiveMembershipsResponse: The response message for 2995// MembershipsService.SearchTransitiveMemberships. 2996type SearchTransitiveMembershipsResponse struct { 2997 // Memberships: List of transitive memberships satisfying the query. 2998 Memberships []*MemberRelation `json:"memberships,omitempty"` 2999 3000 // NextPageToken: Token to retrieve the next page of results, or empty 3001 // if there are no more results. 3002 NextPageToken string `json:"nextPageToken,omitempty"` 3003 3004 // ServerResponse contains the HTTP response code and headers from the 3005 // server. 3006 googleapi.ServerResponse `json:"-"` 3007 3008 // ForceSendFields is a list of field names (e.g. "Memberships") to 3009 // unconditionally include in API requests. By default, fields with 3010 // empty or default values are omitted from API requests. However, any 3011 // non-pointer, non-interface field appearing in ForceSendFields will be 3012 // sent to the server regardless of whether the field is empty or not. 3013 // This may be used to include empty fields in Patch requests. 3014 ForceSendFields []string `json:"-"` 3015 3016 // NullFields is a list of field names (e.g. "Memberships") to include 3017 // in API requests with the JSON null value. By default, fields with 3018 // empty values are omitted from API requests. However, any field with 3019 // an empty value appearing in NullFields will be sent to the server as 3020 // null. It is an error if a field in this list has a non-empty value. 3021 // This may be used to include null fields in Patch requests. 3022 NullFields []string `json:"-"` 3023} 3024 3025func (s *SearchTransitiveMembershipsResponse) MarshalJSON() ([]byte, error) { 3026 type NoMethod SearchTransitiveMembershipsResponse 3027 raw := NoMethod(*s) 3028 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3029} 3030 3031// SecuritySettings: The definiion of security settings. 3032type SecuritySettings struct { 3033 // MemberRestriction: The Member Restriction value 3034 MemberRestriction *MemberRestriction `json:"memberRestriction,omitempty"` 3035 3036 // Name: Output only. The resource name of the security settings. Shall 3037 // be of the form `groups/{group_id}/securitySettings`. 3038 Name string `json:"name,omitempty"` 3039 3040 // ServerResponse contains the HTTP response code and headers from the 3041 // server. 3042 googleapi.ServerResponse `json:"-"` 3043 3044 // ForceSendFields is a list of field names (e.g. "MemberRestriction") 3045 // to unconditionally include in API requests. By default, fields with 3046 // empty or default values are omitted from API requests. However, any 3047 // non-pointer, non-interface field appearing in ForceSendFields will be 3048 // sent to the server regardless of whether the field is empty or not. 3049 // This may be used to include empty fields in Patch requests. 3050 ForceSendFields []string `json:"-"` 3051 3052 // NullFields is a list of field names (e.g. "MemberRestriction") to 3053 // include in API requests with the JSON null value. By default, fields 3054 // with empty values are omitted from API requests. However, any field 3055 // with an empty value appearing in NullFields will be sent to the 3056 // server as null. It is an error if a field in this list has a 3057 // non-empty value. This may be used to include null fields in Patch 3058 // requests. 3059 NullFields []string `json:"-"` 3060} 3061 3062func (s *SecuritySettings) MarshalJSON() ([]byte, error) { 3063 type NoMethod SecuritySettings 3064 raw := NoMethod(*s) 3065 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3066} 3067 3068// SendUserInvitationRequest: A request to send email for inviting 3069// target user corresponding to the UserInvitation. 3070type SendUserInvitationRequest struct { 3071} 3072 3073// Status: The `Status` type defines a logical error model that is 3074// suitable for different programming environments, including REST APIs 3075// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3076// `Status` message contains three pieces of data: error code, error 3077// message, and error details. You can find out more about this error 3078// model and how to work with it in the API Design Guide 3079// (https://cloud.google.com/apis/design/errors). 3080type Status struct { 3081 // Code: The status code, which should be an enum value of 3082 // google.rpc.Code. 3083 Code int64 `json:"code,omitempty"` 3084 3085 // Details: A list of messages that carry the error details. There is a 3086 // common set of message types for APIs to use. 3087 Details []googleapi.RawMessage `json:"details,omitempty"` 3088 3089 // Message: A developer-facing error message, which should be in 3090 // English. Any user-facing error message should be localized and sent 3091 // in the google.rpc.Status.details field, or localized by the client. 3092 Message string `json:"message,omitempty"` 3093 3094 // ForceSendFields is a list of field names (e.g. "Code") to 3095 // unconditionally include in API requests. By default, fields with 3096 // empty or default values are omitted from API requests. However, any 3097 // non-pointer, non-interface field appearing in ForceSendFields will be 3098 // sent to the server regardless of whether the field is empty or not. 3099 // This may be used to include empty fields in Patch requests. 3100 ForceSendFields []string `json:"-"` 3101 3102 // NullFields is a list of field names (e.g. "Code") to include in API 3103 // requests with the JSON null value. By default, fields with empty 3104 // values are omitted from API requests. However, any field with an 3105 // empty value appearing in NullFields will be sent to the server as 3106 // null. It is an error if a field in this list has a non-empty value. 3107 // This may be used to include null fields in Patch requests. 3108 NullFields []string `json:"-"` 3109} 3110 3111func (s *Status) MarshalJSON() ([]byte, error) { 3112 type NoMethod Status 3113 raw := NoMethod(*s) 3114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3115} 3116 3117// TransitiveMembershipRole: Message representing the role of a 3118// TransitiveMembership. 3119type TransitiveMembershipRole struct { 3120 // Role: TransitiveMembershipRole in string format. Currently supported 3121 // TransitiveMembershipRoles: "MEMBER", "OWNER", and "MANAGER". 3122 Role string `json:"role,omitempty"` 3123 3124 // ForceSendFields is a list of field names (e.g. "Role") to 3125 // unconditionally include in API requests. By default, fields with 3126 // empty or default values are omitted from API requests. However, any 3127 // non-pointer, non-interface field appearing in ForceSendFields will be 3128 // sent to the server regardless of whether the field is empty or not. 3129 // This may be used to include empty fields in Patch requests. 3130 ForceSendFields []string `json:"-"` 3131 3132 // NullFields is a list of field names (e.g. "Role") to include in API 3133 // requests with the JSON null value. By default, fields with empty 3134 // values are omitted from API requests. However, any field with an 3135 // empty value appearing in NullFields will be sent to the server as 3136 // null. It is an error if a field in this list has a non-empty value. 3137 // This may be used to include null fields in Patch requests. 3138 NullFields []string `json:"-"` 3139} 3140 3141func (s *TransitiveMembershipRole) MarshalJSON() ([]byte, error) { 3142 type NoMethod TransitiveMembershipRole 3143 raw := NoMethod(*s) 3144 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3145} 3146 3147// UpdateMembershipRolesParams: The details of an update to a 3148// `MembershipRole`. 3149type UpdateMembershipRolesParams struct { 3150 // FieldMask: The fully-qualified names of fields to update. May only 3151 // contain the field `expiry_detail.expire_time`. 3152 FieldMask string `json:"fieldMask,omitempty"` 3153 3154 // MembershipRole: The `MembershipRole`s to be updated. Only `MEMBER` 3155 // `MembershipRoles` can currently be updated. May only contain a 3156 // `MembershipRole` with `name` `MEMBER`. 3157 MembershipRole *MembershipRole `json:"membershipRole,omitempty"` 3158 3159 // ForceSendFields is a list of field names (e.g. "FieldMask") to 3160 // unconditionally include in API requests. By default, fields with 3161 // empty or default values are omitted from API requests. However, any 3162 // non-pointer, non-interface field appearing in ForceSendFields will be 3163 // sent to the server regardless of whether the field is empty or not. 3164 // This may be used to include empty fields in Patch requests. 3165 ForceSendFields []string `json:"-"` 3166 3167 // NullFields is a list of field names (e.g. "FieldMask") to include in 3168 // API requests with the JSON null value. By default, fields with empty 3169 // values are omitted from API requests. However, any field with an 3170 // empty value appearing in NullFields will be sent to the server as 3171 // null. It is an error if a field in this list has a non-empty value. 3172 // This may be used to include null fields in Patch requests. 3173 NullFields []string `json:"-"` 3174} 3175 3176func (s *UpdateMembershipRolesParams) MarshalJSON() ([]byte, error) { 3177 type NoMethod UpdateMembershipRolesParams 3178 raw := NoMethod(*s) 3179 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3180} 3181 3182// UserInvitation: The `UserInvitation` resource represents an email 3183// that can be sent to an unmanaged user account inviting them to join 3184// the customer’s Google Workspace or Cloud Identity account. An 3185// unmanaged account shares an email address domain with the Google 3186// Workspace or Cloud Identity account but is not managed by it yet. If 3187// the user accepts the `UserInvitation`, the user account will become 3188// managed. 3189type UserInvitation struct { 3190 // MailsSentCount: Number of invitation emails sent to the user. 3191 MailsSentCount int64 `json:"mailsSentCount,omitempty,string"` 3192 3193 // Name: Shall be of the form 3194 // `customers/{customer}/userinvitations/{user_email_address}`. 3195 Name string `json:"name,omitempty"` 3196 3197 // State: State of the `UserInvitation`. 3198 // 3199 // Possible values: 3200 // "STATE_UNSPECIFIED" - The default value. This value is used if the 3201 // state is omitted. 3202 // "NOT_YET_SENT" - The `UserInvitation` has been created and is ready 3203 // for sending as an email. 3204 // "INVITED" - The user has been invited by email. 3205 // "ACCEPTED" - The user has accepted the invitation and is part of 3206 // the organization. 3207 // "DECLINED" - The user declined the invitation. 3208 State string `json:"state,omitempty"` 3209 3210 // UpdateTime: Time when the `UserInvitation` was last updated. 3211 UpdateTime string `json:"updateTime,omitempty"` 3212 3213 // ServerResponse contains the HTTP response code and headers from the 3214 // server. 3215 googleapi.ServerResponse `json:"-"` 3216 3217 // ForceSendFields is a list of field names (e.g. "MailsSentCount") to 3218 // unconditionally include in API requests. By default, fields with 3219 // empty or default values are omitted from API requests. However, any 3220 // non-pointer, non-interface field appearing in ForceSendFields will be 3221 // sent to the server regardless of whether the field is empty or not. 3222 // This may be used to include empty fields in Patch requests. 3223 ForceSendFields []string `json:"-"` 3224 3225 // NullFields is a list of field names (e.g. "MailsSentCount") to 3226 // include in API requests with the JSON null value. By default, fields 3227 // with empty values are omitted from API requests. However, any field 3228 // with an empty value appearing in NullFields will be sent to the 3229 // server as null. It is an error if a field in this list has a 3230 // non-empty value. This may be used to include null fields in Patch 3231 // requests. 3232 NullFields []string `json:"-"` 3233} 3234 3235func (s *UserInvitation) MarshalJSON() ([]byte, error) { 3236 type NoMethod UserInvitation 3237 raw := NoMethod(*s) 3238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3239} 3240 3241// WipeDeviceRequest: Request message for wiping all data on the device. 3242type WipeDeviceRequest struct { 3243 // RemoveResetLock: Optional. Specifies if a user is able to factory 3244 // reset a device after a Device Wipe. On iOS, this is called 3245 // "Activation Lock", while on Android, this is known as "Factory Reset 3246 // Protection". If true, this protection will be removed from the 3247 // device, so that a user can successfully factory reset. If false, the 3248 // setting is untouched on the device. 3249 RemoveResetLock bool `json:"removeResetLock,omitempty"` 3250 3251 // ForceSendFields is a list of field names (e.g. "RemoveResetLock") to 3252 // unconditionally include in API requests. By default, fields with 3253 // empty or default values are omitted from API requests. However, any 3254 // non-pointer, non-interface field appearing in ForceSendFields will be 3255 // sent to the server regardless of whether the field is empty or not. 3256 // This may be used to include empty fields in Patch requests. 3257 ForceSendFields []string `json:"-"` 3258 3259 // NullFields is a list of field names (e.g. "RemoveResetLock") to 3260 // include in API requests with the JSON null value. By default, fields 3261 // with empty values are omitted from API requests. However, any field 3262 // with an empty value appearing in NullFields will be sent to the 3263 // server as null. It is an error if a field in this list has a 3264 // non-empty value. This may be used to include null fields in Patch 3265 // requests. 3266 NullFields []string `json:"-"` 3267} 3268 3269func (s *WipeDeviceRequest) MarshalJSON() ([]byte, error) { 3270 type NoMethod WipeDeviceRequest 3271 raw := NoMethod(*s) 3272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3273} 3274 3275// WipeDeviceResponse: Response message for wiping all data on the 3276// device. 3277type WipeDeviceResponse struct { 3278 // Device: Resultant Device object for the action. Note that asset tags 3279 // will not be returned in the device object. 3280 Device *Device `json:"device,omitempty"` 3281 3282 // ForceSendFields is a list of field names (e.g. "Device") to 3283 // unconditionally include in API requests. By default, fields with 3284 // empty or default values are omitted from API requests. However, any 3285 // non-pointer, non-interface field appearing in ForceSendFields will be 3286 // sent to the server regardless of whether the field is empty or not. 3287 // This may be used to include empty fields in Patch requests. 3288 ForceSendFields []string `json:"-"` 3289 3290 // NullFields is a list of field names (e.g. "Device") to include in API 3291 // requests with the JSON null value. By default, fields with empty 3292 // values are omitted from API requests. However, any field with an 3293 // empty value appearing in NullFields will be sent to the server as 3294 // null. It is an error if a field in this list has a non-empty value. 3295 // This may be used to include null fields in Patch requests. 3296 NullFields []string `json:"-"` 3297} 3298 3299func (s *WipeDeviceResponse) MarshalJSON() ([]byte, error) { 3300 type NoMethod WipeDeviceResponse 3301 raw := NoMethod(*s) 3302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3303} 3304 3305// WipeDeviceUserRequest: Request message for starting an account wipe 3306// on device. 3307type WipeDeviceUserRequest struct { 3308} 3309 3310// WipeDeviceUserResponse: Response message for wiping the user's 3311// account from the device. 3312type WipeDeviceUserResponse struct { 3313 // DeviceUser: Resultant DeviceUser object for the action. 3314 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 3315 3316 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 3317 // unconditionally include in API requests. By default, fields with 3318 // empty or default values are omitted from API requests. However, any 3319 // non-pointer, non-interface field appearing in ForceSendFields will be 3320 // sent to the server regardless of whether the field is empty or not. 3321 // This may be used to include empty fields in Patch requests. 3322 ForceSendFields []string `json:"-"` 3323 3324 // NullFields is a list of field names (e.g. "DeviceUser") to include in 3325 // API requests with the JSON null value. By default, fields with empty 3326 // values are omitted from API requests. However, any field with an 3327 // empty value appearing in NullFields will be sent to the server as 3328 // null. It is an error if a field in this list has a non-empty value. 3329 // This may be used to include null fields in Patch requests. 3330 NullFields []string `json:"-"` 3331} 3332 3333func (s *WipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 3334 type NoMethod WipeDeviceUserResponse 3335 raw := NoMethod(*s) 3336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3337} 3338 3339// method id "cloudidentity.customers.userinvitations.cancel": 3340 3341type CustomersUserinvitationsCancelCall struct { 3342 s *Service 3343 name string 3344 canceluserinvitationrequest *CancelUserInvitationRequest 3345 urlParams_ gensupport.URLParams 3346 ctx_ context.Context 3347 header_ http.Header 3348} 3349 3350// Cancel: Cancels a UserInvitation that was already sent. 3351// 3352// - name: `UserInvitation` name in the format 3353// `customers/{customer}/userinvitations/{user_email_address}`. 3354func (r *CustomersUserinvitationsService) Cancel(name string, canceluserinvitationrequest *CancelUserInvitationRequest) *CustomersUserinvitationsCancelCall { 3355 c := &CustomersUserinvitationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3356 c.name = name 3357 c.canceluserinvitationrequest = canceluserinvitationrequest 3358 return c 3359} 3360 3361// Fields allows partial responses to be retrieved. See 3362// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3363// for more information. 3364func (c *CustomersUserinvitationsCancelCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsCancelCall { 3365 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3366 return c 3367} 3368 3369// Context sets the context to be used in this call's Do method. Any 3370// pending HTTP request will be aborted if the provided context is 3371// canceled. 3372func (c *CustomersUserinvitationsCancelCall) Context(ctx context.Context) *CustomersUserinvitationsCancelCall { 3373 c.ctx_ = ctx 3374 return c 3375} 3376 3377// Header returns an http.Header that can be modified by the caller to 3378// add HTTP headers to the request. 3379func (c *CustomersUserinvitationsCancelCall) Header() http.Header { 3380 if c.header_ == nil { 3381 c.header_ = make(http.Header) 3382 } 3383 return c.header_ 3384} 3385 3386func (c *CustomersUserinvitationsCancelCall) doRequest(alt string) (*http.Response, error) { 3387 reqHeaders := make(http.Header) 3388 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3389 for k, v := range c.header_ { 3390 reqHeaders[k] = v 3391 } 3392 reqHeaders.Set("User-Agent", c.s.userAgent()) 3393 var body io.Reader = nil 3394 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceluserinvitationrequest) 3395 if err != nil { 3396 return nil, err 3397 } 3398 reqHeaders.Set("Content-Type", "application/json") 3399 c.urlParams_.Set("alt", alt) 3400 c.urlParams_.Set("prettyPrint", "false") 3401 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 3402 urls += "?" + c.urlParams_.Encode() 3403 req, err := http.NewRequest("POST", urls, body) 3404 if err != nil { 3405 return nil, err 3406 } 3407 req.Header = reqHeaders 3408 googleapi.Expand(req.URL, map[string]string{ 3409 "name": c.name, 3410 }) 3411 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3412} 3413 3414// Do executes the "cloudidentity.customers.userinvitations.cancel" call. 3415// Exactly one of *Operation or error will be non-nil. Any non-2xx 3416// status code is an error. Response headers are in either 3417// *Operation.ServerResponse.Header or (if a response was returned at 3418// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3419// to check whether the returned error was because 3420// http.StatusNotModified was returned. 3421func (c *CustomersUserinvitationsCancelCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3422 gensupport.SetOptions(c.urlParams_, opts...) 3423 res, err := c.doRequest("json") 3424 if res != nil && res.StatusCode == http.StatusNotModified { 3425 if res.Body != nil { 3426 res.Body.Close() 3427 } 3428 return nil, &googleapi.Error{ 3429 Code: res.StatusCode, 3430 Header: res.Header, 3431 } 3432 } 3433 if err != nil { 3434 return nil, err 3435 } 3436 defer googleapi.CloseBody(res) 3437 if err := googleapi.CheckResponse(res); err != nil { 3438 return nil, err 3439 } 3440 ret := &Operation{ 3441 ServerResponse: googleapi.ServerResponse{ 3442 Header: res.Header, 3443 HTTPStatusCode: res.StatusCode, 3444 }, 3445 } 3446 target := &ret 3447 if err := gensupport.DecodeResponse(target, res); err != nil { 3448 return nil, err 3449 } 3450 return ret, nil 3451 // { 3452 // "description": "Cancels a UserInvitation that was already sent.", 3453 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:cancel", 3454 // "httpMethod": "POST", 3455 // "id": "cloudidentity.customers.userinvitations.cancel", 3456 // "parameterOrder": [ 3457 // "name" 3458 // ], 3459 // "parameters": { 3460 // "name": { 3461 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3462 // "location": "path", 3463 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3464 // "required": true, 3465 // "type": "string" 3466 // } 3467 // }, 3468 // "path": "v1beta1/{+name}:cancel", 3469 // "request": { 3470 // "$ref": "CancelUserInvitationRequest" 3471 // }, 3472 // "response": { 3473 // "$ref": "Operation" 3474 // } 3475 // } 3476 3477} 3478 3479// method id "cloudidentity.customers.userinvitations.get": 3480 3481type CustomersUserinvitationsGetCall struct { 3482 s *Service 3483 name string 3484 urlParams_ gensupport.URLParams 3485 ifNoneMatch_ string 3486 ctx_ context.Context 3487 header_ http.Header 3488} 3489 3490// Get: Retrieves a UserInvitation resource. **Note:** New consumer 3491// accounts with the customer's verified domain created within the 3492// previous 48 hours will not appear in the result. This delay also 3493// applies to newly-verified domains. 3494// 3495// - name: `UserInvitation` name in the format 3496// `customers/{customer}/userinvitations/{user_email_address}`. 3497func (r *CustomersUserinvitationsService) Get(name string) *CustomersUserinvitationsGetCall { 3498 c := &CustomersUserinvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3499 c.name = name 3500 return c 3501} 3502 3503// Fields allows partial responses to be retrieved. See 3504// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3505// for more information. 3506func (c *CustomersUserinvitationsGetCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsGetCall { 3507 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3508 return c 3509} 3510 3511// IfNoneMatch sets the optional parameter which makes the operation 3512// fail if the object's ETag matches the given value. This is useful for 3513// getting updates only after the object has changed since the last 3514// request. Use googleapi.IsNotModified to check whether the response 3515// error from Do is the result of In-None-Match. 3516func (c *CustomersUserinvitationsGetCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsGetCall { 3517 c.ifNoneMatch_ = entityTag 3518 return c 3519} 3520 3521// Context sets the context to be used in this call's Do method. Any 3522// pending HTTP request will be aborted if the provided context is 3523// canceled. 3524func (c *CustomersUserinvitationsGetCall) Context(ctx context.Context) *CustomersUserinvitationsGetCall { 3525 c.ctx_ = ctx 3526 return c 3527} 3528 3529// Header returns an http.Header that can be modified by the caller to 3530// add HTTP headers to the request. 3531func (c *CustomersUserinvitationsGetCall) Header() http.Header { 3532 if c.header_ == nil { 3533 c.header_ = make(http.Header) 3534 } 3535 return c.header_ 3536} 3537 3538func (c *CustomersUserinvitationsGetCall) doRequest(alt string) (*http.Response, error) { 3539 reqHeaders := make(http.Header) 3540 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3541 for k, v := range c.header_ { 3542 reqHeaders[k] = v 3543 } 3544 reqHeaders.Set("User-Agent", c.s.userAgent()) 3545 if c.ifNoneMatch_ != "" { 3546 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3547 } 3548 var body io.Reader = nil 3549 c.urlParams_.Set("alt", alt) 3550 c.urlParams_.Set("prettyPrint", "false") 3551 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3552 urls += "?" + c.urlParams_.Encode() 3553 req, err := http.NewRequest("GET", urls, body) 3554 if err != nil { 3555 return nil, err 3556 } 3557 req.Header = reqHeaders 3558 googleapi.Expand(req.URL, map[string]string{ 3559 "name": c.name, 3560 }) 3561 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3562} 3563 3564// Do executes the "cloudidentity.customers.userinvitations.get" call. 3565// Exactly one of *UserInvitation or error will be non-nil. Any non-2xx 3566// status code is an error. Response headers are in either 3567// *UserInvitation.ServerResponse.Header or (if a response was returned 3568// at all) in error.(*googleapi.Error).Header. Use 3569// googleapi.IsNotModified to check whether the returned error was 3570// because http.StatusNotModified was returned. 3571func (c *CustomersUserinvitationsGetCall) Do(opts ...googleapi.CallOption) (*UserInvitation, error) { 3572 gensupport.SetOptions(c.urlParams_, opts...) 3573 res, err := c.doRequest("json") 3574 if res != nil && res.StatusCode == http.StatusNotModified { 3575 if res.Body != nil { 3576 res.Body.Close() 3577 } 3578 return nil, &googleapi.Error{ 3579 Code: res.StatusCode, 3580 Header: res.Header, 3581 } 3582 } 3583 if err != nil { 3584 return nil, err 3585 } 3586 defer googleapi.CloseBody(res) 3587 if err := googleapi.CheckResponse(res); err != nil { 3588 return nil, err 3589 } 3590 ret := &UserInvitation{ 3591 ServerResponse: googleapi.ServerResponse{ 3592 Header: res.Header, 3593 HTTPStatusCode: res.StatusCode, 3594 }, 3595 } 3596 target := &ret 3597 if err := gensupport.DecodeResponse(target, res); err != nil { 3598 return nil, err 3599 } 3600 return ret, nil 3601 // { 3602 // "description": "Retrieves a UserInvitation resource. **Note:** New consumer accounts with the customer's verified domain created within the previous 48 hours will not appear in the result. This delay also applies to newly-verified domains.", 3603 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}", 3604 // "httpMethod": "GET", 3605 // "id": "cloudidentity.customers.userinvitations.get", 3606 // "parameterOrder": [ 3607 // "name" 3608 // ], 3609 // "parameters": { 3610 // "name": { 3611 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3612 // "location": "path", 3613 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3614 // "required": true, 3615 // "type": "string" 3616 // } 3617 // }, 3618 // "path": "v1beta1/{+name}", 3619 // "response": { 3620 // "$ref": "UserInvitation" 3621 // } 3622 // } 3623 3624} 3625 3626// method id "cloudidentity.customers.userinvitations.isInvitableUser": 3627 3628type CustomersUserinvitationsIsInvitableUserCall struct { 3629 s *Service 3630 name string 3631 urlParams_ gensupport.URLParams 3632 ifNoneMatch_ string 3633 ctx_ context.Context 3634 header_ http.Header 3635} 3636 3637// IsInvitableUser: Verifies whether a user account is eligible to 3638// receive a UserInvitation (is an unmanaged account). Eligibility is 3639// based on the following criteria: * the email address is a consumer 3640// account and it's the primary email address of the account, and * the 3641// domain of the email address matches an existing verified Google 3642// Workspace or Cloud Identity domain If both conditions are met, the 3643// user is eligible. **Note:** This method is not supported for 3644// Workspace Essentials customers. 3645// 3646// - name: `UserInvitation` name in the format 3647// `customers/{customer}/userinvitations/{user_email_address}`. 3648func (r *CustomersUserinvitationsService) IsInvitableUser(name string) *CustomersUserinvitationsIsInvitableUserCall { 3649 c := &CustomersUserinvitationsIsInvitableUserCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3650 c.name = name 3651 return c 3652} 3653 3654// Fields allows partial responses to be retrieved. See 3655// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3656// for more information. 3657func (c *CustomersUserinvitationsIsInvitableUserCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsIsInvitableUserCall { 3658 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3659 return c 3660} 3661 3662// IfNoneMatch sets the optional parameter which makes the operation 3663// fail if the object's ETag matches the given value. This is useful for 3664// getting updates only after the object has changed since the last 3665// request. Use googleapi.IsNotModified to check whether the response 3666// error from Do is the result of In-None-Match. 3667func (c *CustomersUserinvitationsIsInvitableUserCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsIsInvitableUserCall { 3668 c.ifNoneMatch_ = entityTag 3669 return c 3670} 3671 3672// Context sets the context to be used in this call's Do method. Any 3673// pending HTTP request will be aborted if the provided context is 3674// canceled. 3675func (c *CustomersUserinvitationsIsInvitableUserCall) Context(ctx context.Context) *CustomersUserinvitationsIsInvitableUserCall { 3676 c.ctx_ = ctx 3677 return c 3678} 3679 3680// Header returns an http.Header that can be modified by the caller to 3681// add HTTP headers to the request. 3682func (c *CustomersUserinvitationsIsInvitableUserCall) Header() http.Header { 3683 if c.header_ == nil { 3684 c.header_ = make(http.Header) 3685 } 3686 return c.header_ 3687} 3688 3689func (c *CustomersUserinvitationsIsInvitableUserCall) doRequest(alt string) (*http.Response, error) { 3690 reqHeaders := make(http.Header) 3691 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3692 for k, v := range c.header_ { 3693 reqHeaders[k] = v 3694 } 3695 reqHeaders.Set("User-Agent", c.s.userAgent()) 3696 if c.ifNoneMatch_ != "" { 3697 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3698 } 3699 var body io.Reader = nil 3700 c.urlParams_.Set("alt", alt) 3701 c.urlParams_.Set("prettyPrint", "false") 3702 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:isInvitableUser") 3703 urls += "?" + c.urlParams_.Encode() 3704 req, err := http.NewRequest("GET", urls, body) 3705 if err != nil { 3706 return nil, err 3707 } 3708 req.Header = reqHeaders 3709 googleapi.Expand(req.URL, map[string]string{ 3710 "name": c.name, 3711 }) 3712 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3713} 3714 3715// Do executes the "cloudidentity.customers.userinvitations.isInvitableUser" call. 3716// Exactly one of *IsInvitableUserResponse or error will be non-nil. Any 3717// non-2xx status code is an error. Response headers are in either 3718// *IsInvitableUserResponse.ServerResponse.Header or (if a response was 3719// returned at all) in error.(*googleapi.Error).Header. Use 3720// googleapi.IsNotModified to check whether the returned error was 3721// because http.StatusNotModified was returned. 3722func (c *CustomersUserinvitationsIsInvitableUserCall) Do(opts ...googleapi.CallOption) (*IsInvitableUserResponse, error) { 3723 gensupport.SetOptions(c.urlParams_, opts...) 3724 res, err := c.doRequest("json") 3725 if res != nil && res.StatusCode == http.StatusNotModified { 3726 if res.Body != nil { 3727 res.Body.Close() 3728 } 3729 return nil, &googleapi.Error{ 3730 Code: res.StatusCode, 3731 Header: res.Header, 3732 } 3733 } 3734 if err != nil { 3735 return nil, err 3736 } 3737 defer googleapi.CloseBody(res) 3738 if err := googleapi.CheckResponse(res); err != nil { 3739 return nil, err 3740 } 3741 ret := &IsInvitableUserResponse{ 3742 ServerResponse: googleapi.ServerResponse{ 3743 Header: res.Header, 3744 HTTPStatusCode: res.StatusCode, 3745 }, 3746 } 3747 target := &ret 3748 if err := gensupport.DecodeResponse(target, res); err != nil { 3749 return nil, err 3750 } 3751 return ret, nil 3752 // { 3753 // "description": "Verifies whether a user account is eligible to receive a UserInvitation (is an unmanaged account). Eligibility is based on the following criteria: * the email address is a consumer account and it's the primary email address of the account, and * the domain of the email address matches an existing verified Google Workspace or Cloud Identity domain If both conditions are met, the user is eligible. **Note:** This method is not supported for Workspace Essentials customers.", 3754 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:isInvitableUser", 3755 // "httpMethod": "GET", 3756 // "id": "cloudidentity.customers.userinvitations.isInvitableUser", 3757 // "parameterOrder": [ 3758 // "name" 3759 // ], 3760 // "parameters": { 3761 // "name": { 3762 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3763 // "location": "path", 3764 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3765 // "required": true, 3766 // "type": "string" 3767 // } 3768 // }, 3769 // "path": "v1beta1/{+name}:isInvitableUser", 3770 // "response": { 3771 // "$ref": "IsInvitableUserResponse" 3772 // } 3773 // } 3774 3775} 3776 3777// method id "cloudidentity.customers.userinvitations.list": 3778 3779type CustomersUserinvitationsListCall struct { 3780 s *Service 3781 parent string 3782 urlParams_ gensupport.URLParams 3783 ifNoneMatch_ string 3784 ctx_ context.Context 3785 header_ http.Header 3786} 3787 3788// List: Retrieves a list of UserInvitation resources. **Note:** New 3789// consumer accounts with the customer's verified domain created within 3790// the previous 48 hours will not appear in the result. This delay also 3791// applies to newly-verified domains. 3792// 3793// - parent: The customer ID of the Google Workspace or Cloud Identity 3794// account the UserInvitation resources are associated with. 3795func (r *CustomersUserinvitationsService) List(parent string) *CustomersUserinvitationsListCall { 3796 c := &CustomersUserinvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3797 c.parent = parent 3798 return c 3799} 3800 3801// Filter sets the optional parameter "filter": A query string for 3802// filtering `UserInvitation` results by their current state, in the 3803// format: "state=='invited'". 3804func (c *CustomersUserinvitationsListCall) Filter(filter string) *CustomersUserinvitationsListCall { 3805 c.urlParams_.Set("filter", filter) 3806 return c 3807} 3808 3809// OrderBy sets the optional parameter "orderBy": The sort order of the 3810// list results. You can sort the results in descending order based on 3811// either email or last update timestamp but not both, using 3812// `order_by="email desc". Currently, sorting is supported for 3813// `update_time asc`, `update_time desc`, `email asc`, and `email desc`. 3814// If not specified, results will be returned based on `email asc` 3815// order. 3816func (c *CustomersUserinvitationsListCall) OrderBy(orderBy string) *CustomersUserinvitationsListCall { 3817 c.urlParams_.Set("orderBy", orderBy) 3818 return c 3819} 3820 3821// PageSize sets the optional parameter "pageSize": The maximum number 3822// of UserInvitation resources to return. If unspecified, at most 100 3823// resources will be returned. The maximum value is 200; values above 3824// 200 will be set to 200. 3825func (c *CustomersUserinvitationsListCall) PageSize(pageSize int64) *CustomersUserinvitationsListCall { 3826 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3827 return c 3828} 3829 3830// PageToken sets the optional parameter "pageToken": A page token, 3831// received from a previous `ListUserInvitations` call. Provide this to 3832// retrieve the subsequent page. When paginating, all other parameters 3833// provided to `ListBooks` must match the call that provided the page 3834// token. 3835func (c *CustomersUserinvitationsListCall) PageToken(pageToken string) *CustomersUserinvitationsListCall { 3836 c.urlParams_.Set("pageToken", pageToken) 3837 return c 3838} 3839 3840// Fields allows partial responses to be retrieved. See 3841// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3842// for more information. 3843func (c *CustomersUserinvitationsListCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsListCall { 3844 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3845 return c 3846} 3847 3848// IfNoneMatch sets the optional parameter which makes the operation 3849// fail if the object's ETag matches the given value. This is useful for 3850// getting updates only after the object has changed since the last 3851// request. Use googleapi.IsNotModified to check whether the response 3852// error from Do is the result of In-None-Match. 3853func (c *CustomersUserinvitationsListCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsListCall { 3854 c.ifNoneMatch_ = entityTag 3855 return c 3856} 3857 3858// Context sets the context to be used in this call's Do method. Any 3859// pending HTTP request will be aborted if the provided context is 3860// canceled. 3861func (c *CustomersUserinvitationsListCall) Context(ctx context.Context) *CustomersUserinvitationsListCall { 3862 c.ctx_ = ctx 3863 return c 3864} 3865 3866// Header returns an http.Header that can be modified by the caller to 3867// add HTTP headers to the request. 3868func (c *CustomersUserinvitationsListCall) Header() http.Header { 3869 if c.header_ == nil { 3870 c.header_ = make(http.Header) 3871 } 3872 return c.header_ 3873} 3874 3875func (c *CustomersUserinvitationsListCall) doRequest(alt string) (*http.Response, error) { 3876 reqHeaders := make(http.Header) 3877 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3878 for k, v := range c.header_ { 3879 reqHeaders[k] = v 3880 } 3881 reqHeaders.Set("User-Agent", c.s.userAgent()) 3882 if c.ifNoneMatch_ != "" { 3883 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3884 } 3885 var body io.Reader = nil 3886 c.urlParams_.Set("alt", alt) 3887 c.urlParams_.Set("prettyPrint", "false") 3888 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userinvitations") 3889 urls += "?" + c.urlParams_.Encode() 3890 req, err := http.NewRequest("GET", urls, body) 3891 if err != nil { 3892 return nil, err 3893 } 3894 req.Header = reqHeaders 3895 googleapi.Expand(req.URL, map[string]string{ 3896 "parent": c.parent, 3897 }) 3898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3899} 3900 3901// Do executes the "cloudidentity.customers.userinvitations.list" call. 3902// Exactly one of *ListUserInvitationsResponse or error will be non-nil. 3903// Any non-2xx status code is an error. Response headers are in either 3904// *ListUserInvitationsResponse.ServerResponse.Header or (if a response 3905// was returned at all) in error.(*googleapi.Error).Header. Use 3906// googleapi.IsNotModified to check whether the returned error was 3907// because http.StatusNotModified was returned. 3908func (c *CustomersUserinvitationsListCall) Do(opts ...googleapi.CallOption) (*ListUserInvitationsResponse, error) { 3909 gensupport.SetOptions(c.urlParams_, opts...) 3910 res, err := c.doRequest("json") 3911 if res != nil && res.StatusCode == http.StatusNotModified { 3912 if res.Body != nil { 3913 res.Body.Close() 3914 } 3915 return nil, &googleapi.Error{ 3916 Code: res.StatusCode, 3917 Header: res.Header, 3918 } 3919 } 3920 if err != nil { 3921 return nil, err 3922 } 3923 defer googleapi.CloseBody(res) 3924 if err := googleapi.CheckResponse(res); err != nil { 3925 return nil, err 3926 } 3927 ret := &ListUserInvitationsResponse{ 3928 ServerResponse: googleapi.ServerResponse{ 3929 Header: res.Header, 3930 HTTPStatusCode: res.StatusCode, 3931 }, 3932 } 3933 target := &ret 3934 if err := gensupport.DecodeResponse(target, res); err != nil { 3935 return nil, err 3936 } 3937 return ret, nil 3938 // { 3939 // "description": "Retrieves a list of UserInvitation resources. **Note:** New consumer accounts with the customer's verified domain created within the previous 48 hours will not appear in the result. This delay also applies to newly-verified domains.", 3940 // "flatPath": "v1beta1/customers/{customersId}/userinvitations", 3941 // "httpMethod": "GET", 3942 // "id": "cloudidentity.customers.userinvitations.list", 3943 // "parameterOrder": [ 3944 // "parent" 3945 // ], 3946 // "parameters": { 3947 // "filter": { 3948 // "description": "Optional. A query string for filtering `UserInvitation` results by their current state, in the format: `\"state=='invited'\"`.", 3949 // "location": "query", 3950 // "type": "string" 3951 // }, 3952 // "orderBy": { 3953 // "description": "Optional. The sort order of the list results. You can sort the results in descending order based on either email or last update timestamp but not both, using `order_by=\"email desc\"`. Currently, sorting is supported for `update_time asc`, `update_time desc`, `email asc`, and `email desc`. If not specified, results will be returned based on `email asc` order.", 3954 // "location": "query", 3955 // "type": "string" 3956 // }, 3957 // "pageSize": { 3958 // "description": "Optional. The maximum number of UserInvitation resources to return. If unspecified, at most 100 resources will be returned. The maximum value is 200; values above 200 will be set to 200.", 3959 // "format": "int32", 3960 // "location": "query", 3961 // "type": "integer" 3962 // }, 3963 // "pageToken": { 3964 // "description": "Optional. A page token, received from a previous `ListUserInvitations` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBooks` must match the call that provided the page token.", 3965 // "location": "query", 3966 // "type": "string" 3967 // }, 3968 // "parent": { 3969 // "description": "Required. The customer ID of the Google Workspace or Cloud Identity account the UserInvitation resources are associated with.", 3970 // "location": "path", 3971 // "pattern": "^customers/[^/]+$", 3972 // "required": true, 3973 // "type": "string" 3974 // } 3975 // }, 3976 // "path": "v1beta1/{+parent}/userinvitations", 3977 // "response": { 3978 // "$ref": "ListUserInvitationsResponse" 3979 // } 3980 // } 3981 3982} 3983 3984// Pages invokes f for each page of results. 3985// A non-nil error returned from f will halt the iteration. 3986// The provided context supersedes any context provided to the Context method. 3987func (c *CustomersUserinvitationsListCall) Pages(ctx context.Context, f func(*ListUserInvitationsResponse) error) error { 3988 c.ctx_ = ctx 3989 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3990 for { 3991 x, err := c.Do() 3992 if err != nil { 3993 return err 3994 } 3995 if err := f(x); err != nil { 3996 return err 3997 } 3998 if x.NextPageToken == "" { 3999 return nil 4000 } 4001 c.PageToken(x.NextPageToken) 4002 } 4003} 4004 4005// method id "cloudidentity.customers.userinvitations.send": 4006 4007type CustomersUserinvitationsSendCall struct { 4008 s *Service 4009 name string 4010 senduserinvitationrequest *SendUserInvitationRequest 4011 urlParams_ gensupport.URLParams 4012 ctx_ context.Context 4013 header_ http.Header 4014} 4015 4016// Send: Sends a UserInvitation to email. If the `UserInvitation` does 4017// not exist for this request and it is a valid request, the request 4018// creates a `UserInvitation`. **Note:** The `get` and `list` methods 4019// have a 48-hour delay where newly-created consumer accounts will not 4020// appear in the results. You can still send a `UserInvitation` to those 4021// accounts if you know the unmanaged email address and 4022// IsInvitableUser==True. 4023// 4024// - name: `UserInvitation` name in the format 4025// `customers/{customer}/userinvitations/{user_email_address}`. 4026func (r *CustomersUserinvitationsService) Send(name string, senduserinvitationrequest *SendUserInvitationRequest) *CustomersUserinvitationsSendCall { 4027 c := &CustomersUserinvitationsSendCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4028 c.name = name 4029 c.senduserinvitationrequest = senduserinvitationrequest 4030 return c 4031} 4032 4033// Fields allows partial responses to be retrieved. See 4034// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4035// for more information. 4036func (c *CustomersUserinvitationsSendCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsSendCall { 4037 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4038 return c 4039} 4040 4041// Context sets the context to be used in this call's Do method. Any 4042// pending HTTP request will be aborted if the provided context is 4043// canceled. 4044func (c *CustomersUserinvitationsSendCall) Context(ctx context.Context) *CustomersUserinvitationsSendCall { 4045 c.ctx_ = ctx 4046 return c 4047} 4048 4049// Header returns an http.Header that can be modified by the caller to 4050// add HTTP headers to the request. 4051func (c *CustomersUserinvitationsSendCall) Header() http.Header { 4052 if c.header_ == nil { 4053 c.header_ = make(http.Header) 4054 } 4055 return c.header_ 4056} 4057 4058func (c *CustomersUserinvitationsSendCall) doRequest(alt string) (*http.Response, error) { 4059 reqHeaders := make(http.Header) 4060 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4061 for k, v := range c.header_ { 4062 reqHeaders[k] = v 4063 } 4064 reqHeaders.Set("User-Agent", c.s.userAgent()) 4065 var body io.Reader = nil 4066 body, err := googleapi.WithoutDataWrapper.JSONReader(c.senduserinvitationrequest) 4067 if err != nil { 4068 return nil, err 4069 } 4070 reqHeaders.Set("Content-Type", "application/json") 4071 c.urlParams_.Set("alt", alt) 4072 c.urlParams_.Set("prettyPrint", "false") 4073 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:send") 4074 urls += "?" + c.urlParams_.Encode() 4075 req, err := http.NewRequest("POST", urls, body) 4076 if err != nil { 4077 return nil, err 4078 } 4079 req.Header = reqHeaders 4080 googleapi.Expand(req.URL, map[string]string{ 4081 "name": c.name, 4082 }) 4083 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4084} 4085 4086// Do executes the "cloudidentity.customers.userinvitations.send" call. 4087// Exactly one of *Operation or error will be non-nil. Any non-2xx 4088// status code is an error. Response headers are in either 4089// *Operation.ServerResponse.Header or (if a response was returned at 4090// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4091// to check whether the returned error was because 4092// http.StatusNotModified was returned. 4093func (c *CustomersUserinvitationsSendCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4094 gensupport.SetOptions(c.urlParams_, opts...) 4095 res, err := c.doRequest("json") 4096 if res != nil && res.StatusCode == http.StatusNotModified { 4097 if res.Body != nil { 4098 res.Body.Close() 4099 } 4100 return nil, &googleapi.Error{ 4101 Code: res.StatusCode, 4102 Header: res.Header, 4103 } 4104 } 4105 if err != nil { 4106 return nil, err 4107 } 4108 defer googleapi.CloseBody(res) 4109 if err := googleapi.CheckResponse(res); err != nil { 4110 return nil, err 4111 } 4112 ret := &Operation{ 4113 ServerResponse: googleapi.ServerResponse{ 4114 Header: res.Header, 4115 HTTPStatusCode: res.StatusCode, 4116 }, 4117 } 4118 target := &ret 4119 if err := gensupport.DecodeResponse(target, res); err != nil { 4120 return nil, err 4121 } 4122 return ret, nil 4123 // { 4124 // "description": "Sends a UserInvitation to email. If the `UserInvitation` does not exist for this request and it is a valid request, the request creates a `UserInvitation`. **Note:** The `get` and `list` methods have a 48-hour delay where newly-created consumer accounts will not appear in the results. You can still send a `UserInvitation` to those accounts if you know the unmanaged email address and IsInvitableUser==True.", 4125 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:send", 4126 // "httpMethod": "POST", 4127 // "id": "cloudidentity.customers.userinvitations.send", 4128 // "parameterOrder": [ 4129 // "name" 4130 // ], 4131 // "parameters": { 4132 // "name": { 4133 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 4134 // "location": "path", 4135 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 4136 // "required": true, 4137 // "type": "string" 4138 // } 4139 // }, 4140 // "path": "v1beta1/{+name}:send", 4141 // "request": { 4142 // "$ref": "SendUserInvitationRequest" 4143 // }, 4144 // "response": { 4145 // "$ref": "Operation" 4146 // } 4147 // } 4148 4149} 4150 4151// method id "cloudidentity.devices.cancelWipe": 4152 4153type DevicesCancelWipeCall struct { 4154 s *Service 4155 name string 4156 cancelwipedevicerequest *CancelWipeDeviceRequest 4157 urlParams_ gensupport.URLParams 4158 ctx_ context.Context 4159 header_ http.Header 4160} 4161 4162// CancelWipe: Cancels an unfinished device wipe. This operation can be 4163// used to cancel device wipe in the gap between the wipe operation 4164// returning success and the device being wiped. 4165// 4166// - name: Resource name 4167// (https://cloud.google.com/apis/design/resource_names) of the Device 4168// in format: `devices/{device_id}`, where device_id is the unique ID 4169// assigned to the Device. 4170func (r *DevicesService) CancelWipe(name string, cancelwipedevicerequest *CancelWipeDeviceRequest) *DevicesCancelWipeCall { 4171 c := &DevicesCancelWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4172 c.name = name 4173 c.cancelwipedevicerequest = cancelwipedevicerequest 4174 return c 4175} 4176 4177// Fields allows partial responses to be retrieved. See 4178// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4179// for more information. 4180func (c *DevicesCancelWipeCall) Fields(s ...googleapi.Field) *DevicesCancelWipeCall { 4181 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4182 return c 4183} 4184 4185// Context sets the context to be used in this call's Do method. Any 4186// pending HTTP request will be aborted if the provided context is 4187// canceled. 4188func (c *DevicesCancelWipeCall) Context(ctx context.Context) *DevicesCancelWipeCall { 4189 c.ctx_ = ctx 4190 return c 4191} 4192 4193// Header returns an http.Header that can be modified by the caller to 4194// add HTTP headers to the request. 4195func (c *DevicesCancelWipeCall) Header() http.Header { 4196 if c.header_ == nil { 4197 c.header_ = make(http.Header) 4198 } 4199 return c.header_ 4200} 4201 4202func (c *DevicesCancelWipeCall) doRequest(alt string) (*http.Response, error) { 4203 reqHeaders := make(http.Header) 4204 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4205 for k, v := range c.header_ { 4206 reqHeaders[k] = v 4207 } 4208 reqHeaders.Set("User-Agent", c.s.userAgent()) 4209 var body io.Reader = nil 4210 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedevicerequest) 4211 if err != nil { 4212 return nil, err 4213 } 4214 reqHeaders.Set("Content-Type", "application/json") 4215 c.urlParams_.Set("alt", alt) 4216 c.urlParams_.Set("prettyPrint", "false") 4217 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancelWipe") 4218 urls += "?" + c.urlParams_.Encode() 4219 req, err := http.NewRequest("POST", urls, body) 4220 if err != nil { 4221 return nil, err 4222 } 4223 req.Header = reqHeaders 4224 googleapi.Expand(req.URL, map[string]string{ 4225 "name": c.name, 4226 }) 4227 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4228} 4229 4230// Do executes the "cloudidentity.devices.cancelWipe" call. 4231// Exactly one of *Operation or error will be non-nil. Any non-2xx 4232// status code is an error. Response headers are in either 4233// *Operation.ServerResponse.Header or (if a response was returned at 4234// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4235// to check whether the returned error was because 4236// http.StatusNotModified was returned. 4237func (c *DevicesCancelWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4238 gensupport.SetOptions(c.urlParams_, opts...) 4239 res, err := c.doRequest("json") 4240 if res != nil && res.StatusCode == http.StatusNotModified { 4241 if res.Body != nil { 4242 res.Body.Close() 4243 } 4244 return nil, &googleapi.Error{ 4245 Code: res.StatusCode, 4246 Header: res.Header, 4247 } 4248 } 4249 if err != nil { 4250 return nil, err 4251 } 4252 defer googleapi.CloseBody(res) 4253 if err := googleapi.CheckResponse(res); err != nil { 4254 return nil, err 4255 } 4256 ret := &Operation{ 4257 ServerResponse: googleapi.ServerResponse{ 4258 Header: res.Header, 4259 HTTPStatusCode: res.StatusCode, 4260 }, 4261 } 4262 target := &ret 4263 if err := gensupport.DecodeResponse(target, res); err != nil { 4264 return nil, err 4265 } 4266 return ret, nil 4267 // { 4268 // "description": "Cancels an unfinished device wipe. This operation can be used to cancel device wipe in the gap between the wipe operation returning success and the device being wiped.", 4269 // "flatPath": "v1beta1/devices/{devicesId}:cancelWipe", 4270 // "httpMethod": "POST", 4271 // "id": "cloudidentity.devices.cancelWipe", 4272 // "parameterOrder": [ 4273 // "name" 4274 // ], 4275 // "parameters": { 4276 // "name": { 4277 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}`, where device_id is the unique ID assigned to the Device.", 4278 // "location": "path", 4279 // "pattern": "^devices/[^/]+$", 4280 // "required": true, 4281 // "type": "string" 4282 // } 4283 // }, 4284 // "path": "v1beta1/{+name}:cancelWipe", 4285 // "request": { 4286 // "$ref": "CancelWipeDeviceRequest" 4287 // }, 4288 // "response": { 4289 // "$ref": "Operation" 4290 // } 4291 // } 4292 4293} 4294 4295// method id "cloudidentity.devices.create": 4296 4297type DevicesCreateCall struct { 4298 s *Service 4299 createdevicerequest *CreateDeviceRequest 4300 urlParams_ gensupport.URLParams 4301 ctx_ context.Context 4302 header_ http.Header 4303} 4304 4305// Create: Creates a device. Only company-owned device may be created. 4306// **Note**: This method is available only to customers who have one of 4307// the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise 4308// for Education, and Cloud Identity Premium 4309func (r *DevicesService) Create(createdevicerequest *CreateDeviceRequest) *DevicesCreateCall { 4310 c := &DevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4311 c.createdevicerequest = createdevicerequest 4312 return c 4313} 4314 4315// Fields allows partial responses to be retrieved. See 4316// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4317// for more information. 4318func (c *DevicesCreateCall) Fields(s ...googleapi.Field) *DevicesCreateCall { 4319 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4320 return c 4321} 4322 4323// Context sets the context to be used in this call's Do method. Any 4324// pending HTTP request will be aborted if the provided context is 4325// canceled. 4326func (c *DevicesCreateCall) Context(ctx context.Context) *DevicesCreateCall { 4327 c.ctx_ = ctx 4328 return c 4329} 4330 4331// Header returns an http.Header that can be modified by the caller to 4332// add HTTP headers to the request. 4333func (c *DevicesCreateCall) Header() http.Header { 4334 if c.header_ == nil { 4335 c.header_ = make(http.Header) 4336 } 4337 return c.header_ 4338} 4339 4340func (c *DevicesCreateCall) doRequest(alt string) (*http.Response, error) { 4341 reqHeaders := make(http.Header) 4342 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4343 for k, v := range c.header_ { 4344 reqHeaders[k] = v 4345 } 4346 reqHeaders.Set("User-Agent", c.s.userAgent()) 4347 var body io.Reader = nil 4348 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createdevicerequest) 4349 if err != nil { 4350 return nil, err 4351 } 4352 reqHeaders.Set("Content-Type", "application/json") 4353 c.urlParams_.Set("alt", alt) 4354 c.urlParams_.Set("prettyPrint", "false") 4355 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/devices") 4356 urls += "?" + c.urlParams_.Encode() 4357 req, err := http.NewRequest("POST", urls, body) 4358 if err != nil { 4359 return nil, err 4360 } 4361 req.Header = reqHeaders 4362 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4363} 4364 4365// Do executes the "cloudidentity.devices.create" call. 4366// Exactly one of *Operation or error will be non-nil. Any non-2xx 4367// status code is an error. Response headers are in either 4368// *Operation.ServerResponse.Header or (if a response was returned at 4369// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4370// to check whether the returned error was because 4371// http.StatusNotModified was returned. 4372func (c *DevicesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4373 gensupport.SetOptions(c.urlParams_, opts...) 4374 res, err := c.doRequest("json") 4375 if res != nil && res.StatusCode == http.StatusNotModified { 4376 if res.Body != nil { 4377 res.Body.Close() 4378 } 4379 return nil, &googleapi.Error{ 4380 Code: res.StatusCode, 4381 Header: res.Header, 4382 } 4383 } 4384 if err != nil { 4385 return nil, err 4386 } 4387 defer googleapi.CloseBody(res) 4388 if err := googleapi.CheckResponse(res); err != nil { 4389 return nil, err 4390 } 4391 ret := &Operation{ 4392 ServerResponse: googleapi.ServerResponse{ 4393 Header: res.Header, 4394 HTTPStatusCode: res.StatusCode, 4395 }, 4396 } 4397 target := &ret 4398 if err := gensupport.DecodeResponse(target, res); err != nil { 4399 return nil, err 4400 } 4401 return ret, nil 4402 // { 4403 // "description": "Creates a device. Only company-owned device may be created. **Note**: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium", 4404 // "flatPath": "v1beta1/devices", 4405 // "httpMethod": "POST", 4406 // "id": "cloudidentity.devices.create", 4407 // "parameterOrder": [], 4408 // "parameters": {}, 4409 // "path": "v1beta1/devices", 4410 // "request": { 4411 // "$ref": "CreateDeviceRequest" 4412 // }, 4413 // "response": { 4414 // "$ref": "Operation" 4415 // } 4416 // } 4417 4418} 4419 4420// method id "cloudidentity.devices.delete": 4421 4422type DevicesDeleteCall struct { 4423 s *Service 4424 name string 4425 urlParams_ gensupport.URLParams 4426 ctx_ context.Context 4427 header_ http.Header 4428} 4429 4430// Delete: Deletes the specified device. 4431// 4432// - name: Resource name 4433// (https://cloud.google.com/apis/design/resource_names) of the Device 4434// in format: `devices/{device_id}`, where device_id is the unique ID 4435// assigned to the Device. 4436func (r *DevicesService) Delete(name string) *DevicesDeleteCall { 4437 c := &DevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4438 c.name = name 4439 return c 4440} 4441 4442// Fields allows partial responses to be retrieved. See 4443// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4444// for more information. 4445func (c *DevicesDeleteCall) Fields(s ...googleapi.Field) *DevicesDeleteCall { 4446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4447 return c 4448} 4449 4450// Context sets the context to be used in this call's Do method. Any 4451// pending HTTP request will be aborted if the provided context is 4452// canceled. 4453func (c *DevicesDeleteCall) Context(ctx context.Context) *DevicesDeleteCall { 4454 c.ctx_ = ctx 4455 return c 4456} 4457 4458// Header returns an http.Header that can be modified by the caller to 4459// add HTTP headers to the request. 4460func (c *DevicesDeleteCall) Header() http.Header { 4461 if c.header_ == nil { 4462 c.header_ = make(http.Header) 4463 } 4464 return c.header_ 4465} 4466 4467func (c *DevicesDeleteCall) doRequest(alt string) (*http.Response, error) { 4468 reqHeaders := make(http.Header) 4469 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4470 for k, v := range c.header_ { 4471 reqHeaders[k] = v 4472 } 4473 reqHeaders.Set("User-Agent", c.s.userAgent()) 4474 var body io.Reader = nil 4475 c.urlParams_.Set("alt", alt) 4476 c.urlParams_.Set("prettyPrint", "false") 4477 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4478 urls += "?" + c.urlParams_.Encode() 4479 req, err := http.NewRequest("DELETE", urls, body) 4480 if err != nil { 4481 return nil, err 4482 } 4483 req.Header = reqHeaders 4484 googleapi.Expand(req.URL, map[string]string{ 4485 "name": c.name, 4486 }) 4487 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4488} 4489 4490// Do executes the "cloudidentity.devices.delete" call. 4491// Exactly one of *Operation or error will be non-nil. Any non-2xx 4492// status code is an error. Response headers are in either 4493// *Operation.ServerResponse.Header or (if a response was returned at 4494// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4495// to check whether the returned error was because 4496// http.StatusNotModified was returned. 4497func (c *DevicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4498 gensupport.SetOptions(c.urlParams_, opts...) 4499 res, err := c.doRequest("json") 4500 if res != nil && res.StatusCode == http.StatusNotModified { 4501 if res.Body != nil { 4502 res.Body.Close() 4503 } 4504 return nil, &googleapi.Error{ 4505 Code: res.StatusCode, 4506 Header: res.Header, 4507 } 4508 } 4509 if err != nil { 4510 return nil, err 4511 } 4512 defer googleapi.CloseBody(res) 4513 if err := googleapi.CheckResponse(res); err != nil { 4514 return nil, err 4515 } 4516 ret := &Operation{ 4517 ServerResponse: googleapi.ServerResponse{ 4518 Header: res.Header, 4519 HTTPStatusCode: res.StatusCode, 4520 }, 4521 } 4522 target := &ret 4523 if err := gensupport.DecodeResponse(target, res); err != nil { 4524 return nil, err 4525 } 4526 return ret, nil 4527 // { 4528 // "description": "Deletes the specified device.", 4529 // "flatPath": "v1beta1/devices/{devicesId}", 4530 // "httpMethod": "DELETE", 4531 // "id": "cloudidentity.devices.delete", 4532 // "parameterOrder": [ 4533 // "name" 4534 // ], 4535 // "parameters": { 4536 // "name": { 4537 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}`, where device_id is the unique ID assigned to the Device.", 4538 // "location": "path", 4539 // "pattern": "^devices/[^/]+$", 4540 // "required": true, 4541 // "type": "string" 4542 // } 4543 // }, 4544 // "path": "v1beta1/{+name}", 4545 // "response": { 4546 // "$ref": "Operation" 4547 // } 4548 // } 4549 4550} 4551 4552// method id "cloudidentity.devices.get": 4553 4554type DevicesGetCall struct { 4555 s *Service 4556 name string 4557 urlParams_ gensupport.URLParams 4558 ifNoneMatch_ string 4559 ctx_ context.Context 4560 header_ http.Header 4561} 4562 4563// Get: Retrieves the specified device. 4564// 4565// - name: Resource name 4566// (https://cloud.google.com/apis/design/resource_names) of the Device 4567// in format: `devices/{device_id}`, where device_id is the unique ID 4568// assigned to the Device. 4569func (r *DevicesService) Get(name string) *DevicesGetCall { 4570 c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4571 c.name = name 4572 return c 4573} 4574 4575// Fields allows partial responses to be retrieved. See 4576// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4577// for more information. 4578func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall { 4579 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4580 return c 4581} 4582 4583// IfNoneMatch sets the optional parameter which makes the operation 4584// fail if the object's ETag matches the given value. This is useful for 4585// getting updates only after the object has changed since the last 4586// request. Use googleapi.IsNotModified to check whether the response 4587// error from Do is the result of In-None-Match. 4588func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall { 4589 c.ifNoneMatch_ = entityTag 4590 return c 4591} 4592 4593// Context sets the context to be used in this call's Do method. Any 4594// pending HTTP request will be aborted if the provided context is 4595// canceled. 4596func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall { 4597 c.ctx_ = ctx 4598 return c 4599} 4600 4601// Header returns an http.Header that can be modified by the caller to 4602// add HTTP headers to the request. 4603func (c *DevicesGetCall) Header() http.Header { 4604 if c.header_ == nil { 4605 c.header_ = make(http.Header) 4606 } 4607 return c.header_ 4608} 4609 4610func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { 4611 reqHeaders := make(http.Header) 4612 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4613 for k, v := range c.header_ { 4614 reqHeaders[k] = v 4615 } 4616 reqHeaders.Set("User-Agent", c.s.userAgent()) 4617 if c.ifNoneMatch_ != "" { 4618 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4619 } 4620 var body io.Reader = nil 4621 c.urlParams_.Set("alt", alt) 4622 c.urlParams_.Set("prettyPrint", "false") 4623 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4624 urls += "?" + c.urlParams_.Encode() 4625 req, err := http.NewRequest("GET", urls, body) 4626 if err != nil { 4627 return nil, err 4628 } 4629 req.Header = reqHeaders 4630 googleapi.Expand(req.URL, map[string]string{ 4631 "name": c.name, 4632 }) 4633 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4634} 4635 4636// Do executes the "cloudidentity.devices.get" call. 4637// Exactly one of *Device or error will be non-nil. Any non-2xx status 4638// code is an error. Response headers are in either 4639// *Device.ServerResponse.Header or (if a response was returned at all) 4640// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4641// check whether the returned error was because http.StatusNotModified 4642// was returned. 4643func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4644 gensupport.SetOptions(c.urlParams_, opts...) 4645 res, err := c.doRequest("json") 4646 if res != nil && res.StatusCode == http.StatusNotModified { 4647 if res.Body != nil { 4648 res.Body.Close() 4649 } 4650 return nil, &googleapi.Error{ 4651 Code: res.StatusCode, 4652 Header: res.Header, 4653 } 4654 } 4655 if err != nil { 4656 return nil, err 4657 } 4658 defer googleapi.CloseBody(res) 4659 if err := googleapi.CheckResponse(res); err != nil { 4660 return nil, err 4661 } 4662 ret := &Device{ 4663 ServerResponse: googleapi.ServerResponse{ 4664 Header: res.Header, 4665 HTTPStatusCode: res.StatusCode, 4666 }, 4667 } 4668 target := &ret 4669 if err := gensupport.DecodeResponse(target, res); err != nil { 4670 return nil, err 4671 } 4672 return ret, nil 4673 // { 4674 // "description": "Retrieves the specified device.", 4675 // "flatPath": "v1beta1/devices/{devicesId}", 4676 // "httpMethod": "GET", 4677 // "id": "cloudidentity.devices.get", 4678 // "parameterOrder": [ 4679 // "name" 4680 // ], 4681 // "parameters": { 4682 // "name": { 4683 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}`, where device_id is the unique ID assigned to the Device.", 4684 // "location": "path", 4685 // "pattern": "^devices/[^/]+$", 4686 // "required": true, 4687 // "type": "string" 4688 // } 4689 // }, 4690 // "path": "v1beta1/{+name}", 4691 // "response": { 4692 // "$ref": "Device" 4693 // } 4694 // } 4695 4696} 4697 4698// method id "cloudidentity.devices.list": 4699 4700type DevicesListCall struct { 4701 s *Service 4702 urlParams_ gensupport.URLParams 4703 ifNoneMatch_ string 4704 ctx_ context.Context 4705 header_ http.Header 4706} 4707 4708// List: Lists/Searches devices. 4709func (r *DevicesService) List() *DevicesListCall { 4710 c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4711 return c 4712} 4713 4714// Filter sets the optional parameter "filter": Additional restrictions 4715// when fetching list of devices. For a list of search fields, refer to 4716// Mobile device search fields 4717// (https://developers.google.com/admin-sdk/directory/v1/search-operators). 4718// Multiple search fields are separated by the space character. 4719func (c *DevicesListCall) Filter(filter string) *DevicesListCall { 4720 c.urlParams_.Set("filter", filter) 4721 return c 4722} 4723 4724// OrderBy sets the optional parameter "orderBy": Order specification 4725// for devices in the response. Only one of the following field names 4726// may be used to specify the order: `create_time`, `last_sync_time`, 4727// `model`, `os_version`, `device_type` and `serial_number`. `desc` may 4728// be specified optionally to specify results to be sorted in descending 4729// order. Default order is ascending. 4730func (c *DevicesListCall) OrderBy(orderBy string) *DevicesListCall { 4731 c.urlParams_.Set("orderBy", orderBy) 4732 return c 4733} 4734 4735// PageSize sets the optional parameter "pageSize": The maximum number 4736// of Devices to return. If unspecified, at most 20 Devices will be 4737// returned. The maximum value is 100; values above 100 will be coerced 4738// to 100. 4739func (c *DevicesListCall) PageSize(pageSize int64) *DevicesListCall { 4740 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4741 return c 4742} 4743 4744// PageToken sets the optional parameter "pageToken": A page token, 4745// received from a previous `ListDevices` call. Provide this to retrieve 4746// the subsequent page. When paginating, all other parameters provided 4747// to `ListDevices` must match the call that provided the page token. 4748func (c *DevicesListCall) PageToken(pageToken string) *DevicesListCall { 4749 c.urlParams_.Set("pageToken", pageToken) 4750 return c 4751} 4752 4753// View sets the optional parameter "view": The view to use for the List 4754// request. 4755// 4756// Possible values: 4757// "VIEW_UNSPECIFIED" - Default value. The value is unused. 4758// "COMPANY_INVENTORY" - This view contains all devices imported by 4759// the company admin. Each device in the response contains all 4760// information specified by the company admin when importing the device 4761// (i.e. asset tags). 4762// "USER_ASSIGNED_DEVICES" - This view contains all devices with at 4763// least one user registered on the device. Each device in the response 4764// contains all device information, except for asset tags. 4765func (c *DevicesListCall) View(view string) *DevicesListCall { 4766 c.urlParams_.Set("view", view) 4767 return c 4768} 4769 4770// Fields allows partial responses to be retrieved. See 4771// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4772// for more information. 4773func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall { 4774 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4775 return c 4776} 4777 4778// IfNoneMatch sets the optional parameter which makes the operation 4779// fail if the object's ETag matches the given value. This is useful for 4780// getting updates only after the object has changed since the last 4781// request. Use googleapi.IsNotModified to check whether the response 4782// error from Do is the result of In-None-Match. 4783func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall { 4784 c.ifNoneMatch_ = entityTag 4785 return c 4786} 4787 4788// Context sets the context to be used in this call's Do method. Any 4789// pending HTTP request will be aborted if the provided context is 4790// canceled. 4791func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall { 4792 c.ctx_ = ctx 4793 return c 4794} 4795 4796// Header returns an http.Header that can be modified by the caller to 4797// add HTTP headers to the request. 4798func (c *DevicesListCall) Header() http.Header { 4799 if c.header_ == nil { 4800 c.header_ = make(http.Header) 4801 } 4802 return c.header_ 4803} 4804 4805func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { 4806 reqHeaders := make(http.Header) 4807 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4808 for k, v := range c.header_ { 4809 reqHeaders[k] = v 4810 } 4811 reqHeaders.Set("User-Agent", c.s.userAgent()) 4812 if c.ifNoneMatch_ != "" { 4813 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4814 } 4815 var body io.Reader = nil 4816 c.urlParams_.Set("alt", alt) 4817 c.urlParams_.Set("prettyPrint", "false") 4818 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/devices") 4819 urls += "?" + c.urlParams_.Encode() 4820 req, err := http.NewRequest("GET", urls, body) 4821 if err != nil { 4822 return nil, err 4823 } 4824 req.Header = reqHeaders 4825 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4826} 4827 4828// Do executes the "cloudidentity.devices.list" call. 4829// Exactly one of *ListDevicesResponse or error will be non-nil. Any 4830// non-2xx status code is an error. Response headers are in either 4831// *ListDevicesResponse.ServerResponse.Header or (if a response was 4832// returned at all) in error.(*googleapi.Error).Header. Use 4833// googleapi.IsNotModified to check whether the returned error was 4834// because http.StatusNotModified was returned. 4835func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*ListDevicesResponse, error) { 4836 gensupport.SetOptions(c.urlParams_, opts...) 4837 res, err := c.doRequest("json") 4838 if res != nil && res.StatusCode == http.StatusNotModified { 4839 if res.Body != nil { 4840 res.Body.Close() 4841 } 4842 return nil, &googleapi.Error{ 4843 Code: res.StatusCode, 4844 Header: res.Header, 4845 } 4846 } 4847 if err != nil { 4848 return nil, err 4849 } 4850 defer googleapi.CloseBody(res) 4851 if err := googleapi.CheckResponse(res); err != nil { 4852 return nil, err 4853 } 4854 ret := &ListDevicesResponse{ 4855 ServerResponse: googleapi.ServerResponse{ 4856 Header: res.Header, 4857 HTTPStatusCode: res.StatusCode, 4858 }, 4859 } 4860 target := &ret 4861 if err := gensupport.DecodeResponse(target, res); err != nil { 4862 return nil, err 4863 } 4864 return ret, nil 4865 // { 4866 // "description": "Lists/Searches devices.", 4867 // "flatPath": "v1beta1/devices", 4868 // "httpMethod": "GET", 4869 // "id": "cloudidentity.devices.list", 4870 // "parameterOrder": [], 4871 // "parameters": { 4872 // "filter": { 4873 // "description": "Optional. Additional restrictions when fetching list of devices. For a list of search fields, refer to [Mobile device search fields](https://developers.google.com/admin-sdk/directory/v1/search-operators). Multiple search fields are separated by the space character.", 4874 // "location": "query", 4875 // "type": "string" 4876 // }, 4877 // "orderBy": { 4878 // "description": "Optional. Order specification for devices in the response. Only one of the following field names may be used to specify the order: `create_time`, `last_sync_time`, `model`, `os_version`, `device_type` and `serial_number`. `desc` may be specified optionally to specify results to be sorted in descending order. Default order is ascending.", 4879 // "location": "query", 4880 // "type": "string" 4881 // }, 4882 // "pageSize": { 4883 // "description": "Optional. The maximum number of Devices to return. If unspecified, at most 20 Devices will be returned. The maximum value is 100; values above 100 will be coerced to 100.", 4884 // "format": "int32", 4885 // "location": "query", 4886 // "type": "integer" 4887 // }, 4888 // "pageToken": { 4889 // "description": "Optional. A page token, received from a previous `ListDevices` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDevices` must match the call that provided the page token.", 4890 // "location": "query", 4891 // "type": "string" 4892 // }, 4893 // "view": { 4894 // "description": "Optional. The view to use for the List request.", 4895 // "enum": [ 4896 // "VIEW_UNSPECIFIED", 4897 // "COMPANY_INVENTORY", 4898 // "USER_ASSIGNED_DEVICES" 4899 // ], 4900 // "enumDescriptions": [ 4901 // "Default value. The value is unused.", 4902 // "This view contains all devices imported by the company admin. Each device in the response contains all information specified by the company admin when importing the device (i.e. asset tags).", 4903 // "This view contains all devices with at least one user registered on the device. Each device in the response contains all device information, except for asset tags." 4904 // ], 4905 // "location": "query", 4906 // "type": "string" 4907 // } 4908 // }, 4909 // "path": "v1beta1/devices", 4910 // "response": { 4911 // "$ref": "ListDevicesResponse" 4912 // } 4913 // } 4914 4915} 4916 4917// Pages invokes f for each page of results. 4918// A non-nil error returned from f will halt the iteration. 4919// The provided context supersedes any context provided to the Context method. 4920func (c *DevicesListCall) Pages(ctx context.Context, f func(*ListDevicesResponse) error) error { 4921 c.ctx_ = ctx 4922 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4923 for { 4924 x, err := c.Do() 4925 if err != nil { 4926 return err 4927 } 4928 if err := f(x); err != nil { 4929 return err 4930 } 4931 if x.NextPageToken == "" { 4932 return nil 4933 } 4934 c.PageToken(x.NextPageToken) 4935 } 4936} 4937 4938// method id "cloudidentity.devices.wipe": 4939 4940type DevicesWipeCall struct { 4941 s *Service 4942 name string 4943 wipedevicerequest *WipeDeviceRequest 4944 urlParams_ gensupport.URLParams 4945 ctx_ context.Context 4946 header_ http.Header 4947} 4948 4949// Wipe: Wipes all data on the specified device. 4950// 4951// - name: Resource name 4952// (https://cloud.google.com/apis/design/resource_names) of the Device 4953// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 4954// where device_id is the unique ID assigned to the Device, and 4955// device_user_id is the unique ID assigned to the User. 4956func (r *DevicesService) Wipe(name string, wipedevicerequest *WipeDeviceRequest) *DevicesWipeCall { 4957 c := &DevicesWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4958 c.name = name 4959 c.wipedevicerequest = wipedevicerequest 4960 return c 4961} 4962 4963// Fields allows partial responses to be retrieved. See 4964// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4965// for more information. 4966func (c *DevicesWipeCall) Fields(s ...googleapi.Field) *DevicesWipeCall { 4967 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4968 return c 4969} 4970 4971// Context sets the context to be used in this call's Do method. Any 4972// pending HTTP request will be aborted if the provided context is 4973// canceled. 4974func (c *DevicesWipeCall) Context(ctx context.Context) *DevicesWipeCall { 4975 c.ctx_ = ctx 4976 return c 4977} 4978 4979// Header returns an http.Header that can be modified by the caller to 4980// add HTTP headers to the request. 4981func (c *DevicesWipeCall) Header() http.Header { 4982 if c.header_ == nil { 4983 c.header_ = make(http.Header) 4984 } 4985 return c.header_ 4986} 4987 4988func (c *DevicesWipeCall) doRequest(alt string) (*http.Response, error) { 4989 reqHeaders := make(http.Header) 4990 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4991 for k, v := range c.header_ { 4992 reqHeaders[k] = v 4993 } 4994 reqHeaders.Set("User-Agent", c.s.userAgent()) 4995 var body io.Reader = nil 4996 body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedevicerequest) 4997 if err != nil { 4998 return nil, err 4999 } 5000 reqHeaders.Set("Content-Type", "application/json") 5001 c.urlParams_.Set("alt", alt) 5002 c.urlParams_.Set("prettyPrint", "false") 5003 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wipe") 5004 urls += "?" + c.urlParams_.Encode() 5005 req, err := http.NewRequest("POST", urls, body) 5006 if err != nil { 5007 return nil, err 5008 } 5009 req.Header = reqHeaders 5010 googleapi.Expand(req.URL, map[string]string{ 5011 "name": c.name, 5012 }) 5013 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5014} 5015 5016// Do executes the "cloudidentity.devices.wipe" call. 5017// Exactly one of *Operation or error will be non-nil. Any non-2xx 5018// status code is an error. Response headers are in either 5019// *Operation.ServerResponse.Header or (if a response was returned at 5020// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5021// to check whether the returned error was because 5022// http.StatusNotModified was returned. 5023func (c *DevicesWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5024 gensupport.SetOptions(c.urlParams_, opts...) 5025 res, err := c.doRequest("json") 5026 if res != nil && res.StatusCode == http.StatusNotModified { 5027 if res.Body != nil { 5028 res.Body.Close() 5029 } 5030 return nil, &googleapi.Error{ 5031 Code: res.StatusCode, 5032 Header: res.Header, 5033 } 5034 } 5035 if err != nil { 5036 return nil, err 5037 } 5038 defer googleapi.CloseBody(res) 5039 if err := googleapi.CheckResponse(res); err != nil { 5040 return nil, err 5041 } 5042 ret := &Operation{ 5043 ServerResponse: googleapi.ServerResponse{ 5044 Header: res.Header, 5045 HTTPStatusCode: res.StatusCode, 5046 }, 5047 } 5048 target := &ret 5049 if err := gensupport.DecodeResponse(target, res); err != nil { 5050 return nil, err 5051 } 5052 return ret, nil 5053 // { 5054 // "description": "Wipes all data on the specified device.", 5055 // "flatPath": "v1beta1/devices/{devicesId}:wipe", 5056 // "httpMethod": "POST", 5057 // "id": "cloudidentity.devices.wipe", 5058 // "parameterOrder": [ 5059 // "name" 5060 // ], 5061 // "parameters": { 5062 // "name": { 5063 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5064 // "location": "path", 5065 // "pattern": "^devices/[^/]+$", 5066 // "required": true, 5067 // "type": "string" 5068 // } 5069 // }, 5070 // "path": "v1beta1/{+name}:wipe", 5071 // "request": { 5072 // "$ref": "WipeDeviceRequest" 5073 // }, 5074 // "response": { 5075 // "$ref": "Operation" 5076 // } 5077 // } 5078 5079} 5080 5081// method id "cloudidentity.devices.deviceUsers.approve": 5082 5083type DevicesDeviceUsersApproveCall struct { 5084 s *Service 5085 name string 5086 approvedeviceuserrequest *ApproveDeviceUserRequest 5087 urlParams_ gensupport.URLParams 5088 ctx_ context.Context 5089 header_ http.Header 5090} 5091 5092// Approve: Approves device to access user data. 5093// 5094// - name: Resource name 5095// (https://cloud.google.com/apis/design/resource_names) of the Device 5096// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5097// where device_id is the unique ID assigned to the Device, and 5098// device_user_id is the unique ID assigned to the User. 5099func (r *DevicesDeviceUsersService) Approve(name string, approvedeviceuserrequest *ApproveDeviceUserRequest) *DevicesDeviceUsersApproveCall { 5100 c := &DevicesDeviceUsersApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5101 c.name = name 5102 c.approvedeviceuserrequest = approvedeviceuserrequest 5103 return c 5104} 5105 5106// Fields allows partial responses to be retrieved. See 5107// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5108// for more information. 5109func (c *DevicesDeviceUsersApproveCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersApproveCall { 5110 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5111 return c 5112} 5113 5114// Context sets the context to be used in this call's Do method. Any 5115// pending HTTP request will be aborted if the provided context is 5116// canceled. 5117func (c *DevicesDeviceUsersApproveCall) Context(ctx context.Context) *DevicesDeviceUsersApproveCall { 5118 c.ctx_ = ctx 5119 return c 5120} 5121 5122// Header returns an http.Header that can be modified by the caller to 5123// add HTTP headers to the request. 5124func (c *DevicesDeviceUsersApproveCall) Header() http.Header { 5125 if c.header_ == nil { 5126 c.header_ = make(http.Header) 5127 } 5128 return c.header_ 5129} 5130 5131func (c *DevicesDeviceUsersApproveCall) doRequest(alt string) (*http.Response, error) { 5132 reqHeaders := make(http.Header) 5133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5134 for k, v := range c.header_ { 5135 reqHeaders[k] = v 5136 } 5137 reqHeaders.Set("User-Agent", c.s.userAgent()) 5138 var body io.Reader = nil 5139 body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvedeviceuserrequest) 5140 if err != nil { 5141 return nil, err 5142 } 5143 reqHeaders.Set("Content-Type", "application/json") 5144 c.urlParams_.Set("alt", alt) 5145 c.urlParams_.Set("prettyPrint", "false") 5146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:approve") 5147 urls += "?" + c.urlParams_.Encode() 5148 req, err := http.NewRequest("POST", urls, body) 5149 if err != nil { 5150 return nil, err 5151 } 5152 req.Header = reqHeaders 5153 googleapi.Expand(req.URL, map[string]string{ 5154 "name": c.name, 5155 }) 5156 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5157} 5158 5159// Do executes the "cloudidentity.devices.deviceUsers.approve" call. 5160// Exactly one of *Operation or error will be non-nil. Any non-2xx 5161// status code is an error. Response headers are in either 5162// *Operation.ServerResponse.Header or (if a response was returned at 5163// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5164// to check whether the returned error was because 5165// http.StatusNotModified was returned. 5166func (c *DevicesDeviceUsersApproveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5167 gensupport.SetOptions(c.urlParams_, opts...) 5168 res, err := c.doRequest("json") 5169 if res != nil && res.StatusCode == http.StatusNotModified { 5170 if res.Body != nil { 5171 res.Body.Close() 5172 } 5173 return nil, &googleapi.Error{ 5174 Code: res.StatusCode, 5175 Header: res.Header, 5176 } 5177 } 5178 if err != nil { 5179 return nil, err 5180 } 5181 defer googleapi.CloseBody(res) 5182 if err := googleapi.CheckResponse(res); err != nil { 5183 return nil, err 5184 } 5185 ret := &Operation{ 5186 ServerResponse: googleapi.ServerResponse{ 5187 Header: res.Header, 5188 HTTPStatusCode: res.StatusCode, 5189 }, 5190 } 5191 target := &ret 5192 if err := gensupport.DecodeResponse(target, res); err != nil { 5193 return nil, err 5194 } 5195 return ret, nil 5196 // { 5197 // "description": "Approves device to access user data.", 5198 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:approve", 5199 // "httpMethod": "POST", 5200 // "id": "cloudidentity.devices.deviceUsers.approve", 5201 // "parameterOrder": [ 5202 // "name" 5203 // ], 5204 // "parameters": { 5205 // "name": { 5206 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5207 // "location": "path", 5208 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5209 // "required": true, 5210 // "type": "string" 5211 // } 5212 // }, 5213 // "path": "v1beta1/{+name}:approve", 5214 // "request": { 5215 // "$ref": "ApproveDeviceUserRequest" 5216 // }, 5217 // "response": { 5218 // "$ref": "Operation" 5219 // } 5220 // } 5221 5222} 5223 5224// method id "cloudidentity.devices.deviceUsers.block": 5225 5226type DevicesDeviceUsersBlockCall struct { 5227 s *Service 5228 name string 5229 blockdeviceuserrequest *BlockDeviceUserRequest 5230 urlParams_ gensupport.URLParams 5231 ctx_ context.Context 5232 header_ http.Header 5233} 5234 5235// Block: Blocks device from accessing user data 5236// 5237// - name: Resource name 5238// (https://cloud.google.com/apis/design/resource_names) of the Device 5239// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5240// where device_id is the unique ID assigned to the Device, and 5241// device_user_id is the unique ID assigned to the User. 5242func (r *DevicesDeviceUsersService) Block(name string, blockdeviceuserrequest *BlockDeviceUserRequest) *DevicesDeviceUsersBlockCall { 5243 c := &DevicesDeviceUsersBlockCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5244 c.name = name 5245 c.blockdeviceuserrequest = blockdeviceuserrequest 5246 return c 5247} 5248 5249// Fields allows partial responses to be retrieved. See 5250// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5251// for more information. 5252func (c *DevicesDeviceUsersBlockCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersBlockCall { 5253 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5254 return c 5255} 5256 5257// Context sets the context to be used in this call's Do method. Any 5258// pending HTTP request will be aborted if the provided context is 5259// canceled. 5260func (c *DevicesDeviceUsersBlockCall) Context(ctx context.Context) *DevicesDeviceUsersBlockCall { 5261 c.ctx_ = ctx 5262 return c 5263} 5264 5265// Header returns an http.Header that can be modified by the caller to 5266// add HTTP headers to the request. 5267func (c *DevicesDeviceUsersBlockCall) Header() http.Header { 5268 if c.header_ == nil { 5269 c.header_ = make(http.Header) 5270 } 5271 return c.header_ 5272} 5273 5274func (c *DevicesDeviceUsersBlockCall) doRequest(alt string) (*http.Response, error) { 5275 reqHeaders := make(http.Header) 5276 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5277 for k, v := range c.header_ { 5278 reqHeaders[k] = v 5279 } 5280 reqHeaders.Set("User-Agent", c.s.userAgent()) 5281 var body io.Reader = nil 5282 body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockdeviceuserrequest) 5283 if err != nil { 5284 return nil, err 5285 } 5286 reqHeaders.Set("Content-Type", "application/json") 5287 c.urlParams_.Set("alt", alt) 5288 c.urlParams_.Set("prettyPrint", "false") 5289 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:block") 5290 urls += "?" + c.urlParams_.Encode() 5291 req, err := http.NewRequest("POST", urls, body) 5292 if err != nil { 5293 return nil, err 5294 } 5295 req.Header = reqHeaders 5296 googleapi.Expand(req.URL, map[string]string{ 5297 "name": c.name, 5298 }) 5299 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5300} 5301 5302// Do executes the "cloudidentity.devices.deviceUsers.block" call. 5303// Exactly one of *Operation or error will be non-nil. Any non-2xx 5304// status code is an error. Response headers are in either 5305// *Operation.ServerResponse.Header or (if a response was returned at 5306// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5307// to check whether the returned error was because 5308// http.StatusNotModified was returned. 5309func (c *DevicesDeviceUsersBlockCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5310 gensupport.SetOptions(c.urlParams_, opts...) 5311 res, err := c.doRequest("json") 5312 if res != nil && res.StatusCode == http.StatusNotModified { 5313 if res.Body != nil { 5314 res.Body.Close() 5315 } 5316 return nil, &googleapi.Error{ 5317 Code: res.StatusCode, 5318 Header: res.Header, 5319 } 5320 } 5321 if err != nil { 5322 return nil, err 5323 } 5324 defer googleapi.CloseBody(res) 5325 if err := googleapi.CheckResponse(res); err != nil { 5326 return nil, err 5327 } 5328 ret := &Operation{ 5329 ServerResponse: googleapi.ServerResponse{ 5330 Header: res.Header, 5331 HTTPStatusCode: res.StatusCode, 5332 }, 5333 } 5334 target := &ret 5335 if err := gensupport.DecodeResponse(target, res); err != nil { 5336 return nil, err 5337 } 5338 return ret, nil 5339 // { 5340 // "description": "Blocks device from accessing user data", 5341 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:block", 5342 // "httpMethod": "POST", 5343 // "id": "cloudidentity.devices.deviceUsers.block", 5344 // "parameterOrder": [ 5345 // "name" 5346 // ], 5347 // "parameters": { 5348 // "name": { 5349 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5350 // "location": "path", 5351 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5352 // "required": true, 5353 // "type": "string" 5354 // } 5355 // }, 5356 // "path": "v1beta1/{+name}:block", 5357 // "request": { 5358 // "$ref": "BlockDeviceUserRequest" 5359 // }, 5360 // "response": { 5361 // "$ref": "Operation" 5362 // } 5363 // } 5364 5365} 5366 5367// method id "cloudidentity.devices.deviceUsers.cancelWipe": 5368 5369type DevicesDeviceUsersCancelWipeCall struct { 5370 s *Service 5371 name string 5372 cancelwipedeviceuserrequest *CancelWipeDeviceUserRequest 5373 urlParams_ gensupport.URLParams 5374 ctx_ context.Context 5375 header_ http.Header 5376} 5377 5378// CancelWipe: Cancels an unfinished user account wipe. This operation 5379// can be used to cancel device wipe in the gap between the wipe 5380// operation returning success and the device being wiped. 5381// 5382// - name: Resource name 5383// (https://cloud.google.com/apis/design/resource_names) of the Device 5384// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5385// where device_id is the unique ID assigned to the Device, and 5386// device_user_id is the unique ID assigned to the User. 5387func (r *DevicesDeviceUsersService) CancelWipe(name string, cancelwipedeviceuserrequest *CancelWipeDeviceUserRequest) *DevicesDeviceUsersCancelWipeCall { 5388 c := &DevicesDeviceUsersCancelWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5389 c.name = name 5390 c.cancelwipedeviceuserrequest = cancelwipedeviceuserrequest 5391 return c 5392} 5393 5394// Fields allows partial responses to be retrieved. See 5395// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5396// for more information. 5397func (c *DevicesDeviceUsersCancelWipeCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersCancelWipeCall { 5398 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5399 return c 5400} 5401 5402// Context sets the context to be used in this call's Do method. Any 5403// pending HTTP request will be aborted if the provided context is 5404// canceled. 5405func (c *DevicesDeviceUsersCancelWipeCall) Context(ctx context.Context) *DevicesDeviceUsersCancelWipeCall { 5406 c.ctx_ = ctx 5407 return c 5408} 5409 5410// Header returns an http.Header that can be modified by the caller to 5411// add HTTP headers to the request. 5412func (c *DevicesDeviceUsersCancelWipeCall) Header() http.Header { 5413 if c.header_ == nil { 5414 c.header_ = make(http.Header) 5415 } 5416 return c.header_ 5417} 5418 5419func (c *DevicesDeviceUsersCancelWipeCall) doRequest(alt string) (*http.Response, error) { 5420 reqHeaders := make(http.Header) 5421 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5422 for k, v := range c.header_ { 5423 reqHeaders[k] = v 5424 } 5425 reqHeaders.Set("User-Agent", c.s.userAgent()) 5426 var body io.Reader = nil 5427 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedeviceuserrequest) 5428 if err != nil { 5429 return nil, err 5430 } 5431 reqHeaders.Set("Content-Type", "application/json") 5432 c.urlParams_.Set("alt", alt) 5433 c.urlParams_.Set("prettyPrint", "false") 5434 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancelWipe") 5435 urls += "?" + c.urlParams_.Encode() 5436 req, err := http.NewRequest("POST", urls, body) 5437 if err != nil { 5438 return nil, err 5439 } 5440 req.Header = reqHeaders 5441 googleapi.Expand(req.URL, map[string]string{ 5442 "name": c.name, 5443 }) 5444 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5445} 5446 5447// Do executes the "cloudidentity.devices.deviceUsers.cancelWipe" call. 5448// Exactly one of *Operation or error will be non-nil. Any non-2xx 5449// status code is an error. Response headers are in either 5450// *Operation.ServerResponse.Header or (if a response was returned at 5451// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5452// to check whether the returned error was because 5453// http.StatusNotModified was returned. 5454func (c *DevicesDeviceUsersCancelWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5455 gensupport.SetOptions(c.urlParams_, opts...) 5456 res, err := c.doRequest("json") 5457 if res != nil && res.StatusCode == http.StatusNotModified { 5458 if res.Body != nil { 5459 res.Body.Close() 5460 } 5461 return nil, &googleapi.Error{ 5462 Code: res.StatusCode, 5463 Header: res.Header, 5464 } 5465 } 5466 if err != nil { 5467 return nil, err 5468 } 5469 defer googleapi.CloseBody(res) 5470 if err := googleapi.CheckResponse(res); err != nil { 5471 return nil, err 5472 } 5473 ret := &Operation{ 5474 ServerResponse: googleapi.ServerResponse{ 5475 Header: res.Header, 5476 HTTPStatusCode: res.StatusCode, 5477 }, 5478 } 5479 target := &ret 5480 if err := gensupport.DecodeResponse(target, res); err != nil { 5481 return nil, err 5482 } 5483 return ret, nil 5484 // { 5485 // "description": "Cancels an unfinished user account wipe. This operation can be used to cancel device wipe in the gap between the wipe operation returning success and the device being wiped.", 5486 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:cancelWipe", 5487 // "httpMethod": "POST", 5488 // "id": "cloudidentity.devices.deviceUsers.cancelWipe", 5489 // "parameterOrder": [ 5490 // "name" 5491 // ], 5492 // "parameters": { 5493 // "name": { 5494 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5495 // "location": "path", 5496 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5497 // "required": true, 5498 // "type": "string" 5499 // } 5500 // }, 5501 // "path": "v1beta1/{+name}:cancelWipe", 5502 // "request": { 5503 // "$ref": "CancelWipeDeviceUserRequest" 5504 // }, 5505 // "response": { 5506 // "$ref": "Operation" 5507 // } 5508 // } 5509 5510} 5511 5512// method id "cloudidentity.devices.deviceUsers.delete": 5513 5514type DevicesDeviceUsersDeleteCall struct { 5515 s *Service 5516 name string 5517 urlParams_ gensupport.URLParams 5518 ctx_ context.Context 5519 header_ http.Header 5520} 5521 5522// Delete: Deletes the specified DeviceUser. This also revokes the 5523// user's access to device data. 5524// 5525// - name: Resource name 5526// (https://cloud.google.com/apis/design/resource_names) of the Device 5527// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5528// where device_id is the unique ID assigned to the Device, and 5529// device_user_id is the unique ID assigned to the User. 5530func (r *DevicesDeviceUsersService) Delete(name string) *DevicesDeviceUsersDeleteCall { 5531 c := &DevicesDeviceUsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5532 c.name = name 5533 return c 5534} 5535 5536// Fields allows partial responses to be retrieved. See 5537// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5538// for more information. 5539func (c *DevicesDeviceUsersDeleteCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersDeleteCall { 5540 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5541 return c 5542} 5543 5544// Context sets the context to be used in this call's Do method. Any 5545// pending HTTP request will be aborted if the provided context is 5546// canceled. 5547func (c *DevicesDeviceUsersDeleteCall) Context(ctx context.Context) *DevicesDeviceUsersDeleteCall { 5548 c.ctx_ = ctx 5549 return c 5550} 5551 5552// Header returns an http.Header that can be modified by the caller to 5553// add HTTP headers to the request. 5554func (c *DevicesDeviceUsersDeleteCall) Header() http.Header { 5555 if c.header_ == nil { 5556 c.header_ = make(http.Header) 5557 } 5558 return c.header_ 5559} 5560 5561func (c *DevicesDeviceUsersDeleteCall) doRequest(alt string) (*http.Response, error) { 5562 reqHeaders := make(http.Header) 5563 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5564 for k, v := range c.header_ { 5565 reqHeaders[k] = v 5566 } 5567 reqHeaders.Set("User-Agent", c.s.userAgent()) 5568 var body io.Reader = nil 5569 c.urlParams_.Set("alt", alt) 5570 c.urlParams_.Set("prettyPrint", "false") 5571 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5572 urls += "?" + c.urlParams_.Encode() 5573 req, err := http.NewRequest("DELETE", urls, body) 5574 if err != nil { 5575 return nil, err 5576 } 5577 req.Header = reqHeaders 5578 googleapi.Expand(req.URL, map[string]string{ 5579 "name": c.name, 5580 }) 5581 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5582} 5583 5584// Do executes the "cloudidentity.devices.deviceUsers.delete" call. 5585// Exactly one of *Operation or error will be non-nil. Any non-2xx 5586// status code is an error. Response headers are in either 5587// *Operation.ServerResponse.Header or (if a response was returned at 5588// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5589// to check whether the returned error was because 5590// http.StatusNotModified was returned. 5591func (c *DevicesDeviceUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5592 gensupport.SetOptions(c.urlParams_, opts...) 5593 res, err := c.doRequest("json") 5594 if res != nil && res.StatusCode == http.StatusNotModified { 5595 if res.Body != nil { 5596 res.Body.Close() 5597 } 5598 return nil, &googleapi.Error{ 5599 Code: res.StatusCode, 5600 Header: res.Header, 5601 } 5602 } 5603 if err != nil { 5604 return nil, err 5605 } 5606 defer googleapi.CloseBody(res) 5607 if err := googleapi.CheckResponse(res); err != nil { 5608 return nil, err 5609 } 5610 ret := &Operation{ 5611 ServerResponse: googleapi.ServerResponse{ 5612 Header: res.Header, 5613 HTTPStatusCode: res.StatusCode, 5614 }, 5615 } 5616 target := &ret 5617 if err := gensupport.DecodeResponse(target, res); err != nil { 5618 return nil, err 5619 } 5620 return ret, nil 5621 // { 5622 // "description": "Deletes the specified DeviceUser. This also revokes the user's access to device data.", 5623 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}", 5624 // "httpMethod": "DELETE", 5625 // "id": "cloudidentity.devices.deviceUsers.delete", 5626 // "parameterOrder": [ 5627 // "name" 5628 // ], 5629 // "parameters": { 5630 // "name": { 5631 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5632 // "location": "path", 5633 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5634 // "required": true, 5635 // "type": "string" 5636 // } 5637 // }, 5638 // "path": "v1beta1/{+name}", 5639 // "response": { 5640 // "$ref": "Operation" 5641 // } 5642 // } 5643 5644} 5645 5646// method id "cloudidentity.devices.deviceUsers.get": 5647 5648type DevicesDeviceUsersGetCall struct { 5649 s *Service 5650 name string 5651 urlParams_ gensupport.URLParams 5652 ifNoneMatch_ string 5653 ctx_ context.Context 5654 header_ http.Header 5655} 5656 5657// Get: Retrieves the specified DeviceUser 5658// 5659// - name: Resource name 5660// (https://cloud.google.com/apis/design/resource_names) of the Device 5661// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5662// where device_id is the unique ID assigned to the Device, and 5663// device_user_id is the unique ID assigned to the User. 5664func (r *DevicesDeviceUsersService) Get(name string) *DevicesDeviceUsersGetCall { 5665 c := &DevicesDeviceUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5666 c.name = name 5667 return c 5668} 5669 5670// Fields allows partial responses to be retrieved. See 5671// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5672// for more information. 5673func (c *DevicesDeviceUsersGetCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersGetCall { 5674 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5675 return c 5676} 5677 5678// IfNoneMatch sets the optional parameter which makes the operation 5679// fail if the object's ETag matches the given value. This is useful for 5680// getting updates only after the object has changed since the last 5681// request. Use googleapi.IsNotModified to check whether the response 5682// error from Do is the result of In-None-Match. 5683func (c *DevicesDeviceUsersGetCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersGetCall { 5684 c.ifNoneMatch_ = entityTag 5685 return c 5686} 5687 5688// Context sets the context to be used in this call's Do method. Any 5689// pending HTTP request will be aborted if the provided context is 5690// canceled. 5691func (c *DevicesDeviceUsersGetCall) Context(ctx context.Context) *DevicesDeviceUsersGetCall { 5692 c.ctx_ = ctx 5693 return c 5694} 5695 5696// Header returns an http.Header that can be modified by the caller to 5697// add HTTP headers to the request. 5698func (c *DevicesDeviceUsersGetCall) Header() http.Header { 5699 if c.header_ == nil { 5700 c.header_ = make(http.Header) 5701 } 5702 return c.header_ 5703} 5704 5705func (c *DevicesDeviceUsersGetCall) doRequest(alt string) (*http.Response, error) { 5706 reqHeaders := make(http.Header) 5707 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5708 for k, v := range c.header_ { 5709 reqHeaders[k] = v 5710 } 5711 reqHeaders.Set("User-Agent", c.s.userAgent()) 5712 if c.ifNoneMatch_ != "" { 5713 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5714 } 5715 var body io.Reader = nil 5716 c.urlParams_.Set("alt", alt) 5717 c.urlParams_.Set("prettyPrint", "false") 5718 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5719 urls += "?" + c.urlParams_.Encode() 5720 req, err := http.NewRequest("GET", urls, body) 5721 if err != nil { 5722 return nil, err 5723 } 5724 req.Header = reqHeaders 5725 googleapi.Expand(req.URL, map[string]string{ 5726 "name": c.name, 5727 }) 5728 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5729} 5730 5731// Do executes the "cloudidentity.devices.deviceUsers.get" call. 5732// Exactly one of *DeviceUser or error will be non-nil. Any non-2xx 5733// status code is an error. Response headers are in either 5734// *DeviceUser.ServerResponse.Header or (if a response was returned at 5735// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5736// to check whether the returned error was because 5737// http.StatusNotModified was returned. 5738func (c *DevicesDeviceUsersGetCall) Do(opts ...googleapi.CallOption) (*DeviceUser, error) { 5739 gensupport.SetOptions(c.urlParams_, opts...) 5740 res, err := c.doRequest("json") 5741 if res != nil && res.StatusCode == http.StatusNotModified { 5742 if res.Body != nil { 5743 res.Body.Close() 5744 } 5745 return nil, &googleapi.Error{ 5746 Code: res.StatusCode, 5747 Header: res.Header, 5748 } 5749 } 5750 if err != nil { 5751 return nil, err 5752 } 5753 defer googleapi.CloseBody(res) 5754 if err := googleapi.CheckResponse(res); err != nil { 5755 return nil, err 5756 } 5757 ret := &DeviceUser{ 5758 ServerResponse: googleapi.ServerResponse{ 5759 Header: res.Header, 5760 HTTPStatusCode: res.StatusCode, 5761 }, 5762 } 5763 target := &ret 5764 if err := gensupport.DecodeResponse(target, res); err != nil { 5765 return nil, err 5766 } 5767 return ret, nil 5768 // { 5769 // "description": "Retrieves the specified DeviceUser", 5770 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}", 5771 // "httpMethod": "GET", 5772 // "id": "cloudidentity.devices.deviceUsers.get", 5773 // "parameterOrder": [ 5774 // "name" 5775 // ], 5776 // "parameters": { 5777 // "name": { 5778 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 5779 // "location": "path", 5780 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5781 // "required": true, 5782 // "type": "string" 5783 // } 5784 // }, 5785 // "path": "v1beta1/{+name}", 5786 // "response": { 5787 // "$ref": "DeviceUser" 5788 // } 5789 // } 5790 5791} 5792 5793// method id "cloudidentity.devices.deviceUsers.list": 5794 5795type DevicesDeviceUsersListCall struct { 5796 s *Service 5797 parent string 5798 urlParams_ gensupport.URLParams 5799 ifNoneMatch_ string 5800 ctx_ context.Context 5801 header_ http.Header 5802} 5803 5804// List: Lists/Searches DeviceUsers. 5805// 5806// - parent: To list all DeviceUsers, set this to "devices/-". To list 5807// all DeviceUsers owned by a device, set this to the resource name of 5808// the device. Format: devices/{device}. 5809func (r *DevicesDeviceUsersService) List(parent string) *DevicesDeviceUsersListCall { 5810 c := &DevicesDeviceUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5811 c.parent = parent 5812 return c 5813} 5814 5815// Filter sets the optional parameter "filter": Additional restrictions 5816// when fetching list of devices. For a list of search fields, refer to 5817// Mobile device search fields 5818// (https://developers.google.com/admin-sdk/directory/v1/search-operators). 5819// Multiple search fields are separated by the space character. 5820func (c *DevicesDeviceUsersListCall) Filter(filter string) *DevicesDeviceUsersListCall { 5821 c.urlParams_.Set("filter", filter) 5822 return c 5823} 5824 5825// OrderBy sets the optional parameter "orderBy": Order specification 5826// for devices in the response. 5827func (c *DevicesDeviceUsersListCall) OrderBy(orderBy string) *DevicesDeviceUsersListCall { 5828 c.urlParams_.Set("orderBy", orderBy) 5829 return c 5830} 5831 5832// PageSize sets the optional parameter "pageSize": The maximum number 5833// of DeviceUsers to return. If unspecified, at most 5 DeviceUsers will 5834// be returned. The maximum value is 20; values above 20 will be coerced 5835// to 20. 5836func (c *DevicesDeviceUsersListCall) PageSize(pageSize int64) *DevicesDeviceUsersListCall { 5837 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5838 return c 5839} 5840 5841// PageToken sets the optional parameter "pageToken": A page token, 5842// received from a previous `ListDeviceUsers` call. Provide this to 5843// retrieve the subsequent page. When paginating, all other parameters 5844// provided to `ListBooks` must match the call that provided the page 5845// token. 5846func (c *DevicesDeviceUsersListCall) PageToken(pageToken string) *DevicesDeviceUsersListCall { 5847 c.urlParams_.Set("pageToken", pageToken) 5848 return c 5849} 5850 5851// Fields allows partial responses to be retrieved. See 5852// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5853// for more information. 5854func (c *DevicesDeviceUsersListCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersListCall { 5855 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5856 return c 5857} 5858 5859// IfNoneMatch sets the optional parameter which makes the operation 5860// fail if the object's ETag matches the given value. This is useful for 5861// getting updates only after the object has changed since the last 5862// request. Use googleapi.IsNotModified to check whether the response 5863// error from Do is the result of In-None-Match. 5864func (c *DevicesDeviceUsersListCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersListCall { 5865 c.ifNoneMatch_ = entityTag 5866 return c 5867} 5868 5869// Context sets the context to be used in this call's Do method. Any 5870// pending HTTP request will be aborted if the provided context is 5871// canceled. 5872func (c *DevicesDeviceUsersListCall) Context(ctx context.Context) *DevicesDeviceUsersListCall { 5873 c.ctx_ = ctx 5874 return c 5875} 5876 5877// Header returns an http.Header that can be modified by the caller to 5878// add HTTP headers to the request. 5879func (c *DevicesDeviceUsersListCall) Header() http.Header { 5880 if c.header_ == nil { 5881 c.header_ = make(http.Header) 5882 } 5883 return c.header_ 5884} 5885 5886func (c *DevicesDeviceUsersListCall) doRequest(alt string) (*http.Response, error) { 5887 reqHeaders := make(http.Header) 5888 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5889 for k, v := range c.header_ { 5890 reqHeaders[k] = v 5891 } 5892 reqHeaders.Set("User-Agent", c.s.userAgent()) 5893 if c.ifNoneMatch_ != "" { 5894 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5895 } 5896 var body io.Reader = nil 5897 c.urlParams_.Set("alt", alt) 5898 c.urlParams_.Set("prettyPrint", "false") 5899 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deviceUsers") 5900 urls += "?" + c.urlParams_.Encode() 5901 req, err := http.NewRequest("GET", urls, body) 5902 if err != nil { 5903 return nil, err 5904 } 5905 req.Header = reqHeaders 5906 googleapi.Expand(req.URL, map[string]string{ 5907 "parent": c.parent, 5908 }) 5909 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5910} 5911 5912// Do executes the "cloudidentity.devices.deviceUsers.list" call. 5913// Exactly one of *ListDeviceUsersResponse or error will be non-nil. Any 5914// non-2xx status code is an error. Response headers are in either 5915// *ListDeviceUsersResponse.ServerResponse.Header or (if a response was 5916// returned at all) in error.(*googleapi.Error).Header. Use 5917// googleapi.IsNotModified to check whether the returned error was 5918// because http.StatusNotModified was returned. 5919func (c *DevicesDeviceUsersListCall) Do(opts ...googleapi.CallOption) (*ListDeviceUsersResponse, error) { 5920 gensupport.SetOptions(c.urlParams_, opts...) 5921 res, err := c.doRequest("json") 5922 if res != nil && res.StatusCode == http.StatusNotModified { 5923 if res.Body != nil { 5924 res.Body.Close() 5925 } 5926 return nil, &googleapi.Error{ 5927 Code: res.StatusCode, 5928 Header: res.Header, 5929 } 5930 } 5931 if err != nil { 5932 return nil, err 5933 } 5934 defer googleapi.CloseBody(res) 5935 if err := googleapi.CheckResponse(res); err != nil { 5936 return nil, err 5937 } 5938 ret := &ListDeviceUsersResponse{ 5939 ServerResponse: googleapi.ServerResponse{ 5940 Header: res.Header, 5941 HTTPStatusCode: res.StatusCode, 5942 }, 5943 } 5944 target := &ret 5945 if err := gensupport.DecodeResponse(target, res); err != nil { 5946 return nil, err 5947 } 5948 return ret, nil 5949 // { 5950 // "description": "Lists/Searches DeviceUsers.", 5951 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers", 5952 // "httpMethod": "GET", 5953 // "id": "cloudidentity.devices.deviceUsers.list", 5954 // "parameterOrder": [ 5955 // "parent" 5956 // ], 5957 // "parameters": { 5958 // "filter": { 5959 // "description": "Optional. Additional restrictions when fetching list of devices. For a list of search fields, refer to [Mobile device search fields](https://developers.google.com/admin-sdk/directory/v1/search-operators). Multiple search fields are separated by the space character.", 5960 // "location": "query", 5961 // "type": "string" 5962 // }, 5963 // "orderBy": { 5964 // "description": "Optional. Order specification for devices in the response.", 5965 // "location": "query", 5966 // "type": "string" 5967 // }, 5968 // "pageSize": { 5969 // "description": "Optional. The maximum number of DeviceUsers to return. If unspecified, at most 5 DeviceUsers will be returned. The maximum value is 20; values above 20 will be coerced to 20.", 5970 // "format": "int32", 5971 // "location": "query", 5972 // "type": "integer" 5973 // }, 5974 // "pageToken": { 5975 // "description": "Optional. A page token, received from a previous `ListDeviceUsers` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBooks` must match the call that provided the page token.", 5976 // "location": "query", 5977 // "type": "string" 5978 // }, 5979 // "parent": { 5980 // "description": "Required. To list all DeviceUsers, set this to \"devices/-\". To list all DeviceUsers owned by a device, set this to the resource name of the device. Format: devices/{device}", 5981 // "location": "path", 5982 // "pattern": "^devices/[^/]+$", 5983 // "required": true, 5984 // "type": "string" 5985 // } 5986 // }, 5987 // "path": "v1beta1/{+parent}/deviceUsers", 5988 // "response": { 5989 // "$ref": "ListDeviceUsersResponse" 5990 // } 5991 // } 5992 5993} 5994 5995// Pages invokes f for each page of results. 5996// A non-nil error returned from f will halt the iteration. 5997// The provided context supersedes any context provided to the Context method. 5998func (c *DevicesDeviceUsersListCall) Pages(ctx context.Context, f func(*ListDeviceUsersResponse) error) error { 5999 c.ctx_ = ctx 6000 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6001 for { 6002 x, err := c.Do() 6003 if err != nil { 6004 return err 6005 } 6006 if err := f(x); err != nil { 6007 return err 6008 } 6009 if x.NextPageToken == "" { 6010 return nil 6011 } 6012 c.PageToken(x.NextPageToken) 6013 } 6014} 6015 6016// method id "cloudidentity.devices.deviceUsers.lookup": 6017 6018type DevicesDeviceUsersLookupCall struct { 6019 s *Service 6020 parent string 6021 urlParams_ gensupport.URLParams 6022 ifNoneMatch_ string 6023 ctx_ context.Context 6024 header_ http.Header 6025} 6026 6027// Lookup: Looks up resource names of the DeviceUsers associated with 6028// the caller's credentials, as well as the properties provided in the 6029// request. This method must be called with end-user credentials with 6030// the scope: 6031// https://www.googleapis.com/auth/cloud-identity.devices.lookup If 6032// multiple properties are provided, only DeviceUsers having all of 6033// these properties are considered as matches - i.e. the query behaves 6034// like an AND. Different platforms require different amounts of 6035// information from the caller to ensure that the DeviceUser is uniquely 6036// identified. - iOS: No properties need to be passed, the caller's 6037// credentials are sufficient to identify the corresponding DeviceUser. 6038// - Android: Specifying the 'android_id' field is required. - Desktop: 6039// Specifying the 'raw_resource_id' field is required. 6040// 6041// - parent: Must be set to "devices/-/deviceUsers" to search across all 6042// DeviceUser belonging to the user. 6043func (r *DevicesDeviceUsersService) Lookup(parent string) *DevicesDeviceUsersLookupCall { 6044 c := &DevicesDeviceUsersLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6045 c.parent = parent 6046 return c 6047} 6048 6049// AndroidId sets the optional parameter "androidId": Android Id 6050// returned by Settings.Secure#ANDROID_ID 6051// (https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). 6052func (c *DevicesDeviceUsersLookupCall) AndroidId(androidId string) *DevicesDeviceUsersLookupCall { 6053 c.urlParams_.Set("androidId", androidId) 6054 return c 6055} 6056 6057// PageSize sets the optional parameter "pageSize": The maximum number 6058// of DeviceUsers to return. If unspecified, at most 20 DeviceUsers will 6059// be returned. The maximum value is 20; values above 20 will be coerced 6060// to 20. 6061func (c *DevicesDeviceUsersLookupCall) PageSize(pageSize int64) *DevicesDeviceUsersLookupCall { 6062 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6063 return c 6064} 6065 6066// PageToken sets the optional parameter "pageToken": A page token, 6067// received from a previous `LookupDeviceUsers` call. Provide this to 6068// retrieve the subsequent page. When paginating, all other parameters 6069// provided to `LookupDeviceUsers` must match the call that provided the 6070// page token. 6071func (c *DevicesDeviceUsersLookupCall) PageToken(pageToken string) *DevicesDeviceUsersLookupCall { 6072 c.urlParams_.Set("pageToken", pageToken) 6073 return c 6074} 6075 6076// RawResourceId sets the optional parameter "rawResourceId": Raw 6077// Resource Id used by Google Endpoint Verification. If the user is 6078// enrolled into Google Endpoint Verification, this id will be saved as 6079// the 'device_resource_id' field in the following platform dependent 6080// files. Mac: ~/.secureConnect/context_aware_config.json Windows: 6081// C:\Users\%USERPROFILE%\.secureConnect\context_aware_config.json 6082// Linux: ~/.secureConnect/context_aware_config.json 6083func (c *DevicesDeviceUsersLookupCall) RawResourceId(rawResourceId string) *DevicesDeviceUsersLookupCall { 6084 c.urlParams_.Set("rawResourceId", rawResourceId) 6085 return c 6086} 6087 6088// UserId sets the optional parameter "userId": The user whose 6089// DeviceUser's resource name will be fetched. Must be set to 'me' to 6090// fetch the DeviceUser's resource name for the calling user. 6091func (c *DevicesDeviceUsersLookupCall) UserId(userId string) *DevicesDeviceUsersLookupCall { 6092 c.urlParams_.Set("userId", userId) 6093 return c 6094} 6095 6096// Fields allows partial responses to be retrieved. See 6097// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6098// for more information. 6099func (c *DevicesDeviceUsersLookupCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersLookupCall { 6100 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6101 return c 6102} 6103 6104// IfNoneMatch sets the optional parameter which makes the operation 6105// fail if the object's ETag matches the given value. This is useful for 6106// getting updates only after the object has changed since the last 6107// request. Use googleapi.IsNotModified to check whether the response 6108// error from Do is the result of In-None-Match. 6109func (c *DevicesDeviceUsersLookupCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersLookupCall { 6110 c.ifNoneMatch_ = entityTag 6111 return c 6112} 6113 6114// Context sets the context to be used in this call's Do method. Any 6115// pending HTTP request will be aborted if the provided context is 6116// canceled. 6117func (c *DevicesDeviceUsersLookupCall) Context(ctx context.Context) *DevicesDeviceUsersLookupCall { 6118 c.ctx_ = ctx 6119 return c 6120} 6121 6122// Header returns an http.Header that can be modified by the caller to 6123// add HTTP headers to the request. 6124func (c *DevicesDeviceUsersLookupCall) Header() http.Header { 6125 if c.header_ == nil { 6126 c.header_ = make(http.Header) 6127 } 6128 return c.header_ 6129} 6130 6131func (c *DevicesDeviceUsersLookupCall) doRequest(alt string) (*http.Response, error) { 6132 reqHeaders := make(http.Header) 6133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6134 for k, v := range c.header_ { 6135 reqHeaders[k] = v 6136 } 6137 reqHeaders.Set("User-Agent", c.s.userAgent()) 6138 if c.ifNoneMatch_ != "" { 6139 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6140 } 6141 var body io.Reader = nil 6142 c.urlParams_.Set("alt", alt) 6143 c.urlParams_.Set("prettyPrint", "false") 6144 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:lookup") 6145 urls += "?" + c.urlParams_.Encode() 6146 req, err := http.NewRequest("GET", urls, body) 6147 if err != nil { 6148 return nil, err 6149 } 6150 req.Header = reqHeaders 6151 googleapi.Expand(req.URL, map[string]string{ 6152 "parent": c.parent, 6153 }) 6154 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6155} 6156 6157// Do executes the "cloudidentity.devices.deviceUsers.lookup" call. 6158// Exactly one of *LookupSelfDeviceUsersResponse or error will be 6159// non-nil. Any non-2xx status code is an error. Response headers are in 6160// either *LookupSelfDeviceUsersResponse.ServerResponse.Header or (if a 6161// response was returned at all) in error.(*googleapi.Error).Header. Use 6162// googleapi.IsNotModified to check whether the returned error was 6163// because http.StatusNotModified was returned. 6164func (c *DevicesDeviceUsersLookupCall) Do(opts ...googleapi.CallOption) (*LookupSelfDeviceUsersResponse, error) { 6165 gensupport.SetOptions(c.urlParams_, opts...) 6166 res, err := c.doRequest("json") 6167 if res != nil && res.StatusCode == http.StatusNotModified { 6168 if res.Body != nil { 6169 res.Body.Close() 6170 } 6171 return nil, &googleapi.Error{ 6172 Code: res.StatusCode, 6173 Header: res.Header, 6174 } 6175 } 6176 if err != nil { 6177 return nil, err 6178 } 6179 defer googleapi.CloseBody(res) 6180 if err := googleapi.CheckResponse(res); err != nil { 6181 return nil, err 6182 } 6183 ret := &LookupSelfDeviceUsersResponse{ 6184 ServerResponse: googleapi.ServerResponse{ 6185 Header: res.Header, 6186 HTTPStatusCode: res.StatusCode, 6187 }, 6188 } 6189 target := &ret 6190 if err := gensupport.DecodeResponse(target, res); err != nil { 6191 return nil, err 6192 } 6193 return ret, nil 6194 // { 6195 // "description": "Looks up resource names of the DeviceUsers associated with the caller's credentials, as well as the properties provided in the request. This method must be called with end-user credentials with the scope: https://www.googleapis.com/auth/cloud-identity.devices.lookup If multiple properties are provided, only DeviceUsers having all of these properties are considered as matches - i.e. the query behaves like an AND. Different platforms require different amounts of information from the caller to ensure that the DeviceUser is uniquely identified. - iOS: No properties need to be passed, the caller's credentials are sufficient to identify the corresponding DeviceUser. - Android: Specifying the 'android_id' field is required. - Desktop: Specifying the 'raw_resource_id' field is required.", 6196 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers:lookup", 6197 // "httpMethod": "GET", 6198 // "id": "cloudidentity.devices.deviceUsers.lookup", 6199 // "parameterOrder": [ 6200 // "parent" 6201 // ], 6202 // "parameters": { 6203 // "androidId": { 6204 // "description": "Android Id returned by [Settings.Secure#ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID).", 6205 // "location": "query", 6206 // "type": "string" 6207 // }, 6208 // "pageSize": { 6209 // "description": "The maximum number of DeviceUsers to return. If unspecified, at most 20 DeviceUsers will be returned. The maximum value is 20; values above 20 will be coerced to 20.", 6210 // "format": "int32", 6211 // "location": "query", 6212 // "type": "integer" 6213 // }, 6214 // "pageToken": { 6215 // "description": "A page token, received from a previous `LookupDeviceUsers` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `LookupDeviceUsers` must match the call that provided the page token.", 6216 // "location": "query", 6217 // "type": "string" 6218 // }, 6219 // "parent": { 6220 // "description": "Must be set to \"devices/-/deviceUsers\" to search across all DeviceUser belonging to the user.", 6221 // "location": "path", 6222 // "pattern": "^devices/[^/]+/deviceUsers$", 6223 // "required": true, 6224 // "type": "string" 6225 // }, 6226 // "rawResourceId": { 6227 // "description": "Raw Resource Id used by Google Endpoint Verification. If the user is enrolled into Google Endpoint Verification, this id will be saved as the 'device_resource_id' field in the following platform dependent files. Mac: ~/.secureConnect/context_aware_config.json Windows: C:\\Users\\%USERPROFILE%\\.secureConnect\\context_aware_config.json Linux: ~/.secureConnect/context_aware_config.json", 6228 // "location": "query", 6229 // "type": "string" 6230 // }, 6231 // "userId": { 6232 // "description": "The user whose DeviceUser's resource name will be fetched. Must be set to 'me' to fetch the DeviceUser's resource name for the calling user.", 6233 // "location": "query", 6234 // "type": "string" 6235 // } 6236 // }, 6237 // "path": "v1beta1/{+parent}:lookup", 6238 // "response": { 6239 // "$ref": "LookupSelfDeviceUsersResponse" 6240 // }, 6241 // "scopes": [ 6242 // "https://www.googleapis.com/auth/cloud-identity.devices.lookup" 6243 // ] 6244 // } 6245 6246} 6247 6248// Pages invokes f for each page of results. 6249// A non-nil error returned from f will halt the iteration. 6250// The provided context supersedes any context provided to the Context method. 6251func (c *DevicesDeviceUsersLookupCall) Pages(ctx context.Context, f func(*LookupSelfDeviceUsersResponse) error) error { 6252 c.ctx_ = ctx 6253 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6254 for { 6255 x, err := c.Do() 6256 if err != nil { 6257 return err 6258 } 6259 if err := f(x); err != nil { 6260 return err 6261 } 6262 if x.NextPageToken == "" { 6263 return nil 6264 } 6265 c.PageToken(x.NextPageToken) 6266 } 6267} 6268 6269// method id "cloudidentity.devices.deviceUsers.wipe": 6270 6271type DevicesDeviceUsersWipeCall struct { 6272 s *Service 6273 name string 6274 wipedeviceuserrequest *WipeDeviceUserRequest 6275 urlParams_ gensupport.URLParams 6276 ctx_ context.Context 6277 header_ http.Header 6278} 6279 6280// Wipe: Wipes the user's account on a device. 6281// 6282// - name: Resource name 6283// (https://cloud.google.com/apis/design/resource_names) of the Device 6284// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 6285// where device_id is the unique ID assigned to the Device, and 6286// device_user_id is the unique ID assigned to the User. 6287func (r *DevicesDeviceUsersService) Wipe(name string, wipedeviceuserrequest *WipeDeviceUserRequest) *DevicesDeviceUsersWipeCall { 6288 c := &DevicesDeviceUsersWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6289 c.name = name 6290 c.wipedeviceuserrequest = wipedeviceuserrequest 6291 return c 6292} 6293 6294// Fields allows partial responses to be retrieved. See 6295// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6296// for more information. 6297func (c *DevicesDeviceUsersWipeCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersWipeCall { 6298 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6299 return c 6300} 6301 6302// Context sets the context to be used in this call's Do method. Any 6303// pending HTTP request will be aborted if the provided context is 6304// canceled. 6305func (c *DevicesDeviceUsersWipeCall) Context(ctx context.Context) *DevicesDeviceUsersWipeCall { 6306 c.ctx_ = ctx 6307 return c 6308} 6309 6310// Header returns an http.Header that can be modified by the caller to 6311// add HTTP headers to the request. 6312func (c *DevicesDeviceUsersWipeCall) Header() http.Header { 6313 if c.header_ == nil { 6314 c.header_ = make(http.Header) 6315 } 6316 return c.header_ 6317} 6318 6319func (c *DevicesDeviceUsersWipeCall) doRequest(alt string) (*http.Response, error) { 6320 reqHeaders := make(http.Header) 6321 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6322 for k, v := range c.header_ { 6323 reqHeaders[k] = v 6324 } 6325 reqHeaders.Set("User-Agent", c.s.userAgent()) 6326 var body io.Reader = nil 6327 body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedeviceuserrequest) 6328 if err != nil { 6329 return nil, err 6330 } 6331 reqHeaders.Set("Content-Type", "application/json") 6332 c.urlParams_.Set("alt", alt) 6333 c.urlParams_.Set("prettyPrint", "false") 6334 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wipe") 6335 urls += "?" + c.urlParams_.Encode() 6336 req, err := http.NewRequest("POST", urls, body) 6337 if err != nil { 6338 return nil, err 6339 } 6340 req.Header = reqHeaders 6341 googleapi.Expand(req.URL, map[string]string{ 6342 "name": c.name, 6343 }) 6344 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6345} 6346 6347// Do executes the "cloudidentity.devices.deviceUsers.wipe" call. 6348// Exactly one of *Operation or error will be non-nil. Any non-2xx 6349// status code is an error. Response headers are in either 6350// *Operation.ServerResponse.Header or (if a response was returned at 6351// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6352// to check whether the returned error was because 6353// http.StatusNotModified was returned. 6354func (c *DevicesDeviceUsersWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6355 gensupport.SetOptions(c.urlParams_, opts...) 6356 res, err := c.doRequest("json") 6357 if res != nil && res.StatusCode == http.StatusNotModified { 6358 if res.Body != nil { 6359 res.Body.Close() 6360 } 6361 return nil, &googleapi.Error{ 6362 Code: res.StatusCode, 6363 Header: res.Header, 6364 } 6365 } 6366 if err != nil { 6367 return nil, err 6368 } 6369 defer googleapi.CloseBody(res) 6370 if err := googleapi.CheckResponse(res); err != nil { 6371 return nil, err 6372 } 6373 ret := &Operation{ 6374 ServerResponse: googleapi.ServerResponse{ 6375 Header: res.Header, 6376 HTTPStatusCode: res.StatusCode, 6377 }, 6378 } 6379 target := &ret 6380 if err := gensupport.DecodeResponse(target, res); err != nil { 6381 return nil, err 6382 } 6383 return ret, nil 6384 // { 6385 // "description": "Wipes the user's account on a device.", 6386 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:wipe", 6387 // "httpMethod": "POST", 6388 // "id": "cloudidentity.devices.deviceUsers.wipe", 6389 // "parameterOrder": [ 6390 // "name" 6391 // ], 6392 // "parameters": { 6393 // "name": { 6394 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Device in format: `devices/{device_id}/deviceUsers/{device_user_id}`, where device_id is the unique ID assigned to the Device, and device_user_id is the unique ID assigned to the User.", 6395 // "location": "path", 6396 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 6397 // "required": true, 6398 // "type": "string" 6399 // } 6400 // }, 6401 // "path": "v1beta1/{+name}:wipe", 6402 // "request": { 6403 // "$ref": "WipeDeviceUserRequest" 6404 // }, 6405 // "response": { 6406 // "$ref": "Operation" 6407 // } 6408 // } 6409 6410} 6411 6412// method id "cloudidentity.devices.deviceUsers.clientStates.get": 6413 6414type DevicesDeviceUsersClientStatesGetCall struct { 6415 s *Service 6416 name string 6417 urlParams_ gensupport.URLParams 6418 ifNoneMatch_ string 6419 ctx_ context.Context 6420 header_ http.Header 6421} 6422 6423// Get: Gets the client state for the device user 6424// 6425// - name: Resource name 6426// (https://cloud.google.com/apis/design/resource_names) of the 6427// ClientState in format: 6428// `devices/{device_id}/deviceUsers/{device_user_id}/clientStates/{part 6429// ner_id}`, where `device_id` is the unique ID assigned to the 6430// Device, `device_user_id` is the unique ID assigned to the User and 6431// `partner_id` identifies the partner storing the data. To get the 6432// client state for devices belonging to your own organization, the 6433// `partnerId` is in the format: `customerId-*anystring*`. Where the 6434// `customerId` is your organization's customer ID and `anystring` is 6435// any suffix. This suffix is used in setting up Custom Access Levels 6436// in Context-Aware Access. You may use `my_customer` instead of the 6437// customer ID for devices managed by your own organization. You may 6438// specify `-` in place of the `{device_id}`, so the ClientState 6439// resource name can be: 6440// `devices/-/deviceUsers/{device_user_resource_id}/clientStates/{partn 6441// er_id}`. 6442func (r *DevicesDeviceUsersClientStatesService) Get(name string) *DevicesDeviceUsersClientStatesGetCall { 6443 c := &DevicesDeviceUsersClientStatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6444 c.name = name 6445 return c 6446} 6447 6448// Customer sets the optional parameter "customer": Resource name 6449// (https://cloud.google.com/apis/design/resource_names) of the 6450// customer. If you're using this API for your own organization, use 6451// `customers/my_customer` If you're using this API to manage another 6452// organization, use `customers/{customer_id}`, where customer_id is the 6453// customer to whom the device belongs. 6454func (c *DevicesDeviceUsersClientStatesGetCall) Customer(customer string) *DevicesDeviceUsersClientStatesGetCall { 6455 c.urlParams_.Set("customer", customer) 6456 return c 6457} 6458 6459// Fields allows partial responses to be retrieved. See 6460// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6461// for more information. 6462func (c *DevicesDeviceUsersClientStatesGetCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersClientStatesGetCall { 6463 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6464 return c 6465} 6466 6467// IfNoneMatch sets the optional parameter which makes the operation 6468// fail if the object's ETag matches the given value. This is useful for 6469// getting updates only after the object has changed since the last 6470// request. Use googleapi.IsNotModified to check whether the response 6471// error from Do is the result of In-None-Match. 6472func (c *DevicesDeviceUsersClientStatesGetCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersClientStatesGetCall { 6473 c.ifNoneMatch_ = entityTag 6474 return c 6475} 6476 6477// Context sets the context to be used in this call's Do method. Any 6478// pending HTTP request will be aborted if the provided context is 6479// canceled. 6480func (c *DevicesDeviceUsersClientStatesGetCall) Context(ctx context.Context) *DevicesDeviceUsersClientStatesGetCall { 6481 c.ctx_ = ctx 6482 return c 6483} 6484 6485// Header returns an http.Header that can be modified by the caller to 6486// add HTTP headers to the request. 6487func (c *DevicesDeviceUsersClientStatesGetCall) Header() http.Header { 6488 if c.header_ == nil { 6489 c.header_ = make(http.Header) 6490 } 6491 return c.header_ 6492} 6493 6494func (c *DevicesDeviceUsersClientStatesGetCall) doRequest(alt string) (*http.Response, error) { 6495 reqHeaders := make(http.Header) 6496 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6497 for k, v := range c.header_ { 6498 reqHeaders[k] = v 6499 } 6500 reqHeaders.Set("User-Agent", c.s.userAgent()) 6501 if c.ifNoneMatch_ != "" { 6502 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6503 } 6504 var body io.Reader = nil 6505 c.urlParams_.Set("alt", alt) 6506 c.urlParams_.Set("prettyPrint", "false") 6507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6508 urls += "?" + c.urlParams_.Encode() 6509 req, err := http.NewRequest("GET", urls, body) 6510 if err != nil { 6511 return nil, err 6512 } 6513 req.Header = reqHeaders 6514 googleapi.Expand(req.URL, map[string]string{ 6515 "name": c.name, 6516 }) 6517 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6518} 6519 6520// Do executes the "cloudidentity.devices.deviceUsers.clientStates.get" call. 6521// Exactly one of *ClientState or error will be non-nil. Any non-2xx 6522// status code is an error. Response headers are in either 6523// *ClientState.ServerResponse.Header or (if a response was returned at 6524// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6525// to check whether the returned error was because 6526// http.StatusNotModified was returned. 6527func (c *DevicesDeviceUsersClientStatesGetCall) Do(opts ...googleapi.CallOption) (*ClientState, error) { 6528 gensupport.SetOptions(c.urlParams_, opts...) 6529 res, err := c.doRequest("json") 6530 if res != nil && res.StatusCode == http.StatusNotModified { 6531 if res.Body != nil { 6532 res.Body.Close() 6533 } 6534 return nil, &googleapi.Error{ 6535 Code: res.StatusCode, 6536 Header: res.Header, 6537 } 6538 } 6539 if err != nil { 6540 return nil, err 6541 } 6542 defer googleapi.CloseBody(res) 6543 if err := googleapi.CheckResponse(res); err != nil { 6544 return nil, err 6545 } 6546 ret := &ClientState{ 6547 ServerResponse: googleapi.ServerResponse{ 6548 Header: res.Header, 6549 HTTPStatusCode: res.StatusCode, 6550 }, 6551 } 6552 target := &ret 6553 if err := gensupport.DecodeResponse(target, res); err != nil { 6554 return nil, err 6555 } 6556 return ret, nil 6557 // { 6558 // "description": "Gets the client state for the device user", 6559 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}", 6560 // "httpMethod": "GET", 6561 // "id": "cloudidentity.devices.deviceUsers.clientStates.get", 6562 // "parameterOrder": [ 6563 // "name" 6564 // ], 6565 // "parameters": { 6566 // "customer": { 6567 // "description": "Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer_id}`, where customer_id is the customer to whom the device belongs.", 6568 // "location": "query", 6569 // "type": "string" 6570 // }, 6571 // "name": { 6572 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the ClientState in format: `devices/{device_id}/deviceUsers/{device_user_id}/clientStates/{partner_id}`, where `device_id` is the unique ID assigned to the Device, `device_user_id` is the unique ID assigned to the User and `partner_id` identifies the partner storing the data. To get the client state for devices belonging to your own organization, the `partnerId` is in the format: `customerId-*anystring*`. Where the `customerId` is your organization's customer ID and `anystring` is any suffix. This suffix is used in setting up Custom Access Levels in Context-Aware Access. You may use `my_customer` instead of the customer ID for devices managed by your own organization. You may specify `-` in place of the `{device_id}`, so the ClientState resource name can be: `devices/-/deviceUsers/{device_user_resource_id}/clientStates/{partner_id}`.", 6573 // "location": "path", 6574 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+/clientStates/[^/]+$", 6575 // "required": true, 6576 // "type": "string" 6577 // } 6578 // }, 6579 // "path": "v1beta1/{+name}", 6580 // "response": { 6581 // "$ref": "ClientState" 6582 // } 6583 // } 6584 6585} 6586 6587// method id "cloudidentity.devices.deviceUsers.clientStates.patch": 6588 6589type DevicesDeviceUsersClientStatesPatchCall struct { 6590 s *Service 6591 name string 6592 clientstate *ClientState 6593 urlParams_ gensupport.URLParams 6594 ctx_ context.Context 6595 header_ http.Header 6596} 6597 6598// Patch: Updates the client state for the device user **Note**: This 6599// method is available only to customers who have one of the following 6600// SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, 6601// and Cloud Identity Premium 6602// 6603// - name: Output only. Resource name 6604// (https://cloud.google.com/apis/design/resource_names) of the 6605// ClientState in format: 6606// `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partn 6607// er_id}`, where partner_id corresponds to the partner storing the 6608// data. 6609func (r *DevicesDeviceUsersClientStatesService) Patch(name string, clientstate *ClientState) *DevicesDeviceUsersClientStatesPatchCall { 6610 c := &DevicesDeviceUsersClientStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6611 c.name = name 6612 c.clientstate = clientstate 6613 return c 6614} 6615 6616// Customer sets the optional parameter "customer": Resource name 6617// (https://cloud.google.com/apis/design/resource_names) of the 6618// customer. If you're using this API for your own organization, use 6619// `customers/my_customer` If you're using this API to manage another 6620// organization, use `customers/{customer_id}`, where customer_id is the 6621// customer to whom the device belongs. 6622func (c *DevicesDeviceUsersClientStatesPatchCall) Customer(customer string) *DevicesDeviceUsersClientStatesPatchCall { 6623 c.urlParams_.Set("customer", customer) 6624 return c 6625} 6626 6627// UpdateMask sets the optional parameter "updateMask": Comma-separated 6628// list of fully qualified names of fields to be updated. If not 6629// specified, all updatable fields in ClientState are updated. 6630func (c *DevicesDeviceUsersClientStatesPatchCall) UpdateMask(updateMask string) *DevicesDeviceUsersClientStatesPatchCall { 6631 c.urlParams_.Set("updateMask", updateMask) 6632 return c 6633} 6634 6635// Fields allows partial responses to be retrieved. See 6636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6637// for more information. 6638func (c *DevicesDeviceUsersClientStatesPatchCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersClientStatesPatchCall { 6639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6640 return c 6641} 6642 6643// Context sets the context to be used in this call's Do method. Any 6644// pending HTTP request will be aborted if the provided context is 6645// canceled. 6646func (c *DevicesDeviceUsersClientStatesPatchCall) Context(ctx context.Context) *DevicesDeviceUsersClientStatesPatchCall { 6647 c.ctx_ = ctx 6648 return c 6649} 6650 6651// Header returns an http.Header that can be modified by the caller to 6652// add HTTP headers to the request. 6653func (c *DevicesDeviceUsersClientStatesPatchCall) Header() http.Header { 6654 if c.header_ == nil { 6655 c.header_ = make(http.Header) 6656 } 6657 return c.header_ 6658} 6659 6660func (c *DevicesDeviceUsersClientStatesPatchCall) doRequest(alt string) (*http.Response, error) { 6661 reqHeaders := make(http.Header) 6662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6663 for k, v := range c.header_ { 6664 reqHeaders[k] = v 6665 } 6666 reqHeaders.Set("User-Agent", c.s.userAgent()) 6667 var body io.Reader = nil 6668 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientstate) 6669 if err != nil { 6670 return nil, err 6671 } 6672 reqHeaders.Set("Content-Type", "application/json") 6673 c.urlParams_.Set("alt", alt) 6674 c.urlParams_.Set("prettyPrint", "false") 6675 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6676 urls += "?" + c.urlParams_.Encode() 6677 req, err := http.NewRequest("PATCH", urls, body) 6678 if err != nil { 6679 return nil, err 6680 } 6681 req.Header = reqHeaders 6682 googleapi.Expand(req.URL, map[string]string{ 6683 "name": c.name, 6684 }) 6685 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6686} 6687 6688// Do executes the "cloudidentity.devices.deviceUsers.clientStates.patch" call. 6689// Exactly one of *Operation or error will be non-nil. Any non-2xx 6690// status code is an error. Response headers are in either 6691// *Operation.ServerResponse.Header or (if a response was returned at 6692// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6693// to check whether the returned error was because 6694// http.StatusNotModified was returned. 6695func (c *DevicesDeviceUsersClientStatesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6696 gensupport.SetOptions(c.urlParams_, opts...) 6697 res, err := c.doRequest("json") 6698 if res != nil && res.StatusCode == http.StatusNotModified { 6699 if res.Body != nil { 6700 res.Body.Close() 6701 } 6702 return nil, &googleapi.Error{ 6703 Code: res.StatusCode, 6704 Header: res.Header, 6705 } 6706 } 6707 if err != nil { 6708 return nil, err 6709 } 6710 defer googleapi.CloseBody(res) 6711 if err := googleapi.CheckResponse(res); err != nil { 6712 return nil, err 6713 } 6714 ret := &Operation{ 6715 ServerResponse: googleapi.ServerResponse{ 6716 Header: res.Header, 6717 HTTPStatusCode: res.StatusCode, 6718 }, 6719 } 6720 target := &ret 6721 if err := gensupport.DecodeResponse(target, res); err != nil { 6722 return nil, err 6723 } 6724 return ret, nil 6725 // { 6726 // "description": "Updates the client state for the device user **Note**: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium", 6727 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}", 6728 // "httpMethod": "PATCH", 6729 // "id": "cloudidentity.devices.deviceUsers.clientStates.patch", 6730 // "parameterOrder": [ 6731 // "name" 6732 // ], 6733 // "parameters": { 6734 // "customer": { 6735 // "description": "Optional. [Resource name](https://cloud.google.com/apis/design/resource_names) of the customer. If you're using this API for your own organization, use `customers/my_customer` If you're using this API to manage another organization, use `customers/{customer_id}`, where customer_id is the customer to whom the device belongs.", 6736 // "location": "query", 6737 // "type": "string" 6738 // }, 6739 // "name": { 6740 // "description": "Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the ClientState in format: `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partner_id}`, where partner_id corresponds to the partner storing the data.", 6741 // "location": "path", 6742 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+/clientStates/[^/]+$", 6743 // "required": true, 6744 // "type": "string" 6745 // }, 6746 // "updateMask": { 6747 // "description": "Optional. Comma-separated list of fully qualified names of fields to be updated. If not specified, all updatable fields in ClientState are updated.", 6748 // "format": "google-fieldmask", 6749 // "location": "query", 6750 // "type": "string" 6751 // } 6752 // }, 6753 // "path": "v1beta1/{+name}", 6754 // "request": { 6755 // "$ref": "ClientState" 6756 // }, 6757 // "response": { 6758 // "$ref": "Operation" 6759 // } 6760 // } 6761 6762} 6763 6764// method id "cloudidentity.groups.create": 6765 6766type GroupsCreateCall struct { 6767 s *Service 6768 group *Group 6769 urlParams_ gensupport.URLParams 6770 ctx_ context.Context 6771 header_ http.Header 6772} 6773 6774// Create: Creates a `Group`. 6775func (r *GroupsService) Create(group *Group) *GroupsCreateCall { 6776 c := &GroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6777 c.group = group 6778 return c 6779} 6780 6781// InitialGroupConfig sets the optional parameter "initialGroupConfig": 6782// Required. The initial configuration option for the `Group`. 6783// 6784// Possible values: 6785// "INITIAL_GROUP_CONFIG_UNSPECIFIED" - Default. Should not be used. 6786// "WITH_INITIAL_OWNER" - The end user making the request will be 6787// added as the initial owner of the `Group`. 6788// "EMPTY" - An empty group is created without any initial owners. 6789// This can only be used by admins of the domain. 6790func (c *GroupsCreateCall) InitialGroupConfig(initialGroupConfig string) *GroupsCreateCall { 6791 c.urlParams_.Set("initialGroupConfig", initialGroupConfig) 6792 return c 6793} 6794 6795// Fields allows partial responses to be retrieved. See 6796// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6797// for more information. 6798func (c *GroupsCreateCall) Fields(s ...googleapi.Field) *GroupsCreateCall { 6799 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6800 return c 6801} 6802 6803// Context sets the context to be used in this call's Do method. Any 6804// pending HTTP request will be aborted if the provided context is 6805// canceled. 6806func (c *GroupsCreateCall) Context(ctx context.Context) *GroupsCreateCall { 6807 c.ctx_ = ctx 6808 return c 6809} 6810 6811// Header returns an http.Header that can be modified by the caller to 6812// add HTTP headers to the request. 6813func (c *GroupsCreateCall) Header() http.Header { 6814 if c.header_ == nil { 6815 c.header_ = make(http.Header) 6816 } 6817 return c.header_ 6818} 6819 6820func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) { 6821 reqHeaders := make(http.Header) 6822 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6823 for k, v := range c.header_ { 6824 reqHeaders[k] = v 6825 } 6826 reqHeaders.Set("User-Agent", c.s.userAgent()) 6827 var body io.Reader = nil 6828 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 6829 if err != nil { 6830 return nil, err 6831 } 6832 reqHeaders.Set("Content-Type", "application/json") 6833 c.urlParams_.Set("alt", alt) 6834 c.urlParams_.Set("prettyPrint", "false") 6835 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups") 6836 urls += "?" + c.urlParams_.Encode() 6837 req, err := http.NewRequest("POST", urls, body) 6838 if err != nil { 6839 return nil, err 6840 } 6841 req.Header = reqHeaders 6842 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6843} 6844 6845// Do executes the "cloudidentity.groups.create" call. 6846// Exactly one of *Operation or error will be non-nil. Any non-2xx 6847// status code is an error. Response headers are in either 6848// *Operation.ServerResponse.Header or (if a response was returned at 6849// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6850// to check whether the returned error was because 6851// http.StatusNotModified was returned. 6852func (c *GroupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6853 gensupport.SetOptions(c.urlParams_, opts...) 6854 res, err := c.doRequest("json") 6855 if res != nil && res.StatusCode == http.StatusNotModified { 6856 if res.Body != nil { 6857 res.Body.Close() 6858 } 6859 return nil, &googleapi.Error{ 6860 Code: res.StatusCode, 6861 Header: res.Header, 6862 } 6863 } 6864 if err != nil { 6865 return nil, err 6866 } 6867 defer googleapi.CloseBody(res) 6868 if err := googleapi.CheckResponse(res); err != nil { 6869 return nil, err 6870 } 6871 ret := &Operation{ 6872 ServerResponse: googleapi.ServerResponse{ 6873 Header: res.Header, 6874 HTTPStatusCode: res.StatusCode, 6875 }, 6876 } 6877 target := &ret 6878 if err := gensupport.DecodeResponse(target, res); err != nil { 6879 return nil, err 6880 } 6881 return ret, nil 6882 // { 6883 // "description": "Creates a `Group`.", 6884 // "flatPath": "v1beta1/groups", 6885 // "httpMethod": "POST", 6886 // "id": "cloudidentity.groups.create", 6887 // "parameterOrder": [], 6888 // "parameters": { 6889 // "initialGroupConfig": { 6890 // "description": "Required. The initial configuration option for the `Group`.", 6891 // "enum": [ 6892 // "INITIAL_GROUP_CONFIG_UNSPECIFIED", 6893 // "WITH_INITIAL_OWNER", 6894 // "EMPTY" 6895 // ], 6896 // "enumDescriptions": [ 6897 // "Default. Should not be used.", 6898 // "The end user making the request will be added as the initial owner of the `Group`.", 6899 // "An empty group is created without any initial owners. This can only be used by admins of the domain." 6900 // ], 6901 // "location": "query", 6902 // "type": "string" 6903 // } 6904 // }, 6905 // "path": "v1beta1/groups", 6906 // "request": { 6907 // "$ref": "Group" 6908 // }, 6909 // "response": { 6910 // "$ref": "Operation" 6911 // }, 6912 // "scopes": [ 6913 // "https://www.googleapis.com/auth/cloud-identity.groups", 6914 // "https://www.googleapis.com/auth/cloud-platform" 6915 // ] 6916 // } 6917 6918} 6919 6920// method id "cloudidentity.groups.delete": 6921 6922type GroupsDeleteCall struct { 6923 s *Service 6924 name string 6925 urlParams_ gensupport.URLParams 6926 ctx_ context.Context 6927 header_ http.Header 6928} 6929 6930// Delete: Deletes a `Group`. 6931// 6932// - name: The resource name 6933// (https://cloud.google.com/apis/design/resource_names) of the 6934// `Group` to retrieve. Must be of the form `groups/{group_id}`. 6935func (r *GroupsService) Delete(name string) *GroupsDeleteCall { 6936 c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6937 c.name = name 6938 return c 6939} 6940 6941// Fields allows partial responses to be retrieved. See 6942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6943// for more information. 6944func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { 6945 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6946 return c 6947} 6948 6949// Context sets the context to be used in this call's Do method. Any 6950// pending HTTP request will be aborted if the provided context is 6951// canceled. 6952func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { 6953 c.ctx_ = ctx 6954 return c 6955} 6956 6957// Header returns an http.Header that can be modified by the caller to 6958// add HTTP headers to the request. 6959func (c *GroupsDeleteCall) Header() http.Header { 6960 if c.header_ == nil { 6961 c.header_ = make(http.Header) 6962 } 6963 return c.header_ 6964} 6965 6966func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 6967 reqHeaders := make(http.Header) 6968 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6969 for k, v := range c.header_ { 6970 reqHeaders[k] = v 6971 } 6972 reqHeaders.Set("User-Agent", c.s.userAgent()) 6973 var body io.Reader = nil 6974 c.urlParams_.Set("alt", alt) 6975 c.urlParams_.Set("prettyPrint", "false") 6976 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6977 urls += "?" + c.urlParams_.Encode() 6978 req, err := http.NewRequest("DELETE", urls, body) 6979 if err != nil { 6980 return nil, err 6981 } 6982 req.Header = reqHeaders 6983 googleapi.Expand(req.URL, map[string]string{ 6984 "name": c.name, 6985 }) 6986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6987} 6988 6989// Do executes the "cloudidentity.groups.delete" call. 6990// Exactly one of *Operation or error will be non-nil. Any non-2xx 6991// status code is an error. Response headers are in either 6992// *Operation.ServerResponse.Header or (if a response was returned at 6993// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6994// to check whether the returned error was because 6995// http.StatusNotModified was returned. 6996func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6997 gensupport.SetOptions(c.urlParams_, opts...) 6998 res, err := c.doRequest("json") 6999 if res != nil && res.StatusCode == http.StatusNotModified { 7000 if res.Body != nil { 7001 res.Body.Close() 7002 } 7003 return nil, &googleapi.Error{ 7004 Code: res.StatusCode, 7005 Header: res.Header, 7006 } 7007 } 7008 if err != nil { 7009 return nil, err 7010 } 7011 defer googleapi.CloseBody(res) 7012 if err := googleapi.CheckResponse(res); err != nil { 7013 return nil, err 7014 } 7015 ret := &Operation{ 7016 ServerResponse: googleapi.ServerResponse{ 7017 Header: res.Header, 7018 HTTPStatusCode: res.StatusCode, 7019 }, 7020 } 7021 target := &ret 7022 if err := gensupport.DecodeResponse(target, res); err != nil { 7023 return nil, err 7024 } 7025 return ret, nil 7026 // { 7027 // "description": "Deletes a `Group`.", 7028 // "flatPath": "v1beta1/groups/{groupsId}", 7029 // "httpMethod": "DELETE", 7030 // "id": "cloudidentity.groups.delete", 7031 // "parameterOrder": [ 7032 // "name" 7033 // ], 7034 // "parameters": { 7035 // "name": { 7036 // "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Group` to retrieve. Must be of the form `groups/{group_id}`.", 7037 // "location": "path", 7038 // "pattern": "^groups/[^/]+$", 7039 // "required": true, 7040 // "type": "string" 7041 // } 7042 // }, 7043 // "path": "v1beta1/{+name}", 7044 // "response": { 7045 // "$ref": "Operation" 7046 // }, 7047 // "scopes": [ 7048 // "https://www.googleapis.com/auth/cloud-identity.groups", 7049 // "https://www.googleapis.com/auth/cloud-platform" 7050 // ] 7051 // } 7052 7053} 7054 7055// method id "cloudidentity.groups.get": 7056 7057type GroupsGetCall struct { 7058 s *Service 7059 name string 7060 urlParams_ gensupport.URLParams 7061 ifNoneMatch_ string 7062 ctx_ context.Context 7063 header_ http.Header 7064} 7065 7066// Get: Retrieves a `Group`. 7067// 7068// - name: The resource name 7069// (https://cloud.google.com/apis/design/resource_names) of the 7070// `Group` to retrieve. Must be of the form `groups/{group_id}`. 7071func (r *GroupsService) Get(name string) *GroupsGetCall { 7072 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7073 c.name = name 7074 return c 7075} 7076 7077// Fields allows partial responses to be retrieved. See 7078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7079// for more information. 7080func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 7081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7082 return c 7083} 7084 7085// IfNoneMatch sets the optional parameter which makes the operation 7086// fail if the object's ETag matches the given value. This is useful for 7087// getting updates only after the object has changed since the last 7088// request. Use googleapi.IsNotModified to check whether the response 7089// error from Do is the result of In-None-Match. 7090func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 7091 c.ifNoneMatch_ = entityTag 7092 return c 7093} 7094 7095// Context sets the context to be used in this call's Do method. Any 7096// pending HTTP request will be aborted if the provided context is 7097// canceled. 7098func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 7099 c.ctx_ = ctx 7100 return c 7101} 7102 7103// Header returns an http.Header that can be modified by the caller to 7104// add HTTP headers to the request. 7105func (c *GroupsGetCall) Header() http.Header { 7106 if c.header_ == nil { 7107 c.header_ = make(http.Header) 7108 } 7109 return c.header_ 7110} 7111 7112func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 7113 reqHeaders := make(http.Header) 7114 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7115 for k, v := range c.header_ { 7116 reqHeaders[k] = v 7117 } 7118 reqHeaders.Set("User-Agent", c.s.userAgent()) 7119 if c.ifNoneMatch_ != "" { 7120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7121 } 7122 var body io.Reader = nil 7123 c.urlParams_.Set("alt", alt) 7124 c.urlParams_.Set("prettyPrint", "false") 7125 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7126 urls += "?" + c.urlParams_.Encode() 7127 req, err := http.NewRequest("GET", urls, body) 7128 if err != nil { 7129 return nil, err 7130 } 7131 req.Header = reqHeaders 7132 googleapi.Expand(req.URL, map[string]string{ 7133 "name": c.name, 7134 }) 7135 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7136} 7137 7138// Do executes the "cloudidentity.groups.get" call. 7139// Exactly one of *Group or error will be non-nil. Any non-2xx status 7140// code is an error. Response headers are in either 7141// *Group.ServerResponse.Header or (if a response was returned at all) 7142// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7143// check whether the returned error was because http.StatusNotModified 7144// was returned. 7145func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 7146 gensupport.SetOptions(c.urlParams_, opts...) 7147 res, err := c.doRequest("json") 7148 if res != nil && res.StatusCode == http.StatusNotModified { 7149 if res.Body != nil { 7150 res.Body.Close() 7151 } 7152 return nil, &googleapi.Error{ 7153 Code: res.StatusCode, 7154 Header: res.Header, 7155 } 7156 } 7157 if err != nil { 7158 return nil, err 7159 } 7160 defer googleapi.CloseBody(res) 7161 if err := googleapi.CheckResponse(res); err != nil { 7162 return nil, err 7163 } 7164 ret := &Group{ 7165 ServerResponse: googleapi.ServerResponse{ 7166 Header: res.Header, 7167 HTTPStatusCode: res.StatusCode, 7168 }, 7169 } 7170 target := &ret 7171 if err := gensupport.DecodeResponse(target, res); err != nil { 7172 return nil, err 7173 } 7174 return ret, nil 7175 // { 7176 // "description": "Retrieves a `Group`.", 7177 // "flatPath": "v1beta1/groups/{groupsId}", 7178 // "httpMethod": "GET", 7179 // "id": "cloudidentity.groups.get", 7180 // "parameterOrder": [ 7181 // "name" 7182 // ], 7183 // "parameters": { 7184 // "name": { 7185 // "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Group` to retrieve. Must be of the form `groups/{group_id}`.", 7186 // "location": "path", 7187 // "pattern": "^groups/[^/]+$", 7188 // "required": true, 7189 // "type": "string" 7190 // } 7191 // }, 7192 // "path": "v1beta1/{+name}", 7193 // "response": { 7194 // "$ref": "Group" 7195 // }, 7196 // "scopes": [ 7197 // "https://www.googleapis.com/auth/cloud-identity.groups", 7198 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7199 // "https://www.googleapis.com/auth/cloud-platform" 7200 // ] 7201 // } 7202 7203} 7204 7205// method id "cloudidentity.groups.getSecuritySettings": 7206 7207type GroupsGetSecuritySettingsCall struct { 7208 s *Service 7209 name string 7210 urlParams_ gensupport.URLParams 7211 ifNoneMatch_ string 7212 ctx_ context.Context 7213 header_ http.Header 7214} 7215 7216// GetSecuritySettings: Get Security Settings 7217// 7218// - name: The security settings to retrieve. Format: 7219// `groups/{group_id}/securitySettings`. 7220func (r *GroupsService) GetSecuritySettings(name string) *GroupsGetSecuritySettingsCall { 7221 c := &GroupsGetSecuritySettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7222 c.name = name 7223 return c 7224} 7225 7226// ReadMask sets the optional parameter "readMask": Field-level read 7227// mask of which fields to return. "*" returns all fields. If not 7228// specified, all fields will be returned. May only contain the 7229// following field: `member_restriction`. 7230func (c *GroupsGetSecuritySettingsCall) ReadMask(readMask string) *GroupsGetSecuritySettingsCall { 7231 c.urlParams_.Set("readMask", readMask) 7232 return c 7233} 7234 7235// Fields allows partial responses to be retrieved. See 7236// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7237// for more information. 7238func (c *GroupsGetSecuritySettingsCall) Fields(s ...googleapi.Field) *GroupsGetSecuritySettingsCall { 7239 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7240 return c 7241} 7242 7243// IfNoneMatch sets the optional parameter which makes the operation 7244// fail if the object's ETag matches the given value. This is useful for 7245// getting updates only after the object has changed since the last 7246// request. Use googleapi.IsNotModified to check whether the response 7247// error from Do is the result of In-None-Match. 7248func (c *GroupsGetSecuritySettingsCall) IfNoneMatch(entityTag string) *GroupsGetSecuritySettingsCall { 7249 c.ifNoneMatch_ = entityTag 7250 return c 7251} 7252 7253// Context sets the context to be used in this call's Do method. Any 7254// pending HTTP request will be aborted if the provided context is 7255// canceled. 7256func (c *GroupsGetSecuritySettingsCall) Context(ctx context.Context) *GroupsGetSecuritySettingsCall { 7257 c.ctx_ = ctx 7258 return c 7259} 7260 7261// Header returns an http.Header that can be modified by the caller to 7262// add HTTP headers to the request. 7263func (c *GroupsGetSecuritySettingsCall) Header() http.Header { 7264 if c.header_ == nil { 7265 c.header_ = make(http.Header) 7266 } 7267 return c.header_ 7268} 7269 7270func (c *GroupsGetSecuritySettingsCall) doRequest(alt string) (*http.Response, error) { 7271 reqHeaders := make(http.Header) 7272 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7273 for k, v := range c.header_ { 7274 reqHeaders[k] = v 7275 } 7276 reqHeaders.Set("User-Agent", c.s.userAgent()) 7277 if c.ifNoneMatch_ != "" { 7278 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7279 } 7280 var body io.Reader = nil 7281 c.urlParams_.Set("alt", alt) 7282 c.urlParams_.Set("prettyPrint", "false") 7283 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7284 urls += "?" + c.urlParams_.Encode() 7285 req, err := http.NewRequest("GET", urls, body) 7286 if err != nil { 7287 return nil, err 7288 } 7289 req.Header = reqHeaders 7290 googleapi.Expand(req.URL, map[string]string{ 7291 "name": c.name, 7292 }) 7293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7294} 7295 7296// Do executes the "cloudidentity.groups.getSecuritySettings" call. 7297// Exactly one of *SecuritySettings or error will be non-nil. Any 7298// non-2xx status code is an error. Response headers are in either 7299// *SecuritySettings.ServerResponse.Header or (if a response was 7300// returned at all) in error.(*googleapi.Error).Header. Use 7301// googleapi.IsNotModified to check whether the returned error was 7302// because http.StatusNotModified was returned. 7303func (c *GroupsGetSecuritySettingsCall) Do(opts ...googleapi.CallOption) (*SecuritySettings, error) { 7304 gensupport.SetOptions(c.urlParams_, opts...) 7305 res, err := c.doRequest("json") 7306 if res != nil && res.StatusCode == http.StatusNotModified { 7307 if res.Body != nil { 7308 res.Body.Close() 7309 } 7310 return nil, &googleapi.Error{ 7311 Code: res.StatusCode, 7312 Header: res.Header, 7313 } 7314 } 7315 if err != nil { 7316 return nil, err 7317 } 7318 defer googleapi.CloseBody(res) 7319 if err := googleapi.CheckResponse(res); err != nil { 7320 return nil, err 7321 } 7322 ret := &SecuritySettings{ 7323 ServerResponse: googleapi.ServerResponse{ 7324 Header: res.Header, 7325 HTTPStatusCode: res.StatusCode, 7326 }, 7327 } 7328 target := &ret 7329 if err := gensupport.DecodeResponse(target, res); err != nil { 7330 return nil, err 7331 } 7332 return ret, nil 7333 // { 7334 // "description": "Get Security Settings", 7335 // "flatPath": "v1beta1/groups/{groupsId}/securitySettings", 7336 // "httpMethod": "GET", 7337 // "id": "cloudidentity.groups.getSecuritySettings", 7338 // "parameterOrder": [ 7339 // "name" 7340 // ], 7341 // "parameters": { 7342 // "name": { 7343 // "description": "Required. The security settings to retrieve. Format: `groups/{group_id}/securitySettings`", 7344 // "location": "path", 7345 // "pattern": "^groups/[^/]+/securitySettings$", 7346 // "required": true, 7347 // "type": "string" 7348 // }, 7349 // "readMask": { 7350 // "description": "Field-level read mask of which fields to return. \"*\" returns all fields. If not specified, all fields will be returned. May only contain the following field: `member_restriction`.", 7351 // "format": "google-fieldmask", 7352 // "location": "query", 7353 // "type": "string" 7354 // } 7355 // }, 7356 // "path": "v1beta1/{+name}", 7357 // "response": { 7358 // "$ref": "SecuritySettings" 7359 // }, 7360 // "scopes": [ 7361 // "https://www.googleapis.com/auth/cloud-identity.groups", 7362 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7363 // "https://www.googleapis.com/auth/cloud-platform" 7364 // ] 7365 // } 7366 7367} 7368 7369// method id "cloudidentity.groups.list": 7370 7371type GroupsListCall struct { 7372 s *Service 7373 urlParams_ gensupport.URLParams 7374 ifNoneMatch_ string 7375 ctx_ context.Context 7376 header_ http.Header 7377} 7378 7379// List: Lists the `Group` resources under a customer or namespace. 7380func (r *GroupsService) List() *GroupsListCall { 7381 c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7382 return c 7383} 7384 7385// PageSize sets the optional parameter "pageSize": The maximum number 7386// of results to return. Note that the number of results returned may be 7387// less than this value even if there are more available results. To 7388// fetch all results, clients must continue calling this method 7389// repeatedly until the response no longer contains a `next_page_token`. 7390// If unspecified, defaults to 200 for `View.BASIC` and to 50 for 7391// `View.FULL`. Must not be greater than 1000 for `View.BASIC` or 500 7392// for `View.FULL`. 7393func (c *GroupsListCall) PageSize(pageSize int64) *GroupsListCall { 7394 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7395 return c 7396} 7397 7398// PageToken sets the optional parameter "pageToken": The 7399// `next_page_token` value returned from a previous list request, if 7400// any. 7401func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { 7402 c.urlParams_.Set("pageToken", pageToken) 7403 return c 7404} 7405 7406// Parent sets the optional parameter "parent": Required. The parent 7407// resource under which to list all `Group` resources. Must be of the 7408// form `identitysources/{identity_source_id}` for external- 7409// identity-mapped groups or `customers/{customer_id}` for Google 7410// Groups. The `customer_id` must begin with "C" (for example, 7411// 'C046psxkn'). 7412func (c *GroupsListCall) Parent(parent string) *GroupsListCall { 7413 c.urlParams_.Set("parent", parent) 7414 return c 7415} 7416 7417// View sets the optional parameter "view": The level of detail to be 7418// returned. If unspecified, defaults to `View.BASIC`. 7419// 7420// Possible values: 7421// "VIEW_UNSPECIFIED" - Default. Should not be used. 7422// "BASIC" - Only basic resource information is returned. 7423// "FULL" - All resource information is returned. 7424func (c *GroupsListCall) View(view string) *GroupsListCall { 7425 c.urlParams_.Set("view", view) 7426 return c 7427} 7428 7429// Fields allows partial responses to be retrieved. See 7430// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7431// for more information. 7432func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { 7433 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7434 return c 7435} 7436 7437// IfNoneMatch sets the optional parameter which makes the operation 7438// fail if the object's ETag matches the given value. This is useful for 7439// getting updates only after the object has changed since the last 7440// request. Use googleapi.IsNotModified to check whether the response 7441// error from Do is the result of In-None-Match. 7442func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { 7443 c.ifNoneMatch_ = entityTag 7444 return c 7445} 7446 7447// Context sets the context to be used in this call's Do method. Any 7448// pending HTTP request will be aborted if the provided context is 7449// canceled. 7450func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { 7451 c.ctx_ = ctx 7452 return c 7453} 7454 7455// Header returns an http.Header that can be modified by the caller to 7456// add HTTP headers to the request. 7457func (c *GroupsListCall) Header() http.Header { 7458 if c.header_ == nil { 7459 c.header_ = make(http.Header) 7460 } 7461 return c.header_ 7462} 7463 7464func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { 7465 reqHeaders := make(http.Header) 7466 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7467 for k, v := range c.header_ { 7468 reqHeaders[k] = v 7469 } 7470 reqHeaders.Set("User-Agent", c.s.userAgent()) 7471 if c.ifNoneMatch_ != "" { 7472 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7473 } 7474 var body io.Reader = nil 7475 c.urlParams_.Set("alt", alt) 7476 c.urlParams_.Set("prettyPrint", "false") 7477 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups") 7478 urls += "?" + c.urlParams_.Encode() 7479 req, err := http.NewRequest("GET", urls, body) 7480 if err != nil { 7481 return nil, err 7482 } 7483 req.Header = reqHeaders 7484 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7485} 7486 7487// Do executes the "cloudidentity.groups.list" call. 7488// Exactly one of *ListGroupsResponse or error will be non-nil. Any 7489// non-2xx status code is an error. Response headers are in either 7490// *ListGroupsResponse.ServerResponse.Header or (if a response was 7491// returned at all) in error.(*googleapi.Error).Header. Use 7492// googleapi.IsNotModified to check whether the returned error was 7493// because http.StatusNotModified was returned. 7494func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*ListGroupsResponse, error) { 7495 gensupport.SetOptions(c.urlParams_, opts...) 7496 res, err := c.doRequest("json") 7497 if res != nil && res.StatusCode == http.StatusNotModified { 7498 if res.Body != nil { 7499 res.Body.Close() 7500 } 7501 return nil, &googleapi.Error{ 7502 Code: res.StatusCode, 7503 Header: res.Header, 7504 } 7505 } 7506 if err != nil { 7507 return nil, err 7508 } 7509 defer googleapi.CloseBody(res) 7510 if err := googleapi.CheckResponse(res); err != nil { 7511 return nil, err 7512 } 7513 ret := &ListGroupsResponse{ 7514 ServerResponse: googleapi.ServerResponse{ 7515 Header: res.Header, 7516 HTTPStatusCode: res.StatusCode, 7517 }, 7518 } 7519 target := &ret 7520 if err := gensupport.DecodeResponse(target, res); err != nil { 7521 return nil, err 7522 } 7523 return ret, nil 7524 // { 7525 // "description": "Lists the `Group` resources under a customer or namespace.", 7526 // "flatPath": "v1beta1/groups", 7527 // "httpMethod": "GET", 7528 // "id": "cloudidentity.groups.list", 7529 // "parameterOrder": [], 7530 // "parameters": { 7531 // "pageSize": { 7532 // "description": "The maximum number of results to return. Note that the number of results returned may be less than this value even if there are more available results. To fetch all results, clients must continue calling this method repeatedly until the response no longer contains a `next_page_token`. If unspecified, defaults to 200 for `View.BASIC` and to 50 for `View.FULL`. Must not be greater than 1000 for `View.BASIC` or 500 for `View.FULL`.", 7533 // "format": "int32", 7534 // "location": "query", 7535 // "type": "integer" 7536 // }, 7537 // "pageToken": { 7538 // "description": "The `next_page_token` value returned from a previous list request, if any.", 7539 // "location": "query", 7540 // "type": "string" 7541 // }, 7542 // "parent": { 7543 // "description": "Required. The parent resource under which to list all `Group` resources. Must be of the form `identitysources/{identity_source_id}` for external- identity-mapped groups or `customers/{customer_id}` for Google Groups. The `customer_id` must begin with \"C\" (for example, 'C046psxkn').", 7544 // "location": "query", 7545 // "type": "string" 7546 // }, 7547 // "view": { 7548 // "description": "The level of detail to be returned. If unspecified, defaults to `View.BASIC`.", 7549 // "enum": [ 7550 // "VIEW_UNSPECIFIED", 7551 // "BASIC", 7552 // "FULL" 7553 // ], 7554 // "enumDescriptions": [ 7555 // "Default. Should not be used.", 7556 // "Only basic resource information is returned.", 7557 // "All resource information is returned." 7558 // ], 7559 // "location": "query", 7560 // "type": "string" 7561 // } 7562 // }, 7563 // "path": "v1beta1/groups", 7564 // "response": { 7565 // "$ref": "ListGroupsResponse" 7566 // }, 7567 // "scopes": [ 7568 // "https://www.googleapis.com/auth/cloud-identity.groups", 7569 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7570 // "https://www.googleapis.com/auth/cloud-platform" 7571 // ] 7572 // } 7573 7574} 7575 7576// Pages invokes f for each page of results. 7577// A non-nil error returned from f will halt the iteration. 7578// The provided context supersedes any context provided to the Context method. 7579func (c *GroupsListCall) Pages(ctx context.Context, f func(*ListGroupsResponse) error) error { 7580 c.ctx_ = ctx 7581 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7582 for { 7583 x, err := c.Do() 7584 if err != nil { 7585 return err 7586 } 7587 if err := f(x); err != nil { 7588 return err 7589 } 7590 if x.NextPageToken == "" { 7591 return nil 7592 } 7593 c.PageToken(x.NextPageToken) 7594 } 7595} 7596 7597// method id "cloudidentity.groups.lookup": 7598 7599type GroupsLookupCall struct { 7600 s *Service 7601 urlParams_ gensupport.URLParams 7602 ifNoneMatch_ string 7603 ctx_ context.Context 7604 header_ http.Header 7605} 7606 7607// Lookup: Looks up the resource name 7608// (https://cloud.google.com/apis/design/resource_names) of a `Group` by 7609// its `EntityKey`. 7610func (r *GroupsService) Lookup() *GroupsLookupCall { 7611 c := &GroupsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7612 return c 7613} 7614 7615// GroupKeyId sets the optional parameter "groupKey.id": The ID of the 7616// entity. For Google-managed entities, the `id` must be the email 7617// address of an existing group or user. For external-identity-mapped 7618// entities, the `id` must be a string conforming to the Identity 7619// Source's requirements. Must be unique within a `namespace`. 7620func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall { 7621 c.urlParams_.Set("groupKey.id", groupKeyId) 7622 return c 7623} 7624 7625// GroupKeyNamespace sets the optional parameter "groupKey.namespace": 7626// The namespace in which the entity exists. If not specified, the 7627// `EntityKey` represents a Google-managed entity such as a Google user 7628// or a Google Group. If specified, the `EntityKey` represents an 7629// external-identity-mapped group. The namespace must correspond to an 7630// identity source created in Admin Console and must be in the form of 7631// `identitysources/{identity_source_id}`. 7632func (c *GroupsLookupCall) GroupKeyNamespace(groupKeyNamespace string) *GroupsLookupCall { 7633 c.urlParams_.Set("groupKey.namespace", groupKeyNamespace) 7634 return c 7635} 7636 7637// Fields allows partial responses to be retrieved. See 7638// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7639// for more information. 7640func (c *GroupsLookupCall) Fields(s ...googleapi.Field) *GroupsLookupCall { 7641 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7642 return c 7643} 7644 7645// IfNoneMatch sets the optional parameter which makes the operation 7646// fail if the object's ETag matches the given value. This is useful for 7647// getting updates only after the object has changed since the last 7648// request. Use googleapi.IsNotModified to check whether the response 7649// error from Do is the result of In-None-Match. 7650func (c *GroupsLookupCall) IfNoneMatch(entityTag string) *GroupsLookupCall { 7651 c.ifNoneMatch_ = entityTag 7652 return c 7653} 7654 7655// Context sets the context to be used in this call's Do method. Any 7656// pending HTTP request will be aborted if the provided context is 7657// canceled. 7658func (c *GroupsLookupCall) Context(ctx context.Context) *GroupsLookupCall { 7659 c.ctx_ = ctx 7660 return c 7661} 7662 7663// Header returns an http.Header that can be modified by the caller to 7664// add HTTP headers to the request. 7665func (c *GroupsLookupCall) Header() http.Header { 7666 if c.header_ == nil { 7667 c.header_ = make(http.Header) 7668 } 7669 return c.header_ 7670} 7671 7672func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) { 7673 reqHeaders := make(http.Header) 7674 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7675 for k, v := range c.header_ { 7676 reqHeaders[k] = v 7677 } 7678 reqHeaders.Set("User-Agent", c.s.userAgent()) 7679 if c.ifNoneMatch_ != "" { 7680 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7681 } 7682 var body io.Reader = nil 7683 c.urlParams_.Set("alt", alt) 7684 c.urlParams_.Set("prettyPrint", "false") 7685 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:lookup") 7686 urls += "?" + c.urlParams_.Encode() 7687 req, err := http.NewRequest("GET", urls, body) 7688 if err != nil { 7689 return nil, err 7690 } 7691 req.Header = reqHeaders 7692 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7693} 7694 7695// Do executes the "cloudidentity.groups.lookup" call. 7696// Exactly one of *LookupGroupNameResponse or error will be non-nil. Any 7697// non-2xx status code is an error. Response headers are in either 7698// *LookupGroupNameResponse.ServerResponse.Header or (if a response was 7699// returned at all) in error.(*googleapi.Error).Header. Use 7700// googleapi.IsNotModified to check whether the returned error was 7701// because http.StatusNotModified was returned. 7702func (c *GroupsLookupCall) Do(opts ...googleapi.CallOption) (*LookupGroupNameResponse, error) { 7703 gensupport.SetOptions(c.urlParams_, opts...) 7704 res, err := c.doRequest("json") 7705 if res != nil && res.StatusCode == http.StatusNotModified { 7706 if res.Body != nil { 7707 res.Body.Close() 7708 } 7709 return nil, &googleapi.Error{ 7710 Code: res.StatusCode, 7711 Header: res.Header, 7712 } 7713 } 7714 if err != nil { 7715 return nil, err 7716 } 7717 defer googleapi.CloseBody(res) 7718 if err := googleapi.CheckResponse(res); err != nil { 7719 return nil, err 7720 } 7721 ret := &LookupGroupNameResponse{ 7722 ServerResponse: googleapi.ServerResponse{ 7723 Header: res.Header, 7724 HTTPStatusCode: res.StatusCode, 7725 }, 7726 } 7727 target := &ret 7728 if err := gensupport.DecodeResponse(target, res); err != nil { 7729 return nil, err 7730 } 7731 return ret, nil 7732 // { 7733 // "description": "Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Group` by its `EntityKey`.", 7734 // "flatPath": "v1beta1/groups:lookup", 7735 // "httpMethod": "GET", 7736 // "id": "cloudidentity.groups.lookup", 7737 // "parameterOrder": [], 7738 // "parameters": { 7739 // "groupKey.id": { 7740 // "description": "The ID of the entity. For Google-managed entities, the `id` must be the email address of an existing group or user. For external-identity-mapped entities, the `id` must be a string conforming to the Identity Source's requirements. Must be unique within a `namespace`.", 7741 // "location": "query", 7742 // "type": "string" 7743 // }, 7744 // "groupKey.namespace": { 7745 // "description": "The namespace in which the entity exists. If not specified, the `EntityKey` represents a Google-managed entity such as a Google user or a Google Group. If specified, the `EntityKey` represents an external-identity-mapped group. The namespace must correspond to an identity source created in Admin Console and must be in the form of `identitysources/{identity_source_id}`.", 7746 // "location": "query", 7747 // "type": "string" 7748 // } 7749 // }, 7750 // "path": "v1beta1/groups:lookup", 7751 // "response": { 7752 // "$ref": "LookupGroupNameResponse" 7753 // }, 7754 // "scopes": [ 7755 // "https://www.googleapis.com/auth/cloud-identity.groups", 7756 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7757 // "https://www.googleapis.com/auth/cloud-platform" 7758 // ] 7759 // } 7760 7761} 7762 7763// method id "cloudidentity.groups.patch": 7764 7765type GroupsPatchCall struct { 7766 s *Service 7767 name string 7768 group *Group 7769 urlParams_ gensupport.URLParams 7770 ctx_ context.Context 7771 header_ http.Header 7772} 7773 7774// Patch: Updates a `Group`. 7775// 7776// - name: Output only. The resource name 7777// (https://cloud.google.com/apis/design/resource_names) of the 7778// `Group`. Shall be of the form `groups/{group_id}`. 7779func (r *GroupsService) Patch(name string, group *Group) *GroupsPatchCall { 7780 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7781 c.name = name 7782 c.group = group 7783 return c 7784} 7785 7786// UpdateMask sets the optional parameter "updateMask": Required. The 7787// names of fields to update. May only contain the following field 7788// names: `display_name`, `description`, `labels`, 7789// `dynamic_group_metadata`, `posix_groups`. 7790func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall { 7791 c.urlParams_.Set("updateMask", updateMask) 7792 return c 7793} 7794 7795// Fields allows partial responses to be retrieved. See 7796// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7797// for more information. 7798func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 7799 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7800 return c 7801} 7802 7803// Context sets the context to be used in this call's Do method. Any 7804// pending HTTP request will be aborted if the provided context is 7805// canceled. 7806func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 7807 c.ctx_ = ctx 7808 return c 7809} 7810 7811// Header returns an http.Header that can be modified by the caller to 7812// add HTTP headers to the request. 7813func (c *GroupsPatchCall) Header() http.Header { 7814 if c.header_ == nil { 7815 c.header_ = make(http.Header) 7816 } 7817 return c.header_ 7818} 7819 7820func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 7821 reqHeaders := make(http.Header) 7822 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7823 for k, v := range c.header_ { 7824 reqHeaders[k] = v 7825 } 7826 reqHeaders.Set("User-Agent", c.s.userAgent()) 7827 var body io.Reader = nil 7828 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 7829 if err != nil { 7830 return nil, err 7831 } 7832 reqHeaders.Set("Content-Type", "application/json") 7833 c.urlParams_.Set("alt", alt) 7834 c.urlParams_.Set("prettyPrint", "false") 7835 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7836 urls += "?" + c.urlParams_.Encode() 7837 req, err := http.NewRequest("PATCH", urls, body) 7838 if err != nil { 7839 return nil, err 7840 } 7841 req.Header = reqHeaders 7842 googleapi.Expand(req.URL, map[string]string{ 7843 "name": c.name, 7844 }) 7845 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7846} 7847 7848// Do executes the "cloudidentity.groups.patch" call. 7849// Exactly one of *Operation or error will be non-nil. Any non-2xx 7850// status code is an error. Response headers are in either 7851// *Operation.ServerResponse.Header or (if a response was returned at 7852// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7853// to check whether the returned error was because 7854// http.StatusNotModified was returned. 7855func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7856 gensupport.SetOptions(c.urlParams_, opts...) 7857 res, err := c.doRequest("json") 7858 if res != nil && res.StatusCode == http.StatusNotModified { 7859 if res.Body != nil { 7860 res.Body.Close() 7861 } 7862 return nil, &googleapi.Error{ 7863 Code: res.StatusCode, 7864 Header: res.Header, 7865 } 7866 } 7867 if err != nil { 7868 return nil, err 7869 } 7870 defer googleapi.CloseBody(res) 7871 if err := googleapi.CheckResponse(res); err != nil { 7872 return nil, err 7873 } 7874 ret := &Operation{ 7875 ServerResponse: googleapi.ServerResponse{ 7876 Header: res.Header, 7877 HTTPStatusCode: res.StatusCode, 7878 }, 7879 } 7880 target := &ret 7881 if err := gensupport.DecodeResponse(target, res); err != nil { 7882 return nil, err 7883 } 7884 return ret, nil 7885 // { 7886 // "description": "Updates a `Group`.", 7887 // "flatPath": "v1beta1/groups/{groupsId}", 7888 // "httpMethod": "PATCH", 7889 // "id": "cloudidentity.groups.patch", 7890 // "parameterOrder": [ 7891 // "name" 7892 // ], 7893 // "parameters": { 7894 // "name": { 7895 // "description": "Output only. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Group`. Shall be of the form `groups/{group_id}`.", 7896 // "location": "path", 7897 // "pattern": "^groups/[^/]+$", 7898 // "required": true, 7899 // "type": "string" 7900 // }, 7901 // "updateMask": { 7902 // "description": "Required. The names of fields to update. May only contain the following field names: `display_name`, `description`, `labels`, `dynamic_group_metadata`, `posix_groups`.", 7903 // "format": "google-fieldmask", 7904 // "location": "query", 7905 // "type": "string" 7906 // } 7907 // }, 7908 // "path": "v1beta1/{+name}", 7909 // "request": { 7910 // "$ref": "Group" 7911 // }, 7912 // "response": { 7913 // "$ref": "Operation" 7914 // }, 7915 // "scopes": [ 7916 // "https://www.googleapis.com/auth/cloud-identity.groups", 7917 // "https://www.googleapis.com/auth/cloud-platform" 7918 // ] 7919 // } 7920 7921} 7922 7923// method id "cloudidentity.groups.search": 7924 7925type GroupsSearchCall struct { 7926 s *Service 7927 urlParams_ gensupport.URLParams 7928 ifNoneMatch_ string 7929 ctx_ context.Context 7930 header_ http.Header 7931} 7932 7933// Search: Searches for `Group` resources matching a specified query. 7934func (r *GroupsService) Search() *GroupsSearchCall { 7935 c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7936 return c 7937} 7938 7939// PageSize sets the optional parameter "pageSize": The maximum number 7940// of results to return. Note that the number of results returned may be 7941// less than this value even if there are more available results. To 7942// fetch all results, clients must continue calling this method 7943// repeatedly until the response no longer contains a `next_page_token`. 7944// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for 7945// `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` 7946// or 500 for `GroupView.FULL`. 7947func (c *GroupsSearchCall) PageSize(pageSize int64) *GroupsSearchCall { 7948 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7949 return c 7950} 7951 7952// PageToken sets the optional parameter "pageToken": The 7953// `next_page_token` value returned from a previous search request, if 7954// any. 7955func (c *GroupsSearchCall) PageToken(pageToken string) *GroupsSearchCall { 7956 c.urlParams_.Set("pageToken", pageToken) 7957 return c 7958} 7959 7960// Query sets the optional parameter "query": Required. The search 7961// query. Must be specified in Common Expression Language 7962// (https://opensource.google/projects/cel). May only contain equality 7963// operators on the parent and inclusion operators on labels (e.g., 7964// `parent == 'customers/{customer_id}' && 7965// 'cloudidentity.googleapis.com/groups.discussion_forum' in labels`). 7966// The `customer_id` must begin with "C" (for example, 'C046psxkn'). 7967func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall { 7968 c.urlParams_.Set("query", query) 7969 return c 7970} 7971 7972// View sets the optional parameter "view": The level of detail to be 7973// returned. If unspecified, defaults to `View.BASIC`. 7974// 7975// Possible values: 7976// "BASIC" - Default. Only basic resource information is returned. 7977// "FULL" - All resource information is returned. 7978func (c *GroupsSearchCall) View(view string) *GroupsSearchCall { 7979 c.urlParams_.Set("view", view) 7980 return c 7981} 7982 7983// Fields allows partial responses to be retrieved. See 7984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7985// for more information. 7986func (c *GroupsSearchCall) Fields(s ...googleapi.Field) *GroupsSearchCall { 7987 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7988 return c 7989} 7990 7991// IfNoneMatch sets the optional parameter which makes the operation 7992// fail if the object's ETag matches the given value. This is useful for 7993// getting updates only after the object has changed since the last 7994// request. Use googleapi.IsNotModified to check whether the response 7995// error from Do is the result of In-None-Match. 7996func (c *GroupsSearchCall) IfNoneMatch(entityTag string) *GroupsSearchCall { 7997 c.ifNoneMatch_ = entityTag 7998 return c 7999} 8000 8001// Context sets the context to be used in this call's Do method. Any 8002// pending HTTP request will be aborted if the provided context is 8003// canceled. 8004func (c *GroupsSearchCall) Context(ctx context.Context) *GroupsSearchCall { 8005 c.ctx_ = ctx 8006 return c 8007} 8008 8009// Header returns an http.Header that can be modified by the caller to 8010// add HTTP headers to the request. 8011func (c *GroupsSearchCall) Header() http.Header { 8012 if c.header_ == nil { 8013 c.header_ = make(http.Header) 8014 } 8015 return c.header_ 8016} 8017 8018func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) { 8019 reqHeaders := make(http.Header) 8020 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8021 for k, v := range c.header_ { 8022 reqHeaders[k] = v 8023 } 8024 reqHeaders.Set("User-Agent", c.s.userAgent()) 8025 if c.ifNoneMatch_ != "" { 8026 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8027 } 8028 var body io.Reader = nil 8029 c.urlParams_.Set("alt", alt) 8030 c.urlParams_.Set("prettyPrint", "false") 8031 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:search") 8032 urls += "?" + c.urlParams_.Encode() 8033 req, err := http.NewRequest("GET", urls, body) 8034 if err != nil { 8035 return nil, err 8036 } 8037 req.Header = reqHeaders 8038 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8039} 8040 8041// Do executes the "cloudidentity.groups.search" call. 8042// Exactly one of *SearchGroupsResponse or error will be non-nil. Any 8043// non-2xx status code is an error. Response headers are in either 8044// *SearchGroupsResponse.ServerResponse.Header or (if a response was 8045// returned at all) in error.(*googleapi.Error).Header. Use 8046// googleapi.IsNotModified to check whether the returned error was 8047// because http.StatusNotModified was returned. 8048func (c *GroupsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGroupsResponse, error) { 8049 gensupport.SetOptions(c.urlParams_, opts...) 8050 res, err := c.doRequest("json") 8051 if res != nil && res.StatusCode == http.StatusNotModified { 8052 if res.Body != nil { 8053 res.Body.Close() 8054 } 8055 return nil, &googleapi.Error{ 8056 Code: res.StatusCode, 8057 Header: res.Header, 8058 } 8059 } 8060 if err != nil { 8061 return nil, err 8062 } 8063 defer googleapi.CloseBody(res) 8064 if err := googleapi.CheckResponse(res); err != nil { 8065 return nil, err 8066 } 8067 ret := &SearchGroupsResponse{ 8068 ServerResponse: googleapi.ServerResponse{ 8069 Header: res.Header, 8070 HTTPStatusCode: res.StatusCode, 8071 }, 8072 } 8073 target := &ret 8074 if err := gensupport.DecodeResponse(target, res); err != nil { 8075 return nil, err 8076 } 8077 return ret, nil 8078 // { 8079 // "description": "Searches for `Group` resources matching a specified query.", 8080 // "flatPath": "v1beta1/groups:search", 8081 // "httpMethod": "GET", 8082 // "id": "cloudidentity.groups.search", 8083 // "parameterOrder": [], 8084 // "parameters": { 8085 // "pageSize": { 8086 // "description": "The maximum number of results to return. Note that the number of results returned may be less than this value even if there are more available results. To fetch all results, clients must continue calling this method repeatedly until the response no longer contains a `next_page_token`. If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` or 500 for `GroupView.FULL`.", 8087 // "format": "int32", 8088 // "location": "query", 8089 // "type": "integer" 8090 // }, 8091 // "pageToken": { 8092 // "description": "The `next_page_token` value returned from a previous search request, if any.", 8093 // "location": "query", 8094 // "type": "string" 8095 // }, 8096 // "query": { 8097 // "description": "Required. The search query. Must be specified in [Common Expression Language](https://opensource.google/projects/cel). May only contain equality operators on the parent and inclusion operators on labels (e.g., `parent == 'customers/{customer_id}' \u0026\u0026 'cloudidentity.googleapis.com/groups.discussion_forum' in labels`). The `customer_id` must begin with \"C\" (for example, 'C046psxkn').", 8098 // "location": "query", 8099 // "type": "string" 8100 // }, 8101 // "view": { 8102 // "description": "The level of detail to be returned. If unspecified, defaults to `View.BASIC`.", 8103 // "enum": [ 8104 // "BASIC", 8105 // "FULL" 8106 // ], 8107 // "enumDescriptions": [ 8108 // "Default. Only basic resource information is returned.", 8109 // "All resource information is returned." 8110 // ], 8111 // "location": "query", 8112 // "type": "string" 8113 // } 8114 // }, 8115 // "path": "v1beta1/groups:search", 8116 // "response": { 8117 // "$ref": "SearchGroupsResponse" 8118 // }, 8119 // "scopes": [ 8120 // "https://www.googleapis.com/auth/cloud-identity.groups", 8121 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8122 // "https://www.googleapis.com/auth/cloud-platform" 8123 // ] 8124 // } 8125 8126} 8127 8128// Pages invokes f for each page of results. 8129// A non-nil error returned from f will halt the iteration. 8130// The provided context supersedes any context provided to the Context method. 8131func (c *GroupsSearchCall) Pages(ctx context.Context, f func(*SearchGroupsResponse) error) error { 8132 c.ctx_ = ctx 8133 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8134 for { 8135 x, err := c.Do() 8136 if err != nil { 8137 return err 8138 } 8139 if err := f(x); err != nil { 8140 return err 8141 } 8142 if x.NextPageToken == "" { 8143 return nil 8144 } 8145 c.PageToken(x.NextPageToken) 8146 } 8147} 8148 8149// method id "cloudidentity.groups.updateSecuritySettings": 8150 8151type GroupsUpdateSecuritySettingsCall struct { 8152 s *Service 8153 name string 8154 securitysettings *SecuritySettings 8155 urlParams_ gensupport.URLParams 8156 ctx_ context.Context 8157 header_ http.Header 8158} 8159 8160// UpdateSecuritySettings: Update Security Settings 8161// 8162// - name: Output only. The resource name of the security settings. 8163// Shall be of the form `groups/{group_id}/securitySettings`. 8164func (r *GroupsService) UpdateSecuritySettings(name string, securitysettings *SecuritySettings) *GroupsUpdateSecuritySettingsCall { 8165 c := &GroupsUpdateSecuritySettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8166 c.name = name 8167 c.securitysettings = securitysettings 8168 return c 8169} 8170 8171// UpdateMask sets the optional parameter "updateMask": Required. The 8172// fully-qualified names of fields to update. May only contain the 8173// following field: `member_restriction.query`. 8174func (c *GroupsUpdateSecuritySettingsCall) UpdateMask(updateMask string) *GroupsUpdateSecuritySettingsCall { 8175 c.urlParams_.Set("updateMask", updateMask) 8176 return c 8177} 8178 8179// Fields allows partial responses to be retrieved. See 8180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8181// for more information. 8182func (c *GroupsUpdateSecuritySettingsCall) Fields(s ...googleapi.Field) *GroupsUpdateSecuritySettingsCall { 8183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8184 return c 8185} 8186 8187// Context sets the context to be used in this call's Do method. Any 8188// pending HTTP request will be aborted if the provided context is 8189// canceled. 8190func (c *GroupsUpdateSecuritySettingsCall) Context(ctx context.Context) *GroupsUpdateSecuritySettingsCall { 8191 c.ctx_ = ctx 8192 return c 8193} 8194 8195// Header returns an http.Header that can be modified by the caller to 8196// add HTTP headers to the request. 8197func (c *GroupsUpdateSecuritySettingsCall) Header() http.Header { 8198 if c.header_ == nil { 8199 c.header_ = make(http.Header) 8200 } 8201 return c.header_ 8202} 8203 8204func (c *GroupsUpdateSecuritySettingsCall) doRequest(alt string) (*http.Response, error) { 8205 reqHeaders := make(http.Header) 8206 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8207 for k, v := range c.header_ { 8208 reqHeaders[k] = v 8209 } 8210 reqHeaders.Set("User-Agent", c.s.userAgent()) 8211 var body io.Reader = nil 8212 body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitysettings) 8213 if err != nil { 8214 return nil, err 8215 } 8216 reqHeaders.Set("Content-Type", "application/json") 8217 c.urlParams_.Set("alt", alt) 8218 c.urlParams_.Set("prettyPrint", "false") 8219 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8220 urls += "?" + c.urlParams_.Encode() 8221 req, err := http.NewRequest("PATCH", urls, body) 8222 if err != nil { 8223 return nil, err 8224 } 8225 req.Header = reqHeaders 8226 googleapi.Expand(req.URL, map[string]string{ 8227 "name": c.name, 8228 }) 8229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8230} 8231 8232// Do executes the "cloudidentity.groups.updateSecuritySettings" call. 8233// Exactly one of *Operation or error will be non-nil. Any non-2xx 8234// status code is an error. Response headers are in either 8235// *Operation.ServerResponse.Header or (if a response was returned at 8236// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8237// to check whether the returned error was because 8238// http.StatusNotModified was returned. 8239func (c *GroupsUpdateSecuritySettingsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8240 gensupport.SetOptions(c.urlParams_, opts...) 8241 res, err := c.doRequest("json") 8242 if res != nil && res.StatusCode == http.StatusNotModified { 8243 if res.Body != nil { 8244 res.Body.Close() 8245 } 8246 return nil, &googleapi.Error{ 8247 Code: res.StatusCode, 8248 Header: res.Header, 8249 } 8250 } 8251 if err != nil { 8252 return nil, err 8253 } 8254 defer googleapi.CloseBody(res) 8255 if err := googleapi.CheckResponse(res); err != nil { 8256 return nil, err 8257 } 8258 ret := &Operation{ 8259 ServerResponse: googleapi.ServerResponse{ 8260 Header: res.Header, 8261 HTTPStatusCode: res.StatusCode, 8262 }, 8263 } 8264 target := &ret 8265 if err := gensupport.DecodeResponse(target, res); err != nil { 8266 return nil, err 8267 } 8268 return ret, nil 8269 // { 8270 // "description": "Update Security Settings", 8271 // "flatPath": "v1beta1/groups/{groupsId}/securitySettings", 8272 // "httpMethod": "PATCH", 8273 // "id": "cloudidentity.groups.updateSecuritySettings", 8274 // "parameterOrder": [ 8275 // "name" 8276 // ], 8277 // "parameters": { 8278 // "name": { 8279 // "description": "Output only. The resource name of the security settings. Shall be of the form `groups/{group_id}/securitySettings`.", 8280 // "location": "path", 8281 // "pattern": "^groups/[^/]+/securitySettings$", 8282 // "required": true, 8283 // "type": "string" 8284 // }, 8285 // "updateMask": { 8286 // "description": "Required. The fully-qualified names of fields to update. May only contain the following field: `member_restriction.query`.", 8287 // "format": "google-fieldmask", 8288 // "location": "query", 8289 // "type": "string" 8290 // } 8291 // }, 8292 // "path": "v1beta1/{+name}", 8293 // "request": { 8294 // "$ref": "SecuritySettings" 8295 // }, 8296 // "response": { 8297 // "$ref": "Operation" 8298 // }, 8299 // "scopes": [ 8300 // "https://www.googleapis.com/auth/cloud-identity.groups", 8301 // "https://www.googleapis.com/auth/cloud-platform" 8302 // ] 8303 // } 8304 8305} 8306 8307// method id "cloudidentity.groups.memberships.checkTransitiveMembership": 8308 8309type GroupsMembershipsCheckTransitiveMembershipCall struct { 8310 s *Service 8311 parent string 8312 urlParams_ gensupport.URLParams 8313 ifNoneMatch_ string 8314 ctx_ context.Context 8315 header_ http.Header 8316} 8317 8318// CheckTransitiveMembership: Check a potential member for membership in 8319// a group. **Note:** This feature is only available to Google Workspace 8320// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 8321// and Cloud Identity Premium accounts. A member has membership to a 8322// group as long as there is a single viewable transitive membership 8323// between the group and the member. The actor must have view 8324// permissions to at least one transitive membership between the member 8325// and group. 8326// 8327// - parent: Resource name 8328// (https://cloud.google.com/apis/design/resource_names) of the group 8329// to check the transitive membership in. Format: `groups/{group_id}`, 8330// where `group_id` is the unique id assigned to the Group to which 8331// the Membership belongs to. 8332func (r *GroupsMembershipsService) CheckTransitiveMembership(parent string) *GroupsMembershipsCheckTransitiveMembershipCall { 8333 c := &GroupsMembershipsCheckTransitiveMembershipCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8334 c.parent = parent 8335 return c 8336} 8337 8338// Query sets the optional parameter "query": Required. A CEL expression 8339// that MUST include member specification. This is a `required` field. 8340// Certain groups are uniquely identified by both a 'member_key_id' and 8341// a 'member_key_namespace', which requires an additional query input: 8342// 'member_key_namespace'. Example query: `member_key_id == 8343// 'member_key_id_value'` 8344func (c *GroupsMembershipsCheckTransitiveMembershipCall) Query(query string) *GroupsMembershipsCheckTransitiveMembershipCall { 8345 c.urlParams_.Set("query", query) 8346 return c 8347} 8348 8349// Fields allows partial responses to be retrieved. See 8350// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8351// for more information. 8352func (c *GroupsMembershipsCheckTransitiveMembershipCall) Fields(s ...googleapi.Field) *GroupsMembershipsCheckTransitiveMembershipCall { 8353 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8354 return c 8355} 8356 8357// IfNoneMatch sets the optional parameter which makes the operation 8358// fail if the object's ETag matches the given value. This is useful for 8359// getting updates only after the object has changed since the last 8360// request. Use googleapi.IsNotModified to check whether the response 8361// error from Do is the result of In-None-Match. 8362func (c *GroupsMembershipsCheckTransitiveMembershipCall) IfNoneMatch(entityTag string) *GroupsMembershipsCheckTransitiveMembershipCall { 8363 c.ifNoneMatch_ = entityTag 8364 return c 8365} 8366 8367// Context sets the context to be used in this call's Do method. Any 8368// pending HTTP request will be aborted if the provided context is 8369// canceled. 8370func (c *GroupsMembershipsCheckTransitiveMembershipCall) Context(ctx context.Context) *GroupsMembershipsCheckTransitiveMembershipCall { 8371 c.ctx_ = ctx 8372 return c 8373} 8374 8375// Header returns an http.Header that can be modified by the caller to 8376// add HTTP headers to the request. 8377func (c *GroupsMembershipsCheckTransitiveMembershipCall) Header() http.Header { 8378 if c.header_ == nil { 8379 c.header_ = make(http.Header) 8380 } 8381 return c.header_ 8382} 8383 8384func (c *GroupsMembershipsCheckTransitiveMembershipCall) doRequest(alt string) (*http.Response, error) { 8385 reqHeaders := make(http.Header) 8386 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8387 for k, v := range c.header_ { 8388 reqHeaders[k] = v 8389 } 8390 reqHeaders.Set("User-Agent", c.s.userAgent()) 8391 if c.ifNoneMatch_ != "" { 8392 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8393 } 8394 var body io.Reader = nil 8395 c.urlParams_.Set("alt", alt) 8396 c.urlParams_.Set("prettyPrint", "false") 8397 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:checkTransitiveMembership") 8398 urls += "?" + c.urlParams_.Encode() 8399 req, err := http.NewRequest("GET", urls, body) 8400 if err != nil { 8401 return nil, err 8402 } 8403 req.Header = reqHeaders 8404 googleapi.Expand(req.URL, map[string]string{ 8405 "parent": c.parent, 8406 }) 8407 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8408} 8409 8410// Do executes the "cloudidentity.groups.memberships.checkTransitiveMembership" call. 8411// Exactly one of *CheckTransitiveMembershipResponse or error will be 8412// non-nil. Any non-2xx status code is an error. Response headers are in 8413// either *CheckTransitiveMembershipResponse.ServerResponse.Header or 8414// (if a response was returned at all) in 8415// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8416// whether the returned error was because http.StatusNotModified was 8417// returned. 8418func (c *GroupsMembershipsCheckTransitiveMembershipCall) Do(opts ...googleapi.CallOption) (*CheckTransitiveMembershipResponse, error) { 8419 gensupport.SetOptions(c.urlParams_, opts...) 8420 res, err := c.doRequest("json") 8421 if res != nil && res.StatusCode == http.StatusNotModified { 8422 if res.Body != nil { 8423 res.Body.Close() 8424 } 8425 return nil, &googleapi.Error{ 8426 Code: res.StatusCode, 8427 Header: res.Header, 8428 } 8429 } 8430 if err != nil { 8431 return nil, err 8432 } 8433 defer googleapi.CloseBody(res) 8434 if err := googleapi.CheckResponse(res); err != nil { 8435 return nil, err 8436 } 8437 ret := &CheckTransitiveMembershipResponse{ 8438 ServerResponse: googleapi.ServerResponse{ 8439 Header: res.Header, 8440 HTTPStatusCode: res.StatusCode, 8441 }, 8442 } 8443 target := &ret 8444 if err := gensupport.DecodeResponse(target, res); err != nil { 8445 return nil, err 8446 } 8447 return ret, nil 8448 // { 8449 // "description": "Check a potential member for membership in a group. **Note:** This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. A member has membership to a group as long as there is a single viewable transitive membership between the group and the member. The actor must have view permissions to at least one transitive membership between the member and group.", 8450 // "flatPath": "v1beta1/groups/{groupsId}/memberships:checkTransitiveMembership", 8451 // "httpMethod": "GET", 8452 // "id": "cloudidentity.groups.memberships.checkTransitiveMembership", 8453 // "parameterOrder": [ 8454 // "parent" 8455 // ], 8456 // "parameters": { 8457 // "parent": { 8458 // "description": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the group to check the transitive membership in. Format: `groups/{group_id}`, where `group_id` is the unique id assigned to the Group to which the Membership belongs to.", 8459 // "location": "path", 8460 // "pattern": "^groups/[^/]+$", 8461 // "required": true, 8462 // "type": "string" 8463 // }, 8464 // "query": { 8465 // "description": "Required. A CEL expression that MUST include member specification. This is a `required` field. Certain groups are uniquely identified by both a 'member_key_id' and a 'member_key_namespace', which requires an additional query input: 'member_key_namespace'. Example query: `member_key_id == 'member_key_id_value'`", 8466 // "location": "query", 8467 // "type": "string" 8468 // } 8469 // }, 8470 // "path": "v1beta1/{+parent}/memberships:checkTransitiveMembership", 8471 // "response": { 8472 // "$ref": "CheckTransitiveMembershipResponse" 8473 // }, 8474 // "scopes": [ 8475 // "https://www.googleapis.com/auth/cloud-identity.groups", 8476 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8477 // "https://www.googleapis.com/auth/cloud-platform" 8478 // ] 8479 // } 8480 8481} 8482 8483// method id "cloudidentity.groups.memberships.create": 8484 8485type GroupsMembershipsCreateCall struct { 8486 s *Service 8487 parent string 8488 membership *Membership 8489 urlParams_ gensupport.URLParams 8490 ctx_ context.Context 8491 header_ http.Header 8492} 8493 8494// Create: Creates a `Membership`. 8495// 8496// - parent: The parent `Group` resource under which to create the 8497// `Membership`. Must be of the form `groups/{group_id}`. 8498func (r *GroupsMembershipsService) Create(parent string, membership *Membership) *GroupsMembershipsCreateCall { 8499 c := &GroupsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8500 c.parent = parent 8501 c.membership = membership 8502 return c 8503} 8504 8505// Fields allows partial responses to be retrieved. See 8506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8507// for more information. 8508func (c *GroupsMembershipsCreateCall) Fields(s ...googleapi.Field) *GroupsMembershipsCreateCall { 8509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8510 return c 8511} 8512 8513// Context sets the context to be used in this call's Do method. Any 8514// pending HTTP request will be aborted if the provided context is 8515// canceled. 8516func (c *GroupsMembershipsCreateCall) Context(ctx context.Context) *GroupsMembershipsCreateCall { 8517 c.ctx_ = ctx 8518 return c 8519} 8520 8521// Header returns an http.Header that can be modified by the caller to 8522// add HTTP headers to the request. 8523func (c *GroupsMembershipsCreateCall) Header() http.Header { 8524 if c.header_ == nil { 8525 c.header_ = make(http.Header) 8526 } 8527 return c.header_ 8528} 8529 8530func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { 8531 reqHeaders := make(http.Header) 8532 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8533 for k, v := range c.header_ { 8534 reqHeaders[k] = v 8535 } 8536 reqHeaders.Set("User-Agent", c.s.userAgent()) 8537 var body io.Reader = nil 8538 body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) 8539 if err != nil { 8540 return nil, err 8541 } 8542 reqHeaders.Set("Content-Type", "application/json") 8543 c.urlParams_.Set("alt", alt) 8544 c.urlParams_.Set("prettyPrint", "false") 8545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 8546 urls += "?" + c.urlParams_.Encode() 8547 req, err := http.NewRequest("POST", urls, body) 8548 if err != nil { 8549 return nil, err 8550 } 8551 req.Header = reqHeaders 8552 googleapi.Expand(req.URL, map[string]string{ 8553 "parent": c.parent, 8554 }) 8555 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8556} 8557 8558// Do executes the "cloudidentity.groups.memberships.create" call. 8559// Exactly one of *Operation or error will be non-nil. Any non-2xx 8560// status code is an error. Response headers are in either 8561// *Operation.ServerResponse.Header or (if a response was returned at 8562// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8563// to check whether the returned error was because 8564// http.StatusNotModified was returned. 8565func (c *GroupsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8566 gensupport.SetOptions(c.urlParams_, opts...) 8567 res, err := c.doRequest("json") 8568 if res != nil && res.StatusCode == http.StatusNotModified { 8569 if res.Body != nil { 8570 res.Body.Close() 8571 } 8572 return nil, &googleapi.Error{ 8573 Code: res.StatusCode, 8574 Header: res.Header, 8575 } 8576 } 8577 if err != nil { 8578 return nil, err 8579 } 8580 defer googleapi.CloseBody(res) 8581 if err := googleapi.CheckResponse(res); err != nil { 8582 return nil, err 8583 } 8584 ret := &Operation{ 8585 ServerResponse: googleapi.ServerResponse{ 8586 Header: res.Header, 8587 HTTPStatusCode: res.StatusCode, 8588 }, 8589 } 8590 target := &ret 8591 if err := gensupport.DecodeResponse(target, res); err != nil { 8592 return nil, err 8593 } 8594 return ret, nil 8595 // { 8596 // "description": "Creates a `Membership`.", 8597 // "flatPath": "v1beta1/groups/{groupsId}/memberships", 8598 // "httpMethod": "POST", 8599 // "id": "cloudidentity.groups.memberships.create", 8600 // "parameterOrder": [ 8601 // "parent" 8602 // ], 8603 // "parameters": { 8604 // "parent": { 8605 // "description": "Required. The parent `Group` resource under which to create the `Membership`. Must be of the form `groups/{group_id}`.", 8606 // "location": "path", 8607 // "pattern": "^groups/[^/]+$", 8608 // "required": true, 8609 // "type": "string" 8610 // } 8611 // }, 8612 // "path": "v1beta1/{+parent}/memberships", 8613 // "request": { 8614 // "$ref": "Membership" 8615 // }, 8616 // "response": { 8617 // "$ref": "Operation" 8618 // }, 8619 // "scopes": [ 8620 // "https://www.googleapis.com/auth/cloud-identity.groups", 8621 // "https://www.googleapis.com/auth/cloud-platform" 8622 // ] 8623 // } 8624 8625} 8626 8627// method id "cloudidentity.groups.memberships.delete": 8628 8629type GroupsMembershipsDeleteCall struct { 8630 s *Service 8631 name string 8632 urlParams_ gensupport.URLParams 8633 ctx_ context.Context 8634 header_ http.Header 8635} 8636 8637// Delete: Deletes a `Membership`. 8638// 8639// - name: The resource name 8640// (https://cloud.google.com/apis/design/resource_names) of the 8641// `Membership` to delete. Must be of the form 8642// `groups/{group_id}/memberships/{membership_id}`. 8643func (r *GroupsMembershipsService) Delete(name string) *GroupsMembershipsDeleteCall { 8644 c := &GroupsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8645 c.name = name 8646 return c 8647} 8648 8649// Fields allows partial responses to be retrieved. See 8650// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8651// for more information. 8652func (c *GroupsMembershipsDeleteCall) Fields(s ...googleapi.Field) *GroupsMembershipsDeleteCall { 8653 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8654 return c 8655} 8656 8657// Context sets the context to be used in this call's Do method. Any 8658// pending HTTP request will be aborted if the provided context is 8659// canceled. 8660func (c *GroupsMembershipsDeleteCall) Context(ctx context.Context) *GroupsMembershipsDeleteCall { 8661 c.ctx_ = ctx 8662 return c 8663} 8664 8665// Header returns an http.Header that can be modified by the caller to 8666// add HTTP headers to the request. 8667func (c *GroupsMembershipsDeleteCall) Header() http.Header { 8668 if c.header_ == nil { 8669 c.header_ = make(http.Header) 8670 } 8671 return c.header_ 8672} 8673 8674func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { 8675 reqHeaders := make(http.Header) 8676 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8677 for k, v := range c.header_ { 8678 reqHeaders[k] = v 8679 } 8680 reqHeaders.Set("User-Agent", c.s.userAgent()) 8681 var body io.Reader = nil 8682 c.urlParams_.Set("alt", alt) 8683 c.urlParams_.Set("prettyPrint", "false") 8684 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8685 urls += "?" + c.urlParams_.Encode() 8686 req, err := http.NewRequest("DELETE", urls, body) 8687 if err != nil { 8688 return nil, err 8689 } 8690 req.Header = reqHeaders 8691 googleapi.Expand(req.URL, map[string]string{ 8692 "name": c.name, 8693 }) 8694 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8695} 8696 8697// Do executes the "cloudidentity.groups.memberships.delete" call. 8698// Exactly one of *Operation or error will be non-nil. Any non-2xx 8699// status code is an error. Response headers are in either 8700// *Operation.ServerResponse.Header or (if a response was returned at 8701// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8702// to check whether the returned error was because 8703// http.StatusNotModified was returned. 8704func (c *GroupsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8705 gensupport.SetOptions(c.urlParams_, opts...) 8706 res, err := c.doRequest("json") 8707 if res != nil && res.StatusCode == http.StatusNotModified { 8708 if res.Body != nil { 8709 res.Body.Close() 8710 } 8711 return nil, &googleapi.Error{ 8712 Code: res.StatusCode, 8713 Header: res.Header, 8714 } 8715 } 8716 if err != nil { 8717 return nil, err 8718 } 8719 defer googleapi.CloseBody(res) 8720 if err := googleapi.CheckResponse(res); err != nil { 8721 return nil, err 8722 } 8723 ret := &Operation{ 8724 ServerResponse: googleapi.ServerResponse{ 8725 Header: res.Header, 8726 HTTPStatusCode: res.StatusCode, 8727 }, 8728 } 8729 target := &ret 8730 if err := gensupport.DecodeResponse(target, res); err != nil { 8731 return nil, err 8732 } 8733 return ret, nil 8734 // { 8735 // "description": "Deletes a `Membership`.", 8736 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}", 8737 // "httpMethod": "DELETE", 8738 // "id": "cloudidentity.groups.memberships.delete", 8739 // "parameterOrder": [ 8740 // "name" 8741 // ], 8742 // "parameters": { 8743 // "name": { 8744 // "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Membership` to delete. Must be of the form `groups/{group_id}/memberships/{membership_id}`.", 8745 // "location": "path", 8746 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 8747 // "required": true, 8748 // "type": "string" 8749 // } 8750 // }, 8751 // "path": "v1beta1/{+name}", 8752 // "response": { 8753 // "$ref": "Operation" 8754 // }, 8755 // "scopes": [ 8756 // "https://www.googleapis.com/auth/cloud-identity.groups", 8757 // "https://www.googleapis.com/auth/cloud-platform" 8758 // ] 8759 // } 8760 8761} 8762 8763// method id "cloudidentity.groups.memberships.get": 8764 8765type GroupsMembershipsGetCall struct { 8766 s *Service 8767 name string 8768 urlParams_ gensupport.URLParams 8769 ifNoneMatch_ string 8770 ctx_ context.Context 8771 header_ http.Header 8772} 8773 8774// Get: Retrieves a `Membership`. 8775// 8776// - name: The resource name 8777// (https://cloud.google.com/apis/design/resource_names) of the 8778// `Membership` to retrieve. Must be of the form 8779// `groups/{group_id}/memberships/{membership_id}`. 8780func (r *GroupsMembershipsService) Get(name string) *GroupsMembershipsGetCall { 8781 c := &GroupsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8782 c.name = name 8783 return c 8784} 8785 8786// Fields allows partial responses to be retrieved. See 8787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8788// for more information. 8789func (c *GroupsMembershipsGetCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetCall { 8790 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8791 return c 8792} 8793 8794// IfNoneMatch sets the optional parameter which makes the operation 8795// fail if the object's ETag matches the given value. This is useful for 8796// getting updates only after the object has changed since the last 8797// request. Use googleapi.IsNotModified to check whether the response 8798// error from Do is the result of In-None-Match. 8799func (c *GroupsMembershipsGetCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetCall { 8800 c.ifNoneMatch_ = entityTag 8801 return c 8802} 8803 8804// Context sets the context to be used in this call's Do method. Any 8805// pending HTTP request will be aborted if the provided context is 8806// canceled. 8807func (c *GroupsMembershipsGetCall) Context(ctx context.Context) *GroupsMembershipsGetCall { 8808 c.ctx_ = ctx 8809 return c 8810} 8811 8812// Header returns an http.Header that can be modified by the caller to 8813// add HTTP headers to the request. 8814func (c *GroupsMembershipsGetCall) Header() http.Header { 8815 if c.header_ == nil { 8816 c.header_ = make(http.Header) 8817 } 8818 return c.header_ 8819} 8820 8821func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) { 8822 reqHeaders := make(http.Header) 8823 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8824 for k, v := range c.header_ { 8825 reqHeaders[k] = v 8826 } 8827 reqHeaders.Set("User-Agent", c.s.userAgent()) 8828 if c.ifNoneMatch_ != "" { 8829 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8830 } 8831 var body io.Reader = nil 8832 c.urlParams_.Set("alt", alt) 8833 c.urlParams_.Set("prettyPrint", "false") 8834 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8835 urls += "?" + c.urlParams_.Encode() 8836 req, err := http.NewRequest("GET", urls, body) 8837 if err != nil { 8838 return nil, err 8839 } 8840 req.Header = reqHeaders 8841 googleapi.Expand(req.URL, map[string]string{ 8842 "name": c.name, 8843 }) 8844 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8845} 8846 8847// Do executes the "cloudidentity.groups.memberships.get" call. 8848// Exactly one of *Membership or error will be non-nil. Any non-2xx 8849// status code is an error. Response headers are in either 8850// *Membership.ServerResponse.Header or (if a response was returned at 8851// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8852// to check whether the returned error was because 8853// http.StatusNotModified was returned. 8854func (c *GroupsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) { 8855 gensupport.SetOptions(c.urlParams_, opts...) 8856 res, err := c.doRequest("json") 8857 if res != nil && res.StatusCode == http.StatusNotModified { 8858 if res.Body != nil { 8859 res.Body.Close() 8860 } 8861 return nil, &googleapi.Error{ 8862 Code: res.StatusCode, 8863 Header: res.Header, 8864 } 8865 } 8866 if err != nil { 8867 return nil, err 8868 } 8869 defer googleapi.CloseBody(res) 8870 if err := googleapi.CheckResponse(res); err != nil { 8871 return nil, err 8872 } 8873 ret := &Membership{ 8874 ServerResponse: googleapi.ServerResponse{ 8875 Header: res.Header, 8876 HTTPStatusCode: res.StatusCode, 8877 }, 8878 } 8879 target := &ret 8880 if err := gensupport.DecodeResponse(target, res); err != nil { 8881 return nil, err 8882 } 8883 return ret, nil 8884 // { 8885 // "description": "Retrieves a `Membership`.", 8886 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}", 8887 // "httpMethod": "GET", 8888 // "id": "cloudidentity.groups.memberships.get", 8889 // "parameterOrder": [ 8890 // "name" 8891 // ], 8892 // "parameters": { 8893 // "name": { 8894 // "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Membership` to retrieve. Must be of the form `groups/{group_id}/memberships/{membership_id}`.", 8895 // "location": "path", 8896 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 8897 // "required": true, 8898 // "type": "string" 8899 // } 8900 // }, 8901 // "path": "v1beta1/{+name}", 8902 // "response": { 8903 // "$ref": "Membership" 8904 // }, 8905 // "scopes": [ 8906 // "https://www.googleapis.com/auth/cloud-identity.groups", 8907 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8908 // "https://www.googleapis.com/auth/cloud-platform" 8909 // ] 8910 // } 8911 8912} 8913 8914// method id "cloudidentity.groups.memberships.getMembershipGraph": 8915 8916type GroupsMembershipsGetMembershipGraphCall struct { 8917 s *Service 8918 parent string 8919 urlParams_ gensupport.URLParams 8920 ifNoneMatch_ string 8921 ctx_ context.Context 8922 header_ http.Header 8923} 8924 8925// GetMembershipGraph: Get a membership graph of just a member or both a 8926// member and a group. **Note:** This feature is only available to 8927// Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise 8928// for Education; and Cloud Identity Premium accounts. Given a member, 8929// the response will contain all membership paths from the member. Given 8930// both a group and a member, the response will contain all membership 8931// paths between the group and the member. 8932// 8933// - parent: Resource name 8934// (https://cloud.google.com/apis/design/resource_names) of the group 8935// to search transitive memberships in. Format: `groups/{group_id}`, 8936// where `group_id` is the unique ID assigned to the Group to which 8937// the Membership belongs to. group_id can be a wildcard collection id 8938// "-". When a group_id is specified, the membership graph will be 8939// constrained to paths between the member (defined in the query) and 8940// the parent. If a wildcard collection is provided, all membership 8941// paths connected to the member will be returned. 8942func (r *GroupsMembershipsService) GetMembershipGraph(parent string) *GroupsMembershipsGetMembershipGraphCall { 8943 c := &GroupsMembershipsGetMembershipGraphCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8944 c.parent = parent 8945 return c 8946} 8947 8948// Query sets the optional parameter "query": Required. A CEL expression 8949// that MUST include member specification AND label(s). Certain groups 8950// are uniquely identified by both a 'member_key_id' and a 8951// 'member_key_namespace', which requires an additional query input: 8952// 'member_key_namespace'. Example query: `member_key_id == 8953// 'member_key_id_value' && in labels` 8954func (c *GroupsMembershipsGetMembershipGraphCall) Query(query string) *GroupsMembershipsGetMembershipGraphCall { 8955 c.urlParams_.Set("query", query) 8956 return c 8957} 8958 8959// Fields allows partial responses to be retrieved. See 8960// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8961// for more information. 8962func (c *GroupsMembershipsGetMembershipGraphCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetMembershipGraphCall { 8963 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8964 return c 8965} 8966 8967// IfNoneMatch sets the optional parameter which makes the operation 8968// fail if the object's ETag matches the given value. This is useful for 8969// getting updates only after the object has changed since the last 8970// request. Use googleapi.IsNotModified to check whether the response 8971// error from Do is the result of In-None-Match. 8972func (c *GroupsMembershipsGetMembershipGraphCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetMembershipGraphCall { 8973 c.ifNoneMatch_ = entityTag 8974 return c 8975} 8976 8977// Context sets the context to be used in this call's Do method. Any 8978// pending HTTP request will be aborted if the provided context is 8979// canceled. 8980func (c *GroupsMembershipsGetMembershipGraphCall) Context(ctx context.Context) *GroupsMembershipsGetMembershipGraphCall { 8981 c.ctx_ = ctx 8982 return c 8983} 8984 8985// Header returns an http.Header that can be modified by the caller to 8986// add HTTP headers to the request. 8987func (c *GroupsMembershipsGetMembershipGraphCall) Header() http.Header { 8988 if c.header_ == nil { 8989 c.header_ = make(http.Header) 8990 } 8991 return c.header_ 8992} 8993 8994func (c *GroupsMembershipsGetMembershipGraphCall) doRequest(alt string) (*http.Response, error) { 8995 reqHeaders := make(http.Header) 8996 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8997 for k, v := range c.header_ { 8998 reqHeaders[k] = v 8999 } 9000 reqHeaders.Set("User-Agent", c.s.userAgent()) 9001 if c.ifNoneMatch_ != "" { 9002 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9003 } 9004 var body io.Reader = nil 9005 c.urlParams_.Set("alt", alt) 9006 c.urlParams_.Set("prettyPrint", "false") 9007 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:getMembershipGraph") 9008 urls += "?" + c.urlParams_.Encode() 9009 req, err := http.NewRequest("GET", urls, body) 9010 if err != nil { 9011 return nil, err 9012 } 9013 req.Header = reqHeaders 9014 googleapi.Expand(req.URL, map[string]string{ 9015 "parent": c.parent, 9016 }) 9017 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9018} 9019 9020// Do executes the "cloudidentity.groups.memberships.getMembershipGraph" call. 9021// Exactly one of *Operation or error will be non-nil. Any non-2xx 9022// status code is an error. Response headers are in either 9023// *Operation.ServerResponse.Header or (if a response was returned at 9024// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9025// to check whether the returned error was because 9026// http.StatusNotModified was returned. 9027func (c *GroupsMembershipsGetMembershipGraphCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9028 gensupport.SetOptions(c.urlParams_, opts...) 9029 res, err := c.doRequest("json") 9030 if res != nil && res.StatusCode == http.StatusNotModified { 9031 if res.Body != nil { 9032 res.Body.Close() 9033 } 9034 return nil, &googleapi.Error{ 9035 Code: res.StatusCode, 9036 Header: res.Header, 9037 } 9038 } 9039 if err != nil { 9040 return nil, err 9041 } 9042 defer googleapi.CloseBody(res) 9043 if err := googleapi.CheckResponse(res); err != nil { 9044 return nil, err 9045 } 9046 ret := &Operation{ 9047 ServerResponse: googleapi.ServerResponse{ 9048 Header: res.Header, 9049 HTTPStatusCode: res.StatusCode, 9050 }, 9051 } 9052 target := &ret 9053 if err := gensupport.DecodeResponse(target, res); err != nil { 9054 return nil, err 9055 } 9056 return ret, nil 9057 // { 9058 // "description": "Get a membership graph of just a member or both a member and a group. **Note:** This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. Given a member, the response will contain all membership paths from the member. Given both a group and a member, the response will contain all membership paths between the group and the member.", 9059 // "flatPath": "v1beta1/groups/{groupsId}/memberships:getMembershipGraph", 9060 // "httpMethod": "GET", 9061 // "id": "cloudidentity.groups.memberships.getMembershipGraph", 9062 // "parameterOrder": [ 9063 // "parent" 9064 // ], 9065 // "parameters": { 9066 // "parent": { 9067 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the group to search transitive memberships in. Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to the Group to which the Membership belongs to. group_id can be a wildcard collection id \"-\". When a group_id is specified, the membership graph will be constrained to paths between the member (defined in the query) and the parent. If a wildcard collection is provided, all membership paths connected to the member will be returned.", 9068 // "location": "path", 9069 // "pattern": "^groups/[^/]+$", 9070 // "required": true, 9071 // "type": "string" 9072 // }, 9073 // "query": { 9074 // "description": "Required. A CEL expression that MUST include member specification AND label(s). Certain groups are uniquely identified by both a 'member_key_id' and a 'member_key_namespace', which requires an additional query input: 'member_key_namespace'. Example query: `member_key_id == 'member_key_id_value' \u0026\u0026 in labels`", 9075 // "location": "query", 9076 // "type": "string" 9077 // } 9078 // }, 9079 // "path": "v1beta1/{+parent}/memberships:getMembershipGraph", 9080 // "response": { 9081 // "$ref": "Operation" 9082 // }, 9083 // "scopes": [ 9084 // "https://www.googleapis.com/auth/cloud-identity.groups", 9085 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9086 // "https://www.googleapis.com/auth/cloud-platform" 9087 // ] 9088 // } 9089 9090} 9091 9092// method id "cloudidentity.groups.memberships.list": 9093 9094type GroupsMembershipsListCall struct { 9095 s *Service 9096 parent string 9097 urlParams_ gensupport.URLParams 9098 ifNoneMatch_ string 9099 ctx_ context.Context 9100 header_ http.Header 9101} 9102 9103// List: Lists the `Membership`s within a `Group`. 9104// 9105// - parent: The parent `Group` resource under which to lookup the 9106// `Membership` name. Must be of the form `groups/{group_id}`. 9107func (r *GroupsMembershipsService) List(parent string) *GroupsMembershipsListCall { 9108 c := &GroupsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9109 c.parent = parent 9110 return c 9111} 9112 9113// PageSize sets the optional parameter "pageSize": The maximum number 9114// of results to return. Note that the number of results returned may be 9115// less than this value even if there are more available results. To 9116// fetch all results, clients must continue calling this method 9117// repeatedly until the response no longer contains a `next_page_token`. 9118// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for 9119// `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` 9120// or 500 for `GroupView.FULL`. 9121func (c *GroupsMembershipsListCall) PageSize(pageSize int64) *GroupsMembershipsListCall { 9122 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9123 return c 9124} 9125 9126// PageToken sets the optional parameter "pageToken": The 9127// `next_page_token` value returned from a previous search request, if 9128// any. 9129func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall { 9130 c.urlParams_.Set("pageToken", pageToken) 9131 return c 9132} 9133 9134// View sets the optional parameter "view": The level of detail to be 9135// returned. If unspecified, defaults to `MembershipView.BASIC`. 9136// 9137// Possible values: 9138// "BASIC" - Default. Only basic resource information is returned. 9139// "FULL" - All resource information is returned. 9140func (c *GroupsMembershipsListCall) View(view string) *GroupsMembershipsListCall { 9141 c.urlParams_.Set("view", view) 9142 return c 9143} 9144 9145// Fields allows partial responses to be retrieved. See 9146// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9147// for more information. 9148func (c *GroupsMembershipsListCall) Fields(s ...googleapi.Field) *GroupsMembershipsListCall { 9149 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9150 return c 9151} 9152 9153// IfNoneMatch sets the optional parameter which makes the operation 9154// fail if the object's ETag matches the given value. This is useful for 9155// getting updates only after the object has changed since the last 9156// request. Use googleapi.IsNotModified to check whether the response 9157// error from Do is the result of In-None-Match. 9158func (c *GroupsMembershipsListCall) IfNoneMatch(entityTag string) *GroupsMembershipsListCall { 9159 c.ifNoneMatch_ = entityTag 9160 return c 9161} 9162 9163// Context sets the context to be used in this call's Do method. Any 9164// pending HTTP request will be aborted if the provided context is 9165// canceled. 9166func (c *GroupsMembershipsListCall) Context(ctx context.Context) *GroupsMembershipsListCall { 9167 c.ctx_ = ctx 9168 return c 9169} 9170 9171// Header returns an http.Header that can be modified by the caller to 9172// add HTTP headers to the request. 9173func (c *GroupsMembershipsListCall) Header() http.Header { 9174 if c.header_ == nil { 9175 c.header_ = make(http.Header) 9176 } 9177 return c.header_ 9178} 9179 9180func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error) { 9181 reqHeaders := make(http.Header) 9182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9183 for k, v := range c.header_ { 9184 reqHeaders[k] = v 9185 } 9186 reqHeaders.Set("User-Agent", c.s.userAgent()) 9187 if c.ifNoneMatch_ != "" { 9188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9189 } 9190 var body io.Reader = nil 9191 c.urlParams_.Set("alt", alt) 9192 c.urlParams_.Set("prettyPrint", "false") 9193 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 9194 urls += "?" + c.urlParams_.Encode() 9195 req, err := http.NewRequest("GET", urls, body) 9196 if err != nil { 9197 return nil, err 9198 } 9199 req.Header = reqHeaders 9200 googleapi.Expand(req.URL, map[string]string{ 9201 "parent": c.parent, 9202 }) 9203 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9204} 9205 9206// Do executes the "cloudidentity.groups.memberships.list" call. 9207// Exactly one of *ListMembershipsResponse or error will be non-nil. Any 9208// non-2xx status code is an error. Response headers are in either 9209// *ListMembershipsResponse.ServerResponse.Header or (if a response was 9210// returned at all) in error.(*googleapi.Error).Header. Use 9211// googleapi.IsNotModified to check whether the returned error was 9212// because http.StatusNotModified was returned. 9213func (c *GroupsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) { 9214 gensupport.SetOptions(c.urlParams_, opts...) 9215 res, err := c.doRequest("json") 9216 if res != nil && res.StatusCode == http.StatusNotModified { 9217 if res.Body != nil { 9218 res.Body.Close() 9219 } 9220 return nil, &googleapi.Error{ 9221 Code: res.StatusCode, 9222 Header: res.Header, 9223 } 9224 } 9225 if err != nil { 9226 return nil, err 9227 } 9228 defer googleapi.CloseBody(res) 9229 if err := googleapi.CheckResponse(res); err != nil { 9230 return nil, err 9231 } 9232 ret := &ListMembershipsResponse{ 9233 ServerResponse: googleapi.ServerResponse{ 9234 Header: res.Header, 9235 HTTPStatusCode: res.StatusCode, 9236 }, 9237 } 9238 target := &ret 9239 if err := gensupport.DecodeResponse(target, res); err != nil { 9240 return nil, err 9241 } 9242 return ret, nil 9243 // { 9244 // "description": "Lists the `Membership`s within a `Group`.", 9245 // "flatPath": "v1beta1/groups/{groupsId}/memberships", 9246 // "httpMethod": "GET", 9247 // "id": "cloudidentity.groups.memberships.list", 9248 // "parameterOrder": [ 9249 // "parent" 9250 // ], 9251 // "parameters": { 9252 // "pageSize": { 9253 // "description": "The maximum number of results to return. Note that the number of results returned may be less than this value even if there are more available results. To fetch all results, clients must continue calling this method repeatedly until the response no longer contains a `next_page_token`. If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` or 500 for `GroupView.FULL`.", 9254 // "format": "int32", 9255 // "location": "query", 9256 // "type": "integer" 9257 // }, 9258 // "pageToken": { 9259 // "description": "The `next_page_token` value returned from a previous search request, if any.", 9260 // "location": "query", 9261 // "type": "string" 9262 // }, 9263 // "parent": { 9264 // "description": "Required. The parent `Group` resource under which to lookup the `Membership` name. Must be of the form `groups/{group_id}`.", 9265 // "location": "path", 9266 // "pattern": "^groups/[^/]+$", 9267 // "required": true, 9268 // "type": "string" 9269 // }, 9270 // "view": { 9271 // "description": "The level of detail to be returned. If unspecified, defaults to `MembershipView.BASIC`.", 9272 // "enum": [ 9273 // "BASIC", 9274 // "FULL" 9275 // ], 9276 // "enumDescriptions": [ 9277 // "Default. Only basic resource information is returned.", 9278 // "All resource information is returned." 9279 // ], 9280 // "location": "query", 9281 // "type": "string" 9282 // } 9283 // }, 9284 // "path": "v1beta1/{+parent}/memberships", 9285 // "response": { 9286 // "$ref": "ListMembershipsResponse" 9287 // }, 9288 // "scopes": [ 9289 // "https://www.googleapis.com/auth/cloud-identity.groups", 9290 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9291 // "https://www.googleapis.com/auth/cloud-platform" 9292 // ] 9293 // } 9294 9295} 9296 9297// Pages invokes f for each page of results. 9298// A non-nil error returned from f will halt the iteration. 9299// The provided context supersedes any context provided to the Context method. 9300func (c *GroupsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error { 9301 c.ctx_ = ctx 9302 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9303 for { 9304 x, err := c.Do() 9305 if err != nil { 9306 return err 9307 } 9308 if err := f(x); err != nil { 9309 return err 9310 } 9311 if x.NextPageToken == "" { 9312 return nil 9313 } 9314 c.PageToken(x.NextPageToken) 9315 } 9316} 9317 9318// method id "cloudidentity.groups.memberships.lookup": 9319 9320type GroupsMembershipsLookupCall struct { 9321 s *Service 9322 parent string 9323 urlParams_ gensupport.URLParams 9324 ifNoneMatch_ string 9325 ctx_ context.Context 9326 header_ http.Header 9327} 9328 9329// Lookup: Looks up the resource name 9330// (https://cloud.google.com/apis/design/resource_names) of a 9331// `Membership` by its `EntityKey`. 9332// 9333// - parent: The parent `Group` resource under which to lookup the 9334// `Membership` name. Must be of the form `groups/{group_id}`. 9335func (r *GroupsMembershipsService) Lookup(parent string) *GroupsMembershipsLookupCall { 9336 c := &GroupsMembershipsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9337 c.parent = parent 9338 return c 9339} 9340 9341// MemberKeyId sets the optional parameter "memberKey.id": The ID of the 9342// entity. For Google-managed entities, the `id` must be the email 9343// address of an existing group or user. For external-identity-mapped 9344// entities, the `id` must be a string conforming to the Identity 9345// Source's requirements. Must be unique within a `namespace`. 9346func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall { 9347 c.urlParams_.Set("memberKey.id", memberKeyId) 9348 return c 9349} 9350 9351// MemberKeyNamespace sets the optional parameter "memberKey.namespace": 9352// The namespace in which the entity exists. If not specified, the 9353// `EntityKey` represents a Google-managed entity such as a Google user 9354// or a Google Group. If specified, the `EntityKey` represents an 9355// external-identity-mapped group. The namespace must correspond to an 9356// identity source created in Admin Console and must be in the form of 9357// `identitysources/{identity_source_id}`. 9358func (c *GroupsMembershipsLookupCall) MemberKeyNamespace(memberKeyNamespace string) *GroupsMembershipsLookupCall { 9359 c.urlParams_.Set("memberKey.namespace", memberKeyNamespace) 9360 return c 9361} 9362 9363// Fields allows partial responses to be retrieved. See 9364// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9365// for more information. 9366func (c *GroupsMembershipsLookupCall) Fields(s ...googleapi.Field) *GroupsMembershipsLookupCall { 9367 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9368 return c 9369} 9370 9371// IfNoneMatch sets the optional parameter which makes the operation 9372// fail if the object's ETag matches the given value. This is useful for 9373// getting updates only after the object has changed since the last 9374// request. Use googleapi.IsNotModified to check whether the response 9375// error from Do is the result of In-None-Match. 9376func (c *GroupsMembershipsLookupCall) IfNoneMatch(entityTag string) *GroupsMembershipsLookupCall { 9377 c.ifNoneMatch_ = entityTag 9378 return c 9379} 9380 9381// Context sets the context to be used in this call's Do method. Any 9382// pending HTTP request will be aborted if the provided context is 9383// canceled. 9384func (c *GroupsMembershipsLookupCall) Context(ctx context.Context) *GroupsMembershipsLookupCall { 9385 c.ctx_ = ctx 9386 return c 9387} 9388 9389// Header returns an http.Header that can be modified by the caller to 9390// add HTTP headers to the request. 9391func (c *GroupsMembershipsLookupCall) Header() http.Header { 9392 if c.header_ == nil { 9393 c.header_ = make(http.Header) 9394 } 9395 return c.header_ 9396} 9397 9398func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, error) { 9399 reqHeaders := make(http.Header) 9400 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9401 for k, v := range c.header_ { 9402 reqHeaders[k] = v 9403 } 9404 reqHeaders.Set("User-Agent", c.s.userAgent()) 9405 if c.ifNoneMatch_ != "" { 9406 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9407 } 9408 var body io.Reader = nil 9409 c.urlParams_.Set("alt", alt) 9410 c.urlParams_.Set("prettyPrint", "false") 9411 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:lookup") 9412 urls += "?" + c.urlParams_.Encode() 9413 req, err := http.NewRequest("GET", urls, body) 9414 if err != nil { 9415 return nil, err 9416 } 9417 req.Header = reqHeaders 9418 googleapi.Expand(req.URL, map[string]string{ 9419 "parent": c.parent, 9420 }) 9421 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9422} 9423 9424// Do executes the "cloudidentity.groups.memberships.lookup" call. 9425// Exactly one of *LookupMembershipNameResponse or error will be 9426// non-nil. Any non-2xx status code is an error. Response headers are in 9427// either *LookupMembershipNameResponse.ServerResponse.Header or (if a 9428// response was returned at all) in error.(*googleapi.Error).Header. Use 9429// googleapi.IsNotModified to check whether the returned error was 9430// because http.StatusNotModified was returned. 9431func (c *GroupsMembershipsLookupCall) Do(opts ...googleapi.CallOption) (*LookupMembershipNameResponse, error) { 9432 gensupport.SetOptions(c.urlParams_, opts...) 9433 res, err := c.doRequest("json") 9434 if res != nil && res.StatusCode == http.StatusNotModified { 9435 if res.Body != nil { 9436 res.Body.Close() 9437 } 9438 return nil, &googleapi.Error{ 9439 Code: res.StatusCode, 9440 Header: res.Header, 9441 } 9442 } 9443 if err != nil { 9444 return nil, err 9445 } 9446 defer googleapi.CloseBody(res) 9447 if err := googleapi.CheckResponse(res); err != nil { 9448 return nil, err 9449 } 9450 ret := &LookupMembershipNameResponse{ 9451 ServerResponse: googleapi.ServerResponse{ 9452 Header: res.Header, 9453 HTTPStatusCode: res.StatusCode, 9454 }, 9455 } 9456 target := &ret 9457 if err := gensupport.DecodeResponse(target, res); err != nil { 9458 return nil, err 9459 } 9460 return ret, nil 9461 // { 9462 // "description": "Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Membership` by its `EntityKey`.", 9463 // "flatPath": "v1beta1/groups/{groupsId}/memberships:lookup", 9464 // "httpMethod": "GET", 9465 // "id": "cloudidentity.groups.memberships.lookup", 9466 // "parameterOrder": [ 9467 // "parent" 9468 // ], 9469 // "parameters": { 9470 // "memberKey.id": { 9471 // "description": "The ID of the entity. For Google-managed entities, the `id` must be the email address of an existing group or user. For external-identity-mapped entities, the `id` must be a string conforming to the Identity Source's requirements. Must be unique within a `namespace`.", 9472 // "location": "query", 9473 // "type": "string" 9474 // }, 9475 // "memberKey.namespace": { 9476 // "description": "The namespace in which the entity exists. If not specified, the `EntityKey` represents a Google-managed entity such as a Google user or a Google Group. If specified, the `EntityKey` represents an external-identity-mapped group. The namespace must correspond to an identity source created in Admin Console and must be in the form of `identitysources/{identity_source_id}`.", 9477 // "location": "query", 9478 // "type": "string" 9479 // }, 9480 // "parent": { 9481 // "description": "Required. The parent `Group` resource under which to lookup the `Membership` name. Must be of the form `groups/{group_id}`.", 9482 // "location": "path", 9483 // "pattern": "^groups/[^/]+$", 9484 // "required": true, 9485 // "type": "string" 9486 // } 9487 // }, 9488 // "path": "v1beta1/{+parent}/memberships:lookup", 9489 // "response": { 9490 // "$ref": "LookupMembershipNameResponse" 9491 // }, 9492 // "scopes": [ 9493 // "https://www.googleapis.com/auth/cloud-identity.groups", 9494 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9495 // "https://www.googleapis.com/auth/cloud-platform" 9496 // ] 9497 // } 9498 9499} 9500 9501// method id "cloudidentity.groups.memberships.modifyMembershipRoles": 9502 9503type GroupsMembershipsModifyMembershipRolesCall struct { 9504 s *Service 9505 name string 9506 modifymembershiprolesrequest *ModifyMembershipRolesRequest 9507 urlParams_ gensupport.URLParams 9508 ctx_ context.Context 9509 header_ http.Header 9510} 9511 9512// ModifyMembershipRoles: Modifies the `MembershipRole`s of a 9513// `Membership`. 9514// 9515// - name: The resource name 9516// (https://cloud.google.com/apis/design/resource_names) of the 9517// `Membership` whose roles are to be modified. Must be of the form 9518// `groups/{group_id}/memberships/{membership_id}`. 9519func (r *GroupsMembershipsService) ModifyMembershipRoles(name string, modifymembershiprolesrequest *ModifyMembershipRolesRequest) *GroupsMembershipsModifyMembershipRolesCall { 9520 c := &GroupsMembershipsModifyMembershipRolesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9521 c.name = name 9522 c.modifymembershiprolesrequest = modifymembershiprolesrequest 9523 return c 9524} 9525 9526// Fields allows partial responses to be retrieved. See 9527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9528// for more information. 9529func (c *GroupsMembershipsModifyMembershipRolesCall) Fields(s ...googleapi.Field) *GroupsMembershipsModifyMembershipRolesCall { 9530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9531 return c 9532} 9533 9534// Context sets the context to be used in this call's Do method. Any 9535// pending HTTP request will be aborted if the provided context is 9536// canceled. 9537func (c *GroupsMembershipsModifyMembershipRolesCall) Context(ctx context.Context) *GroupsMembershipsModifyMembershipRolesCall { 9538 c.ctx_ = ctx 9539 return c 9540} 9541 9542// Header returns an http.Header that can be modified by the caller to 9543// add HTTP headers to the request. 9544func (c *GroupsMembershipsModifyMembershipRolesCall) Header() http.Header { 9545 if c.header_ == nil { 9546 c.header_ = make(http.Header) 9547 } 9548 return c.header_ 9549} 9550 9551func (c *GroupsMembershipsModifyMembershipRolesCall) doRequest(alt string) (*http.Response, error) { 9552 reqHeaders := make(http.Header) 9553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9554 for k, v := range c.header_ { 9555 reqHeaders[k] = v 9556 } 9557 reqHeaders.Set("User-Agent", c.s.userAgent()) 9558 var body io.Reader = nil 9559 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymembershiprolesrequest) 9560 if err != nil { 9561 return nil, err 9562 } 9563 reqHeaders.Set("Content-Type", "application/json") 9564 c.urlParams_.Set("alt", alt) 9565 c.urlParams_.Set("prettyPrint", "false") 9566 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:modifyMembershipRoles") 9567 urls += "?" + c.urlParams_.Encode() 9568 req, err := http.NewRequest("POST", urls, body) 9569 if err != nil { 9570 return nil, err 9571 } 9572 req.Header = reqHeaders 9573 googleapi.Expand(req.URL, map[string]string{ 9574 "name": c.name, 9575 }) 9576 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9577} 9578 9579// Do executes the "cloudidentity.groups.memberships.modifyMembershipRoles" call. 9580// Exactly one of *ModifyMembershipRolesResponse or error will be 9581// non-nil. Any non-2xx status code is an error. Response headers are in 9582// either *ModifyMembershipRolesResponse.ServerResponse.Header or (if a 9583// response was returned at all) in error.(*googleapi.Error).Header. Use 9584// googleapi.IsNotModified to check whether the returned error was 9585// because http.StatusNotModified was returned. 9586func (c *GroupsMembershipsModifyMembershipRolesCall) Do(opts ...googleapi.CallOption) (*ModifyMembershipRolesResponse, error) { 9587 gensupport.SetOptions(c.urlParams_, opts...) 9588 res, err := c.doRequest("json") 9589 if res != nil && res.StatusCode == http.StatusNotModified { 9590 if res.Body != nil { 9591 res.Body.Close() 9592 } 9593 return nil, &googleapi.Error{ 9594 Code: res.StatusCode, 9595 Header: res.Header, 9596 } 9597 } 9598 if err != nil { 9599 return nil, err 9600 } 9601 defer googleapi.CloseBody(res) 9602 if err := googleapi.CheckResponse(res); err != nil { 9603 return nil, err 9604 } 9605 ret := &ModifyMembershipRolesResponse{ 9606 ServerResponse: googleapi.ServerResponse{ 9607 Header: res.Header, 9608 HTTPStatusCode: res.StatusCode, 9609 }, 9610 } 9611 target := &ret 9612 if err := gensupport.DecodeResponse(target, res); err != nil { 9613 return nil, err 9614 } 9615 return ret, nil 9616 // { 9617 // "description": "Modifies the `MembershipRole`s of a `Membership`.", 9618 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}:modifyMembershipRoles", 9619 // "httpMethod": "POST", 9620 // "id": "cloudidentity.groups.memberships.modifyMembershipRoles", 9621 // "parameterOrder": [ 9622 // "name" 9623 // ], 9624 // "parameters": { 9625 // "name": { 9626 // "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of the `Membership` whose roles are to be modified. Must be of the form `groups/{group_id}/memberships/{membership_id}`.", 9627 // "location": "path", 9628 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 9629 // "required": true, 9630 // "type": "string" 9631 // } 9632 // }, 9633 // "path": "v1beta1/{+name}:modifyMembershipRoles", 9634 // "request": { 9635 // "$ref": "ModifyMembershipRolesRequest" 9636 // }, 9637 // "response": { 9638 // "$ref": "ModifyMembershipRolesResponse" 9639 // }, 9640 // "scopes": [ 9641 // "https://www.googleapis.com/auth/cloud-identity.groups", 9642 // "https://www.googleapis.com/auth/cloud-platform" 9643 // ] 9644 // } 9645 9646} 9647 9648// method id "cloudidentity.groups.memberships.searchTransitiveGroups": 9649 9650type GroupsMembershipsSearchTransitiveGroupsCall struct { 9651 s *Service 9652 parent string 9653 urlParams_ gensupport.URLParams 9654 ifNoneMatch_ string 9655 ctx_ context.Context 9656 header_ http.Header 9657} 9658 9659// SearchTransitiveGroups: Search transitive groups of a member. 9660// **Note:** This feature is only available to Google Workspace 9661// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 9662// and Cloud Identity Premium accounts. A transitive group is any group 9663// that has a direct or indirect membership to the member. Actor must 9664// have view permissions all transitive groups. 9665// 9666// - parent: Resource name 9667// (https://cloud.google.com/apis/design/resource_names) of the group 9668// to search transitive memberships in. Format: `groups/{group_id}`, 9669// where `group_id` is always '-' as this API will search across all 9670// groups for a given member. 9671func (r *GroupsMembershipsService) SearchTransitiveGroups(parent string) *GroupsMembershipsSearchTransitiveGroupsCall { 9672 c := &GroupsMembershipsSearchTransitiveGroupsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9673 c.parent = parent 9674 return c 9675} 9676 9677// PageSize sets the optional parameter "pageSize": The default page 9678// size is 200 (max 1000). 9679func (c *GroupsMembershipsSearchTransitiveGroupsCall) PageSize(pageSize int64) *GroupsMembershipsSearchTransitiveGroupsCall { 9680 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9681 return c 9682} 9683 9684// PageToken sets the optional parameter "pageToken": The 9685// next_page_token value returned from a previous list request, if any. 9686func (c *GroupsMembershipsSearchTransitiveGroupsCall) PageToken(pageToken string) *GroupsMembershipsSearchTransitiveGroupsCall { 9687 c.urlParams_.Set("pageToken", pageToken) 9688 return c 9689} 9690 9691// Query sets the optional parameter "query": Required. A CEL expression 9692// that MUST include member specification AND label(s). This is a 9693// `required` field. Users can search on label attributes of groups. 9694// CONTAINS match ('in') is supported on labels. Identity-mapped groups 9695// are uniquely identified by both a `member_key_id` and a 9696// `member_key_namespace`, which requires an additional query input: 9697// `member_key_namespace`. Example query: `member_key_id == 9698// 'member_key_id_value' && in labels` 9699func (c *GroupsMembershipsSearchTransitiveGroupsCall) Query(query string) *GroupsMembershipsSearchTransitiveGroupsCall { 9700 c.urlParams_.Set("query", query) 9701 return c 9702} 9703 9704// Fields allows partial responses to be retrieved. See 9705// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9706// for more information. 9707func (c *GroupsMembershipsSearchTransitiveGroupsCall) Fields(s ...googleapi.Field) *GroupsMembershipsSearchTransitiveGroupsCall { 9708 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9709 return c 9710} 9711 9712// IfNoneMatch sets the optional parameter which makes the operation 9713// fail if the object's ETag matches the given value. This is useful for 9714// getting updates only after the object has changed since the last 9715// request. Use googleapi.IsNotModified to check whether the response 9716// error from Do is the result of In-None-Match. 9717func (c *GroupsMembershipsSearchTransitiveGroupsCall) IfNoneMatch(entityTag string) *GroupsMembershipsSearchTransitiveGroupsCall { 9718 c.ifNoneMatch_ = entityTag 9719 return c 9720} 9721 9722// Context sets the context to be used in this call's Do method. Any 9723// pending HTTP request will be aborted if the provided context is 9724// canceled. 9725func (c *GroupsMembershipsSearchTransitiveGroupsCall) Context(ctx context.Context) *GroupsMembershipsSearchTransitiveGroupsCall { 9726 c.ctx_ = ctx 9727 return c 9728} 9729 9730// Header returns an http.Header that can be modified by the caller to 9731// add HTTP headers to the request. 9732func (c *GroupsMembershipsSearchTransitiveGroupsCall) Header() http.Header { 9733 if c.header_ == nil { 9734 c.header_ = make(http.Header) 9735 } 9736 return c.header_ 9737} 9738 9739func (c *GroupsMembershipsSearchTransitiveGroupsCall) doRequest(alt string) (*http.Response, error) { 9740 reqHeaders := make(http.Header) 9741 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9742 for k, v := range c.header_ { 9743 reqHeaders[k] = v 9744 } 9745 reqHeaders.Set("User-Agent", c.s.userAgent()) 9746 if c.ifNoneMatch_ != "" { 9747 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9748 } 9749 var body io.Reader = nil 9750 c.urlParams_.Set("alt", alt) 9751 c.urlParams_.Set("prettyPrint", "false") 9752 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveGroups") 9753 urls += "?" + c.urlParams_.Encode() 9754 req, err := http.NewRequest("GET", urls, body) 9755 if err != nil { 9756 return nil, err 9757 } 9758 req.Header = reqHeaders 9759 googleapi.Expand(req.URL, map[string]string{ 9760 "parent": c.parent, 9761 }) 9762 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9763} 9764 9765// Do executes the "cloudidentity.groups.memberships.searchTransitiveGroups" call. 9766// Exactly one of *SearchTransitiveGroupsResponse or error will be 9767// non-nil. Any non-2xx status code is an error. Response headers are in 9768// either *SearchTransitiveGroupsResponse.ServerResponse.Header or (if a 9769// response was returned at all) in error.(*googleapi.Error).Header. Use 9770// googleapi.IsNotModified to check whether the returned error was 9771// because http.StatusNotModified was returned. 9772func (c *GroupsMembershipsSearchTransitiveGroupsCall) Do(opts ...googleapi.CallOption) (*SearchTransitiveGroupsResponse, error) { 9773 gensupport.SetOptions(c.urlParams_, opts...) 9774 res, err := c.doRequest("json") 9775 if res != nil && res.StatusCode == http.StatusNotModified { 9776 if res.Body != nil { 9777 res.Body.Close() 9778 } 9779 return nil, &googleapi.Error{ 9780 Code: res.StatusCode, 9781 Header: res.Header, 9782 } 9783 } 9784 if err != nil { 9785 return nil, err 9786 } 9787 defer googleapi.CloseBody(res) 9788 if err := googleapi.CheckResponse(res); err != nil { 9789 return nil, err 9790 } 9791 ret := &SearchTransitiveGroupsResponse{ 9792 ServerResponse: googleapi.ServerResponse{ 9793 Header: res.Header, 9794 HTTPStatusCode: res.StatusCode, 9795 }, 9796 } 9797 target := &ret 9798 if err := gensupport.DecodeResponse(target, res); err != nil { 9799 return nil, err 9800 } 9801 return ret, nil 9802 // { 9803 // "description": "Search transitive groups of a member. **Note:** This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. A transitive group is any group that has a direct or indirect membership to the member. Actor must have view permissions all transitive groups.", 9804 // "flatPath": "v1beta1/groups/{groupsId}/memberships:searchTransitiveGroups", 9805 // "httpMethod": "GET", 9806 // "id": "cloudidentity.groups.memberships.searchTransitiveGroups", 9807 // "parameterOrder": [ 9808 // "parent" 9809 // ], 9810 // "parameters": { 9811 // "pageSize": { 9812 // "description": "The default page size is 200 (max 1000).", 9813 // "format": "int32", 9814 // "location": "query", 9815 // "type": "integer" 9816 // }, 9817 // "pageToken": { 9818 // "description": "The next_page_token value returned from a previous list request, if any.", 9819 // "location": "query", 9820 // "type": "string" 9821 // }, 9822 // "parent": { 9823 // "description": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the group to search transitive memberships in. Format: `groups/{group_id}`, where `group_id` is always '-' as this API will search across all groups for a given member.", 9824 // "location": "path", 9825 // "pattern": "^groups/[^/]+$", 9826 // "required": true, 9827 // "type": "string" 9828 // }, 9829 // "query": { 9830 // "description": "Required. A CEL expression that MUST include member specification AND label(s). This is a `required` field. Users can search on label attributes of groups. CONTAINS match ('in') is supported on labels. Identity-mapped groups are uniquely identified by both a `member_key_id` and a `member_key_namespace`, which requires an additional query input: `member_key_namespace`. Example query: `member_key_id == 'member_key_id_value' \u0026\u0026 in labels`", 9831 // "location": "query", 9832 // "type": "string" 9833 // } 9834 // }, 9835 // "path": "v1beta1/{+parent}/memberships:searchTransitiveGroups", 9836 // "response": { 9837 // "$ref": "SearchTransitiveGroupsResponse" 9838 // }, 9839 // "scopes": [ 9840 // "https://www.googleapis.com/auth/cloud-identity.groups", 9841 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9842 // "https://www.googleapis.com/auth/cloud-platform" 9843 // ] 9844 // } 9845 9846} 9847 9848// Pages invokes f for each page of results. 9849// A non-nil error returned from f will halt the iteration. 9850// The provided context supersedes any context provided to the Context method. 9851func (c *GroupsMembershipsSearchTransitiveGroupsCall) Pages(ctx context.Context, f func(*SearchTransitiveGroupsResponse) error) error { 9852 c.ctx_ = ctx 9853 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9854 for { 9855 x, err := c.Do() 9856 if err != nil { 9857 return err 9858 } 9859 if err := f(x); err != nil { 9860 return err 9861 } 9862 if x.NextPageToken == "" { 9863 return nil 9864 } 9865 c.PageToken(x.NextPageToken) 9866 } 9867} 9868 9869// method id "cloudidentity.groups.memberships.searchTransitiveMemberships": 9870 9871type GroupsMembershipsSearchTransitiveMembershipsCall struct { 9872 s *Service 9873 parent string 9874 urlParams_ gensupport.URLParams 9875 ifNoneMatch_ string 9876 ctx_ context.Context 9877 header_ http.Header 9878} 9879 9880// SearchTransitiveMemberships: Search transitive memberships of a 9881// group. **Note:** This feature is only available to Google Workspace 9882// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 9883// and Cloud Identity Premium accounts. A transitive membership is any 9884// direct or indirect membership of a group. Actor must have view 9885// permissions to all transitive memberships. 9886// 9887// - parent: Resource name 9888// (https://cloud.google.com/apis/design/resource_names) of the group 9889// to search transitive memberships in. Format: `groups/{group_id}`, 9890// where `group_id` is the unique ID assigned to the Group. 9891func (r *GroupsMembershipsService) SearchTransitiveMemberships(parent string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9892 c := &GroupsMembershipsSearchTransitiveMembershipsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9893 c.parent = parent 9894 return c 9895} 9896 9897// PageSize sets the optional parameter "pageSize": The default page 9898// size is 200 (max 1000). 9899func (c *GroupsMembershipsSearchTransitiveMembershipsCall) PageSize(pageSize int64) *GroupsMembershipsSearchTransitiveMembershipsCall { 9900 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9901 return c 9902} 9903 9904// PageToken sets the optional parameter "pageToken": The 9905// next_page_token value returned from a previous list request, if any. 9906func (c *GroupsMembershipsSearchTransitiveMembershipsCall) PageToken(pageToken string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9907 c.urlParams_.Set("pageToken", pageToken) 9908 return c 9909} 9910 9911// Fields allows partial responses to be retrieved. See 9912// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9913// for more information. 9914func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Fields(s ...googleapi.Field) *GroupsMembershipsSearchTransitiveMembershipsCall { 9915 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9916 return c 9917} 9918 9919// IfNoneMatch sets the optional parameter which makes the operation 9920// fail if the object's ETag matches the given value. This is useful for 9921// getting updates only after the object has changed since the last 9922// request. Use googleapi.IsNotModified to check whether the response 9923// error from Do is the result of In-None-Match. 9924func (c *GroupsMembershipsSearchTransitiveMembershipsCall) IfNoneMatch(entityTag string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9925 c.ifNoneMatch_ = entityTag 9926 return c 9927} 9928 9929// Context sets the context to be used in this call's Do method. Any 9930// pending HTTP request will be aborted if the provided context is 9931// canceled. 9932func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Context(ctx context.Context) *GroupsMembershipsSearchTransitiveMembershipsCall { 9933 c.ctx_ = ctx 9934 return c 9935} 9936 9937// Header returns an http.Header that can be modified by the caller to 9938// add HTTP headers to the request. 9939func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Header() http.Header { 9940 if c.header_ == nil { 9941 c.header_ = make(http.Header) 9942 } 9943 return c.header_ 9944} 9945 9946func (c *GroupsMembershipsSearchTransitiveMembershipsCall) doRequest(alt string) (*http.Response, error) { 9947 reqHeaders := make(http.Header) 9948 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9949 for k, v := range c.header_ { 9950 reqHeaders[k] = v 9951 } 9952 reqHeaders.Set("User-Agent", c.s.userAgent()) 9953 if c.ifNoneMatch_ != "" { 9954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9955 } 9956 var body io.Reader = nil 9957 c.urlParams_.Set("alt", alt) 9958 c.urlParams_.Set("prettyPrint", "false") 9959 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveMemberships") 9960 urls += "?" + c.urlParams_.Encode() 9961 req, err := http.NewRequest("GET", urls, body) 9962 if err != nil { 9963 return nil, err 9964 } 9965 req.Header = reqHeaders 9966 googleapi.Expand(req.URL, map[string]string{ 9967 "parent": c.parent, 9968 }) 9969 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9970} 9971 9972// Do executes the "cloudidentity.groups.memberships.searchTransitiveMemberships" call. 9973// Exactly one of *SearchTransitiveMembershipsResponse or error will be 9974// non-nil. Any non-2xx status code is an error. Response headers are in 9975// either *SearchTransitiveMembershipsResponse.ServerResponse.Header or 9976// (if a response was returned at all) in 9977// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9978// whether the returned error was because http.StatusNotModified was 9979// returned. 9980func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Do(opts ...googleapi.CallOption) (*SearchTransitiveMembershipsResponse, error) { 9981 gensupport.SetOptions(c.urlParams_, opts...) 9982 res, err := c.doRequest("json") 9983 if res != nil && res.StatusCode == http.StatusNotModified { 9984 if res.Body != nil { 9985 res.Body.Close() 9986 } 9987 return nil, &googleapi.Error{ 9988 Code: res.StatusCode, 9989 Header: res.Header, 9990 } 9991 } 9992 if err != nil { 9993 return nil, err 9994 } 9995 defer googleapi.CloseBody(res) 9996 if err := googleapi.CheckResponse(res); err != nil { 9997 return nil, err 9998 } 9999 ret := &SearchTransitiveMembershipsResponse{ 10000 ServerResponse: googleapi.ServerResponse{ 10001 Header: res.Header, 10002 HTTPStatusCode: res.StatusCode, 10003 }, 10004 } 10005 target := &ret 10006 if err := gensupport.DecodeResponse(target, res); err != nil { 10007 return nil, err 10008 } 10009 return ret, nil 10010 // { 10011 // "description": "Search transitive memberships of a group. **Note:** This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. A transitive membership is any direct or indirect membership of a group. Actor must have view permissions to all transitive memberships.", 10012 // "flatPath": "v1beta1/groups/{groupsId}/memberships:searchTransitiveMemberships", 10013 // "httpMethod": "GET", 10014 // "id": "cloudidentity.groups.memberships.searchTransitiveMemberships", 10015 // "parameterOrder": [ 10016 // "parent" 10017 // ], 10018 // "parameters": { 10019 // "pageSize": { 10020 // "description": "The default page size is 200 (max 1000).", 10021 // "format": "int32", 10022 // "location": "query", 10023 // "type": "integer" 10024 // }, 10025 // "pageToken": { 10026 // "description": "The next_page_token value returned from a previous list request, if any.", 10027 // "location": "query", 10028 // "type": "string" 10029 // }, 10030 // "parent": { 10031 // "description": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the group to search transitive memberships in. Format: `groups/{group_id}`, where `group_id` is the unique ID assigned to the Group.", 10032 // "location": "path", 10033 // "pattern": "^groups/[^/]+$", 10034 // "required": true, 10035 // "type": "string" 10036 // } 10037 // }, 10038 // "path": "v1beta1/{+parent}/memberships:searchTransitiveMemberships", 10039 // "response": { 10040 // "$ref": "SearchTransitiveMembershipsResponse" 10041 // }, 10042 // "scopes": [ 10043 // "https://www.googleapis.com/auth/cloud-identity.groups", 10044 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 10045 // "https://www.googleapis.com/auth/cloud-platform" 10046 // ] 10047 // } 10048 10049} 10050 10051// Pages invokes f for each page of results. 10052// A non-nil error returned from f will halt the iteration. 10053// The provided context supersedes any context provided to the Context method. 10054func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Pages(ctx context.Context, f func(*SearchTransitiveMembershipsResponse) error) error { 10055 c.ctx_ = ctx 10056 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10057 for { 10058 x, err := c.Do() 10059 if err != nil { 10060 return err 10061 } 10062 if err := f(x); err != nil { 10063 return err 10064 } 10065 if x.NextPageToken == "" { 10066 return nil 10067 } 10068 c.PageToken(x.NextPageToken) 10069 } 10070} 10071