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 Platform data 98 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 99) 100 101// NewService creates a new Service. 102func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 103 scopesOption := option.WithScopes( 104 "https://www.googleapis.com/auth/cloud-identity.devices.lookup", 105 "https://www.googleapis.com/auth/cloud-identity.groups", 106 "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 107 "https://www.googleapis.com/auth/cloud-platform", 108 ) 109 // NOTE: prepend, so we don't override user-specified scopes. 110 opts = append([]option.ClientOption{scopesOption}, opts...) 111 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 client, endpoint, err := htransport.NewClient(ctx, opts...) 114 if err != nil { 115 return nil, err 116 } 117 s, err := New(client) 118 if err != nil { 119 return nil, err 120 } 121 if endpoint != "" { 122 s.BasePath = endpoint 123 } 124 return s, nil 125} 126 127// New creates a new Service. It uses the provided http.Client for requests. 128// 129// Deprecated: please use NewService instead. 130// To provide a custom HTTP client, use option.WithHTTPClient. 131// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 132func New(client *http.Client) (*Service, error) { 133 if client == nil { 134 return nil, errors.New("client is nil") 135 } 136 s := &Service{client: client, BasePath: basePath} 137 s.Customers = NewCustomersService(s) 138 s.Devices = NewDevicesService(s) 139 s.Groups = NewGroupsService(s) 140 return s, nil 141} 142 143type Service struct { 144 client *http.Client 145 BasePath string // API endpoint base URL 146 UserAgent string // optional additional User-Agent fragment 147 148 Customers *CustomersService 149 150 Devices *DevicesService 151 152 Groups *GroupsService 153} 154 155func (s *Service) userAgent() string { 156 if s.UserAgent == "" { 157 return googleapi.UserAgent 158 } 159 return googleapi.UserAgent + " " + s.UserAgent 160} 161 162func NewCustomersService(s *Service) *CustomersService { 163 rs := &CustomersService{s: s} 164 rs.Userinvitations = NewCustomersUserinvitationsService(s) 165 return rs 166} 167 168type CustomersService struct { 169 s *Service 170 171 Userinvitations *CustomersUserinvitationsService 172} 173 174func NewCustomersUserinvitationsService(s *Service) *CustomersUserinvitationsService { 175 rs := &CustomersUserinvitationsService{s: s} 176 return rs 177} 178 179type CustomersUserinvitationsService struct { 180 s *Service 181} 182 183func NewDevicesService(s *Service) *DevicesService { 184 rs := &DevicesService{s: s} 185 rs.DeviceUsers = NewDevicesDeviceUsersService(s) 186 return rs 187} 188 189type DevicesService struct { 190 s *Service 191 192 DeviceUsers *DevicesDeviceUsersService 193} 194 195func NewDevicesDeviceUsersService(s *Service) *DevicesDeviceUsersService { 196 rs := &DevicesDeviceUsersService{s: s} 197 rs.ClientStates = NewDevicesDeviceUsersClientStatesService(s) 198 return rs 199} 200 201type DevicesDeviceUsersService struct { 202 s *Service 203 204 ClientStates *DevicesDeviceUsersClientStatesService 205} 206 207func NewDevicesDeviceUsersClientStatesService(s *Service) *DevicesDeviceUsersClientStatesService { 208 rs := &DevicesDeviceUsersClientStatesService{s: s} 209 return rs 210} 211 212type DevicesDeviceUsersClientStatesService struct { 213 s *Service 214} 215 216func NewGroupsService(s *Service) *GroupsService { 217 rs := &GroupsService{s: s} 218 rs.Memberships = NewGroupsMembershipsService(s) 219 return rs 220} 221 222type GroupsService struct { 223 s *Service 224 225 Memberships *GroupsMembershipsService 226} 227 228func NewGroupsMembershipsService(s *Service) *GroupsMembershipsService { 229 rs := &GroupsMembershipsService{s: s} 230 return rs 231} 232 233type GroupsMembershipsService struct { 234 s *Service 235} 236 237// AndroidAttributes: Resource representing the Android specific 238// attributes of a Device. 239type AndroidAttributes struct { 240 // EnabledUnknownSources: Whether applications from unknown sources can 241 // be installed on device. 242 EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"` 243 244 // OwnerProfileAccount: Whether this account is on an owner/primary 245 // profile. For phones, only true for owner profiles. Android 4+ devices 246 // can have secondary or restricted user profiles. 247 OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"` 248 249 // OwnershipPrivilege: Ownership privileges on device. 250 // 251 // Possible values: 252 // "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set. 253 // "DEVICE_ADMINISTRATOR" - Active device administrator privileges on 254 // the device. 255 // "PROFILE_OWNER" - Profile Owner privileges. The account is in a 256 // managed corporate profile. 257 // "DEVICE_OWNER" - Device Owner privileges on the device. 258 OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"` 259 260 // SupportsWorkProfile: Whether device supports Android work profiles. 261 // If false, this service will not block access to corp data even if an 262 // administrator turns on the "Enforce Work Profile" policy. 263 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 264 265 // ForceSendFields is a list of field names (e.g. 266 // "EnabledUnknownSources") to unconditionally include in API requests. 267 // By default, fields with empty or default values are omitted from API 268 // requests. However, any non-pointer, non-interface field appearing in 269 // ForceSendFields will be sent to the server regardless of whether the 270 // field is empty or not. This may be used to include empty fields in 271 // Patch requests. 272 ForceSendFields []string `json:"-"` 273 274 // NullFields is a list of field names (e.g. "EnabledUnknownSources") to 275 // include in API requests with the JSON null value. By default, fields 276 // with empty values are omitted from API requests. However, any field 277 // with an empty value appearing in NullFields will be sent to the 278 // server as null. It is an error if a field in this list has a 279 // non-empty value. This may be used to include null fields in Patch 280 // requests. 281 NullFields []string `json:"-"` 282} 283 284func (s *AndroidAttributes) MarshalJSON() ([]byte, error) { 285 type NoMethod AndroidAttributes 286 raw := NoMethod(*s) 287 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 288} 289 290// ApproveDeviceUserRequest: Request message for approving the device to 291// access user data. 292type ApproveDeviceUserRequest struct { 293} 294 295// ApproveDeviceUserResponse: Response message for approving the device 296// to access user data. 297type ApproveDeviceUserResponse struct { 298 // DeviceUser: Resultant DeviceUser object for the action. 299 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 300 301 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 302 // unconditionally include in API requests. By default, fields with 303 // empty or default values are omitted from API requests. However, any 304 // non-pointer, non-interface field appearing in ForceSendFields will be 305 // sent to the server regardless of whether the field is empty or not. 306 // This may be used to include empty fields in Patch requests. 307 ForceSendFields []string `json:"-"` 308 309 // NullFields is a list of field names (e.g. "DeviceUser") to include in 310 // API requests with the JSON null value. By default, fields with empty 311 // values are omitted from API requests. However, any field with an 312 // empty value appearing in NullFields will be sent to the server as 313 // null. It is an error if a field in this list has a non-empty value. 314 // This may be used to include null fields in Patch requests. 315 NullFields []string `json:"-"` 316} 317 318func (s *ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) { 319 type NoMethod ApproveDeviceUserResponse 320 raw := NoMethod(*s) 321 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 322} 323 324// BlockDeviceUserRequest: Request message for blocking account on 325// device. 326type BlockDeviceUserRequest struct { 327} 328 329// BlockDeviceUserResponse: Response message for blocking the device 330// from accessing user data. 331type BlockDeviceUserResponse struct { 332 // DeviceUser: Resultant DeviceUser object for the action. 333 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 334 335 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 336 // unconditionally include in API requests. By default, fields with 337 // empty or default values are omitted from API requests. However, any 338 // non-pointer, non-interface field appearing in ForceSendFields will be 339 // sent to the server regardless of whether the field is empty or not. 340 // This may be used to include empty fields in Patch requests. 341 ForceSendFields []string `json:"-"` 342 343 // NullFields is a list of field names (e.g. "DeviceUser") to include in 344 // API requests with the JSON null value. By default, fields with empty 345 // values are omitted from API requests. However, any field with an 346 // empty value appearing in NullFields will be sent to the server as 347 // null. It is an error if a field in this list has a non-empty value. 348 // This may be used to include null fields in Patch requests. 349 NullFields []string `json:"-"` 350} 351 352func (s *BlockDeviceUserResponse) MarshalJSON() ([]byte, error) { 353 type NoMethod BlockDeviceUserResponse 354 raw := NoMethod(*s) 355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 356} 357 358// CancelUserInvitationRequest: Request to cancel sent invitation for 359// target email in UserInvitation. 360type CancelUserInvitationRequest struct { 361} 362 363// CancelWipeDeviceRequest: Request message for cancelling an unfinished 364// device wipe. 365type CancelWipeDeviceRequest struct { 366} 367 368// CancelWipeDeviceResponse: Response message for cancelling an 369// unfinished device wipe. 370type CancelWipeDeviceResponse struct { 371 // Device: Resultant Device object for the action. Note that asset tags 372 // will not be returned in the device object. 373 Device *Device `json:"device,omitempty"` 374 375 // ForceSendFields is a list of field names (e.g. "Device") to 376 // unconditionally include in API requests. By default, fields with 377 // empty or default values are omitted from API requests. However, any 378 // non-pointer, non-interface field appearing in ForceSendFields will be 379 // sent to the server regardless of whether the field is empty or not. 380 // This may be used to include empty fields in Patch requests. 381 ForceSendFields []string `json:"-"` 382 383 // NullFields is a list of field names (e.g. "Device") to include in API 384 // requests with the JSON null value. By default, fields with empty 385 // values are omitted from API requests. However, any field with an 386 // empty value appearing in NullFields will be sent to the server as 387 // null. It is an error if a field in this list has a non-empty value. 388 // This may be used to include null fields in Patch requests. 389 NullFields []string `json:"-"` 390} 391 392func (s *CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) { 393 type NoMethod CancelWipeDeviceResponse 394 raw := NoMethod(*s) 395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 396} 397 398// CancelWipeDeviceUserRequest: Request message for cancelling an 399// unfinished user account wipe. 400type CancelWipeDeviceUserRequest struct { 401} 402 403// CancelWipeDeviceUserResponse: Response message for cancelling an 404// unfinished user account wipe. 405type CancelWipeDeviceUserResponse struct { 406 // DeviceUser: Resultant DeviceUser object for the action. 407 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 408 409 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 410 // unconditionally include in API requests. By default, fields with 411 // empty or default values are omitted from API requests. However, any 412 // non-pointer, non-interface field appearing in ForceSendFields will be 413 // sent to the server regardless of whether the field is empty or not. 414 // This may be used to include empty fields in Patch requests. 415 ForceSendFields []string `json:"-"` 416 417 // NullFields is a list of field names (e.g. "DeviceUser") to include in 418 // API requests with the JSON null value. By default, fields with empty 419 // values are omitted from API requests. However, any field with an 420 // empty value appearing in NullFields will be sent to the server as 421 // null. It is an error if a field in this list has a non-empty value. 422 // This may be used to include null fields in Patch requests. 423 NullFields []string `json:"-"` 424} 425 426func (s *CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 427 type NoMethod CancelWipeDeviceUserResponse 428 raw := NoMethod(*s) 429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 430} 431 432// CheckTransitiveMembershipResponse: The response message for 433// MembershipsService.CheckTransitiveMembership. 434type CheckTransitiveMembershipResponse struct { 435 // HasMembership: Response does not include the possible roles of a 436 // member since the behavior of this rpc is not all-or-nothing unlike 437 // the other rpcs. So, it may not be possible to list all the roles 438 // definitively, due to possible lack of authorization in some of the 439 // paths. 440 HasMembership bool `json:"hasMembership,omitempty"` 441 442 // ServerResponse contains the HTTP response code and headers from the 443 // server. 444 googleapi.ServerResponse `json:"-"` 445 446 // ForceSendFields is a list of field names (e.g. "HasMembership") to 447 // unconditionally include in API requests. By default, fields with 448 // empty or default values are omitted from API requests. However, any 449 // non-pointer, non-interface field appearing in ForceSendFields will be 450 // sent to the server regardless of whether the field is empty or not. 451 // This may be used to include empty fields in Patch requests. 452 ForceSendFields []string `json:"-"` 453 454 // NullFields is a list of field names (e.g. "HasMembership") to include 455 // in API requests with the JSON null value. By default, fields with 456 // empty values are omitted from API requests. However, any field with 457 // an empty value appearing in NullFields will be sent to the server as 458 // null. It is an error if a field in this list has a non-empty value. 459 // This may be used to include null fields in Patch requests. 460 NullFields []string `json:"-"` 461} 462 463func (s *CheckTransitiveMembershipResponse) MarshalJSON() ([]byte, error) { 464 type NoMethod CheckTransitiveMembershipResponse 465 raw := NoMethod(*s) 466 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 467} 468 469// ClientState: Represents the state associated with an API client 470// calling the Devices API. Resource representing ClientState and 471// supports updates from API users 472type ClientState struct { 473 // AssetTags: The caller can specify asset tags for this resource 474 AssetTags []string `json:"assetTags,omitempty"` 475 476 // ComplianceState: The compliance state of the resource as specified by 477 // the API client. 478 // 479 // Possible values: 480 // "COMPLIANCE_STATE_UNSPECIFIED" - The compliance state of the 481 // resource is unknown or unspecified. 482 // "COMPLIANT" - Device is compliant with third party policies 483 // "NON_COMPLIANT" - Device is not compliant with third party policies 484 ComplianceState string `json:"complianceState,omitempty"` 485 486 // CreateTime: Output only. The time the client state data was created. 487 CreateTime string `json:"createTime,omitempty"` 488 489 // CustomId: This field may be used to store a unique identifier for the 490 // API resource within which these CustomAttributes are a field. 491 CustomId string `json:"customId,omitempty"` 492 493 // Etag: The token that needs to be passed back for concurrency control 494 // in updates. Token needs to be passed back in UpdateRequest 495 Etag string `json:"etag,omitempty"` 496 497 // HealthScore: The Health score of the resource 498 // 499 // Possible values: 500 // "HEALTH_SCORE_UNSPECIFIED" - Default value 501 // "VERY_POOR" - The object is in very poor health as defined by the 502 // caller. 503 // "POOR" - The object is in poor health as defined by the caller. 504 // "NEUTRAL" - The object health is neither good nor poor, as defined 505 // by the caller. 506 // "GOOD" - The object is in good health as defined by the caller. 507 // "VERY_GOOD" - The object is in very good health as defined by the 508 // caller. 509 HealthScore string `json:"healthScore,omitempty"` 510 511 // KeyValuePairs: The map of key-value attributes stored by callers 512 // specific to a device. The total serialized length of this map may not 513 // exceed 10KB. No limit is placed on the number of attributes in a map. 514 KeyValuePairs map[string]CustomAttributeValue `json:"keyValuePairs,omitempty"` 515 516 // LastUpdateTime: Output only. The time the client state data was last 517 // updated. 518 LastUpdateTime string `json:"lastUpdateTime,omitempty"` 519 520 // Managed: The management state of the resource as specified by the API 521 // client. 522 // 523 // Possible values: 524 // "MANAGED_STATE_UNSPECIFIED" - The management state of the resource 525 // is unknown or unspecified. 526 // "MANAGED" - The resource is managed. 527 // "UNMANAGED" - The resource is not managed. 528 Managed string `json:"managed,omitempty"` 529 530 // Name: Output only. Resource name 531 // (https://cloud.google.com/apis/design/resource_names) of the 532 // ClientState in format: 533 // `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partner 534 // _id}`, where partner_id corresponds to the partner storing the data. 535 Name string `json:"name,omitempty"` 536 537 // OwnerType: Output only. The owner of the ClientState 538 // 539 // Possible values: 540 // "OWNER_TYPE_UNSPECIFIED" - Unknown owner type 541 // "OWNER_TYPE_CUSTOMER" - Customer is the owner 542 // "OWNER_TYPE_PARTNER" - Partner is the owner 543 OwnerType string `json:"ownerType,omitempty"` 544 545 // ScoreReason: A descriptive cause of the health score. 546 ScoreReason string `json:"scoreReason,omitempty"` 547 548 // ServerResponse contains the HTTP response code and headers from the 549 // server. 550 googleapi.ServerResponse `json:"-"` 551 552 // ForceSendFields is a list of field names (e.g. "AssetTags") to 553 // unconditionally include in API requests. By default, fields with 554 // empty or default values are omitted from API requests. However, any 555 // non-pointer, non-interface field appearing in ForceSendFields will be 556 // sent to the server regardless of whether the field is empty or not. 557 // This may be used to include empty fields in Patch requests. 558 ForceSendFields []string `json:"-"` 559 560 // NullFields is a list of field names (e.g. "AssetTags") to include in 561 // API requests with the JSON null value. By default, fields with empty 562 // values are omitted from API requests. However, any field with an 563 // empty value appearing in NullFields will be sent to the server as 564 // null. It is an error if a field in this list has a non-empty value. 565 // This may be used to include null fields in Patch requests. 566 NullFields []string `json:"-"` 567} 568 569func (s *ClientState) MarshalJSON() ([]byte, error) { 570 type NoMethod ClientState 571 raw := NoMethod(*s) 572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 573} 574 575// CreateDeviceRequest: Request message for creating a Company Owned 576// device. 577type CreateDeviceRequest struct { 578 // Device: Required. The device to be created. The name field within 579 // this device is ignored in the create method. A new name is created by 580 // the method, and returned within the response. Only the fields 581 // `device_type`, `serial_number` and `asset_tag` (if present) are used 582 // to create the device. All other fields are ignored. The `device_type` 583 // and `serial_number` fields are required. 584 Device *Device `json:"device,omitempty"` 585 586 // ForceSendFields is a list of field names (e.g. "Device") to 587 // unconditionally include in API requests. By default, fields with 588 // empty or default values are omitted from API requests. However, any 589 // non-pointer, non-interface field appearing in ForceSendFields will be 590 // sent to the server regardless of whether the field is empty or not. 591 // This may be used to include empty fields in Patch requests. 592 ForceSendFields []string `json:"-"` 593 594 // NullFields is a list of field names (e.g. "Device") to include in API 595 // requests with the JSON null value. By default, fields with empty 596 // values are omitted from API requests. However, any field with an 597 // empty value appearing in NullFields will be sent to the server as 598 // null. It is an error if a field in this list has a non-empty value. 599 // This may be used to include null fields in Patch requests. 600 NullFields []string `json:"-"` 601} 602 603func (s *CreateDeviceRequest) MarshalJSON() ([]byte, error) { 604 type NoMethod CreateDeviceRequest 605 raw := NoMethod(*s) 606 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 607} 608 609// CustomAttributeValue: Additional custom attribute values may be one 610// of these types 611type CustomAttributeValue struct { 612 // BoolValue: Represents a boolean value. 613 BoolValue bool `json:"boolValue,omitempty"` 614 615 // NumberValue: Represents a double value. 616 NumberValue float64 `json:"numberValue,omitempty"` 617 618 // StringValue: Represents a string value. 619 StringValue string `json:"stringValue,omitempty"` 620 621 // ForceSendFields is a list of field names (e.g. "BoolValue") to 622 // unconditionally include in API requests. By default, fields with 623 // empty or default values are omitted from API requests. However, any 624 // non-pointer, non-interface field appearing in ForceSendFields will be 625 // sent to the server regardless of whether the field is empty or not. 626 // This may be used to include empty fields in Patch requests. 627 ForceSendFields []string `json:"-"` 628 629 // NullFields is a list of field names (e.g. "BoolValue") to include in 630 // API requests with the JSON null value. By default, fields with empty 631 // values are omitted from API requests. However, any field with an 632 // empty value appearing in NullFields will be sent to the server as 633 // null. It is an error if a field in this list has a non-empty value. 634 // This may be used to include null fields in Patch requests. 635 NullFields []string `json:"-"` 636} 637 638func (s *CustomAttributeValue) MarshalJSON() ([]byte, error) { 639 type NoMethod CustomAttributeValue 640 raw := NoMethod(*s) 641 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 642} 643 644func (s *CustomAttributeValue) UnmarshalJSON(data []byte) error { 645 type NoMethod CustomAttributeValue 646 var s1 struct { 647 NumberValue gensupport.JSONFloat64 `json:"numberValue"` 648 *NoMethod 649 } 650 s1.NoMethod = (*NoMethod)(s) 651 if err := json.Unmarshal(data, &s1); err != nil { 652 return err 653 } 654 s.NumberValue = float64(s1.NumberValue) 655 return nil 656} 657 658// Device: A Device within the Cloud Identity Devices API. Represents a 659// Device known to Google Cloud, independent of the device ownership, 660// type, and whether it is assigned or in use by a user. 661type Device struct { 662 // AndroidSpecificAttributes: Output only. Attributes specific to 663 // Android devices. 664 AndroidSpecificAttributes *AndroidAttributes `json:"androidSpecificAttributes,omitempty"` 665 666 // AssetTag: Asset tag of the device. 667 AssetTag string `json:"assetTag,omitempty"` 668 669 // BasebandVersion: Output only. Baseband version of the device. 670 BasebandVersion string `json:"basebandVersion,omitempty"` 671 672 // BootloaderVersion: Output only. Device bootloader version. Example: 673 // 0.6.7. 674 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 675 676 // Brand: Output only. Device brand. Example: Samsung. 677 Brand string `json:"brand,omitempty"` 678 679 // BuildNumber: Output only. Build number of the device. 680 BuildNumber string `json:"buildNumber,omitempty"` 681 682 // CompromisedState: Output only. Represents whether the Device is 683 // compromised. 684 // 685 // Possible values: 686 // "COMPROMISED_STATE_UNSPECIFIED" - Default value. 687 // "COMPROMISED" - The device is compromised (currently, this means 688 // Android device is rooted). 689 // "UNCOMPROMISED" - The device is safe (currently, this means Android 690 // device is unrooted). 691 CompromisedState string `json:"compromisedState,omitempty"` 692 693 // CreateTime: Output only. When the Company-Owned device was imported. 694 // This field is empty for BYOD devices. 695 CreateTime string `json:"createTime,omitempty"` 696 697 // DeviceType: Output only. Type of device. 698 // 699 // Possible values: 700 // "DEVICE_TYPE_UNSPECIFIED" - Unknown device type 701 // "ANDROID" - Device is an Android device 702 // "IOS" - Device is an iOS device 703 // "GOOGLE_SYNC" - Device is a Google Sync device. 704 // "WINDOWS" - Device is a Windows device. 705 // "MAC_OS" - Device is a MacOS device. 706 // "LINUX" - Device is a Linux device. 707 // "CHROME_OS" - Device is a ChromeOS device. 708 DeviceType string `json:"deviceType,omitempty"` 709 710 // EnabledDeveloperOptions: Output only. Whether developer options is 711 // enabled on device. 712 EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"` 713 714 // EnabledUsbDebugging: Output only. Whether USB debugging is enabled on 715 // device. 716 EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"` 717 718 // EncryptionState: Output only. Device encryption state. 719 // 720 // Possible values: 721 // "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set. 722 // "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption. 723 // "ENCRYPTED" - Device is encrypted. 724 // "NOT_ENCRYPTED" - Device is not encrypted. 725 EncryptionState string `json:"encryptionState,omitempty"` 726 727 // Imei: Output only. IMEI number of device if GSM device; empty 728 // otherwise. 729 Imei string `json:"imei,omitempty"` 730 731 // KernelVersion: Output only. Kernel version of the device. 732 KernelVersion string `json:"kernelVersion,omitempty"` 733 734 // LastSyncTime: Most recent time when device synced with this service. 735 LastSyncTime string `json:"lastSyncTime,omitempty"` 736 737 // ManagementState: Output only. Management state of the device 738 // 739 // Possible values: 740 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 741 // unused. 742 // "APPROVED" - Device is approved. 743 // "BLOCKED" - Device is blocked. 744 // "PENDING" - Device is pending approval. 745 // "UNPROVISIONED" - The device is not provisioned. Device will start 746 // from this state until some action is taken (i.e. a user starts using 747 // the device). 748 // "WIPING" - Data and settings on the device are being removed. 749 // "WIPED" - All data and settings on the device are removed. 750 ManagementState string `json:"managementState,omitempty"` 751 752 // Manufacturer: Output only. Device manufacturer. Example: Motorola. 753 Manufacturer string `json:"manufacturer,omitempty"` 754 755 // Meid: Output only. MEID number of device if CDMA device; empty 756 // otherwise. 757 Meid string `json:"meid,omitempty"` 758 759 // Model: Output only. Model name of device. Example: Pixel 3. 760 Model string `json:"model,omitempty"` 761 762 // Name: Output only. Resource name 763 // (https://cloud.google.com/apis/design/resource_names) of the Device 764 // in format: `devices/{device_id}`, where device_id is the unique id 765 // assigned to the Device. 766 Name string `json:"name,omitempty"` 767 768 // NetworkOperator: Output only. Mobile or network operator of device, 769 // if available. 770 NetworkOperator string `json:"networkOperator,omitempty"` 771 772 // OsVersion: Output only. OS version of the device. Example: Android 773 // 8.1.0. 774 OsVersion string `json:"osVersion,omitempty"` 775 776 // OtherAccounts: Output only. Domain name for Google accounts on 777 // device. Type for other accounts on device. On Android, will only be 778 // populated if |ownership_privilege| is |PROFILE_OWNER| or 779 // |DEVICE_OWNER|. Does not include the account signed in to the device 780 // policy app if that account's domain has only one account. Examples: 781 // "com.example", "xyz.com". 782 OtherAccounts []string `json:"otherAccounts,omitempty"` 783 784 // OwnerType: Output only. Whether the device is owned by the company or 785 // an individual 786 // 787 // Possible values: 788 // "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is 789 // unused. 790 // "COMPANY" - Company owns the device. 791 // "BYOD" - Bring Your Own Device (i.e. individual owns the device) 792 OwnerType string `json:"ownerType,omitempty"` 793 794 // ReleaseVersion: Output only. OS release version. Example: 6.0. 795 ReleaseVersion string `json:"releaseVersion,omitempty"` 796 797 // SecurityPatchTime: Output only. OS security patch update time on 798 // device. 799 SecurityPatchTime string `json:"securityPatchTime,omitempty"` 800 801 // SerialNumber: Serial Number of device. Example: HT82V1A01076. 802 SerialNumber string `json:"serialNumber,omitempty"` 803 804 // WifiMacAddresses: WiFi MAC addresses of device. 805 WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"` 806 807 // ServerResponse contains the HTTP response code and headers from the 808 // server. 809 googleapi.ServerResponse `json:"-"` 810 811 // ForceSendFields is a list of field names (e.g. 812 // "AndroidSpecificAttributes") to unconditionally include in API 813 // requests. By default, fields with empty or default values are omitted 814 // from API requests. However, any non-pointer, non-interface field 815 // appearing in ForceSendFields will be sent to the server regardless of 816 // whether the field is empty or not. This may be used to include empty 817 // fields in Patch requests. 818 ForceSendFields []string `json:"-"` 819 820 // NullFields is a list of field names (e.g. 821 // "AndroidSpecificAttributes") to include in API requests with the JSON 822 // null value. By default, fields with empty values are omitted from API 823 // requests. However, any field with an empty value appearing in 824 // NullFields will be sent to the server as null. It is an error if a 825 // field in this list has a non-empty value. This may be used to include 826 // null fields in Patch requests. 827 NullFields []string `json:"-"` 828} 829 830func (s *Device) MarshalJSON() ([]byte, error) { 831 type NoMethod Device 832 raw := NoMethod(*s) 833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 834} 835 836// DeviceUser: Represents a user's use of a Device in the Cloud Identity 837// Devices API. A DeviceUser is a resource representing a user's use of 838// a Device 839type DeviceUser struct { 840 // CompromisedState: Compromised State of the DeviceUser object 841 // 842 // Possible values: 843 // "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User 844 // account is unknown or unspecified. 845 // "COMPROMISED" - Device User Account is compromised. 846 // "NOT_COMPROMISED" - Device User Account is not compromised. 847 CompromisedState string `json:"compromisedState,omitempty"` 848 849 // CreateTime: When the user first signed in to the device 850 CreateTime string `json:"createTime,omitempty"` 851 852 // FirstSyncTime: Output only. Most recent time when user registered 853 // with this service. 854 FirstSyncTime string `json:"firstSyncTime,omitempty"` 855 856 // LanguageCode: Output only. Default locale used on device, in IETF 857 // BCP-47 format. 858 LanguageCode string `json:"languageCode,omitempty"` 859 860 // LastSyncTime: Output only. Last time when user synced with policies. 861 LastSyncTime string `json:"lastSyncTime,omitempty"` 862 863 // ManagementState: Output only. Management state of the user on the 864 // device. 865 // 866 // Possible values: 867 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 868 // unused. 869 // "WIPING" - This user's data and profile is being removed from the 870 // device. 871 // "WIPED" - This user's data and profile is removed from the device. 872 // "APPROVED" - User is approved to access data on the device. 873 // "BLOCKED" - User is blocked from accessing data on the device. 874 // "PENDING_APPROVAL" - User is awaiting approval. 875 // "UNENROLLED" - User is unenrolled from Advanced Windows Management, 876 // but the Windows account is still intact. 877 ManagementState string `json:"managementState,omitempty"` 878 879 // Name: Output only. Resource name 880 // (https://cloud.google.com/apis/design/resource_names) of the 881 // DeviceUser in format: 882 // `devices/{device_id}/deviceUsers/{device_user_id}`, where 883 // `device_user_id` uniquely identifies a user's use of a device. 884 Name string `json:"name,omitempty"` 885 886 // PasswordState: Password state of the DeviceUser object 887 // 888 // Possible values: 889 // "PASSWORD_STATE_UNSPECIFIED" - Password state not set. 890 // "PASSWORD_SET" - Password set in object. 891 // "PASSWORD_NOT_SET" - Password not set in object. 892 PasswordState string `json:"passwordState,omitempty"` 893 894 // UserAgent: Output only. User agent on the device for this specific 895 // user 896 UserAgent string `json:"userAgent,omitempty"` 897 898 // UserEmail: Email address of the user registered on the device. 899 UserEmail string `json:"userEmail,omitempty"` 900 901 // ServerResponse contains the HTTP response code and headers from the 902 // server. 903 googleapi.ServerResponse `json:"-"` 904 905 // ForceSendFields is a list of field names (e.g. "CompromisedState") to 906 // unconditionally include in API requests. By default, fields with 907 // empty or default values are omitted from API requests. However, any 908 // non-pointer, non-interface field appearing in ForceSendFields will be 909 // sent to the server regardless of whether the field is empty or not. 910 // This may be used to include empty fields in Patch requests. 911 ForceSendFields []string `json:"-"` 912 913 // NullFields is a list of field names (e.g. "CompromisedState") to 914 // include in API requests with the JSON null value. By default, fields 915 // with empty values are omitted from API requests. However, any field 916 // with an empty value appearing in NullFields will be sent to the 917 // server as null. It is an error if a field in this list has a 918 // non-empty value. This may be used to include null fields in Patch 919 // requests. 920 NullFields []string `json:"-"` 921} 922 923func (s *DeviceUser) MarshalJSON() ([]byte, error) { 924 type NoMethod DeviceUser 925 raw := NoMethod(*s) 926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 927} 928 929// DynamicGroupMetadata: Dynamic group metadata like queries and status. 930type DynamicGroupMetadata struct { 931 // Queries: Memberships will be the union of all queries. Only one entry 932 // with USER resource is currently supported. Customers can create up to 933 // 100 dynamic groups. 934 Queries []*DynamicGroupQuery `json:"queries,omitempty"` 935 936 // Status: Output only. Status of the dynamic group. 937 Status *DynamicGroupStatus `json:"status,omitempty"` 938 939 // ForceSendFields is a list of field names (e.g. "Queries") to 940 // unconditionally include in API requests. By default, fields with 941 // empty or default values are omitted from API requests. However, any 942 // non-pointer, non-interface field appearing in ForceSendFields will be 943 // sent to the server regardless of whether the field is empty or not. 944 // This may be used to include empty fields in Patch requests. 945 ForceSendFields []string `json:"-"` 946 947 // NullFields is a list of field names (e.g. "Queries") to include in 948 // API requests with the JSON null value. By default, fields with empty 949 // values are omitted from API requests. However, any field with an 950 // empty value appearing in NullFields will be sent to the server as 951 // null. It is an error if a field in this list has a non-empty value. 952 // This may be used to include null fields in Patch requests. 953 NullFields []string `json:"-"` 954} 955 956func (s *DynamicGroupMetadata) MarshalJSON() ([]byte, error) { 957 type NoMethod DynamicGroupMetadata 958 raw := NoMethod(*s) 959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 960} 961 962// DynamicGroupQuery: Defines a query on a resource. 963type DynamicGroupQuery struct { 964 // Query: Query that determines the memberships of the dynamic group. 965 // Examples: All users with at least one `organizations.department` of 966 // engineering. `user.organizations.exists(org, 967 // org.department=='engineering')` All users with at least one location 968 // that has `area` of `foo` and `building_id` of `bar`. 969 // `user.locations.exists(loc, loc.area=='foo' && 970 // loc.building_id=='bar')` 971 Query string `json:"query,omitempty"` 972 973 // Possible values: 974 // "RESOURCE_TYPE_UNSPECIFIED" - Default value (not valid) 975 // "USER" - For queries on User 976 ResourceType string `json:"resourceType,omitempty"` 977 978 // ForceSendFields is a list of field names (e.g. "Query") to 979 // unconditionally include in API requests. By default, fields with 980 // empty or default values are omitted from API requests. However, any 981 // non-pointer, non-interface field appearing in ForceSendFields will be 982 // sent to the server regardless of whether the field is empty or not. 983 // This may be used to include empty fields in Patch requests. 984 ForceSendFields []string `json:"-"` 985 986 // NullFields is a list of field names (e.g. "Query") to include in API 987 // requests with the JSON null value. By default, fields with empty 988 // values are omitted from API requests. However, any field with an 989 // empty value appearing in NullFields will be sent to the server as 990 // null. It is an error if a field in this list has a non-empty value. 991 // This may be used to include null fields in Patch requests. 992 NullFields []string `json:"-"` 993} 994 995func (s *DynamicGroupQuery) MarshalJSON() ([]byte, error) { 996 type NoMethod DynamicGroupQuery 997 raw := NoMethod(*s) 998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 999} 1000 1001// DynamicGroupStatus: The current status of a dynamic group along with 1002// timestamp. 1003type DynamicGroupStatus struct { 1004 // Status: Status of the dynamic group. 1005 // 1006 // Possible values: 1007 // "STATUS_UNSPECIFIED" - Default. 1008 // "UP_TO_DATE" - The dynamic group is up-to-date. 1009 // "UPDATING_MEMBERSHIPS" - The dynamic group has just been created 1010 // and memberships are being updated. 1011 Status string `json:"status,omitempty"` 1012 1013 // StatusTime: The latest time at which the dynamic group is guaranteed 1014 // to be in the given status. If status is `UP_TO_DATE`, the latest time 1015 // at which the dynamic group was confirmed to be up-to-date. If status 1016 // is `UPDATING_MEMBERSHIPS`, the time at which dynamic group was 1017 // created. 1018 StatusTime string `json:"statusTime,omitempty"` 1019 1020 // ForceSendFields is a list of field names (e.g. "Status") to 1021 // unconditionally include in API requests. By default, fields with 1022 // empty or default values are omitted from API requests. However, any 1023 // non-pointer, non-interface field appearing in ForceSendFields will be 1024 // sent to the server regardless of whether the field is empty or not. 1025 // This may be used to include empty fields in Patch requests. 1026 ForceSendFields []string `json:"-"` 1027 1028 // NullFields is a list of field names (e.g. "Status") to include in API 1029 // requests with the JSON null value. By default, fields with empty 1030 // values are omitted from API requests. However, any field with an 1031 // empty value appearing in NullFields will be sent to the server as 1032 // null. It is an error if a field in this list has a non-empty value. 1033 // This may be used to include null fields in Patch requests. 1034 NullFields []string `json:"-"` 1035} 1036 1037func (s *DynamicGroupStatus) MarshalJSON() ([]byte, error) { 1038 type NoMethod DynamicGroupStatus 1039 raw := NoMethod(*s) 1040 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1041} 1042 1043// EntityKey: A unique identifier for an entity in the Cloud Identity 1044// Groups API. An entity can represent either a group with an optional 1045// `namespace` or a user without a `namespace`. The combination of `id` 1046// and `namespace` must be unique; however, the same `id` can be used 1047// with different `namespace`s. 1048type EntityKey struct { 1049 // Id: The ID of the entity. For Google-managed entities, the `id` must 1050 // be the email address of an existing group or user. For 1051 // external-identity-mapped entities, the `id` must be a string 1052 // conforming to the Identity Source's requirements. Must be unique 1053 // within a `namespace`. 1054 Id string `json:"id,omitempty"` 1055 1056 // Namespace: The namespace in which the entity exists. If not 1057 // specified, the `EntityKey` represents a Google-managed entity such as 1058 // a Google user or a Google Group. If specified, the `EntityKey` 1059 // represents an external-identity-mapped group. The namespace must 1060 // correspond to an identity source created in Admin Console and must be 1061 // in the form of `identitysources/{identity_source_id}`. 1062 Namespace string `json:"namespace,omitempty"` 1063 1064 // ForceSendFields is a list of field names (e.g. "Id") to 1065 // unconditionally include in API requests. By default, fields with 1066 // empty or default values are omitted from API requests. However, any 1067 // non-pointer, non-interface field appearing in ForceSendFields will be 1068 // sent to the server regardless of whether the field is empty or not. 1069 // This may be used to include empty fields in Patch requests. 1070 ForceSendFields []string `json:"-"` 1071 1072 // NullFields is a list of field names (e.g. "Id") to include in API 1073 // requests with the JSON null value. By default, fields with empty 1074 // values are omitted from API requests. However, any field with an 1075 // empty value appearing in NullFields will be sent to the server as 1076 // null. It is an error if a field in this list has a non-empty value. 1077 // This may be used to include null fields in Patch requests. 1078 NullFields []string `json:"-"` 1079} 1080 1081func (s *EntityKey) MarshalJSON() ([]byte, error) { 1082 type NoMethod EntityKey 1083 raw := NoMethod(*s) 1084 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1085} 1086 1087// ExpiryDetail: The `MembershipRole` expiry details. 1088type ExpiryDetail struct { 1089 // ExpireTime: The time at which the `MembershipRole` will expire. 1090 ExpireTime string `json:"expireTime,omitempty"` 1091 1092 // ForceSendFields is a list of field names (e.g. "ExpireTime") to 1093 // unconditionally include in API requests. By default, fields with 1094 // empty or default values are omitted from API requests. However, any 1095 // non-pointer, non-interface field appearing in ForceSendFields will be 1096 // sent to the server regardless of whether the field is empty or not. 1097 // This may be used to include empty fields in Patch requests. 1098 ForceSendFields []string `json:"-"` 1099 1100 // NullFields is a list of field names (e.g. "ExpireTime") to include in 1101 // API requests with the JSON null value. By default, fields with empty 1102 // values are omitted from API requests. However, any field with an 1103 // empty value appearing in NullFields will be sent to the server as 1104 // null. It is an error if a field in this list has a non-empty value. 1105 // This may be used to include null fields in Patch requests. 1106 NullFields []string `json:"-"` 1107} 1108 1109func (s *ExpiryDetail) MarshalJSON() ([]byte, error) { 1110 type NoMethod ExpiryDetail 1111 raw := NoMethod(*s) 1112 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1113} 1114 1115// GetMembershipGraphResponse: The response message for 1116// MembershipsService.GetMembershipGraph. 1117type GetMembershipGraphResponse struct { 1118 // AdjacencyList: The membership graph's path information represented as 1119 // an adjacency list. 1120 AdjacencyList []*MembershipAdjacencyList `json:"adjacencyList,omitempty"` 1121 1122 // Groups: The resources representing each group in the adjacency list. 1123 // Each group in this list can be correlated to a 'group' of the 1124 // MembershipAdjacencyList using the 'name' of the Group resource. 1125 Groups []*Group `json:"groups,omitempty"` 1126 1127 // ForceSendFields is a list of field names (e.g. "AdjacencyList") to 1128 // unconditionally include in API requests. By default, fields with 1129 // empty or default values are omitted from API requests. However, any 1130 // non-pointer, non-interface field appearing in ForceSendFields will be 1131 // sent to the server regardless of whether the field is empty or not. 1132 // This may be used to include empty fields in Patch requests. 1133 ForceSendFields []string `json:"-"` 1134 1135 // NullFields is a list of field names (e.g. "AdjacencyList") to include 1136 // in API requests with the JSON null value. By default, fields with 1137 // empty values are omitted from API requests. However, any field with 1138 // an empty value appearing in NullFields will be sent to the server as 1139 // null. It is an error if a field in this list has a non-empty value. 1140 // This may be used to include null fields in Patch requests. 1141 NullFields []string `json:"-"` 1142} 1143 1144func (s *GetMembershipGraphResponse) MarshalJSON() ([]byte, error) { 1145 type NoMethod GetMembershipGraphResponse 1146 raw := NoMethod(*s) 1147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1148} 1149 1150// GoogleAppsCloudidentityDevicesV1AndroidAttributes: Resource 1151// representing the Android specific attributes of a Device. 1152type GoogleAppsCloudidentityDevicesV1AndroidAttributes struct { 1153 // EnabledUnknownSources: Whether applications from unknown sources can 1154 // be installed on device. 1155 EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"` 1156 1157 // OwnerProfileAccount: Whether this account is on an owner/primary 1158 // profile. For phones, only true for owner profiles. Android 4+ devices 1159 // can have secondary or restricted user profiles. 1160 OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"` 1161 1162 // OwnershipPrivilege: Ownership privileges on device. 1163 // 1164 // Possible values: 1165 // "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set. 1166 // "DEVICE_ADMINISTRATOR" - Active device administrator privileges on 1167 // the device. 1168 // "PROFILE_OWNER" - Profile Owner privileges. The account is in a 1169 // managed corporate profile. 1170 // "DEVICE_OWNER" - Device Owner privileges on the device. 1171 OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"` 1172 1173 // SupportsWorkProfile: Whether device supports Android work profiles. 1174 // If false, this service will not block access to corp data even if an 1175 // administrator turns on the "Enforce Work Profile" policy. 1176 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 1177 1178 // ForceSendFields is a list of field names (e.g. 1179 // "EnabledUnknownSources") to unconditionally include in API requests. 1180 // By default, fields with empty or default values are omitted from API 1181 // requests. However, any non-pointer, non-interface field appearing in 1182 // ForceSendFields will be sent to the server regardless of whether the 1183 // field is empty or not. This may be used to include empty fields in 1184 // Patch requests. 1185 ForceSendFields []string `json:"-"` 1186 1187 // NullFields is a list of field names (e.g. "EnabledUnknownSources") to 1188 // include in API requests with the JSON null value. By default, fields 1189 // with empty values are omitted from API requests. However, any field 1190 // with an empty value appearing in NullFields will be sent to the 1191 // server as null. It is an error if a field in this list has a 1192 // non-empty value. This may be used to include null fields in Patch 1193 // requests. 1194 NullFields []string `json:"-"` 1195} 1196 1197func (s *GoogleAppsCloudidentityDevicesV1AndroidAttributes) MarshalJSON() ([]byte, error) { 1198 type NoMethod GoogleAppsCloudidentityDevicesV1AndroidAttributes 1199 raw := NoMethod(*s) 1200 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1201} 1202 1203// GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse: Response 1204// message for approving the device to access user data. 1205type GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse struct { 1206 // DeviceUser: Resultant DeviceUser object for the action. 1207 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1208 1209 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1210 // unconditionally include in API requests. By default, fields with 1211 // empty or default values are omitted from API requests. However, any 1212 // non-pointer, non-interface field appearing in ForceSendFields will be 1213 // sent to the server regardless of whether the field is empty or not. 1214 // This may be used to include empty fields in Patch requests. 1215 ForceSendFields []string `json:"-"` 1216 1217 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1218 // API requests with the JSON null value. By default, fields with empty 1219 // values are omitted from API requests. However, any field with an 1220 // empty value appearing in NullFields will be sent to the server as 1221 // null. It is an error if a field in this list has a non-empty value. 1222 // This may be used to include null fields in Patch requests. 1223 NullFields []string `json:"-"` 1224} 1225 1226func (s *GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) { 1227 type NoMethod GoogleAppsCloudidentityDevicesV1ApproveDeviceUserResponse 1228 raw := NoMethod(*s) 1229 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1230} 1231 1232// GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse: Response 1233// message for blocking the device from accessing user data. 1234type GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse struct { 1235 // DeviceUser: Resultant DeviceUser object for the action. 1236 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1237 1238 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1239 // unconditionally include in API requests. By default, fields with 1240 // empty or default values are omitted from API requests. However, any 1241 // non-pointer, non-interface field appearing in ForceSendFields will be 1242 // sent to the server regardless of whether the field is empty or not. 1243 // This may be used to include empty fields in Patch requests. 1244 ForceSendFields []string `json:"-"` 1245 1246 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1247 // API requests with the JSON null value. By default, fields with empty 1248 // values are omitted from API requests. However, any field with an 1249 // empty value appearing in NullFields will be sent to the server as 1250 // null. It is an error if a field in this list has a non-empty value. 1251 // This may be used to include null fields in Patch requests. 1252 NullFields []string `json:"-"` 1253} 1254 1255func (s *GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse) MarshalJSON() ([]byte, error) { 1256 type NoMethod GoogleAppsCloudidentityDevicesV1BlockDeviceUserResponse 1257 raw := NoMethod(*s) 1258 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1259} 1260 1261// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse: Response 1262// message for cancelling an unfinished device wipe. 1263type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse struct { 1264 // Device: Resultant Device object for the action. Note that asset tags 1265 // will not be returned in the device object. 1266 Device *GoogleAppsCloudidentityDevicesV1Device `json:"device,omitempty"` 1267 1268 // ForceSendFields is a list of field names (e.g. "Device") to 1269 // unconditionally include in API requests. By default, fields with 1270 // empty or default values are omitted from API requests. However, any 1271 // non-pointer, non-interface field appearing in ForceSendFields will be 1272 // sent to the server regardless of whether the field is empty or not. 1273 // This may be used to include empty fields in Patch requests. 1274 ForceSendFields []string `json:"-"` 1275 1276 // NullFields is a list of field names (e.g. "Device") to include in API 1277 // requests with the JSON null value. By default, fields with empty 1278 // values are omitted from API requests. However, any field with an 1279 // empty value appearing in NullFields will be sent to the server as 1280 // null. It is an error if a field in this list has a non-empty value. 1281 // This may be used to include null fields in Patch requests. 1282 NullFields []string `json:"-"` 1283} 1284 1285func (s *GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) { 1286 type NoMethod GoogleAppsCloudidentityDevicesV1CancelWipeDeviceResponse 1287 raw := NoMethod(*s) 1288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1289} 1290 1291// GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse: 1292// Response message for cancelling an unfinished user account wipe. 1293type GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse struct { 1294 // DeviceUser: Resultant DeviceUser object for the action. 1295 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1296 1297 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1298 // unconditionally include in API requests. By default, fields with 1299 // empty or default values are omitted from API requests. However, any 1300 // non-pointer, non-interface field appearing in ForceSendFields will be 1301 // sent to the server regardless of whether the field is empty or not. 1302 // This may be used to include empty fields in Patch requests. 1303 ForceSendFields []string `json:"-"` 1304 1305 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1306 // API requests with the JSON null value. By default, fields with empty 1307 // values are omitted from API requests. However, any field with an 1308 // empty value appearing in NullFields will be sent to the server as 1309 // null. It is an error if a field in this list has a non-empty value. 1310 // This may be used to include null fields in Patch requests. 1311 NullFields []string `json:"-"` 1312} 1313 1314func (s *GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 1315 type NoMethod GoogleAppsCloudidentityDevicesV1CancelWipeDeviceUserResponse 1316 raw := NoMethod(*s) 1317 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1318} 1319 1320// GoogleAppsCloudidentityDevicesV1ClientState: Represents the state 1321// associated with an API client calling the Devices API. Resource 1322// representing ClientState and supports updates from API users 1323type GoogleAppsCloudidentityDevicesV1ClientState struct { 1324 // AssetTags: The caller can specify asset tags for this resource 1325 AssetTags []string `json:"assetTags,omitempty"` 1326 1327 // ComplianceState: The compliance state of the resource as specified by 1328 // the API client. 1329 // 1330 // Possible values: 1331 // "COMPLIANCE_STATE_UNSPECIFIED" - The compliance state of the 1332 // resource is unknown or unspecified. 1333 // "COMPLIANT" - Device is compliant with third party policies 1334 // "NON_COMPLIANT" - Device is not compliant with third party policies 1335 ComplianceState string `json:"complianceState,omitempty"` 1336 1337 // CreateTime: Output only. The time the client state data was created. 1338 CreateTime string `json:"createTime,omitempty"` 1339 1340 // CustomId: This field may be used to store a unique identifier for the 1341 // API resource within which these CustomAttributes are a field. 1342 CustomId string `json:"customId,omitempty"` 1343 1344 // Etag: The token that needs to be passed back for concurrency control 1345 // in updates. Token needs to be passed back in UpdateRequest 1346 Etag string `json:"etag,omitempty"` 1347 1348 // HealthScore: The Health score of the resource. The Health score is 1349 // the callers specification of the condition of the device from a 1350 // usability point of view. For example, a third-party device management 1351 // provider may specify a health score based on its compliance with 1352 // organizational policies. 1353 // 1354 // Possible values: 1355 // "HEALTH_SCORE_UNSPECIFIED" - Default value 1356 // "VERY_POOR" - The object is in very poor health as defined by the 1357 // caller. 1358 // "POOR" - The object is in poor health as defined by the caller. 1359 // "NEUTRAL" - The object health is neither good nor poor, as defined 1360 // by the caller. 1361 // "GOOD" - The object is in good health as defined by the caller. 1362 // "VERY_GOOD" - The object is in very good health as defined by the 1363 // caller. 1364 HealthScore string `json:"healthScore,omitempty"` 1365 1366 // KeyValuePairs: The map of key-value attributes stored by callers 1367 // specific to a device. The total serialized length of this map may not 1368 // exceed 10KB. No limit is placed on the number of attributes in a map. 1369 KeyValuePairs map[string]GoogleAppsCloudidentityDevicesV1CustomAttributeValue `json:"keyValuePairs,omitempty"` 1370 1371 // LastUpdateTime: Output only. The time the client state data was last 1372 // updated. 1373 LastUpdateTime string `json:"lastUpdateTime,omitempty"` 1374 1375 // Managed: The management state of the resource as specified by the API 1376 // client. 1377 // 1378 // Possible values: 1379 // "MANAGED_STATE_UNSPECIFIED" - The management state of the resource 1380 // is unknown or unspecified. 1381 // "MANAGED" - The resource is managed. 1382 // "UNMANAGED" - The resource is not managed. 1383 Managed string `json:"managed,omitempty"` 1384 1385 // Name: Output only. Resource name 1386 // (https://cloud.google.com/apis/design/resource_names) of the 1387 // ClientState in format: 1388 // `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partner 1389 // _id}`, where partner_id corresponds to the partner storing the data. 1390 // For partners belonging to the "BeyondCorp Alliance", this is the 1391 // partner ID specified to you by Google. For all other callers, this is 1392 // a string of the form: `{customer_id}-suffix`, where `customer_id` is 1393 // your customer ID. The *suffix* is any string the caller specifies. 1394 // This string will be displayed verbatim in the administration console. 1395 // This suffix is used in setting up Custom Access Levels in 1396 // Context-Aware Access. Your organization's customer ID can be obtained 1397 // from the URL: `GET 1398 // https://www.googleapis.com/admin/directory/v1/customers/my_customer` 1399 // The `id` field in the response contains the customer ID starting with 1400 // the letter 'C'. The customer ID to be used in this API is the string 1401 // after the letter 'C' (not including 'C') 1402 Name string `json:"name,omitempty"` 1403 1404 // OwnerType: Output only. The owner of the ClientState 1405 // 1406 // Possible values: 1407 // "OWNER_TYPE_UNSPECIFIED" - Unknown owner type 1408 // "OWNER_TYPE_CUSTOMER" - Customer is the owner 1409 // "OWNER_TYPE_PARTNER" - Partner is the owner 1410 OwnerType string `json:"ownerType,omitempty"` 1411 1412 // ScoreReason: A descriptive cause of the health score. 1413 ScoreReason string `json:"scoreReason,omitempty"` 1414 1415 // ForceSendFields is a list of field names (e.g. "AssetTags") to 1416 // unconditionally include in API requests. By default, fields with 1417 // empty or default values are omitted from API requests. However, any 1418 // non-pointer, non-interface field appearing in ForceSendFields will be 1419 // sent to the server regardless of whether the field is empty or not. 1420 // This may be used to include empty fields in Patch requests. 1421 ForceSendFields []string `json:"-"` 1422 1423 // NullFields is a list of field names (e.g. "AssetTags") to include in 1424 // API requests with the JSON null value. By default, fields with empty 1425 // values are omitted from API requests. However, any field with an 1426 // empty value appearing in NullFields will be sent to the server as 1427 // null. It is an error if a field in this list has a non-empty value. 1428 // This may be used to include null fields in Patch requests. 1429 NullFields []string `json:"-"` 1430} 1431 1432func (s *GoogleAppsCloudidentityDevicesV1ClientState) MarshalJSON() ([]byte, error) { 1433 type NoMethod GoogleAppsCloudidentityDevicesV1ClientState 1434 raw := NoMethod(*s) 1435 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1436} 1437 1438// GoogleAppsCloudidentityDevicesV1CustomAttributeValue: Additional 1439// custom attribute values may be one of these types 1440type GoogleAppsCloudidentityDevicesV1CustomAttributeValue struct { 1441 // BoolValue: Represents a boolean value. 1442 BoolValue bool `json:"boolValue,omitempty"` 1443 1444 // NumberValue: Represents a double value. 1445 NumberValue float64 `json:"numberValue,omitempty"` 1446 1447 // StringValue: Represents a string value. 1448 StringValue string `json:"stringValue,omitempty"` 1449 1450 // ForceSendFields is a list of field names (e.g. "BoolValue") to 1451 // unconditionally include in API requests. By default, fields with 1452 // empty or default values are omitted from API requests. However, any 1453 // non-pointer, non-interface field appearing in ForceSendFields will be 1454 // sent to the server regardless of whether the field is empty or not. 1455 // This may be used to include empty fields in Patch requests. 1456 ForceSendFields []string `json:"-"` 1457 1458 // NullFields is a list of field names (e.g. "BoolValue") to include in 1459 // API requests with the JSON null value. By default, fields with empty 1460 // values are omitted from API requests. However, any field with an 1461 // empty value appearing in NullFields will be sent to the server as 1462 // null. It is an error if a field in this list has a non-empty value. 1463 // This may be used to include null fields in Patch requests. 1464 NullFields []string `json:"-"` 1465} 1466 1467func (s *GoogleAppsCloudidentityDevicesV1CustomAttributeValue) MarshalJSON() ([]byte, error) { 1468 type NoMethod GoogleAppsCloudidentityDevicesV1CustomAttributeValue 1469 raw := NoMethod(*s) 1470 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1471} 1472 1473func (s *GoogleAppsCloudidentityDevicesV1CustomAttributeValue) UnmarshalJSON(data []byte) error { 1474 type NoMethod GoogleAppsCloudidentityDevicesV1CustomAttributeValue 1475 var s1 struct { 1476 NumberValue gensupport.JSONFloat64 `json:"numberValue"` 1477 *NoMethod 1478 } 1479 s1.NoMethod = (*NoMethod)(s) 1480 if err := json.Unmarshal(data, &s1); err != nil { 1481 return err 1482 } 1483 s.NumberValue = float64(s1.NumberValue) 1484 return nil 1485} 1486 1487// GoogleAppsCloudidentityDevicesV1Device: A Device within the Cloud 1488// Identity Devices API. Represents a Device known to Google Cloud, 1489// independent of the device ownership, type, and whether it is assigned 1490// or in use by a user. 1491type GoogleAppsCloudidentityDevicesV1Device struct { 1492 // AndroidSpecificAttributes: Output only. Attributes specific to 1493 // Android devices. 1494 AndroidSpecificAttributes *GoogleAppsCloudidentityDevicesV1AndroidAttributes `json:"androidSpecificAttributes,omitempty"` 1495 1496 // AssetTag: Asset tag of the device. 1497 AssetTag string `json:"assetTag,omitempty"` 1498 1499 // BasebandVersion: Output only. Baseband version of the device. 1500 BasebandVersion string `json:"basebandVersion,omitempty"` 1501 1502 // BootloaderVersion: Output only. Device bootloader version. Example: 1503 // 0.6.7. 1504 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 1505 1506 // Brand: Output only. Device brand. Example: Samsung. 1507 Brand string `json:"brand,omitempty"` 1508 1509 // BuildNumber: Output only. Build number of the device. 1510 BuildNumber string `json:"buildNumber,omitempty"` 1511 1512 // CompromisedState: Output only. Represents whether the Device is 1513 // compromised. 1514 // 1515 // Possible values: 1516 // "COMPROMISED_STATE_UNSPECIFIED" - Default value. 1517 // "COMPROMISED" - The device is compromised (currently, this means 1518 // Android device is rooted). 1519 // "UNCOMPROMISED" - The device is safe (currently, this means Android 1520 // device is unrooted). 1521 CompromisedState string `json:"compromisedState,omitempty"` 1522 1523 // CreateTime: Output only. When the Company-Owned device was imported. 1524 // This field is empty for BYOD devices. 1525 CreateTime string `json:"createTime,omitempty"` 1526 1527 // DeviceType: Output only. Type of device. 1528 // 1529 // Possible values: 1530 // "DEVICE_TYPE_UNSPECIFIED" - Unknown device type 1531 // "ANDROID" - Device is an Android device 1532 // "IOS" - Device is an iOS device 1533 // "GOOGLE_SYNC" - Device is a Google Sync device. 1534 // "WINDOWS" - Device is a Windows device. 1535 // "MAC_OS" - Device is a MacOS device. 1536 // "LINUX" - Device is a Linux device. 1537 // "CHROME_OS" - Device is a ChromeOS device. 1538 DeviceType string `json:"deviceType,omitempty"` 1539 1540 // EnabledDeveloperOptions: Output only. Whether developer options is 1541 // enabled on device. 1542 EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"` 1543 1544 // EnabledUsbDebugging: Output only. Whether USB debugging is enabled on 1545 // device. 1546 EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"` 1547 1548 // EncryptionState: Output only. Device encryption state. 1549 // 1550 // Possible values: 1551 // "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set. 1552 // "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption. 1553 // "ENCRYPTED" - Device is encrypted. 1554 // "NOT_ENCRYPTED" - Device is not encrypted. 1555 EncryptionState string `json:"encryptionState,omitempty"` 1556 1557 // Imei: Output only. IMEI number of device if GSM device; empty 1558 // otherwise. 1559 Imei string `json:"imei,omitempty"` 1560 1561 // KernelVersion: Output only. Kernel version of the device. 1562 KernelVersion string `json:"kernelVersion,omitempty"` 1563 1564 // LastSyncTime: Most recent time when device synced with this service. 1565 LastSyncTime string `json:"lastSyncTime,omitempty"` 1566 1567 // ManagementState: Output only. Management state of the device 1568 // 1569 // Possible values: 1570 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 1571 // unused. 1572 // "APPROVED" - Device is approved. 1573 // "BLOCKED" - Device is blocked. 1574 // "PENDING" - Device is pending approval. 1575 // "UNPROVISIONED" - The device is not provisioned. Device will start 1576 // from this state until some action is taken (i.e. a user starts using 1577 // the device). 1578 // "WIPING" - Data and settings on the device are being removed. 1579 // "WIPED" - All data and settings on the device are removed. 1580 ManagementState string `json:"managementState,omitempty"` 1581 1582 // Manufacturer: Output only. Device manufacturer. Example: Motorola. 1583 Manufacturer string `json:"manufacturer,omitempty"` 1584 1585 // Meid: Output only. MEID number of device if CDMA device; empty 1586 // otherwise. 1587 Meid string `json:"meid,omitempty"` 1588 1589 // Model: Output only. Model name of device. Example: Pixel 3. 1590 Model string `json:"model,omitempty"` 1591 1592 // Name: Output only. Resource name 1593 // (https://cloud.google.com/apis/design/resource_names) of the Device 1594 // in format: `devices/{device_id}`, where device_id is the unique id 1595 // assigned to the Device. 1596 Name string `json:"name,omitempty"` 1597 1598 // NetworkOperator: Output only. Mobile or network operator of device, 1599 // if available. 1600 NetworkOperator string `json:"networkOperator,omitempty"` 1601 1602 // OsVersion: Output only. OS version of the device. Example: Android 1603 // 8.1.0. 1604 OsVersion string `json:"osVersion,omitempty"` 1605 1606 // OtherAccounts: Output only. Domain name for Google accounts on 1607 // device. Type for other accounts on device. On Android, will only be 1608 // populated if |ownership_privilege| is |PROFILE_OWNER| or 1609 // |DEVICE_OWNER|. Does not include the account signed in to the device 1610 // policy app if that account's domain has only one account. Examples: 1611 // "com.example", "xyz.com". 1612 OtherAccounts []string `json:"otherAccounts,omitempty"` 1613 1614 // OwnerType: Output only. Whether the device is owned by the company or 1615 // an individual 1616 // 1617 // Possible values: 1618 // "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is 1619 // unused. 1620 // "COMPANY" - Company owns the device. 1621 // "BYOD" - Bring Your Own Device (i.e. individual owns the device) 1622 OwnerType string `json:"ownerType,omitempty"` 1623 1624 // ReleaseVersion: Output only. OS release version. Example: 6.0. 1625 ReleaseVersion string `json:"releaseVersion,omitempty"` 1626 1627 // SecurityPatchTime: Output only. OS security patch update time on 1628 // device. 1629 SecurityPatchTime string `json:"securityPatchTime,omitempty"` 1630 1631 // SerialNumber: Serial Number of device. Example: HT82V1A01076. 1632 SerialNumber string `json:"serialNumber,omitempty"` 1633 1634 // WifiMacAddresses: WiFi MAC addresses of device. 1635 WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"` 1636 1637 // ForceSendFields is a list of field names (e.g. 1638 // "AndroidSpecificAttributes") to unconditionally include in API 1639 // requests. By default, fields with empty or default values are omitted 1640 // from API requests. However, any non-pointer, non-interface field 1641 // appearing in ForceSendFields will be sent to the server regardless of 1642 // whether the field is empty or not. This may be used to include empty 1643 // fields in Patch requests. 1644 ForceSendFields []string `json:"-"` 1645 1646 // NullFields is a list of field names (e.g. 1647 // "AndroidSpecificAttributes") to include in API requests with the JSON 1648 // null value. By default, fields with empty values are omitted from API 1649 // requests. However, any field with an empty value appearing in 1650 // NullFields will be sent to the server as null. It is an error if a 1651 // field in this list has a non-empty value. This may be used to include 1652 // null fields in Patch requests. 1653 NullFields []string `json:"-"` 1654} 1655 1656func (s *GoogleAppsCloudidentityDevicesV1Device) MarshalJSON() ([]byte, error) { 1657 type NoMethod GoogleAppsCloudidentityDevicesV1Device 1658 raw := NoMethod(*s) 1659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1660} 1661 1662// GoogleAppsCloudidentityDevicesV1DeviceUser: Represents a user's use 1663// of a Device in the Cloud Identity Devices API. A DeviceUser is a 1664// resource representing a user's use of a Device 1665type GoogleAppsCloudidentityDevicesV1DeviceUser struct { 1666 // CompromisedState: Compromised State of the DeviceUser object 1667 // 1668 // Possible values: 1669 // "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User 1670 // account is unknown or unspecified. 1671 // "COMPROMISED" - Device User Account is compromised. 1672 // "NOT_COMPROMISED" - Device User Account is not compromised. 1673 CompromisedState string `json:"compromisedState,omitempty"` 1674 1675 // CreateTime: When the user first signed in to the device 1676 CreateTime string `json:"createTime,omitempty"` 1677 1678 // FirstSyncTime: Output only. Most recent time when user registered 1679 // with this service. 1680 FirstSyncTime string `json:"firstSyncTime,omitempty"` 1681 1682 // LanguageCode: Output only. Default locale used on device, in IETF 1683 // BCP-47 format. 1684 LanguageCode string `json:"languageCode,omitempty"` 1685 1686 // LastSyncTime: Output only. Last time when user synced with policies. 1687 LastSyncTime string `json:"lastSyncTime,omitempty"` 1688 1689 // ManagementState: Output only. Management state of the user on the 1690 // device. 1691 // 1692 // Possible values: 1693 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 1694 // unused. 1695 // "WIPING" - This user's data and profile is being removed from the 1696 // device. 1697 // "WIPED" - This user's data and profile is removed from the device. 1698 // "APPROVED" - User is approved to access data on the device. 1699 // "BLOCKED" - User is blocked from accessing data on the device. 1700 // "PENDING_APPROVAL" - User is awaiting approval. 1701 // "UNENROLLED" - User is unenrolled from Advanced Windows Management, 1702 // but the Windows account is still intact. 1703 ManagementState string `json:"managementState,omitempty"` 1704 1705 // Name: Output only. Resource name 1706 // (https://cloud.google.com/apis/design/resource_names) of the 1707 // DeviceUser in format: 1708 // `devices/{device_id}/deviceUsers/{device_user_id}`, where 1709 // `device_user_id` uniquely identifies a user's use of a device. 1710 Name string `json:"name,omitempty"` 1711 1712 // PasswordState: Password state of the DeviceUser object 1713 // 1714 // Possible values: 1715 // "PASSWORD_STATE_UNSPECIFIED" - Password state not set. 1716 // "PASSWORD_SET" - Password set in object. 1717 // "PASSWORD_NOT_SET" - Password not set in object. 1718 PasswordState string `json:"passwordState,omitempty"` 1719 1720 // UserAgent: Output only. User agent on the device for this specific 1721 // user 1722 UserAgent string `json:"userAgent,omitempty"` 1723 1724 // UserEmail: Email address of the user registered on the device. 1725 UserEmail string `json:"userEmail,omitempty"` 1726 1727 // ForceSendFields is a list of field names (e.g. "CompromisedState") to 1728 // unconditionally include in API requests. By default, fields with 1729 // empty or default values are omitted from API requests. However, any 1730 // non-pointer, non-interface field appearing in ForceSendFields will be 1731 // sent to the server regardless of whether the field is empty or not. 1732 // This may be used to include empty fields in Patch requests. 1733 ForceSendFields []string `json:"-"` 1734 1735 // NullFields is a list of field names (e.g. "CompromisedState") to 1736 // include in API requests with the JSON null value. By default, fields 1737 // with empty values are omitted from API requests. However, any field 1738 // with an empty value appearing in NullFields will be sent to the 1739 // server as null. It is an error if a field in this list has a 1740 // non-empty value. This may be used to include null fields in Patch 1741 // requests. 1742 NullFields []string `json:"-"` 1743} 1744 1745func (s *GoogleAppsCloudidentityDevicesV1DeviceUser) MarshalJSON() ([]byte, error) { 1746 type NoMethod GoogleAppsCloudidentityDevicesV1DeviceUser 1747 raw := NoMethod(*s) 1748 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1749} 1750 1751// GoogleAppsCloudidentityDevicesV1WipeDeviceResponse: Response message 1752// for wiping all data on the device. 1753type GoogleAppsCloudidentityDevicesV1WipeDeviceResponse struct { 1754 // Device: Resultant Device object for the action. Note that asset tags 1755 // will not be returned in the device object. 1756 Device *GoogleAppsCloudidentityDevicesV1Device `json:"device,omitempty"` 1757 1758 // ForceSendFields is a list of field names (e.g. "Device") to 1759 // unconditionally include in API requests. By default, fields with 1760 // empty or default values are omitted from API requests. However, any 1761 // non-pointer, non-interface field appearing in ForceSendFields will be 1762 // sent to the server regardless of whether the field is empty or not. 1763 // This may be used to include empty fields in Patch requests. 1764 ForceSendFields []string `json:"-"` 1765 1766 // NullFields is a list of field names (e.g. "Device") to include in API 1767 // requests with the JSON null value. By default, fields with empty 1768 // values are omitted from API requests. However, any field with an 1769 // empty value appearing in NullFields will be sent to the server as 1770 // null. It is an error if a field in this list has a non-empty value. 1771 // This may be used to include null fields in Patch requests. 1772 NullFields []string `json:"-"` 1773} 1774 1775func (s *GoogleAppsCloudidentityDevicesV1WipeDeviceResponse) MarshalJSON() ([]byte, error) { 1776 type NoMethod GoogleAppsCloudidentityDevicesV1WipeDeviceResponse 1777 raw := NoMethod(*s) 1778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1779} 1780 1781// GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse: Response 1782// message for wiping the user's account from the device. 1783type GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse struct { 1784 // DeviceUser: Resultant DeviceUser object for the action. 1785 DeviceUser *GoogleAppsCloudidentityDevicesV1DeviceUser `json:"deviceUser,omitempty"` 1786 1787 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1788 // unconditionally include in API requests. By default, fields with 1789 // empty or default values are omitted from API requests. However, any 1790 // non-pointer, non-interface field appearing in ForceSendFields will be 1791 // sent to the server regardless of whether the field is empty or not. 1792 // This may be used to include empty fields in Patch requests. 1793 ForceSendFields []string `json:"-"` 1794 1795 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1796 // API requests with the JSON null value. By default, fields with empty 1797 // values are omitted from API requests. However, any field with an 1798 // empty value appearing in NullFields will be sent to the server as 1799 // null. It is an error if a field in this list has a non-empty value. 1800 // This may be used to include null fields in Patch requests. 1801 NullFields []string `json:"-"` 1802} 1803 1804func (s *GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 1805 type NoMethod GoogleAppsCloudidentityDevicesV1WipeDeviceUserResponse 1806 raw := NoMethod(*s) 1807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1808} 1809 1810// Group: A group within the Cloud Identity Groups API. A `Group` is a 1811// collection of entities, where each entity is either a user, another 1812// group, or a service account. 1813type Group struct { 1814 // AdditionalGroupKeys: Additional entity key aliases for a Group. 1815 AdditionalGroupKeys []*EntityKey `json:"additionalGroupKeys,omitempty"` 1816 1817 // CreateTime: Output only. The time when the `Group` was created. 1818 CreateTime string `json:"createTime,omitempty"` 1819 1820 // Description: An extended description to help users determine the 1821 // purpose of a `Group`. Must not be longer than 4,096 characters. 1822 Description string `json:"description,omitempty"` 1823 1824 // DisplayName: The display name of the `Group`. 1825 DisplayName string `json:"displayName,omitempty"` 1826 1827 // DynamicGroupMetadata: Optional. Dynamic group metadata like queries 1828 // and status. 1829 DynamicGroupMetadata *DynamicGroupMetadata `json:"dynamicGroupMetadata,omitempty"` 1830 1831 // GroupKey: Required. Immutable. The `EntityKey` of the `Group`. 1832 GroupKey *EntityKey `json:"groupKey,omitempty"` 1833 1834 // Labels: Required. One or more label entries that apply to the Group. 1835 // Currently supported labels contain a key with an empty value. Google 1836 // Groups are the default type of group and have a label with a key of 1837 // `cloudidentity.googleapis.com/groups.discussion_forum` and an empty 1838 // value. Existing Google Groups can have an additional label with a key 1839 // of `cloudidentity.googleapis.com/groups.security` and an empty value 1840 // added to them. **This is an immutable change and the security label 1841 // cannot be removed once added.** Dynamic groups have a label with a 1842 // key of `cloudidentity.googleapis.com/groups.dynamic`. Identity-mapped 1843 // groups for Cloud Search have a label with a key of 1844 // `system/groups/external` and an empty value. 1845 Labels map[string]string `json:"labels,omitempty"` 1846 1847 // Name: Output only. The resource name 1848 // (https://cloud.google.com/apis/design/resource_names) of the `Group`. 1849 // Shall be of the form `groups/{group_id}`. 1850 Name string `json:"name,omitempty"` 1851 1852 // Parent: Required. Immutable. The resource name of the entity under 1853 // which this `Group` resides in the Cloud Identity resource hierarchy. 1854 // Must be of the form `identitysources/{identity_source_id}` for 1855 // external- identity-mapped groups or `customers/{customer_id}` for 1856 // Google Groups. The `customer_id` must begin with "C" (for example, 1857 // 'C046psxkn'). 1858 Parent string `json:"parent,omitempty"` 1859 1860 // PosixGroups: Optional. The POSIX groups associated with the `Group`. 1861 PosixGroups []*PosixGroup `json:"posixGroups,omitempty"` 1862 1863 // UpdateTime: Output only. The time when the `Group` was last updated. 1864 UpdateTime string `json:"updateTime,omitempty"` 1865 1866 // ServerResponse contains the HTTP response code and headers from the 1867 // server. 1868 googleapi.ServerResponse `json:"-"` 1869 1870 // ForceSendFields is a list of field names (e.g. "AdditionalGroupKeys") 1871 // to unconditionally include in API requests. By default, fields with 1872 // empty or default values are omitted from API requests. However, any 1873 // non-pointer, non-interface field appearing in ForceSendFields will be 1874 // sent to the server regardless of whether the field is empty or not. 1875 // This may be used to include empty fields in Patch requests. 1876 ForceSendFields []string `json:"-"` 1877 1878 // NullFields is a list of field names (e.g. "AdditionalGroupKeys") to 1879 // include in API requests with the JSON null value. By default, fields 1880 // with empty values are omitted from API requests. However, any field 1881 // with an empty value appearing in NullFields will be sent to the 1882 // server as null. It is an error if a field in this list has a 1883 // non-empty value. This may be used to include null fields in Patch 1884 // requests. 1885 NullFields []string `json:"-"` 1886} 1887 1888func (s *Group) MarshalJSON() ([]byte, error) { 1889 type NoMethod Group 1890 raw := NoMethod(*s) 1891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1892} 1893 1894// GroupRelation: Message representing a transitive group of a user or a 1895// group. 1896type GroupRelation struct { 1897 // DisplayName: Display name for this group. 1898 DisplayName string `json:"displayName,omitempty"` 1899 1900 // Group: Resource name for this group. 1901 Group string `json:"group,omitempty"` 1902 1903 // GroupKey: Entity key has an id and a namespace. In case of discussion 1904 // forums, the id will be an email address without a namespace. 1905 GroupKey *EntityKey `json:"groupKey,omitempty"` 1906 1907 // Labels: Labels for Group resource. 1908 Labels map[string]string `json:"labels,omitempty"` 1909 1910 // RelationType: The relation between the member and the transitive 1911 // group. 1912 // 1913 // Possible values: 1914 // "RELATION_TYPE_UNSPECIFIED" - The relation type is undefined or 1915 // undetermined. 1916 // "DIRECT" - The two entities have only a direct membership with each 1917 // other. 1918 // "INDIRECT" - The two entities have only an indirect membership with 1919 // each other. 1920 // "DIRECT_AND_INDIRECT" - The two entities have both a direct and an 1921 // indirect membership with each other. 1922 RelationType string `json:"relationType,omitempty"` 1923 1924 // Roles: Membership roles of the member for the group. 1925 Roles []*TransitiveMembershipRole `json:"roles,omitempty"` 1926 1927 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1928 // unconditionally include in API requests. By default, fields with 1929 // empty or default values are omitted from API requests. However, any 1930 // non-pointer, non-interface field appearing in ForceSendFields will be 1931 // sent to the server regardless of whether the field is empty or not. 1932 // This may be used to include empty fields in Patch requests. 1933 ForceSendFields []string `json:"-"` 1934 1935 // NullFields is a list of field names (e.g. "DisplayName") to include 1936 // in API requests with the JSON null value. By default, fields with 1937 // empty values are omitted from API requests. However, any field with 1938 // an empty value appearing in NullFields will be sent to the server as 1939 // null. It is an error if a field in this list has a non-empty value. 1940 // This may be used to include null fields in Patch requests. 1941 NullFields []string `json:"-"` 1942} 1943 1944func (s *GroupRelation) MarshalJSON() ([]byte, error) { 1945 type NoMethod GroupRelation 1946 raw := NoMethod(*s) 1947 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1948} 1949 1950// IsInvitableUserResponse: Response for IsInvitableUser RPC. 1951type IsInvitableUserResponse struct { 1952 // IsInvitableUser: Returns true if the email address is invitable. 1953 IsInvitableUser bool `json:"isInvitableUser,omitempty"` 1954 1955 // ServerResponse contains the HTTP response code and headers from the 1956 // server. 1957 googleapi.ServerResponse `json:"-"` 1958 1959 // ForceSendFields is a list of field names (e.g. "IsInvitableUser") to 1960 // unconditionally include in API requests. By default, fields with 1961 // empty or default values are omitted from API requests. However, any 1962 // non-pointer, non-interface field appearing in ForceSendFields will be 1963 // sent to the server regardless of whether the field is empty or not. 1964 // This may be used to include empty fields in Patch requests. 1965 ForceSendFields []string `json:"-"` 1966 1967 // NullFields is a list of field names (e.g. "IsInvitableUser") to 1968 // include in API requests with the JSON null value. By default, fields 1969 // with empty values are omitted from API requests. However, any field 1970 // with an empty value appearing in NullFields will be sent to the 1971 // server as null. It is an error if a field in this list has a 1972 // non-empty value. This may be used to include null fields in Patch 1973 // requests. 1974 NullFields []string `json:"-"` 1975} 1976 1977func (s *IsInvitableUserResponse) MarshalJSON() ([]byte, error) { 1978 type NoMethod IsInvitableUserResponse 1979 raw := NoMethod(*s) 1980 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1981} 1982 1983// ListClientStatesResponse: Response message that is returned in LRO 1984// result of ListClientStates Operation. 1985type ListClientStatesResponse struct { 1986 // ClientStates: Client states meeting the list restrictions. 1987 ClientStates []*ClientState `json:"clientStates,omitempty"` 1988 1989 // NextPageToken: Token to retrieve the next page of results. Empty if 1990 // there are no more results. 1991 NextPageToken string `json:"nextPageToken,omitempty"` 1992 1993 // ForceSendFields is a list of field names (e.g. "ClientStates") to 1994 // unconditionally include in API requests. By default, fields with 1995 // empty or default values are omitted from API requests. However, any 1996 // non-pointer, non-interface field appearing in ForceSendFields will be 1997 // sent to the server regardless of whether the field is empty or not. 1998 // This may be used to include empty fields in Patch requests. 1999 ForceSendFields []string `json:"-"` 2000 2001 // NullFields is a list of field names (e.g. "ClientStates") to include 2002 // in API requests with the JSON null value. By default, fields with 2003 // empty values are omitted from API requests. However, any field with 2004 // an empty value appearing in NullFields will be sent to the server as 2005 // null. It is an error if a field in this list has a non-empty value. 2006 // This may be used to include null fields in Patch requests. 2007 NullFields []string `json:"-"` 2008} 2009 2010func (s *ListClientStatesResponse) MarshalJSON() ([]byte, error) { 2011 type NoMethod ListClientStatesResponse 2012 raw := NoMethod(*s) 2013 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2014} 2015 2016// ListDeviceUsersResponse: Response message that is returned from the 2017// ListDeviceUsers method. 2018type ListDeviceUsersResponse struct { 2019 // DeviceUsers: Devices meeting the list restrictions. 2020 DeviceUsers []*DeviceUser `json:"deviceUsers,omitempty"` 2021 2022 // NextPageToken: Token to retrieve the next page of results. Empty if 2023 // there are no more results. 2024 NextPageToken string `json:"nextPageToken,omitempty"` 2025 2026 // ServerResponse contains the HTTP response code and headers from the 2027 // server. 2028 googleapi.ServerResponse `json:"-"` 2029 2030 // ForceSendFields is a list of field names (e.g. "DeviceUsers") to 2031 // unconditionally include in API requests. By default, fields with 2032 // empty or default values are omitted from API requests. However, any 2033 // non-pointer, non-interface field appearing in ForceSendFields will be 2034 // sent to the server regardless of whether the field is empty or not. 2035 // This may be used to include empty fields in Patch requests. 2036 ForceSendFields []string `json:"-"` 2037 2038 // NullFields is a list of field names (e.g. "DeviceUsers") to include 2039 // in API requests with the JSON null value. By default, fields with 2040 // empty values are omitted from API requests. However, any field with 2041 // an empty value appearing in NullFields will be sent to the server as 2042 // null. It is an error if a field in this list has a non-empty value. 2043 // This may be used to include null fields in Patch requests. 2044 NullFields []string `json:"-"` 2045} 2046 2047func (s *ListDeviceUsersResponse) MarshalJSON() ([]byte, error) { 2048 type NoMethod ListDeviceUsersResponse 2049 raw := NoMethod(*s) 2050 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2051} 2052 2053// ListDevicesResponse: Response message that is returned from the 2054// ListDevices method. 2055type ListDevicesResponse struct { 2056 // Devices: Devices meeting the list restrictions. 2057 Devices []*Device `json:"devices,omitempty"` 2058 2059 // NextPageToken: Token to retrieve the next page of results. Empty if 2060 // there are no more results. 2061 NextPageToken string `json:"nextPageToken,omitempty"` 2062 2063 // ServerResponse contains the HTTP response code and headers from the 2064 // server. 2065 googleapi.ServerResponse `json:"-"` 2066 2067 // ForceSendFields is a list of field names (e.g. "Devices") to 2068 // unconditionally include in API requests. By default, fields with 2069 // empty or default values are omitted from API requests. However, any 2070 // non-pointer, non-interface field appearing in ForceSendFields will be 2071 // sent to the server regardless of whether the field is empty or not. 2072 // This may be used to include empty fields in Patch requests. 2073 ForceSendFields []string `json:"-"` 2074 2075 // NullFields is a list of field names (e.g. "Devices") to include in 2076 // API requests with the JSON null value. By default, fields with empty 2077 // values are omitted from API requests. However, any field with an 2078 // empty value appearing in NullFields will be sent to the server as 2079 // null. It is an error if a field in this list has a non-empty value. 2080 // This may be used to include null fields in Patch requests. 2081 NullFields []string `json:"-"` 2082} 2083 2084func (s *ListDevicesResponse) MarshalJSON() ([]byte, error) { 2085 type NoMethod ListDevicesResponse 2086 raw := NoMethod(*s) 2087 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2088} 2089 2090// ListGroupsResponse: The response message for 2091// GroupsService.ListGroups. 2092type ListGroupsResponse struct { 2093 // Groups: The `Group` resources under the specified `parent`. 2094 Groups []*Group `json:"groups,omitempty"` 2095 2096 // NextPageToken: A continuation token to retrieve the next page of 2097 // results, or empty if there are no more results available. 2098 NextPageToken string `json:"nextPageToken,omitempty"` 2099 2100 // ServerResponse contains the HTTP response code and headers from the 2101 // server. 2102 googleapi.ServerResponse `json:"-"` 2103 2104 // ForceSendFields is a list of field names (e.g. "Groups") to 2105 // unconditionally include in API requests. By default, fields with 2106 // empty or default values are omitted from API requests. However, any 2107 // non-pointer, non-interface field appearing in ForceSendFields will be 2108 // sent to the server regardless of whether the field is empty or not. 2109 // This may be used to include empty fields in Patch requests. 2110 ForceSendFields []string `json:"-"` 2111 2112 // NullFields is a list of field names (e.g. "Groups") to include in API 2113 // requests with the JSON null value. By default, fields with empty 2114 // values are omitted from API requests. However, any field with an 2115 // empty value appearing in NullFields will be sent to the server as 2116 // null. It is an error if a field in this list has a non-empty value. 2117 // This may be used to include null fields in Patch requests. 2118 NullFields []string `json:"-"` 2119} 2120 2121func (s *ListGroupsResponse) MarshalJSON() ([]byte, error) { 2122 type NoMethod ListGroupsResponse 2123 raw := NoMethod(*s) 2124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2125} 2126 2127// ListMembershipsResponse: The response message for 2128// MembershipsService.ListMemberships. 2129type ListMembershipsResponse struct { 2130 // Memberships: The `Membership`s under the specified `parent`. 2131 Memberships []*Membership `json:"memberships,omitempty"` 2132 2133 // NextPageToken: A continuation token to retrieve the next page of 2134 // results, or empty if there are no more results available. 2135 NextPageToken string `json:"nextPageToken,omitempty"` 2136 2137 // ServerResponse contains the HTTP response code and headers from the 2138 // server. 2139 googleapi.ServerResponse `json:"-"` 2140 2141 // ForceSendFields is a list of field names (e.g. "Memberships") to 2142 // unconditionally include in API requests. By default, fields with 2143 // empty or default values are omitted from API requests. However, any 2144 // non-pointer, non-interface field appearing in ForceSendFields will be 2145 // sent to the server regardless of whether the field is empty or not. 2146 // This may be used to include empty fields in Patch requests. 2147 ForceSendFields []string `json:"-"` 2148 2149 // NullFields is a list of field names (e.g. "Memberships") to include 2150 // in API requests with the JSON null value. By default, fields with 2151 // empty values are omitted from API requests. However, any field with 2152 // an empty value appearing in NullFields will be sent to the server as 2153 // null. It is an error if a field in this list has a non-empty value. 2154 // This may be used to include null fields in Patch requests. 2155 NullFields []string `json:"-"` 2156} 2157 2158func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) { 2159 type NoMethod ListMembershipsResponse 2160 raw := NoMethod(*s) 2161 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2162} 2163 2164// ListUserInvitationsResponse: Response message for UserInvitation 2165// listing request. 2166type ListUserInvitationsResponse struct { 2167 // NextPageToken: The token for the next page. If not empty, indicates 2168 // that there may be more `UserInvitation` resources that match the 2169 // listing request; this value can be used in a subsequent 2170 // ListUserInvitationsRequest to get continued results with the current 2171 // list call. 2172 NextPageToken string `json:"nextPageToken,omitempty"` 2173 2174 // UserInvitations: The list of UserInvitation resources. 2175 UserInvitations []*UserInvitation `json:"userInvitations,omitempty"` 2176 2177 // ServerResponse contains the HTTP response code and headers from the 2178 // server. 2179 googleapi.ServerResponse `json:"-"` 2180 2181 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2182 // unconditionally include in API requests. By default, fields with 2183 // empty or default values are omitted from API requests. However, any 2184 // non-pointer, non-interface field appearing in ForceSendFields will be 2185 // sent to the server regardless of whether the field is empty or not. 2186 // This may be used to include empty fields in Patch requests. 2187 ForceSendFields []string `json:"-"` 2188 2189 // NullFields is a list of field names (e.g. "NextPageToken") to include 2190 // in API requests with the JSON null value. By default, fields with 2191 // empty values are omitted from API requests. However, any field with 2192 // an empty value appearing in NullFields will be sent to the server as 2193 // null. It is an error if a field in this list has a non-empty value. 2194 // This may be used to include null fields in Patch requests. 2195 NullFields []string `json:"-"` 2196} 2197 2198func (s *ListUserInvitationsResponse) MarshalJSON() ([]byte, error) { 2199 type NoMethod ListUserInvitationsResponse 2200 raw := NoMethod(*s) 2201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2202} 2203 2204// LookupGroupNameResponse: The response message for 2205// GroupsService.LookupGroupName. 2206type LookupGroupNameResponse struct { 2207 // Name: Output only. The resource name 2208 // (https://cloud.google.com/apis/design/resource_names) of the 2209 // looked-up `Group`. 2210 Name string `json:"name,omitempty"` 2211 2212 // ServerResponse contains the HTTP response code and headers from the 2213 // server. 2214 googleapi.ServerResponse `json:"-"` 2215 2216 // ForceSendFields is a list of field names (e.g. "Name") to 2217 // unconditionally include in API requests. By default, fields with 2218 // empty or default values are omitted from API requests. However, any 2219 // non-pointer, non-interface field appearing in ForceSendFields will be 2220 // sent to the server regardless of whether the field is empty or not. 2221 // This may be used to include empty fields in Patch requests. 2222 ForceSendFields []string `json:"-"` 2223 2224 // NullFields is a list of field names (e.g. "Name") to include in API 2225 // requests with the JSON null value. By default, fields with empty 2226 // values are omitted from API requests. However, any field with an 2227 // empty value appearing in NullFields will be sent to the server as 2228 // null. It is an error if a field in this list has a non-empty value. 2229 // This may be used to include null fields in Patch requests. 2230 NullFields []string `json:"-"` 2231} 2232 2233func (s *LookupGroupNameResponse) MarshalJSON() ([]byte, error) { 2234 type NoMethod LookupGroupNameResponse 2235 raw := NoMethod(*s) 2236 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2237} 2238 2239// LookupMembershipNameResponse: The response message for 2240// MembershipsService.LookupMembershipName. 2241type LookupMembershipNameResponse struct { 2242 // Name: The resource name 2243 // (https://cloud.google.com/apis/design/resource_names) of the 2244 // looked-up `Membership`. Must be of the form 2245 // `groups/{group_id}/memberships/{membership_id}`. 2246 Name string `json:"name,omitempty"` 2247 2248 // ServerResponse contains the HTTP response code and headers from the 2249 // server. 2250 googleapi.ServerResponse `json:"-"` 2251 2252 // ForceSendFields is a list of field names (e.g. "Name") to 2253 // unconditionally include in API requests. By default, fields with 2254 // empty or default values are omitted from API requests. However, any 2255 // non-pointer, non-interface field appearing in ForceSendFields will be 2256 // sent to the server regardless of whether the field is empty or not. 2257 // This may be used to include empty fields in Patch requests. 2258 ForceSendFields []string `json:"-"` 2259 2260 // NullFields is a list of field names (e.g. "Name") to include in API 2261 // requests with the JSON null value. By default, fields with empty 2262 // values are omitted from API requests. However, any field with an 2263 // empty value appearing in NullFields will be sent to the server as 2264 // null. It is an error if a field in this list has a non-empty value. 2265 // This may be used to include null fields in Patch requests. 2266 NullFields []string `json:"-"` 2267} 2268 2269func (s *LookupMembershipNameResponse) MarshalJSON() ([]byte, error) { 2270 type NoMethod LookupMembershipNameResponse 2271 raw := NoMethod(*s) 2272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2273} 2274 2275// LookupSelfDeviceUsersResponse: Response containing resource names of 2276// the DeviceUsers associated with the caller's credentials. 2277type LookupSelfDeviceUsersResponse struct { 2278 // Customer: The obfuscated customer Id that may be passed back to other 2279 // Devices API methods such as List, Get, etc. 2280 Customer string `json:"customer,omitempty"` 2281 2282 // Names: Resource names 2283 // (https://cloud.google.com/apis/design/resource_names) of the 2284 // DeviceUsers in the format: 2285 // `devices/{device_id}/deviceUsers/{user_resource_id}`, where device_id 2286 // is the unique ID assigned to a Device and user_resource_id is the 2287 // unique user ID 2288 Names []string `json:"names,omitempty"` 2289 2290 // NextPageToken: Token to retrieve the next page of results. Empty if 2291 // there are no more results. 2292 NextPageToken string `json:"nextPageToken,omitempty"` 2293 2294 // ServerResponse contains the HTTP response code and headers from the 2295 // server. 2296 googleapi.ServerResponse `json:"-"` 2297 2298 // ForceSendFields is a list of field names (e.g. "Customer") to 2299 // unconditionally include in API requests. By default, fields with 2300 // empty or default values are omitted from API requests. However, any 2301 // non-pointer, non-interface field appearing in ForceSendFields will be 2302 // sent to the server regardless of whether the field is empty or not. 2303 // This may be used to include empty fields in Patch requests. 2304 ForceSendFields []string `json:"-"` 2305 2306 // NullFields is a list of field names (e.g. "Customer") to include in 2307 // API requests with the JSON null value. By default, fields with empty 2308 // values are omitted from API requests. However, any field with an 2309 // empty value appearing in NullFields will be sent to the server as 2310 // null. It is an error if a field in this list has a non-empty value. 2311 // This may be used to include null fields in Patch requests. 2312 NullFields []string `json:"-"` 2313} 2314 2315func (s *LookupSelfDeviceUsersResponse) MarshalJSON() ([]byte, error) { 2316 type NoMethod LookupSelfDeviceUsersResponse 2317 raw := NoMethod(*s) 2318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2319} 2320 2321// MemberRelation: Message representing a transitive membership of a 2322// group. 2323type MemberRelation struct { 2324 // Member: Resource name for this member. 2325 Member string `json:"member,omitempty"` 2326 2327 // PreferredMemberKey: Entity key has an id and a namespace. In case of 2328 // discussion forums, the id will be an email address without a 2329 // namespace. 2330 PreferredMemberKey []*EntityKey `json:"preferredMemberKey,omitempty"` 2331 2332 // RelationType: The relation between the group and the transitive 2333 // member. 2334 // 2335 // Possible values: 2336 // "RELATION_TYPE_UNSPECIFIED" - The relation type is undefined or 2337 // undetermined. 2338 // "DIRECT" - The two entities have only a direct membership with each 2339 // other. 2340 // "INDIRECT" - The two entities have only an indirect membership with 2341 // each other. 2342 // "DIRECT_AND_INDIRECT" - The two entities have both a direct and an 2343 // indirect membership with each other. 2344 RelationType string `json:"relationType,omitempty"` 2345 2346 // Roles: The membership role details (i.e name of role and expiry 2347 // time). 2348 Roles []*TransitiveMembershipRole `json:"roles,omitempty"` 2349 2350 // ForceSendFields is a list of field names (e.g. "Member") to 2351 // unconditionally include in API requests. By default, fields with 2352 // empty or default values are omitted from API requests. However, any 2353 // non-pointer, non-interface field appearing in ForceSendFields will be 2354 // sent to the server regardless of whether the field is empty or not. 2355 // This may be used to include empty fields in Patch requests. 2356 ForceSendFields []string `json:"-"` 2357 2358 // NullFields is a list of field names (e.g. "Member") to include in API 2359 // requests with the JSON null value. By default, fields with empty 2360 // values are omitted from API requests. However, any field with an 2361 // empty value appearing in NullFields will be sent to the server as 2362 // null. It is an error if a field in this list has a non-empty value. 2363 // This may be used to include null fields in Patch requests. 2364 NullFields []string `json:"-"` 2365} 2366 2367func (s *MemberRelation) MarshalJSON() ([]byte, error) { 2368 type NoMethod MemberRelation 2369 raw := NoMethod(*s) 2370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2371} 2372 2373// Membership: A membership within the Cloud Identity Groups API. A 2374// `Membership` defines a relationship between a `Group` and an entity 2375// belonging to that `Group`, referred to as a "member". 2376type Membership struct { 2377 // CreateTime: Output only. The time when the `Membership` was created. 2378 CreateTime string `json:"createTime,omitempty"` 2379 2380 // MemberKey: Immutable. The `EntityKey` of the member. Either 2381 // `member_key` or `preferred_member_key` must be set when calling 2382 // MembershipsService.CreateMembership but not both; both shall be set 2383 // when returned. 2384 MemberKey *EntityKey `json:"memberKey,omitempty"` 2385 2386 // Name: Output only. The resource name 2387 // (https://cloud.google.com/apis/design/resource_names) of the 2388 // `Membership`. Shall be of the form 2389 // `groups/{group_id}/memberships/{membership_id}`. 2390 Name string `json:"name,omitempty"` 2391 2392 // PreferredMemberKey: Required. Immutable. The `EntityKey` of the 2393 // member. Either `member_key` or `preferred_member_key` must be set 2394 // when calling MembershipsService.CreateMembership but not both; both 2395 // shall be set when returned. 2396 PreferredMemberKey *EntityKey `json:"preferredMemberKey,omitempty"` 2397 2398 // Roles: The `MembershipRole`s that apply to the `Membership`. If 2399 // unspecified, defaults to a single `MembershipRole` with `name` 2400 // `MEMBER`. Must not contain duplicate `MembershipRole`s with the same 2401 // `name`. 2402 Roles []*MembershipRole `json:"roles,omitempty"` 2403 2404 // Type: Output only. The type of the membership. 2405 // 2406 // Possible values: 2407 // "TYPE_UNSPECIFIED" - Default. Should not be used. 2408 // "USER" - Represents user type. 2409 // "SERVICE_ACCOUNT" - Represents service account type. 2410 // "GROUP" - Represents group type. 2411 // "SHARED_DRIVE" - Represents Shared drive. 2412 // "OTHER" - Represents other type. 2413 Type string `json:"type,omitempty"` 2414 2415 // UpdateTime: Output only. The time when the `Membership` was last 2416 // updated. 2417 UpdateTime string `json:"updateTime,omitempty"` 2418 2419 // ServerResponse contains the HTTP response code and headers from the 2420 // server. 2421 googleapi.ServerResponse `json:"-"` 2422 2423 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2424 // unconditionally include in API requests. By default, fields with 2425 // empty or default values are omitted from API requests. However, any 2426 // non-pointer, non-interface field appearing in ForceSendFields will be 2427 // sent to the server regardless of whether the field is empty or not. 2428 // This may be used to include empty fields in Patch requests. 2429 ForceSendFields []string `json:"-"` 2430 2431 // NullFields is a list of field names (e.g. "CreateTime") to include in 2432 // API requests with the JSON null value. By default, fields with empty 2433 // values are omitted from API requests. However, any field with an 2434 // empty value appearing in NullFields will be sent to the server as 2435 // null. It is an error if a field in this list has a non-empty value. 2436 // This may be used to include null fields in Patch requests. 2437 NullFields []string `json:"-"` 2438} 2439 2440func (s *Membership) MarshalJSON() ([]byte, error) { 2441 type NoMethod Membership 2442 raw := NoMethod(*s) 2443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2444} 2445 2446// MembershipAdjacencyList: Membership graph's path information as an 2447// adjacency list. 2448type MembershipAdjacencyList struct { 2449 // Edges: Each edge contains information about the member that belongs 2450 // to this group. Note: Fields returned here will help identify the 2451 // specific Membership resource (e.g name, preferred_member_key and 2452 // role), but may not be a comprehensive list of all fields. 2453 Edges []*Membership `json:"edges,omitempty"` 2454 2455 // Group: Resource name of the group that the members belong to. 2456 Group string `json:"group,omitempty"` 2457 2458 // ForceSendFields is a list of field names (e.g. "Edges") to 2459 // unconditionally include in API requests. By default, fields with 2460 // empty or default values are omitted from API requests. However, any 2461 // non-pointer, non-interface field appearing in ForceSendFields will be 2462 // sent to the server regardless of whether the field is empty or not. 2463 // This may be used to include empty fields in Patch requests. 2464 ForceSendFields []string `json:"-"` 2465 2466 // NullFields is a list of field names (e.g. "Edges") to include in API 2467 // requests with the JSON null value. By default, fields with empty 2468 // values are omitted from API requests. However, any field with an 2469 // empty value appearing in NullFields will be sent to the server as 2470 // null. It is an error if a field in this list has a non-empty value. 2471 // This may be used to include null fields in Patch requests. 2472 NullFields []string `json:"-"` 2473} 2474 2475func (s *MembershipAdjacencyList) MarshalJSON() ([]byte, error) { 2476 type NoMethod MembershipAdjacencyList 2477 raw := NoMethod(*s) 2478 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2479} 2480 2481// MembershipRole: A membership role within the Cloud Identity Groups 2482// API. A `MembershipRole` defines the privileges granted to a 2483// `Membership`. 2484type MembershipRole struct { 2485 // ExpiryDetail: The expiry details of the `MembershipRole`. Expiry 2486 // details are only supported for `MEMBER` `MembershipRoles`. May be set 2487 // if `name` is `MEMBER`. Must not be set if `name` is any other value. 2488 ExpiryDetail *ExpiryDetail `json:"expiryDetail,omitempty"` 2489 2490 // Name: The name of the `MembershipRole`. Must be one of `OWNER`, 2491 // `MANAGER`, `MEMBER`. 2492 Name string `json:"name,omitempty"` 2493 2494 // ForceSendFields is a list of field names (e.g. "ExpiryDetail") to 2495 // unconditionally include in API requests. By default, fields with 2496 // empty or default values are omitted from API requests. However, any 2497 // non-pointer, non-interface field appearing in ForceSendFields will be 2498 // sent to the server regardless of whether the field is empty or not. 2499 // This may be used to include empty fields in Patch requests. 2500 ForceSendFields []string `json:"-"` 2501 2502 // NullFields is a list of field names (e.g. "ExpiryDetail") to include 2503 // in API requests with the JSON null value. By default, fields with 2504 // empty values are omitted from API requests. However, any field with 2505 // an empty value appearing in NullFields will be sent to the server as 2506 // null. It is an error if a field in this list has a non-empty value. 2507 // This may be used to include null fields in Patch requests. 2508 NullFields []string `json:"-"` 2509} 2510 2511func (s *MembershipRole) MarshalJSON() ([]byte, error) { 2512 type NoMethod MembershipRole 2513 raw := NoMethod(*s) 2514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2515} 2516 2517// ModifyMembershipRolesRequest: The request message for 2518// MembershipsService.ModifyMembershipRoles. 2519type ModifyMembershipRolesRequest struct { 2520 // AddRoles: The `MembershipRole`s to be added. Adding or removing roles 2521 // in the same request as updating roles is not supported. Must not be 2522 // set if `update_roles_params` is set. 2523 AddRoles []*MembershipRole `json:"addRoles,omitempty"` 2524 2525 // RemoveRoles: The `name`s of the `MembershipRole`s to be removed. 2526 // Adding or removing roles in the same request as updating roles is not 2527 // supported. It is not possible to remove the `MEMBER` 2528 // `MembershipRole`. If you wish to delete a `Membership`, call 2529 // MembershipsService.DeleteMembership instead. Must not contain 2530 // `MEMBER`. Must not be set if `update_roles_params` is set. 2531 RemoveRoles []string `json:"removeRoles,omitempty"` 2532 2533 // UpdateRolesParams: The `MembershipRole`s to be updated. Updating 2534 // roles in the same request as adding or removing roles is not 2535 // supported. Must not be set if either `add_roles` or `remove_roles` is 2536 // set. 2537 UpdateRolesParams []*UpdateMembershipRolesParams `json:"updateRolesParams,omitempty"` 2538 2539 // ForceSendFields is a list of field names (e.g. "AddRoles") to 2540 // unconditionally include in API requests. By default, fields with 2541 // empty or default values are omitted from API requests. However, any 2542 // non-pointer, non-interface field appearing in ForceSendFields will be 2543 // sent to the server regardless of whether the field is empty or not. 2544 // This may be used to include empty fields in Patch requests. 2545 ForceSendFields []string `json:"-"` 2546 2547 // NullFields is a list of field names (e.g. "AddRoles") to include in 2548 // API requests with the JSON null value. By default, fields with empty 2549 // values are omitted from API requests. However, any field with an 2550 // empty value appearing in NullFields will be sent to the server as 2551 // null. It is an error if a field in this list has a non-empty value. 2552 // This may be used to include null fields in Patch requests. 2553 NullFields []string `json:"-"` 2554} 2555 2556func (s *ModifyMembershipRolesRequest) MarshalJSON() ([]byte, error) { 2557 type NoMethod ModifyMembershipRolesRequest 2558 raw := NoMethod(*s) 2559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2560} 2561 2562// ModifyMembershipRolesResponse: The response message for 2563// MembershipsService.ModifyMembershipRoles. 2564type ModifyMembershipRolesResponse struct { 2565 // Membership: The `Membership` resource after modifying its 2566 // `MembershipRole`s. 2567 Membership *Membership `json:"membership,omitempty"` 2568 2569 // ServerResponse contains the HTTP response code and headers from the 2570 // server. 2571 googleapi.ServerResponse `json:"-"` 2572 2573 // ForceSendFields is a list of field names (e.g. "Membership") to 2574 // unconditionally include in API requests. By default, fields with 2575 // empty or default values are omitted from API requests. However, any 2576 // non-pointer, non-interface field appearing in ForceSendFields will be 2577 // sent to the server regardless of whether the field is empty or not. 2578 // This may be used to include empty fields in Patch requests. 2579 ForceSendFields []string `json:"-"` 2580 2581 // NullFields is a list of field names (e.g. "Membership") to include in 2582 // API requests with the JSON null value. By default, fields with empty 2583 // values are omitted from API requests. However, any field with an 2584 // empty value appearing in NullFields will be sent to the server as 2585 // null. It is an error if a field in this list has a non-empty value. 2586 // This may be used to include null fields in Patch requests. 2587 NullFields []string `json:"-"` 2588} 2589 2590func (s *ModifyMembershipRolesResponse) MarshalJSON() ([]byte, error) { 2591 type NoMethod ModifyMembershipRolesResponse 2592 raw := NoMethod(*s) 2593 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2594} 2595 2596// Operation: This resource represents a long-running operation that is 2597// the result of a network API call. 2598type Operation struct { 2599 // Done: If the value is `false`, it means the operation is still in 2600 // progress. If `true`, the operation is completed, and either `error` 2601 // or `response` is available. 2602 Done bool `json:"done,omitempty"` 2603 2604 // Error: The error result of the operation in case of failure or 2605 // cancellation. 2606 Error *Status `json:"error,omitempty"` 2607 2608 // Metadata: Service-specific metadata associated with the operation. It 2609 // typically contains progress information and common metadata such as 2610 // create time. Some services might not provide such metadata. Any 2611 // method that returns a long-running operation should document the 2612 // metadata type, if any. 2613 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2614 2615 // Name: The server-assigned name, which is only unique within the same 2616 // service that originally returns it. If you use the default HTTP 2617 // mapping, the `name` should be a resource name ending with 2618 // `operations/{unique_id}`. 2619 Name string `json:"name,omitempty"` 2620 2621 // Response: The normal response of the operation in case of success. If 2622 // the original method returns no data on success, such as `Delete`, the 2623 // response is `google.protobuf.Empty`. If the original method is 2624 // standard `Get`/`Create`/`Update`, the response should be the 2625 // resource. For other methods, the response should have the type 2626 // `XxxResponse`, where `Xxx` is the original method name. For example, 2627 // if the original method name is `TakeSnapshot()`, the inferred 2628 // response type is `TakeSnapshotResponse`. 2629 Response googleapi.RawMessage `json:"response,omitempty"` 2630 2631 // ServerResponse contains the HTTP response code and headers from the 2632 // server. 2633 googleapi.ServerResponse `json:"-"` 2634 2635 // ForceSendFields is a list of field names (e.g. "Done") to 2636 // unconditionally include in API requests. By default, fields with 2637 // empty or default values are omitted from API requests. However, any 2638 // non-pointer, non-interface field appearing in ForceSendFields will be 2639 // sent to the server regardless of whether the field is empty or not. 2640 // This may be used to include empty fields in Patch requests. 2641 ForceSendFields []string `json:"-"` 2642 2643 // NullFields is a list of field names (e.g. "Done") to include in API 2644 // requests with the JSON null value. By default, fields with empty 2645 // values are omitted from API requests. However, any field with an 2646 // empty value appearing in NullFields will be sent to the server as 2647 // null. It is an error if a field in this list has a non-empty value. 2648 // This may be used to include null fields in Patch requests. 2649 NullFields []string `json:"-"` 2650} 2651 2652func (s *Operation) MarshalJSON() ([]byte, error) { 2653 type NoMethod Operation 2654 raw := NoMethod(*s) 2655 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2656} 2657 2658// PosixGroup: POSIX Group definition to represent a group in a POSIX 2659// compliant system. 2660type PosixGroup struct { 2661 // Gid: GID of the POSIX group. 2662 Gid uint64 `json:"gid,omitempty,string"` 2663 2664 // Name: Name of the POSIX group. 2665 Name string `json:"name,omitempty"` 2666 2667 // SystemId: System identifier for which group name and gid apply to. If 2668 // not specified it will default to empty value. 2669 SystemId string `json:"systemId,omitempty"` 2670 2671 // ForceSendFields is a list of field names (e.g. "Gid") to 2672 // unconditionally include in API requests. By default, fields with 2673 // empty or default values are omitted from API requests. However, any 2674 // non-pointer, non-interface field appearing in ForceSendFields will be 2675 // sent to the server regardless of whether the field is empty or not. 2676 // This may be used to include empty fields in Patch requests. 2677 ForceSendFields []string `json:"-"` 2678 2679 // NullFields is a list of field names (e.g. "Gid") to include in API 2680 // requests with the JSON null value. By default, fields with empty 2681 // values are omitted from API requests. However, any field with an 2682 // empty value appearing in NullFields will be sent to the server as 2683 // null. It is an error if a field in this list has a non-empty value. 2684 // This may be used to include null fields in Patch requests. 2685 NullFields []string `json:"-"` 2686} 2687 2688func (s *PosixGroup) MarshalJSON() ([]byte, error) { 2689 type NoMethod PosixGroup 2690 raw := NoMethod(*s) 2691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2692} 2693 2694// SearchGroupsResponse: The response message for 2695// GroupsService.SearchGroups. 2696type SearchGroupsResponse struct { 2697 // Groups: The `Group` resources that match the search query. 2698 Groups []*Group `json:"groups,omitempty"` 2699 2700 // NextPageToken: A continuation token to retrieve the next page of 2701 // results, or empty if there are no more results available. 2702 NextPageToken string `json:"nextPageToken,omitempty"` 2703 2704 // ServerResponse contains the HTTP response code and headers from the 2705 // server. 2706 googleapi.ServerResponse `json:"-"` 2707 2708 // ForceSendFields is a list of field names (e.g. "Groups") to 2709 // unconditionally include in API requests. By default, fields with 2710 // empty or default values are omitted from API requests. However, any 2711 // non-pointer, non-interface field appearing in ForceSendFields will be 2712 // sent to the server regardless of whether the field is empty or not. 2713 // This may be used to include empty fields in Patch requests. 2714 ForceSendFields []string `json:"-"` 2715 2716 // NullFields is a list of field names (e.g. "Groups") to include in API 2717 // requests with the JSON null value. By default, fields with empty 2718 // values are omitted from API requests. However, any field with an 2719 // empty value appearing in NullFields will be sent to the server as 2720 // null. It is an error if a field in this list has a non-empty value. 2721 // This may be used to include null fields in Patch requests. 2722 NullFields []string `json:"-"` 2723} 2724 2725func (s *SearchGroupsResponse) MarshalJSON() ([]byte, error) { 2726 type NoMethod SearchGroupsResponse 2727 raw := NoMethod(*s) 2728 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2729} 2730 2731// SearchTransitiveGroupsResponse: The response message for 2732// MembershipsService.SearchTransitiveGroups. 2733type SearchTransitiveGroupsResponse struct { 2734 // Memberships: List of transitive groups satisfying the query. 2735 Memberships []*GroupRelation `json:"memberships,omitempty"` 2736 2737 // NextPageToken: Token to retrieve the next page of results, or empty 2738 // if there are no more results available for listing. 2739 NextPageToken string `json:"nextPageToken,omitempty"` 2740 2741 // ServerResponse contains the HTTP response code and headers from the 2742 // server. 2743 googleapi.ServerResponse `json:"-"` 2744 2745 // ForceSendFields is a list of field names (e.g. "Memberships") to 2746 // unconditionally include in API requests. By default, fields with 2747 // empty or default values are omitted from API requests. However, any 2748 // non-pointer, non-interface field appearing in ForceSendFields will be 2749 // sent to the server regardless of whether the field is empty or not. 2750 // This may be used to include empty fields in Patch requests. 2751 ForceSendFields []string `json:"-"` 2752 2753 // NullFields is a list of field names (e.g. "Memberships") to include 2754 // in API requests with the JSON null value. By default, fields with 2755 // empty values are omitted from API requests. However, any field with 2756 // an empty value appearing in NullFields will be sent to the server as 2757 // null. It is an error if a field in this list has a non-empty value. 2758 // This may be used to include null fields in Patch requests. 2759 NullFields []string `json:"-"` 2760} 2761 2762func (s *SearchTransitiveGroupsResponse) MarshalJSON() ([]byte, error) { 2763 type NoMethod SearchTransitiveGroupsResponse 2764 raw := NoMethod(*s) 2765 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2766} 2767 2768// SearchTransitiveMembershipsResponse: The response message for 2769// MembershipsService.SearchTransitiveMemberships. 2770type SearchTransitiveMembershipsResponse struct { 2771 // Memberships: List of transitive members satisfying the query. 2772 Memberships []*MemberRelation `json:"memberships,omitempty"` 2773 2774 // NextPageToken: Token to retrieve the next page of results, or empty 2775 // if there are no more results. 2776 NextPageToken string `json:"nextPageToken,omitempty"` 2777 2778 // ServerResponse contains the HTTP response code and headers from the 2779 // server. 2780 googleapi.ServerResponse `json:"-"` 2781 2782 // ForceSendFields is a list of field names (e.g. "Memberships") to 2783 // unconditionally include in API requests. By default, fields with 2784 // empty or default values are omitted from API requests. However, any 2785 // non-pointer, non-interface field appearing in ForceSendFields will be 2786 // sent to the server regardless of whether the field is empty or not. 2787 // This may be used to include empty fields in Patch requests. 2788 ForceSendFields []string `json:"-"` 2789 2790 // NullFields is a list of field names (e.g. "Memberships") to include 2791 // in API requests with the JSON null value. By default, fields with 2792 // empty values are omitted from API requests. However, any field with 2793 // an empty value appearing in NullFields will be sent to the server as 2794 // null. It is an error if a field in this list has a non-empty value. 2795 // This may be used to include null fields in Patch requests. 2796 NullFields []string `json:"-"` 2797} 2798 2799func (s *SearchTransitiveMembershipsResponse) MarshalJSON() ([]byte, error) { 2800 type NoMethod SearchTransitiveMembershipsResponse 2801 raw := NoMethod(*s) 2802 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2803} 2804 2805// SendUserInvitationRequest: A request to send email for inviting 2806// target user corresponding to the UserInvitation. 2807type SendUserInvitationRequest struct { 2808} 2809 2810// Status: The `Status` type defines a logical error model that is 2811// suitable for different programming environments, including REST APIs 2812// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 2813// `Status` message contains three pieces of data: error code, error 2814// message, and error details. You can find out more about this error 2815// model and how to work with it in the API Design Guide 2816// (https://cloud.google.com/apis/design/errors). 2817type Status struct { 2818 // Code: The status code, which should be an enum value of 2819 // google.rpc.Code. 2820 Code int64 `json:"code,omitempty"` 2821 2822 // Details: A list of messages that carry the error details. There is a 2823 // common set of message types for APIs to use. 2824 Details []googleapi.RawMessage `json:"details,omitempty"` 2825 2826 // Message: A developer-facing error message, which should be in 2827 // English. Any user-facing error message should be localized and sent 2828 // in the google.rpc.Status.details field, or localized by the client. 2829 Message string `json:"message,omitempty"` 2830 2831 // ForceSendFields is a list of field names (e.g. "Code") to 2832 // unconditionally include in API requests. By default, fields with 2833 // empty or default values are omitted from API requests. However, any 2834 // non-pointer, non-interface field appearing in ForceSendFields will be 2835 // sent to the server regardless of whether the field is empty or not. 2836 // This may be used to include empty fields in Patch requests. 2837 ForceSendFields []string `json:"-"` 2838 2839 // NullFields is a list of field names (e.g. "Code") to include in API 2840 // requests with the JSON null value. By default, fields with empty 2841 // values are omitted from API requests. However, any field with an 2842 // empty value appearing in NullFields will be sent to the server as 2843 // null. It is an error if a field in this list has a non-empty value. 2844 // This may be used to include null fields in Patch requests. 2845 NullFields []string `json:"-"` 2846} 2847 2848func (s *Status) MarshalJSON() ([]byte, error) { 2849 type NoMethod Status 2850 raw := NoMethod(*s) 2851 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2852} 2853 2854// TransitiveMembershipRole: Message representing the role of a 2855// TransitiveMembership. 2856type TransitiveMembershipRole struct { 2857 // Role: TransitiveMembershipRole in string format. Currently supported 2858 // TransitiveMembershipRoles: "MEMBER", "OWNER", and "MANAGER". 2859 Role string `json:"role,omitempty"` 2860 2861 // ForceSendFields is a list of field names (e.g. "Role") to 2862 // unconditionally include in API requests. By default, fields with 2863 // empty or default values are omitted from API requests. However, any 2864 // non-pointer, non-interface field appearing in ForceSendFields will be 2865 // sent to the server regardless of whether the field is empty or not. 2866 // This may be used to include empty fields in Patch requests. 2867 ForceSendFields []string `json:"-"` 2868 2869 // NullFields is a list of field names (e.g. "Role") to include in API 2870 // requests with the JSON null value. By default, fields with empty 2871 // values are omitted from API requests. However, any field with an 2872 // empty value appearing in NullFields will be sent to the server as 2873 // null. It is an error if a field in this list has a non-empty value. 2874 // This may be used to include null fields in Patch requests. 2875 NullFields []string `json:"-"` 2876} 2877 2878func (s *TransitiveMembershipRole) MarshalJSON() ([]byte, error) { 2879 type NoMethod TransitiveMembershipRole 2880 raw := NoMethod(*s) 2881 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2882} 2883 2884// UpdateMembershipRolesParams: The details of an update to a 2885// `MembershipRole`. 2886type UpdateMembershipRolesParams struct { 2887 // FieldMask: The fully-qualified names of fields to update. May only 2888 // contain the field `expiry_detail.expire_time`. 2889 FieldMask string `json:"fieldMask,omitempty"` 2890 2891 // MembershipRole: The `MembershipRole`s to be updated. Only `MEMBER` 2892 // `MembershipRoles` can currently be updated. May only contain a 2893 // `MembershipRole` with `name` `MEMBER`. 2894 MembershipRole *MembershipRole `json:"membershipRole,omitempty"` 2895 2896 // ForceSendFields is a list of field names (e.g. "FieldMask") to 2897 // unconditionally include in API requests. By default, fields with 2898 // empty or default values are omitted from API requests. However, any 2899 // non-pointer, non-interface field appearing in ForceSendFields will be 2900 // sent to the server regardless of whether the field is empty or not. 2901 // This may be used to include empty fields in Patch requests. 2902 ForceSendFields []string `json:"-"` 2903 2904 // NullFields is a list of field names (e.g. "FieldMask") to include in 2905 // API requests with the JSON null value. By default, fields with empty 2906 // values are omitted from API requests. However, any field with an 2907 // empty value appearing in NullFields will be sent to the server as 2908 // null. It is an error if a field in this list has a non-empty value. 2909 // This may be used to include null fields in Patch requests. 2910 NullFields []string `json:"-"` 2911} 2912 2913func (s *UpdateMembershipRolesParams) MarshalJSON() ([]byte, error) { 2914 type NoMethod UpdateMembershipRolesParams 2915 raw := NoMethod(*s) 2916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2917} 2918 2919// UserInvitation: The `UserInvitation` resource represents an email 2920// that can be sent to an unmanaged user account inviting them to join 2921// the customer’s Google Workspace or Cloud Identity account. An 2922// unmanaged account shares an email address domain with the Google 2923// Workspace or Cloud Identity account but is not managed by it yet. If 2924// the user accepts the `UserInvitation`, the user account will become 2925// managed. 2926type UserInvitation struct { 2927 // MailsSentCount: Number of invitation emails sent to the user. 2928 MailsSentCount int64 `json:"mailsSentCount,omitempty,string"` 2929 2930 // Name: Shall be of the form 2931 // `customers/{customer}/userinvitations/{user_email_address}`. 2932 Name string `json:"name,omitempty"` 2933 2934 // State: State of the `UserInvitation`. 2935 // 2936 // Possible values: 2937 // "STATE_UNSPECIFIED" - The default value. This value is used if the 2938 // state is omitted. 2939 // "NOT_YET_SENT" - The `UserInvitation` has been created and is ready 2940 // for sending as an email. 2941 // "INVITED" - The user has been invited by email. 2942 // "ACCEPTED" - The user has accepted the invitation and is part of 2943 // the organization. 2944 // "DECLINED" - The user declined the invitation. 2945 State string `json:"state,omitempty"` 2946 2947 // UpdateTime: Time when the `UserInvitation` was last updated. 2948 UpdateTime string `json:"updateTime,omitempty"` 2949 2950 // ServerResponse contains the HTTP response code and headers from the 2951 // server. 2952 googleapi.ServerResponse `json:"-"` 2953 2954 // ForceSendFields is a list of field names (e.g. "MailsSentCount") to 2955 // unconditionally include in API requests. By default, fields with 2956 // empty or default values are omitted from API requests. However, any 2957 // non-pointer, non-interface field appearing in ForceSendFields will be 2958 // sent to the server regardless of whether the field is empty or not. 2959 // This may be used to include empty fields in Patch requests. 2960 ForceSendFields []string `json:"-"` 2961 2962 // NullFields is a list of field names (e.g. "MailsSentCount") to 2963 // include in API requests with the JSON null value. By default, fields 2964 // with empty values are omitted from API requests. However, any field 2965 // with an empty value appearing in NullFields will be sent to the 2966 // server as null. It is an error if a field in this list has a 2967 // non-empty value. This may be used to include null fields in Patch 2968 // requests. 2969 NullFields []string `json:"-"` 2970} 2971 2972func (s *UserInvitation) MarshalJSON() ([]byte, error) { 2973 type NoMethod UserInvitation 2974 raw := NoMethod(*s) 2975 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2976} 2977 2978// WipeDeviceRequest: Request message for wiping all data on the device. 2979type WipeDeviceRequest struct { 2980 // RemoveResetLock: Optional. Specifies if a user is able to factory 2981 // reset a device after a Device Wipe. On iOS, this is called 2982 // "Activation Lock", while on Android, this is known as "Factory Reset 2983 // Protection". If true, this protection will be removed from the 2984 // device, so that a user can successfully factory reset. If false, the 2985 // setting is untouched on the device. 2986 RemoveResetLock bool `json:"removeResetLock,omitempty"` 2987 2988 // ForceSendFields is a list of field names (e.g. "RemoveResetLock") to 2989 // unconditionally include in API requests. By default, fields with 2990 // empty or default values are omitted from API requests. However, any 2991 // non-pointer, non-interface field appearing in ForceSendFields will be 2992 // sent to the server regardless of whether the field is empty or not. 2993 // This may be used to include empty fields in Patch requests. 2994 ForceSendFields []string `json:"-"` 2995 2996 // NullFields is a list of field names (e.g. "RemoveResetLock") to 2997 // include in API requests with the JSON null value. By default, fields 2998 // with empty values are omitted from API requests. However, any field 2999 // with an empty value appearing in NullFields will be sent to the 3000 // server as null. It is an error if a field in this list has a 3001 // non-empty value. This may be used to include null fields in Patch 3002 // requests. 3003 NullFields []string `json:"-"` 3004} 3005 3006func (s *WipeDeviceRequest) MarshalJSON() ([]byte, error) { 3007 type NoMethod WipeDeviceRequest 3008 raw := NoMethod(*s) 3009 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3010} 3011 3012// WipeDeviceResponse: Response message for wiping all data on the 3013// device. 3014type WipeDeviceResponse struct { 3015 // Device: Resultant Device object for the action. Note that asset tags 3016 // will not be returned in the device object. 3017 Device *Device `json:"device,omitempty"` 3018 3019 // ForceSendFields is a list of field names (e.g. "Device") to 3020 // unconditionally include in API requests. By default, fields with 3021 // empty or default values are omitted from API requests. However, any 3022 // non-pointer, non-interface field appearing in ForceSendFields will be 3023 // sent to the server regardless of whether the field is empty or not. 3024 // This may be used to include empty fields in Patch requests. 3025 ForceSendFields []string `json:"-"` 3026 3027 // NullFields is a list of field names (e.g. "Device") to include in API 3028 // requests with the JSON null value. By default, fields with empty 3029 // values are omitted from API requests. However, any field with an 3030 // empty value appearing in NullFields will be sent to the server as 3031 // null. It is an error if a field in this list has a non-empty value. 3032 // This may be used to include null fields in Patch requests. 3033 NullFields []string `json:"-"` 3034} 3035 3036func (s *WipeDeviceResponse) MarshalJSON() ([]byte, error) { 3037 type NoMethod WipeDeviceResponse 3038 raw := NoMethod(*s) 3039 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3040} 3041 3042// WipeDeviceUserRequest: Request message for starting an account wipe 3043// on device. 3044type WipeDeviceUserRequest struct { 3045} 3046 3047// WipeDeviceUserResponse: Response message for wiping the user's 3048// account from the device. 3049type WipeDeviceUserResponse struct { 3050 // DeviceUser: Resultant DeviceUser object for the action. 3051 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 3052 3053 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 3054 // unconditionally include in API requests. By default, fields with 3055 // empty or default values are omitted from API requests. However, any 3056 // non-pointer, non-interface field appearing in ForceSendFields will be 3057 // sent to the server regardless of whether the field is empty or not. 3058 // This may be used to include empty fields in Patch requests. 3059 ForceSendFields []string `json:"-"` 3060 3061 // NullFields is a list of field names (e.g. "DeviceUser") to include in 3062 // API requests with the JSON null value. By default, fields with empty 3063 // values are omitted from API requests. However, any field with an 3064 // empty value appearing in NullFields will be sent to the server as 3065 // null. It is an error if a field in this list has a non-empty value. 3066 // This may be used to include null fields in Patch requests. 3067 NullFields []string `json:"-"` 3068} 3069 3070func (s *WipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 3071 type NoMethod WipeDeviceUserResponse 3072 raw := NoMethod(*s) 3073 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3074} 3075 3076// method id "cloudidentity.customers.userinvitations.cancel": 3077 3078type CustomersUserinvitationsCancelCall struct { 3079 s *Service 3080 name string 3081 canceluserinvitationrequest *CancelUserInvitationRequest 3082 urlParams_ gensupport.URLParams 3083 ctx_ context.Context 3084 header_ http.Header 3085} 3086 3087// Cancel: Cancels a UserInvitation that was already sent. 3088// 3089// - name: `UserInvitation` name in the format 3090// `customers/{customer}/userinvitations/{user_email_address}`. 3091func (r *CustomersUserinvitationsService) Cancel(name string, canceluserinvitationrequest *CancelUserInvitationRequest) *CustomersUserinvitationsCancelCall { 3092 c := &CustomersUserinvitationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3093 c.name = name 3094 c.canceluserinvitationrequest = canceluserinvitationrequest 3095 return c 3096} 3097 3098// Fields allows partial responses to be retrieved. See 3099// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3100// for more information. 3101func (c *CustomersUserinvitationsCancelCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsCancelCall { 3102 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3103 return c 3104} 3105 3106// Context sets the context to be used in this call's Do method. Any 3107// pending HTTP request will be aborted if the provided context is 3108// canceled. 3109func (c *CustomersUserinvitationsCancelCall) Context(ctx context.Context) *CustomersUserinvitationsCancelCall { 3110 c.ctx_ = ctx 3111 return c 3112} 3113 3114// Header returns an http.Header that can be modified by the caller to 3115// add HTTP headers to the request. 3116func (c *CustomersUserinvitationsCancelCall) Header() http.Header { 3117 if c.header_ == nil { 3118 c.header_ = make(http.Header) 3119 } 3120 return c.header_ 3121} 3122 3123func (c *CustomersUserinvitationsCancelCall) doRequest(alt string) (*http.Response, error) { 3124 reqHeaders := make(http.Header) 3125 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3126 for k, v := range c.header_ { 3127 reqHeaders[k] = v 3128 } 3129 reqHeaders.Set("User-Agent", c.s.userAgent()) 3130 var body io.Reader = nil 3131 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceluserinvitationrequest) 3132 if err != nil { 3133 return nil, err 3134 } 3135 reqHeaders.Set("Content-Type", "application/json") 3136 c.urlParams_.Set("alt", alt) 3137 c.urlParams_.Set("prettyPrint", "false") 3138 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 3139 urls += "?" + c.urlParams_.Encode() 3140 req, err := http.NewRequest("POST", urls, body) 3141 if err != nil { 3142 return nil, err 3143 } 3144 req.Header = reqHeaders 3145 googleapi.Expand(req.URL, map[string]string{ 3146 "name": c.name, 3147 }) 3148 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3149} 3150 3151// Do executes the "cloudidentity.customers.userinvitations.cancel" call. 3152// Exactly one of *Operation or error will be non-nil. Any non-2xx 3153// status code is an error. Response headers are in either 3154// *Operation.ServerResponse.Header or (if a response was returned at 3155// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3156// to check whether the returned error was because 3157// http.StatusNotModified was returned. 3158func (c *CustomersUserinvitationsCancelCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3159 gensupport.SetOptions(c.urlParams_, opts...) 3160 res, err := c.doRequest("json") 3161 if res != nil && res.StatusCode == http.StatusNotModified { 3162 if res.Body != nil { 3163 res.Body.Close() 3164 } 3165 return nil, &googleapi.Error{ 3166 Code: res.StatusCode, 3167 Header: res.Header, 3168 } 3169 } 3170 if err != nil { 3171 return nil, err 3172 } 3173 defer googleapi.CloseBody(res) 3174 if err := googleapi.CheckResponse(res); err != nil { 3175 return nil, err 3176 } 3177 ret := &Operation{ 3178 ServerResponse: googleapi.ServerResponse{ 3179 Header: res.Header, 3180 HTTPStatusCode: res.StatusCode, 3181 }, 3182 } 3183 target := &ret 3184 if err := gensupport.DecodeResponse(target, res); err != nil { 3185 return nil, err 3186 } 3187 return ret, nil 3188 // { 3189 // "description": "Cancels a UserInvitation that was already sent.", 3190 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:cancel", 3191 // "httpMethod": "POST", 3192 // "id": "cloudidentity.customers.userinvitations.cancel", 3193 // "parameterOrder": [ 3194 // "name" 3195 // ], 3196 // "parameters": { 3197 // "name": { 3198 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3199 // "location": "path", 3200 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3201 // "required": true, 3202 // "type": "string" 3203 // } 3204 // }, 3205 // "path": "v1beta1/{+name}:cancel", 3206 // "request": { 3207 // "$ref": "CancelUserInvitationRequest" 3208 // }, 3209 // "response": { 3210 // "$ref": "Operation" 3211 // } 3212 // } 3213 3214} 3215 3216// method id "cloudidentity.customers.userinvitations.get": 3217 3218type CustomersUserinvitationsGetCall struct { 3219 s *Service 3220 name string 3221 urlParams_ gensupport.URLParams 3222 ifNoneMatch_ string 3223 ctx_ context.Context 3224 header_ http.Header 3225} 3226 3227// Get: Retrieves a UserInvitation resource. **Note:** New consumer 3228// accounts with the customer's verified domain created within the 3229// previous 48 hours will not appear in the result. This delay also 3230// applies to newly-verified domains. 3231// 3232// - name: `UserInvitation` name in the format 3233// `customers/{customer}/userinvitations/{user_email_address}`. 3234func (r *CustomersUserinvitationsService) Get(name string) *CustomersUserinvitationsGetCall { 3235 c := &CustomersUserinvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3236 c.name = name 3237 return c 3238} 3239 3240// Fields allows partial responses to be retrieved. See 3241// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3242// for more information. 3243func (c *CustomersUserinvitationsGetCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsGetCall { 3244 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3245 return c 3246} 3247 3248// IfNoneMatch sets the optional parameter which makes the operation 3249// fail if the object's ETag matches the given value. This is useful for 3250// getting updates only after the object has changed since the last 3251// request. Use googleapi.IsNotModified to check whether the response 3252// error from Do is the result of In-None-Match. 3253func (c *CustomersUserinvitationsGetCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsGetCall { 3254 c.ifNoneMatch_ = entityTag 3255 return c 3256} 3257 3258// Context sets the context to be used in this call's Do method. Any 3259// pending HTTP request will be aborted if the provided context is 3260// canceled. 3261func (c *CustomersUserinvitationsGetCall) Context(ctx context.Context) *CustomersUserinvitationsGetCall { 3262 c.ctx_ = ctx 3263 return c 3264} 3265 3266// Header returns an http.Header that can be modified by the caller to 3267// add HTTP headers to the request. 3268func (c *CustomersUserinvitationsGetCall) Header() http.Header { 3269 if c.header_ == nil { 3270 c.header_ = make(http.Header) 3271 } 3272 return c.header_ 3273} 3274 3275func (c *CustomersUserinvitationsGetCall) doRequest(alt string) (*http.Response, error) { 3276 reqHeaders := make(http.Header) 3277 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3278 for k, v := range c.header_ { 3279 reqHeaders[k] = v 3280 } 3281 reqHeaders.Set("User-Agent", c.s.userAgent()) 3282 if c.ifNoneMatch_ != "" { 3283 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3284 } 3285 var body io.Reader = nil 3286 c.urlParams_.Set("alt", alt) 3287 c.urlParams_.Set("prettyPrint", "false") 3288 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3289 urls += "?" + c.urlParams_.Encode() 3290 req, err := http.NewRequest("GET", urls, body) 3291 if err != nil { 3292 return nil, err 3293 } 3294 req.Header = reqHeaders 3295 googleapi.Expand(req.URL, map[string]string{ 3296 "name": c.name, 3297 }) 3298 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3299} 3300 3301// Do executes the "cloudidentity.customers.userinvitations.get" call. 3302// Exactly one of *UserInvitation or error will be non-nil. Any non-2xx 3303// status code is an error. Response headers are in either 3304// *UserInvitation.ServerResponse.Header or (if a response was returned 3305// at all) in error.(*googleapi.Error).Header. Use 3306// googleapi.IsNotModified to check whether the returned error was 3307// because http.StatusNotModified was returned. 3308func (c *CustomersUserinvitationsGetCall) Do(opts ...googleapi.CallOption) (*UserInvitation, error) { 3309 gensupport.SetOptions(c.urlParams_, opts...) 3310 res, err := c.doRequest("json") 3311 if res != nil && res.StatusCode == http.StatusNotModified { 3312 if res.Body != nil { 3313 res.Body.Close() 3314 } 3315 return nil, &googleapi.Error{ 3316 Code: res.StatusCode, 3317 Header: res.Header, 3318 } 3319 } 3320 if err != nil { 3321 return nil, err 3322 } 3323 defer googleapi.CloseBody(res) 3324 if err := googleapi.CheckResponse(res); err != nil { 3325 return nil, err 3326 } 3327 ret := &UserInvitation{ 3328 ServerResponse: googleapi.ServerResponse{ 3329 Header: res.Header, 3330 HTTPStatusCode: res.StatusCode, 3331 }, 3332 } 3333 target := &ret 3334 if err := gensupport.DecodeResponse(target, res); err != nil { 3335 return nil, err 3336 } 3337 return ret, nil 3338 // { 3339 // "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.", 3340 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}", 3341 // "httpMethod": "GET", 3342 // "id": "cloudidentity.customers.userinvitations.get", 3343 // "parameterOrder": [ 3344 // "name" 3345 // ], 3346 // "parameters": { 3347 // "name": { 3348 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3349 // "location": "path", 3350 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3351 // "required": true, 3352 // "type": "string" 3353 // } 3354 // }, 3355 // "path": "v1beta1/{+name}", 3356 // "response": { 3357 // "$ref": "UserInvitation" 3358 // } 3359 // } 3360 3361} 3362 3363// method id "cloudidentity.customers.userinvitations.isInvitableUser": 3364 3365type CustomersUserinvitationsIsInvitableUserCall struct { 3366 s *Service 3367 name string 3368 urlParams_ gensupport.URLParams 3369 ifNoneMatch_ string 3370 ctx_ context.Context 3371 header_ http.Header 3372} 3373 3374// IsInvitableUser: Verifies whether a user account is eligible to 3375// receive a UserInvitation (is an unmanaged account). Eligibility is 3376// based on the following criteria: * the email address is a consumer 3377// account and it's the primary email address of the account, and * the 3378// domain of the email address matches an existing verified Google 3379// Workspace or Cloud Identity domain If both conditions are met, the 3380// user is eligible. **Note:** This method is not supported for 3381// Workspace Essentials customers. 3382// 3383// - name: `UserInvitation` name in the format 3384// `customers/{customer}/userinvitations/{user_email_address}`. 3385func (r *CustomersUserinvitationsService) IsInvitableUser(name string) *CustomersUserinvitationsIsInvitableUserCall { 3386 c := &CustomersUserinvitationsIsInvitableUserCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3387 c.name = name 3388 return c 3389} 3390 3391// Fields allows partial responses to be retrieved. See 3392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3393// for more information. 3394func (c *CustomersUserinvitationsIsInvitableUserCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsIsInvitableUserCall { 3395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3396 return c 3397} 3398 3399// IfNoneMatch sets the optional parameter which makes the operation 3400// fail if the object's ETag matches the given value. This is useful for 3401// getting updates only after the object has changed since the last 3402// request. Use googleapi.IsNotModified to check whether the response 3403// error from Do is the result of In-None-Match. 3404func (c *CustomersUserinvitationsIsInvitableUserCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsIsInvitableUserCall { 3405 c.ifNoneMatch_ = entityTag 3406 return c 3407} 3408 3409// Context sets the context to be used in this call's Do method. Any 3410// pending HTTP request will be aborted if the provided context is 3411// canceled. 3412func (c *CustomersUserinvitationsIsInvitableUserCall) Context(ctx context.Context) *CustomersUserinvitationsIsInvitableUserCall { 3413 c.ctx_ = ctx 3414 return c 3415} 3416 3417// Header returns an http.Header that can be modified by the caller to 3418// add HTTP headers to the request. 3419func (c *CustomersUserinvitationsIsInvitableUserCall) Header() http.Header { 3420 if c.header_ == nil { 3421 c.header_ = make(http.Header) 3422 } 3423 return c.header_ 3424} 3425 3426func (c *CustomersUserinvitationsIsInvitableUserCall) doRequest(alt string) (*http.Response, error) { 3427 reqHeaders := make(http.Header) 3428 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3429 for k, v := range c.header_ { 3430 reqHeaders[k] = v 3431 } 3432 reqHeaders.Set("User-Agent", c.s.userAgent()) 3433 if c.ifNoneMatch_ != "" { 3434 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3435 } 3436 var body io.Reader = nil 3437 c.urlParams_.Set("alt", alt) 3438 c.urlParams_.Set("prettyPrint", "false") 3439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:isInvitableUser") 3440 urls += "?" + c.urlParams_.Encode() 3441 req, err := http.NewRequest("GET", urls, body) 3442 if err != nil { 3443 return nil, err 3444 } 3445 req.Header = reqHeaders 3446 googleapi.Expand(req.URL, map[string]string{ 3447 "name": c.name, 3448 }) 3449 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3450} 3451 3452// Do executes the "cloudidentity.customers.userinvitations.isInvitableUser" call. 3453// Exactly one of *IsInvitableUserResponse or error will be non-nil. Any 3454// non-2xx status code is an error. Response headers are in either 3455// *IsInvitableUserResponse.ServerResponse.Header or (if a response was 3456// returned at all) in error.(*googleapi.Error).Header. Use 3457// googleapi.IsNotModified to check whether the returned error was 3458// because http.StatusNotModified was returned. 3459func (c *CustomersUserinvitationsIsInvitableUserCall) Do(opts ...googleapi.CallOption) (*IsInvitableUserResponse, error) { 3460 gensupport.SetOptions(c.urlParams_, opts...) 3461 res, err := c.doRequest("json") 3462 if res != nil && res.StatusCode == http.StatusNotModified { 3463 if res.Body != nil { 3464 res.Body.Close() 3465 } 3466 return nil, &googleapi.Error{ 3467 Code: res.StatusCode, 3468 Header: res.Header, 3469 } 3470 } 3471 if err != nil { 3472 return nil, err 3473 } 3474 defer googleapi.CloseBody(res) 3475 if err := googleapi.CheckResponse(res); err != nil { 3476 return nil, err 3477 } 3478 ret := &IsInvitableUserResponse{ 3479 ServerResponse: googleapi.ServerResponse{ 3480 Header: res.Header, 3481 HTTPStatusCode: res.StatusCode, 3482 }, 3483 } 3484 target := &ret 3485 if err := gensupport.DecodeResponse(target, res); err != nil { 3486 return nil, err 3487 } 3488 return ret, nil 3489 // { 3490 // "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.", 3491 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:isInvitableUser", 3492 // "httpMethod": "GET", 3493 // "id": "cloudidentity.customers.userinvitations.isInvitableUser", 3494 // "parameterOrder": [ 3495 // "name" 3496 // ], 3497 // "parameters": { 3498 // "name": { 3499 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3500 // "location": "path", 3501 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3502 // "required": true, 3503 // "type": "string" 3504 // } 3505 // }, 3506 // "path": "v1beta1/{+name}:isInvitableUser", 3507 // "response": { 3508 // "$ref": "IsInvitableUserResponse" 3509 // } 3510 // } 3511 3512} 3513 3514// method id "cloudidentity.customers.userinvitations.list": 3515 3516type CustomersUserinvitationsListCall struct { 3517 s *Service 3518 parent string 3519 urlParams_ gensupport.URLParams 3520 ifNoneMatch_ string 3521 ctx_ context.Context 3522 header_ http.Header 3523} 3524 3525// List: Retrieves a list of UserInvitation resources. **Note:** New 3526// consumer accounts with the customer's verified domain created within 3527// the previous 48 hours will not appear in the result. This delay also 3528// applies to newly-verified domains. 3529// 3530// - parent: The customer ID of the Google Workspace or Cloud Identity 3531// account the UserInvitation resources are associated with. 3532func (r *CustomersUserinvitationsService) List(parent string) *CustomersUserinvitationsListCall { 3533 c := &CustomersUserinvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3534 c.parent = parent 3535 return c 3536} 3537 3538// Filter sets the optional parameter "filter": A query string for 3539// filtering `UserInvitation` results by their current state, in the 3540// format: "state=='invited'". 3541func (c *CustomersUserinvitationsListCall) Filter(filter string) *CustomersUserinvitationsListCall { 3542 c.urlParams_.Set("filter", filter) 3543 return c 3544} 3545 3546// OrderBy sets the optional parameter "orderBy": The sort order of the 3547// list results. You can sort the results in descending order based on 3548// either email or last update timestamp but not both, using 3549// `order_by="email desc". Currently, sorting is supported for 3550// `update_time asc`, `update_time desc`, `email asc`, and `email desc`. 3551// If not specified, results will be returned based on `email asc` 3552// order. 3553func (c *CustomersUserinvitationsListCall) OrderBy(orderBy string) *CustomersUserinvitationsListCall { 3554 c.urlParams_.Set("orderBy", orderBy) 3555 return c 3556} 3557 3558// PageSize sets the optional parameter "pageSize": The maximum number 3559// of UserInvitation resources to return. If unspecified, at most 100 3560// resources will be returned. The maximum value is 200; values above 3561// 200 will be set to 200. 3562func (c *CustomersUserinvitationsListCall) PageSize(pageSize int64) *CustomersUserinvitationsListCall { 3563 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3564 return c 3565} 3566 3567// PageToken sets the optional parameter "pageToken": A page token, 3568// received from a previous `ListUserInvitations` call. Provide this to 3569// retrieve the subsequent page. When paginating, all other parameters 3570// provided to `ListBooks` must match the call that provided the page 3571// token. 3572func (c *CustomersUserinvitationsListCall) PageToken(pageToken string) *CustomersUserinvitationsListCall { 3573 c.urlParams_.Set("pageToken", pageToken) 3574 return c 3575} 3576 3577// Fields allows partial responses to be retrieved. See 3578// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3579// for more information. 3580func (c *CustomersUserinvitationsListCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsListCall { 3581 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3582 return c 3583} 3584 3585// IfNoneMatch sets the optional parameter which makes the operation 3586// fail if the object's ETag matches the given value. This is useful for 3587// getting updates only after the object has changed since the last 3588// request. Use googleapi.IsNotModified to check whether the response 3589// error from Do is the result of In-None-Match. 3590func (c *CustomersUserinvitationsListCall) IfNoneMatch(entityTag string) *CustomersUserinvitationsListCall { 3591 c.ifNoneMatch_ = entityTag 3592 return c 3593} 3594 3595// Context sets the context to be used in this call's Do method. Any 3596// pending HTTP request will be aborted if the provided context is 3597// canceled. 3598func (c *CustomersUserinvitationsListCall) Context(ctx context.Context) *CustomersUserinvitationsListCall { 3599 c.ctx_ = ctx 3600 return c 3601} 3602 3603// Header returns an http.Header that can be modified by the caller to 3604// add HTTP headers to the request. 3605func (c *CustomersUserinvitationsListCall) Header() http.Header { 3606 if c.header_ == nil { 3607 c.header_ = make(http.Header) 3608 } 3609 return c.header_ 3610} 3611 3612func (c *CustomersUserinvitationsListCall) doRequest(alt string) (*http.Response, error) { 3613 reqHeaders := make(http.Header) 3614 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3615 for k, v := range c.header_ { 3616 reqHeaders[k] = v 3617 } 3618 reqHeaders.Set("User-Agent", c.s.userAgent()) 3619 if c.ifNoneMatch_ != "" { 3620 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3621 } 3622 var body io.Reader = nil 3623 c.urlParams_.Set("alt", alt) 3624 c.urlParams_.Set("prettyPrint", "false") 3625 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/userinvitations") 3626 urls += "?" + c.urlParams_.Encode() 3627 req, err := http.NewRequest("GET", urls, body) 3628 if err != nil { 3629 return nil, err 3630 } 3631 req.Header = reqHeaders 3632 googleapi.Expand(req.URL, map[string]string{ 3633 "parent": c.parent, 3634 }) 3635 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3636} 3637 3638// Do executes the "cloudidentity.customers.userinvitations.list" call. 3639// Exactly one of *ListUserInvitationsResponse or error will be non-nil. 3640// Any non-2xx status code is an error. Response headers are in either 3641// *ListUserInvitationsResponse.ServerResponse.Header or (if a response 3642// was returned at all) in error.(*googleapi.Error).Header. Use 3643// googleapi.IsNotModified to check whether the returned error was 3644// because http.StatusNotModified was returned. 3645func (c *CustomersUserinvitationsListCall) Do(opts ...googleapi.CallOption) (*ListUserInvitationsResponse, error) { 3646 gensupport.SetOptions(c.urlParams_, opts...) 3647 res, err := c.doRequest("json") 3648 if res != nil && res.StatusCode == http.StatusNotModified { 3649 if res.Body != nil { 3650 res.Body.Close() 3651 } 3652 return nil, &googleapi.Error{ 3653 Code: res.StatusCode, 3654 Header: res.Header, 3655 } 3656 } 3657 if err != nil { 3658 return nil, err 3659 } 3660 defer googleapi.CloseBody(res) 3661 if err := googleapi.CheckResponse(res); err != nil { 3662 return nil, err 3663 } 3664 ret := &ListUserInvitationsResponse{ 3665 ServerResponse: googleapi.ServerResponse{ 3666 Header: res.Header, 3667 HTTPStatusCode: res.StatusCode, 3668 }, 3669 } 3670 target := &ret 3671 if err := gensupport.DecodeResponse(target, res); err != nil { 3672 return nil, err 3673 } 3674 return ret, nil 3675 // { 3676 // "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.", 3677 // "flatPath": "v1beta1/customers/{customersId}/userinvitations", 3678 // "httpMethod": "GET", 3679 // "id": "cloudidentity.customers.userinvitations.list", 3680 // "parameterOrder": [ 3681 // "parent" 3682 // ], 3683 // "parameters": { 3684 // "filter": { 3685 // "description": "Optional. A query string for filtering `UserInvitation` results by their current state, in the format: `\"state=='invited'\"`.", 3686 // "location": "query", 3687 // "type": "string" 3688 // }, 3689 // "orderBy": { 3690 // "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.", 3691 // "location": "query", 3692 // "type": "string" 3693 // }, 3694 // "pageSize": { 3695 // "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.", 3696 // "format": "int32", 3697 // "location": "query", 3698 // "type": "integer" 3699 // }, 3700 // "pageToken": { 3701 // "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.", 3702 // "location": "query", 3703 // "type": "string" 3704 // }, 3705 // "parent": { 3706 // "description": "Required. The customer ID of the Google Workspace or Cloud Identity account the UserInvitation resources are associated with.", 3707 // "location": "path", 3708 // "pattern": "^customers/[^/]+$", 3709 // "required": true, 3710 // "type": "string" 3711 // } 3712 // }, 3713 // "path": "v1beta1/{+parent}/userinvitations", 3714 // "response": { 3715 // "$ref": "ListUserInvitationsResponse" 3716 // } 3717 // } 3718 3719} 3720 3721// Pages invokes f for each page of results. 3722// A non-nil error returned from f will halt the iteration. 3723// The provided context supersedes any context provided to the Context method. 3724func (c *CustomersUserinvitationsListCall) Pages(ctx context.Context, f func(*ListUserInvitationsResponse) error) error { 3725 c.ctx_ = ctx 3726 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3727 for { 3728 x, err := c.Do() 3729 if err != nil { 3730 return err 3731 } 3732 if err := f(x); err != nil { 3733 return err 3734 } 3735 if x.NextPageToken == "" { 3736 return nil 3737 } 3738 c.PageToken(x.NextPageToken) 3739 } 3740} 3741 3742// method id "cloudidentity.customers.userinvitations.send": 3743 3744type CustomersUserinvitationsSendCall struct { 3745 s *Service 3746 name string 3747 senduserinvitationrequest *SendUserInvitationRequest 3748 urlParams_ gensupport.URLParams 3749 ctx_ context.Context 3750 header_ http.Header 3751} 3752 3753// Send: Sends a UserInvitation to email. If the `UserInvitation` does 3754// not exist for this request and it is a valid request, the request 3755// creates a `UserInvitation`. **Note:** The `get` and `list` methods 3756// have a 48-hour delay where newly-created consumer accounts will not 3757// appear in the results. You can still send a `UserInvitation` to those 3758// accounts if you know the unmanaged email address and 3759// IsInvitableUser==True. 3760// 3761// - name: `UserInvitation` name in the format 3762// `customers/{customer}/userinvitations/{user_email_address}`. 3763func (r *CustomersUserinvitationsService) Send(name string, senduserinvitationrequest *SendUserInvitationRequest) *CustomersUserinvitationsSendCall { 3764 c := &CustomersUserinvitationsSendCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3765 c.name = name 3766 c.senduserinvitationrequest = senduserinvitationrequest 3767 return c 3768} 3769 3770// Fields allows partial responses to be retrieved. See 3771// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3772// for more information. 3773func (c *CustomersUserinvitationsSendCall) Fields(s ...googleapi.Field) *CustomersUserinvitationsSendCall { 3774 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3775 return c 3776} 3777 3778// Context sets the context to be used in this call's Do method. Any 3779// pending HTTP request will be aborted if the provided context is 3780// canceled. 3781func (c *CustomersUserinvitationsSendCall) Context(ctx context.Context) *CustomersUserinvitationsSendCall { 3782 c.ctx_ = ctx 3783 return c 3784} 3785 3786// Header returns an http.Header that can be modified by the caller to 3787// add HTTP headers to the request. 3788func (c *CustomersUserinvitationsSendCall) Header() http.Header { 3789 if c.header_ == nil { 3790 c.header_ = make(http.Header) 3791 } 3792 return c.header_ 3793} 3794 3795func (c *CustomersUserinvitationsSendCall) doRequest(alt string) (*http.Response, error) { 3796 reqHeaders := make(http.Header) 3797 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3798 for k, v := range c.header_ { 3799 reqHeaders[k] = v 3800 } 3801 reqHeaders.Set("User-Agent", c.s.userAgent()) 3802 var body io.Reader = nil 3803 body, err := googleapi.WithoutDataWrapper.JSONReader(c.senduserinvitationrequest) 3804 if err != nil { 3805 return nil, err 3806 } 3807 reqHeaders.Set("Content-Type", "application/json") 3808 c.urlParams_.Set("alt", alt) 3809 c.urlParams_.Set("prettyPrint", "false") 3810 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:send") 3811 urls += "?" + c.urlParams_.Encode() 3812 req, err := http.NewRequest("POST", urls, body) 3813 if err != nil { 3814 return nil, err 3815 } 3816 req.Header = reqHeaders 3817 googleapi.Expand(req.URL, map[string]string{ 3818 "name": c.name, 3819 }) 3820 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3821} 3822 3823// Do executes the "cloudidentity.customers.userinvitations.send" call. 3824// Exactly one of *Operation or error will be non-nil. Any non-2xx 3825// status code is an error. Response headers are in either 3826// *Operation.ServerResponse.Header or (if a response was returned at 3827// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3828// to check whether the returned error was because 3829// http.StatusNotModified was returned. 3830func (c *CustomersUserinvitationsSendCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3831 gensupport.SetOptions(c.urlParams_, opts...) 3832 res, err := c.doRequest("json") 3833 if res != nil && res.StatusCode == http.StatusNotModified { 3834 if res.Body != nil { 3835 res.Body.Close() 3836 } 3837 return nil, &googleapi.Error{ 3838 Code: res.StatusCode, 3839 Header: res.Header, 3840 } 3841 } 3842 if err != nil { 3843 return nil, err 3844 } 3845 defer googleapi.CloseBody(res) 3846 if err := googleapi.CheckResponse(res); err != nil { 3847 return nil, err 3848 } 3849 ret := &Operation{ 3850 ServerResponse: googleapi.ServerResponse{ 3851 Header: res.Header, 3852 HTTPStatusCode: res.StatusCode, 3853 }, 3854 } 3855 target := &ret 3856 if err := gensupport.DecodeResponse(target, res); err != nil { 3857 return nil, err 3858 } 3859 return ret, nil 3860 // { 3861 // "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.", 3862 // "flatPath": "v1beta1/customers/{customersId}/userinvitations/{userinvitationsId}:send", 3863 // "httpMethod": "POST", 3864 // "id": "cloudidentity.customers.userinvitations.send", 3865 // "parameterOrder": [ 3866 // "name" 3867 // ], 3868 // "parameters": { 3869 // "name": { 3870 // "description": "Required. `UserInvitation` name in the format `customers/{customer}/userinvitations/{user_email_address}`", 3871 // "location": "path", 3872 // "pattern": "^customers/[^/]+/userinvitations/[^/]+$", 3873 // "required": true, 3874 // "type": "string" 3875 // } 3876 // }, 3877 // "path": "v1beta1/{+name}:send", 3878 // "request": { 3879 // "$ref": "SendUserInvitationRequest" 3880 // }, 3881 // "response": { 3882 // "$ref": "Operation" 3883 // } 3884 // } 3885 3886} 3887 3888// method id "cloudidentity.devices.cancelWipe": 3889 3890type DevicesCancelWipeCall struct { 3891 s *Service 3892 name string 3893 cancelwipedevicerequest *CancelWipeDeviceRequest 3894 urlParams_ gensupport.URLParams 3895 ctx_ context.Context 3896 header_ http.Header 3897} 3898 3899// CancelWipe: Cancels an unfinished device wipe. This operation can be 3900// used to cancel device wipe in the gap between the wipe operation 3901// returning success and the device being wiped. 3902// 3903// - name: Resource name 3904// (https://cloud.google.com/apis/design/resource_names) of the Device 3905// in format: `devices/{device_id}`, where device_id is the unique ID 3906// assigned to the Device. 3907func (r *DevicesService) CancelWipe(name string, cancelwipedevicerequest *CancelWipeDeviceRequest) *DevicesCancelWipeCall { 3908 c := &DevicesCancelWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3909 c.name = name 3910 c.cancelwipedevicerequest = cancelwipedevicerequest 3911 return c 3912} 3913 3914// Fields allows partial responses to be retrieved. See 3915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3916// for more information. 3917func (c *DevicesCancelWipeCall) Fields(s ...googleapi.Field) *DevicesCancelWipeCall { 3918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3919 return c 3920} 3921 3922// Context sets the context to be used in this call's Do method. Any 3923// pending HTTP request will be aborted if the provided context is 3924// canceled. 3925func (c *DevicesCancelWipeCall) Context(ctx context.Context) *DevicesCancelWipeCall { 3926 c.ctx_ = ctx 3927 return c 3928} 3929 3930// Header returns an http.Header that can be modified by the caller to 3931// add HTTP headers to the request. 3932func (c *DevicesCancelWipeCall) Header() http.Header { 3933 if c.header_ == nil { 3934 c.header_ = make(http.Header) 3935 } 3936 return c.header_ 3937} 3938 3939func (c *DevicesCancelWipeCall) doRequest(alt string) (*http.Response, error) { 3940 reqHeaders := make(http.Header) 3941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3942 for k, v := range c.header_ { 3943 reqHeaders[k] = v 3944 } 3945 reqHeaders.Set("User-Agent", c.s.userAgent()) 3946 var body io.Reader = nil 3947 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedevicerequest) 3948 if err != nil { 3949 return nil, err 3950 } 3951 reqHeaders.Set("Content-Type", "application/json") 3952 c.urlParams_.Set("alt", alt) 3953 c.urlParams_.Set("prettyPrint", "false") 3954 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancelWipe") 3955 urls += "?" + c.urlParams_.Encode() 3956 req, err := http.NewRequest("POST", urls, body) 3957 if err != nil { 3958 return nil, err 3959 } 3960 req.Header = reqHeaders 3961 googleapi.Expand(req.URL, map[string]string{ 3962 "name": c.name, 3963 }) 3964 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3965} 3966 3967// Do executes the "cloudidentity.devices.cancelWipe" call. 3968// Exactly one of *Operation or error will be non-nil. Any non-2xx 3969// status code is an error. Response headers are in either 3970// *Operation.ServerResponse.Header or (if a response was returned at 3971// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3972// to check whether the returned error was because 3973// http.StatusNotModified was returned. 3974func (c *DevicesCancelWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3975 gensupport.SetOptions(c.urlParams_, opts...) 3976 res, err := c.doRequest("json") 3977 if res != nil && res.StatusCode == http.StatusNotModified { 3978 if res.Body != nil { 3979 res.Body.Close() 3980 } 3981 return nil, &googleapi.Error{ 3982 Code: res.StatusCode, 3983 Header: res.Header, 3984 } 3985 } 3986 if err != nil { 3987 return nil, err 3988 } 3989 defer googleapi.CloseBody(res) 3990 if err := googleapi.CheckResponse(res); err != nil { 3991 return nil, err 3992 } 3993 ret := &Operation{ 3994 ServerResponse: googleapi.ServerResponse{ 3995 Header: res.Header, 3996 HTTPStatusCode: res.StatusCode, 3997 }, 3998 } 3999 target := &ret 4000 if err := gensupport.DecodeResponse(target, res); err != nil { 4001 return nil, err 4002 } 4003 return ret, nil 4004 // { 4005 // "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.", 4006 // "flatPath": "v1beta1/devices/{devicesId}:cancelWipe", 4007 // "httpMethod": "POST", 4008 // "id": "cloudidentity.devices.cancelWipe", 4009 // "parameterOrder": [ 4010 // "name" 4011 // ], 4012 // "parameters": { 4013 // "name": { 4014 // "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.", 4015 // "location": "path", 4016 // "pattern": "^devices/[^/]+$", 4017 // "required": true, 4018 // "type": "string" 4019 // } 4020 // }, 4021 // "path": "v1beta1/{+name}:cancelWipe", 4022 // "request": { 4023 // "$ref": "CancelWipeDeviceRequest" 4024 // }, 4025 // "response": { 4026 // "$ref": "Operation" 4027 // } 4028 // } 4029 4030} 4031 4032// method id "cloudidentity.devices.create": 4033 4034type DevicesCreateCall struct { 4035 s *Service 4036 createdevicerequest *CreateDeviceRequest 4037 urlParams_ gensupport.URLParams 4038 ctx_ context.Context 4039 header_ http.Header 4040} 4041 4042// Create: Creates a device. Only company-owned device may be created. 4043// **Note**: This method is available only to customers who have one of 4044// the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise 4045// for Education, and Cloud Identity Premium 4046func (r *DevicesService) Create(createdevicerequest *CreateDeviceRequest) *DevicesCreateCall { 4047 c := &DevicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4048 c.createdevicerequest = createdevicerequest 4049 return c 4050} 4051 4052// Fields allows partial responses to be retrieved. See 4053// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4054// for more information. 4055func (c *DevicesCreateCall) Fields(s ...googleapi.Field) *DevicesCreateCall { 4056 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4057 return c 4058} 4059 4060// Context sets the context to be used in this call's Do method. Any 4061// pending HTTP request will be aborted if the provided context is 4062// canceled. 4063func (c *DevicesCreateCall) Context(ctx context.Context) *DevicesCreateCall { 4064 c.ctx_ = ctx 4065 return c 4066} 4067 4068// Header returns an http.Header that can be modified by the caller to 4069// add HTTP headers to the request. 4070func (c *DevicesCreateCall) Header() http.Header { 4071 if c.header_ == nil { 4072 c.header_ = make(http.Header) 4073 } 4074 return c.header_ 4075} 4076 4077func (c *DevicesCreateCall) doRequest(alt string) (*http.Response, error) { 4078 reqHeaders := make(http.Header) 4079 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4080 for k, v := range c.header_ { 4081 reqHeaders[k] = v 4082 } 4083 reqHeaders.Set("User-Agent", c.s.userAgent()) 4084 var body io.Reader = nil 4085 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createdevicerequest) 4086 if err != nil { 4087 return nil, err 4088 } 4089 reqHeaders.Set("Content-Type", "application/json") 4090 c.urlParams_.Set("alt", alt) 4091 c.urlParams_.Set("prettyPrint", "false") 4092 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/devices") 4093 urls += "?" + c.urlParams_.Encode() 4094 req, err := http.NewRequest("POST", urls, body) 4095 if err != nil { 4096 return nil, err 4097 } 4098 req.Header = reqHeaders 4099 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4100} 4101 4102// Do executes the "cloudidentity.devices.create" call. 4103// Exactly one of *Operation or error will be non-nil. Any non-2xx 4104// status code is an error. Response headers are in either 4105// *Operation.ServerResponse.Header or (if a response was returned at 4106// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4107// to check whether the returned error was because 4108// http.StatusNotModified was returned. 4109func (c *DevicesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4110 gensupport.SetOptions(c.urlParams_, opts...) 4111 res, err := c.doRequest("json") 4112 if res != nil && res.StatusCode == http.StatusNotModified { 4113 if res.Body != nil { 4114 res.Body.Close() 4115 } 4116 return nil, &googleapi.Error{ 4117 Code: res.StatusCode, 4118 Header: res.Header, 4119 } 4120 } 4121 if err != nil { 4122 return nil, err 4123 } 4124 defer googleapi.CloseBody(res) 4125 if err := googleapi.CheckResponse(res); err != nil { 4126 return nil, err 4127 } 4128 ret := &Operation{ 4129 ServerResponse: googleapi.ServerResponse{ 4130 Header: res.Header, 4131 HTTPStatusCode: res.StatusCode, 4132 }, 4133 } 4134 target := &ret 4135 if err := gensupport.DecodeResponse(target, res); err != nil { 4136 return nil, err 4137 } 4138 return ret, nil 4139 // { 4140 // "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", 4141 // "flatPath": "v1beta1/devices", 4142 // "httpMethod": "POST", 4143 // "id": "cloudidentity.devices.create", 4144 // "parameterOrder": [], 4145 // "parameters": {}, 4146 // "path": "v1beta1/devices", 4147 // "request": { 4148 // "$ref": "CreateDeviceRequest" 4149 // }, 4150 // "response": { 4151 // "$ref": "Operation" 4152 // } 4153 // } 4154 4155} 4156 4157// method id "cloudidentity.devices.delete": 4158 4159type DevicesDeleteCall struct { 4160 s *Service 4161 name string 4162 urlParams_ gensupport.URLParams 4163 ctx_ context.Context 4164 header_ http.Header 4165} 4166 4167// Delete: Deletes the specified device. 4168// 4169// - name: Resource name 4170// (https://cloud.google.com/apis/design/resource_names) of the Device 4171// in format: `devices/{device_id}`, where device_id is the unique ID 4172// assigned to the Device. 4173func (r *DevicesService) Delete(name string) *DevicesDeleteCall { 4174 c := &DevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4175 c.name = name 4176 return c 4177} 4178 4179// Fields allows partial responses to be retrieved. See 4180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4181// for more information. 4182func (c *DevicesDeleteCall) Fields(s ...googleapi.Field) *DevicesDeleteCall { 4183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4184 return c 4185} 4186 4187// Context sets the context to be used in this call's Do method. Any 4188// pending HTTP request will be aborted if the provided context is 4189// canceled. 4190func (c *DevicesDeleteCall) Context(ctx context.Context) *DevicesDeleteCall { 4191 c.ctx_ = ctx 4192 return c 4193} 4194 4195// Header returns an http.Header that can be modified by the caller to 4196// add HTTP headers to the request. 4197func (c *DevicesDeleteCall) Header() http.Header { 4198 if c.header_ == nil { 4199 c.header_ = make(http.Header) 4200 } 4201 return c.header_ 4202} 4203 4204func (c *DevicesDeleteCall) doRequest(alt string) (*http.Response, error) { 4205 reqHeaders := make(http.Header) 4206 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4207 for k, v := range c.header_ { 4208 reqHeaders[k] = v 4209 } 4210 reqHeaders.Set("User-Agent", c.s.userAgent()) 4211 var body io.Reader = nil 4212 c.urlParams_.Set("alt", alt) 4213 c.urlParams_.Set("prettyPrint", "false") 4214 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4215 urls += "?" + c.urlParams_.Encode() 4216 req, err := http.NewRequest("DELETE", urls, body) 4217 if err != nil { 4218 return nil, err 4219 } 4220 req.Header = reqHeaders 4221 googleapi.Expand(req.URL, map[string]string{ 4222 "name": c.name, 4223 }) 4224 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4225} 4226 4227// Do executes the "cloudidentity.devices.delete" call. 4228// Exactly one of *Operation or error will be non-nil. Any non-2xx 4229// status code is an error. Response headers are in either 4230// *Operation.ServerResponse.Header or (if a response was returned at 4231// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4232// to check whether the returned error was because 4233// http.StatusNotModified was returned. 4234func (c *DevicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4235 gensupport.SetOptions(c.urlParams_, opts...) 4236 res, err := c.doRequest("json") 4237 if res != nil && res.StatusCode == http.StatusNotModified { 4238 if res.Body != nil { 4239 res.Body.Close() 4240 } 4241 return nil, &googleapi.Error{ 4242 Code: res.StatusCode, 4243 Header: res.Header, 4244 } 4245 } 4246 if err != nil { 4247 return nil, err 4248 } 4249 defer googleapi.CloseBody(res) 4250 if err := googleapi.CheckResponse(res); err != nil { 4251 return nil, err 4252 } 4253 ret := &Operation{ 4254 ServerResponse: googleapi.ServerResponse{ 4255 Header: res.Header, 4256 HTTPStatusCode: res.StatusCode, 4257 }, 4258 } 4259 target := &ret 4260 if err := gensupport.DecodeResponse(target, res); err != nil { 4261 return nil, err 4262 } 4263 return ret, nil 4264 // { 4265 // "description": "Deletes the specified device.", 4266 // "flatPath": "v1beta1/devices/{devicesId}", 4267 // "httpMethod": "DELETE", 4268 // "id": "cloudidentity.devices.delete", 4269 // "parameterOrder": [ 4270 // "name" 4271 // ], 4272 // "parameters": { 4273 // "name": { 4274 // "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.", 4275 // "location": "path", 4276 // "pattern": "^devices/[^/]+$", 4277 // "required": true, 4278 // "type": "string" 4279 // } 4280 // }, 4281 // "path": "v1beta1/{+name}", 4282 // "response": { 4283 // "$ref": "Operation" 4284 // } 4285 // } 4286 4287} 4288 4289// method id "cloudidentity.devices.get": 4290 4291type DevicesGetCall struct { 4292 s *Service 4293 name string 4294 urlParams_ gensupport.URLParams 4295 ifNoneMatch_ string 4296 ctx_ context.Context 4297 header_ http.Header 4298} 4299 4300// Get: Retrieves the specified device. 4301// 4302// - name: Resource name 4303// (https://cloud.google.com/apis/design/resource_names) of the Device 4304// in format: `devices/{device_id}`, where device_id is the unique ID 4305// assigned to the Device. 4306func (r *DevicesService) Get(name string) *DevicesGetCall { 4307 c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4308 c.name = name 4309 return c 4310} 4311 4312// Fields allows partial responses to be retrieved. See 4313// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4314// for more information. 4315func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall { 4316 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4317 return c 4318} 4319 4320// IfNoneMatch sets the optional parameter which makes the operation 4321// fail if the object's ETag matches the given value. This is useful for 4322// getting updates only after the object has changed since the last 4323// request. Use googleapi.IsNotModified to check whether the response 4324// error from Do is the result of In-None-Match. 4325func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall { 4326 c.ifNoneMatch_ = entityTag 4327 return c 4328} 4329 4330// Context sets the context to be used in this call's Do method. Any 4331// pending HTTP request will be aborted if the provided context is 4332// canceled. 4333func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall { 4334 c.ctx_ = ctx 4335 return c 4336} 4337 4338// Header returns an http.Header that can be modified by the caller to 4339// add HTTP headers to the request. 4340func (c *DevicesGetCall) Header() http.Header { 4341 if c.header_ == nil { 4342 c.header_ = make(http.Header) 4343 } 4344 return c.header_ 4345} 4346 4347func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { 4348 reqHeaders := make(http.Header) 4349 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4350 for k, v := range c.header_ { 4351 reqHeaders[k] = v 4352 } 4353 reqHeaders.Set("User-Agent", c.s.userAgent()) 4354 if c.ifNoneMatch_ != "" { 4355 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4356 } 4357 var body io.Reader = nil 4358 c.urlParams_.Set("alt", alt) 4359 c.urlParams_.Set("prettyPrint", "false") 4360 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4361 urls += "?" + c.urlParams_.Encode() 4362 req, err := http.NewRequest("GET", urls, body) 4363 if err != nil { 4364 return nil, err 4365 } 4366 req.Header = reqHeaders 4367 googleapi.Expand(req.URL, map[string]string{ 4368 "name": c.name, 4369 }) 4370 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4371} 4372 4373// Do executes the "cloudidentity.devices.get" call. 4374// Exactly one of *Device or error will be non-nil. Any non-2xx status 4375// code is an error. Response headers are in either 4376// *Device.ServerResponse.Header or (if a response was returned at all) 4377// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4378// check whether the returned error was because http.StatusNotModified 4379// was returned. 4380func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) { 4381 gensupport.SetOptions(c.urlParams_, opts...) 4382 res, err := c.doRequest("json") 4383 if res != nil && res.StatusCode == http.StatusNotModified { 4384 if res.Body != nil { 4385 res.Body.Close() 4386 } 4387 return nil, &googleapi.Error{ 4388 Code: res.StatusCode, 4389 Header: res.Header, 4390 } 4391 } 4392 if err != nil { 4393 return nil, err 4394 } 4395 defer googleapi.CloseBody(res) 4396 if err := googleapi.CheckResponse(res); err != nil { 4397 return nil, err 4398 } 4399 ret := &Device{ 4400 ServerResponse: googleapi.ServerResponse{ 4401 Header: res.Header, 4402 HTTPStatusCode: res.StatusCode, 4403 }, 4404 } 4405 target := &ret 4406 if err := gensupport.DecodeResponse(target, res); err != nil { 4407 return nil, err 4408 } 4409 return ret, nil 4410 // { 4411 // "description": "Retrieves the specified device.", 4412 // "flatPath": "v1beta1/devices/{devicesId}", 4413 // "httpMethod": "GET", 4414 // "id": "cloudidentity.devices.get", 4415 // "parameterOrder": [ 4416 // "name" 4417 // ], 4418 // "parameters": { 4419 // "name": { 4420 // "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.", 4421 // "location": "path", 4422 // "pattern": "^devices/[^/]+$", 4423 // "required": true, 4424 // "type": "string" 4425 // } 4426 // }, 4427 // "path": "v1beta1/{+name}", 4428 // "response": { 4429 // "$ref": "Device" 4430 // } 4431 // } 4432 4433} 4434 4435// method id "cloudidentity.devices.list": 4436 4437type DevicesListCall struct { 4438 s *Service 4439 urlParams_ gensupport.URLParams 4440 ifNoneMatch_ string 4441 ctx_ context.Context 4442 header_ http.Header 4443} 4444 4445// List: Lists/Searches devices. 4446func (r *DevicesService) List() *DevicesListCall { 4447 c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4448 return c 4449} 4450 4451// Filter sets the optional parameter "filter": Additional restrictions 4452// when fetching list of devices. For a list of search fields, refer to 4453// Mobile device search fields 4454// (https://developers.google.com/admin-sdk/directory/v1/search-operators). 4455// Multiple search fields are separated by the space character. 4456func (c *DevicesListCall) Filter(filter string) *DevicesListCall { 4457 c.urlParams_.Set("filter", filter) 4458 return c 4459} 4460 4461// OrderBy sets the optional parameter "orderBy": Order specification 4462// for devices in the response. Only one of the following field names 4463// may be used to specify the order: `create_time`, `last_sync_time`, 4464// `model`, `os_version`, `device_type` and `serial_number`. `desc` may 4465// be specified optionally to specify results to be sorted in descending 4466// order. Default order is ascending. 4467func (c *DevicesListCall) OrderBy(orderBy string) *DevicesListCall { 4468 c.urlParams_.Set("orderBy", orderBy) 4469 return c 4470} 4471 4472// PageSize sets the optional parameter "pageSize": The maximum number 4473// of Devices to return. If unspecified, at most 20 Devices will be 4474// returned. The maximum value is 100; values above 100 will be coerced 4475// to 100. 4476func (c *DevicesListCall) PageSize(pageSize int64) *DevicesListCall { 4477 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4478 return c 4479} 4480 4481// PageToken sets the optional parameter "pageToken": A page token, 4482// received from a previous `ListDevices` call. Provide this to retrieve 4483// the subsequent page. When paginating, all other parameters provided 4484// to `ListDevices` must match the call that provided the page token. 4485func (c *DevicesListCall) PageToken(pageToken string) *DevicesListCall { 4486 c.urlParams_.Set("pageToken", pageToken) 4487 return c 4488} 4489 4490// View sets the optional parameter "view": The view to use for the List 4491// request. 4492// 4493// Possible values: 4494// "VIEW_UNSPECIFIED" - Default value. The value is unused. 4495// "COMPANY_INVENTORY" - This view contains all devices imported by 4496// the company admin. Each device in the response contains all 4497// information specified by the company admin when importing the device 4498// (i.e. asset tags). 4499// "USER_ASSIGNED_DEVICES" - This view contains all devices with at 4500// least one user registered on the device. Each device in the response 4501// contains all device information, except for asset tags. 4502func (c *DevicesListCall) View(view string) *DevicesListCall { 4503 c.urlParams_.Set("view", view) 4504 return c 4505} 4506 4507// Fields allows partial responses to be retrieved. See 4508// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4509// for more information. 4510func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall { 4511 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4512 return c 4513} 4514 4515// IfNoneMatch sets the optional parameter which makes the operation 4516// fail if the object's ETag matches the given value. This is useful for 4517// getting updates only after the object has changed since the last 4518// request. Use googleapi.IsNotModified to check whether the response 4519// error from Do is the result of In-None-Match. 4520func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall { 4521 c.ifNoneMatch_ = entityTag 4522 return c 4523} 4524 4525// Context sets the context to be used in this call's Do method. Any 4526// pending HTTP request will be aborted if the provided context is 4527// canceled. 4528func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall { 4529 c.ctx_ = ctx 4530 return c 4531} 4532 4533// Header returns an http.Header that can be modified by the caller to 4534// add HTTP headers to the request. 4535func (c *DevicesListCall) Header() http.Header { 4536 if c.header_ == nil { 4537 c.header_ = make(http.Header) 4538 } 4539 return c.header_ 4540} 4541 4542func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { 4543 reqHeaders := make(http.Header) 4544 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4545 for k, v := range c.header_ { 4546 reqHeaders[k] = v 4547 } 4548 reqHeaders.Set("User-Agent", c.s.userAgent()) 4549 if c.ifNoneMatch_ != "" { 4550 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4551 } 4552 var body io.Reader = nil 4553 c.urlParams_.Set("alt", alt) 4554 c.urlParams_.Set("prettyPrint", "false") 4555 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/devices") 4556 urls += "?" + c.urlParams_.Encode() 4557 req, err := http.NewRequest("GET", urls, body) 4558 if err != nil { 4559 return nil, err 4560 } 4561 req.Header = reqHeaders 4562 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4563} 4564 4565// Do executes the "cloudidentity.devices.list" call. 4566// Exactly one of *ListDevicesResponse or error will be non-nil. Any 4567// non-2xx status code is an error. Response headers are in either 4568// *ListDevicesResponse.ServerResponse.Header or (if a response was 4569// returned at all) in error.(*googleapi.Error).Header. Use 4570// googleapi.IsNotModified to check whether the returned error was 4571// because http.StatusNotModified was returned. 4572func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*ListDevicesResponse, error) { 4573 gensupport.SetOptions(c.urlParams_, opts...) 4574 res, err := c.doRequest("json") 4575 if res != nil && res.StatusCode == http.StatusNotModified { 4576 if res.Body != nil { 4577 res.Body.Close() 4578 } 4579 return nil, &googleapi.Error{ 4580 Code: res.StatusCode, 4581 Header: res.Header, 4582 } 4583 } 4584 if err != nil { 4585 return nil, err 4586 } 4587 defer googleapi.CloseBody(res) 4588 if err := googleapi.CheckResponse(res); err != nil { 4589 return nil, err 4590 } 4591 ret := &ListDevicesResponse{ 4592 ServerResponse: googleapi.ServerResponse{ 4593 Header: res.Header, 4594 HTTPStatusCode: res.StatusCode, 4595 }, 4596 } 4597 target := &ret 4598 if err := gensupport.DecodeResponse(target, res); err != nil { 4599 return nil, err 4600 } 4601 return ret, nil 4602 // { 4603 // "description": "Lists/Searches devices.", 4604 // "flatPath": "v1beta1/devices", 4605 // "httpMethod": "GET", 4606 // "id": "cloudidentity.devices.list", 4607 // "parameterOrder": [], 4608 // "parameters": { 4609 // "filter": { 4610 // "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.", 4611 // "location": "query", 4612 // "type": "string" 4613 // }, 4614 // "orderBy": { 4615 // "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.", 4616 // "location": "query", 4617 // "type": "string" 4618 // }, 4619 // "pageSize": { 4620 // "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.", 4621 // "format": "int32", 4622 // "location": "query", 4623 // "type": "integer" 4624 // }, 4625 // "pageToken": { 4626 // "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.", 4627 // "location": "query", 4628 // "type": "string" 4629 // }, 4630 // "view": { 4631 // "description": "Optional. The view to use for the List request.", 4632 // "enum": [ 4633 // "VIEW_UNSPECIFIED", 4634 // "COMPANY_INVENTORY", 4635 // "USER_ASSIGNED_DEVICES" 4636 // ], 4637 // "enumDescriptions": [ 4638 // "Default value. The value is unused.", 4639 // "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).", 4640 // "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." 4641 // ], 4642 // "location": "query", 4643 // "type": "string" 4644 // } 4645 // }, 4646 // "path": "v1beta1/devices", 4647 // "response": { 4648 // "$ref": "ListDevicesResponse" 4649 // } 4650 // } 4651 4652} 4653 4654// Pages invokes f for each page of results. 4655// A non-nil error returned from f will halt the iteration. 4656// The provided context supersedes any context provided to the Context method. 4657func (c *DevicesListCall) Pages(ctx context.Context, f func(*ListDevicesResponse) error) error { 4658 c.ctx_ = ctx 4659 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4660 for { 4661 x, err := c.Do() 4662 if err != nil { 4663 return err 4664 } 4665 if err := f(x); err != nil { 4666 return err 4667 } 4668 if x.NextPageToken == "" { 4669 return nil 4670 } 4671 c.PageToken(x.NextPageToken) 4672 } 4673} 4674 4675// method id "cloudidentity.devices.wipe": 4676 4677type DevicesWipeCall struct { 4678 s *Service 4679 name string 4680 wipedevicerequest *WipeDeviceRequest 4681 urlParams_ gensupport.URLParams 4682 ctx_ context.Context 4683 header_ http.Header 4684} 4685 4686// Wipe: Wipes all data on the specified device. 4687// 4688// - name: Resource name 4689// (https://cloud.google.com/apis/design/resource_names) of the Device 4690// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 4691// where device_id is the unique ID assigned to the Device, and 4692// device_user_id is the unique ID assigned to the User. 4693func (r *DevicesService) Wipe(name string, wipedevicerequest *WipeDeviceRequest) *DevicesWipeCall { 4694 c := &DevicesWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4695 c.name = name 4696 c.wipedevicerequest = wipedevicerequest 4697 return c 4698} 4699 4700// Fields allows partial responses to be retrieved. See 4701// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4702// for more information. 4703func (c *DevicesWipeCall) Fields(s ...googleapi.Field) *DevicesWipeCall { 4704 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4705 return c 4706} 4707 4708// Context sets the context to be used in this call's Do method. Any 4709// pending HTTP request will be aborted if the provided context is 4710// canceled. 4711func (c *DevicesWipeCall) Context(ctx context.Context) *DevicesWipeCall { 4712 c.ctx_ = ctx 4713 return c 4714} 4715 4716// Header returns an http.Header that can be modified by the caller to 4717// add HTTP headers to the request. 4718func (c *DevicesWipeCall) Header() http.Header { 4719 if c.header_ == nil { 4720 c.header_ = make(http.Header) 4721 } 4722 return c.header_ 4723} 4724 4725func (c *DevicesWipeCall) doRequest(alt string) (*http.Response, error) { 4726 reqHeaders := make(http.Header) 4727 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4728 for k, v := range c.header_ { 4729 reqHeaders[k] = v 4730 } 4731 reqHeaders.Set("User-Agent", c.s.userAgent()) 4732 var body io.Reader = nil 4733 body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedevicerequest) 4734 if err != nil { 4735 return nil, err 4736 } 4737 reqHeaders.Set("Content-Type", "application/json") 4738 c.urlParams_.Set("alt", alt) 4739 c.urlParams_.Set("prettyPrint", "false") 4740 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wipe") 4741 urls += "?" + c.urlParams_.Encode() 4742 req, err := http.NewRequest("POST", urls, body) 4743 if err != nil { 4744 return nil, err 4745 } 4746 req.Header = reqHeaders 4747 googleapi.Expand(req.URL, map[string]string{ 4748 "name": c.name, 4749 }) 4750 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4751} 4752 4753// Do executes the "cloudidentity.devices.wipe" call. 4754// Exactly one of *Operation or error will be non-nil. Any non-2xx 4755// status code is an error. Response headers are in either 4756// *Operation.ServerResponse.Header or (if a response was returned at 4757// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4758// to check whether the returned error was because 4759// http.StatusNotModified was returned. 4760func (c *DevicesWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4761 gensupport.SetOptions(c.urlParams_, opts...) 4762 res, err := c.doRequest("json") 4763 if res != nil && res.StatusCode == http.StatusNotModified { 4764 if res.Body != nil { 4765 res.Body.Close() 4766 } 4767 return nil, &googleapi.Error{ 4768 Code: res.StatusCode, 4769 Header: res.Header, 4770 } 4771 } 4772 if err != nil { 4773 return nil, err 4774 } 4775 defer googleapi.CloseBody(res) 4776 if err := googleapi.CheckResponse(res); err != nil { 4777 return nil, err 4778 } 4779 ret := &Operation{ 4780 ServerResponse: googleapi.ServerResponse{ 4781 Header: res.Header, 4782 HTTPStatusCode: res.StatusCode, 4783 }, 4784 } 4785 target := &ret 4786 if err := gensupport.DecodeResponse(target, res); err != nil { 4787 return nil, err 4788 } 4789 return ret, nil 4790 // { 4791 // "description": "Wipes all data on the specified device.", 4792 // "flatPath": "v1beta1/devices/{devicesId}:wipe", 4793 // "httpMethod": "POST", 4794 // "id": "cloudidentity.devices.wipe", 4795 // "parameterOrder": [ 4796 // "name" 4797 // ], 4798 // "parameters": { 4799 // "name": { 4800 // "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.", 4801 // "location": "path", 4802 // "pattern": "^devices/[^/]+$", 4803 // "required": true, 4804 // "type": "string" 4805 // } 4806 // }, 4807 // "path": "v1beta1/{+name}:wipe", 4808 // "request": { 4809 // "$ref": "WipeDeviceRequest" 4810 // }, 4811 // "response": { 4812 // "$ref": "Operation" 4813 // } 4814 // } 4815 4816} 4817 4818// method id "cloudidentity.devices.deviceUsers.approve": 4819 4820type DevicesDeviceUsersApproveCall struct { 4821 s *Service 4822 name string 4823 approvedeviceuserrequest *ApproveDeviceUserRequest 4824 urlParams_ gensupport.URLParams 4825 ctx_ context.Context 4826 header_ http.Header 4827} 4828 4829// Approve: Approves device to access user data. 4830// 4831// - name: Resource name 4832// (https://cloud.google.com/apis/design/resource_names) of the Device 4833// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 4834// where device_id is the unique ID assigned to the Device, and 4835// device_user_id is the unique ID assigned to the User. 4836func (r *DevicesDeviceUsersService) Approve(name string, approvedeviceuserrequest *ApproveDeviceUserRequest) *DevicesDeviceUsersApproveCall { 4837 c := &DevicesDeviceUsersApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4838 c.name = name 4839 c.approvedeviceuserrequest = approvedeviceuserrequest 4840 return c 4841} 4842 4843// Fields allows partial responses to be retrieved. See 4844// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4845// for more information. 4846func (c *DevicesDeviceUsersApproveCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersApproveCall { 4847 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4848 return c 4849} 4850 4851// Context sets the context to be used in this call's Do method. Any 4852// pending HTTP request will be aborted if the provided context is 4853// canceled. 4854func (c *DevicesDeviceUsersApproveCall) Context(ctx context.Context) *DevicesDeviceUsersApproveCall { 4855 c.ctx_ = ctx 4856 return c 4857} 4858 4859// Header returns an http.Header that can be modified by the caller to 4860// add HTTP headers to the request. 4861func (c *DevicesDeviceUsersApproveCall) Header() http.Header { 4862 if c.header_ == nil { 4863 c.header_ = make(http.Header) 4864 } 4865 return c.header_ 4866} 4867 4868func (c *DevicesDeviceUsersApproveCall) doRequest(alt string) (*http.Response, error) { 4869 reqHeaders := make(http.Header) 4870 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4871 for k, v := range c.header_ { 4872 reqHeaders[k] = v 4873 } 4874 reqHeaders.Set("User-Agent", c.s.userAgent()) 4875 var body io.Reader = nil 4876 body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvedeviceuserrequest) 4877 if err != nil { 4878 return nil, err 4879 } 4880 reqHeaders.Set("Content-Type", "application/json") 4881 c.urlParams_.Set("alt", alt) 4882 c.urlParams_.Set("prettyPrint", "false") 4883 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:approve") 4884 urls += "?" + c.urlParams_.Encode() 4885 req, err := http.NewRequest("POST", urls, body) 4886 if err != nil { 4887 return nil, err 4888 } 4889 req.Header = reqHeaders 4890 googleapi.Expand(req.URL, map[string]string{ 4891 "name": c.name, 4892 }) 4893 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4894} 4895 4896// Do executes the "cloudidentity.devices.deviceUsers.approve" call. 4897// Exactly one of *Operation or error will be non-nil. Any non-2xx 4898// status code is an error. Response headers are in either 4899// *Operation.ServerResponse.Header or (if a response was returned at 4900// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4901// to check whether the returned error was because 4902// http.StatusNotModified was returned. 4903func (c *DevicesDeviceUsersApproveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4904 gensupport.SetOptions(c.urlParams_, opts...) 4905 res, err := c.doRequest("json") 4906 if res != nil && res.StatusCode == http.StatusNotModified { 4907 if res.Body != nil { 4908 res.Body.Close() 4909 } 4910 return nil, &googleapi.Error{ 4911 Code: res.StatusCode, 4912 Header: res.Header, 4913 } 4914 } 4915 if err != nil { 4916 return nil, err 4917 } 4918 defer googleapi.CloseBody(res) 4919 if err := googleapi.CheckResponse(res); err != nil { 4920 return nil, err 4921 } 4922 ret := &Operation{ 4923 ServerResponse: googleapi.ServerResponse{ 4924 Header: res.Header, 4925 HTTPStatusCode: res.StatusCode, 4926 }, 4927 } 4928 target := &ret 4929 if err := gensupport.DecodeResponse(target, res); err != nil { 4930 return nil, err 4931 } 4932 return ret, nil 4933 // { 4934 // "description": "Approves device to access user data.", 4935 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:approve", 4936 // "httpMethod": "POST", 4937 // "id": "cloudidentity.devices.deviceUsers.approve", 4938 // "parameterOrder": [ 4939 // "name" 4940 // ], 4941 // "parameters": { 4942 // "name": { 4943 // "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.", 4944 // "location": "path", 4945 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 4946 // "required": true, 4947 // "type": "string" 4948 // } 4949 // }, 4950 // "path": "v1beta1/{+name}:approve", 4951 // "request": { 4952 // "$ref": "ApproveDeviceUserRequest" 4953 // }, 4954 // "response": { 4955 // "$ref": "Operation" 4956 // } 4957 // } 4958 4959} 4960 4961// method id "cloudidentity.devices.deviceUsers.block": 4962 4963type DevicesDeviceUsersBlockCall struct { 4964 s *Service 4965 name string 4966 blockdeviceuserrequest *BlockDeviceUserRequest 4967 urlParams_ gensupport.URLParams 4968 ctx_ context.Context 4969 header_ http.Header 4970} 4971 4972// Block: Blocks device from accessing user data 4973// 4974// - name: Resource name 4975// (https://cloud.google.com/apis/design/resource_names) of the Device 4976// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 4977// where device_id is the unique ID assigned to the Device, and 4978// device_user_id is the unique ID assigned to the User. 4979func (r *DevicesDeviceUsersService) Block(name string, blockdeviceuserrequest *BlockDeviceUserRequest) *DevicesDeviceUsersBlockCall { 4980 c := &DevicesDeviceUsersBlockCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4981 c.name = name 4982 c.blockdeviceuserrequest = blockdeviceuserrequest 4983 return c 4984} 4985 4986// Fields allows partial responses to be retrieved. See 4987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4988// for more information. 4989func (c *DevicesDeviceUsersBlockCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersBlockCall { 4990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4991 return c 4992} 4993 4994// Context sets the context to be used in this call's Do method. Any 4995// pending HTTP request will be aborted if the provided context is 4996// canceled. 4997func (c *DevicesDeviceUsersBlockCall) Context(ctx context.Context) *DevicesDeviceUsersBlockCall { 4998 c.ctx_ = ctx 4999 return c 5000} 5001 5002// Header returns an http.Header that can be modified by the caller to 5003// add HTTP headers to the request. 5004func (c *DevicesDeviceUsersBlockCall) Header() http.Header { 5005 if c.header_ == nil { 5006 c.header_ = make(http.Header) 5007 } 5008 return c.header_ 5009} 5010 5011func (c *DevicesDeviceUsersBlockCall) doRequest(alt string) (*http.Response, error) { 5012 reqHeaders := make(http.Header) 5013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5014 for k, v := range c.header_ { 5015 reqHeaders[k] = v 5016 } 5017 reqHeaders.Set("User-Agent", c.s.userAgent()) 5018 var body io.Reader = nil 5019 body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockdeviceuserrequest) 5020 if err != nil { 5021 return nil, err 5022 } 5023 reqHeaders.Set("Content-Type", "application/json") 5024 c.urlParams_.Set("alt", alt) 5025 c.urlParams_.Set("prettyPrint", "false") 5026 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:block") 5027 urls += "?" + c.urlParams_.Encode() 5028 req, err := http.NewRequest("POST", urls, body) 5029 if err != nil { 5030 return nil, err 5031 } 5032 req.Header = reqHeaders 5033 googleapi.Expand(req.URL, map[string]string{ 5034 "name": c.name, 5035 }) 5036 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5037} 5038 5039// Do executes the "cloudidentity.devices.deviceUsers.block" call. 5040// Exactly one of *Operation or error will be non-nil. Any non-2xx 5041// status code is an error. Response headers are in either 5042// *Operation.ServerResponse.Header or (if a response was returned at 5043// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5044// to check whether the returned error was because 5045// http.StatusNotModified was returned. 5046func (c *DevicesDeviceUsersBlockCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5047 gensupport.SetOptions(c.urlParams_, opts...) 5048 res, err := c.doRequest("json") 5049 if res != nil && res.StatusCode == http.StatusNotModified { 5050 if res.Body != nil { 5051 res.Body.Close() 5052 } 5053 return nil, &googleapi.Error{ 5054 Code: res.StatusCode, 5055 Header: res.Header, 5056 } 5057 } 5058 if err != nil { 5059 return nil, err 5060 } 5061 defer googleapi.CloseBody(res) 5062 if err := googleapi.CheckResponse(res); err != nil { 5063 return nil, err 5064 } 5065 ret := &Operation{ 5066 ServerResponse: googleapi.ServerResponse{ 5067 Header: res.Header, 5068 HTTPStatusCode: res.StatusCode, 5069 }, 5070 } 5071 target := &ret 5072 if err := gensupport.DecodeResponse(target, res); err != nil { 5073 return nil, err 5074 } 5075 return ret, nil 5076 // { 5077 // "description": "Blocks device from accessing user data", 5078 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:block", 5079 // "httpMethod": "POST", 5080 // "id": "cloudidentity.devices.deviceUsers.block", 5081 // "parameterOrder": [ 5082 // "name" 5083 // ], 5084 // "parameters": { 5085 // "name": { 5086 // "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.", 5087 // "location": "path", 5088 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5089 // "required": true, 5090 // "type": "string" 5091 // } 5092 // }, 5093 // "path": "v1beta1/{+name}:block", 5094 // "request": { 5095 // "$ref": "BlockDeviceUserRequest" 5096 // }, 5097 // "response": { 5098 // "$ref": "Operation" 5099 // } 5100 // } 5101 5102} 5103 5104// method id "cloudidentity.devices.deviceUsers.cancelWipe": 5105 5106type DevicesDeviceUsersCancelWipeCall struct { 5107 s *Service 5108 name string 5109 cancelwipedeviceuserrequest *CancelWipeDeviceUserRequest 5110 urlParams_ gensupport.URLParams 5111 ctx_ context.Context 5112 header_ http.Header 5113} 5114 5115// CancelWipe: Cancels an unfinished user account wipe. This operation 5116// can be used to cancel device wipe in the gap between the wipe 5117// operation returning success and the device being wiped. 5118// 5119// - name: Resource name 5120// (https://cloud.google.com/apis/design/resource_names) of the Device 5121// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5122// where device_id is the unique ID assigned to the Device, and 5123// device_user_id is the unique ID assigned to the User. 5124func (r *DevicesDeviceUsersService) CancelWipe(name string, cancelwipedeviceuserrequest *CancelWipeDeviceUserRequest) *DevicesDeviceUsersCancelWipeCall { 5125 c := &DevicesDeviceUsersCancelWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5126 c.name = name 5127 c.cancelwipedeviceuserrequest = cancelwipedeviceuserrequest 5128 return c 5129} 5130 5131// Fields allows partial responses to be retrieved. See 5132// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5133// for more information. 5134func (c *DevicesDeviceUsersCancelWipeCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersCancelWipeCall { 5135 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5136 return c 5137} 5138 5139// Context sets the context to be used in this call's Do method. Any 5140// pending HTTP request will be aborted if the provided context is 5141// canceled. 5142func (c *DevicesDeviceUsersCancelWipeCall) Context(ctx context.Context) *DevicesDeviceUsersCancelWipeCall { 5143 c.ctx_ = ctx 5144 return c 5145} 5146 5147// Header returns an http.Header that can be modified by the caller to 5148// add HTTP headers to the request. 5149func (c *DevicesDeviceUsersCancelWipeCall) Header() http.Header { 5150 if c.header_ == nil { 5151 c.header_ = make(http.Header) 5152 } 5153 return c.header_ 5154} 5155 5156func (c *DevicesDeviceUsersCancelWipeCall) doRequest(alt string) (*http.Response, error) { 5157 reqHeaders := make(http.Header) 5158 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5159 for k, v := range c.header_ { 5160 reqHeaders[k] = v 5161 } 5162 reqHeaders.Set("User-Agent", c.s.userAgent()) 5163 var body io.Reader = nil 5164 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelwipedeviceuserrequest) 5165 if err != nil { 5166 return nil, err 5167 } 5168 reqHeaders.Set("Content-Type", "application/json") 5169 c.urlParams_.Set("alt", alt) 5170 c.urlParams_.Set("prettyPrint", "false") 5171 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancelWipe") 5172 urls += "?" + c.urlParams_.Encode() 5173 req, err := http.NewRequest("POST", urls, body) 5174 if err != nil { 5175 return nil, err 5176 } 5177 req.Header = reqHeaders 5178 googleapi.Expand(req.URL, map[string]string{ 5179 "name": c.name, 5180 }) 5181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5182} 5183 5184// Do executes the "cloudidentity.devices.deviceUsers.cancelWipe" call. 5185// Exactly one of *Operation or error will be non-nil. Any non-2xx 5186// status code is an error. Response headers are in either 5187// *Operation.ServerResponse.Header or (if a response was returned at 5188// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5189// to check whether the returned error was because 5190// http.StatusNotModified was returned. 5191func (c *DevicesDeviceUsersCancelWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5192 gensupport.SetOptions(c.urlParams_, opts...) 5193 res, err := c.doRequest("json") 5194 if res != nil && res.StatusCode == http.StatusNotModified { 5195 if res.Body != nil { 5196 res.Body.Close() 5197 } 5198 return nil, &googleapi.Error{ 5199 Code: res.StatusCode, 5200 Header: res.Header, 5201 } 5202 } 5203 if err != nil { 5204 return nil, err 5205 } 5206 defer googleapi.CloseBody(res) 5207 if err := googleapi.CheckResponse(res); err != nil { 5208 return nil, err 5209 } 5210 ret := &Operation{ 5211 ServerResponse: googleapi.ServerResponse{ 5212 Header: res.Header, 5213 HTTPStatusCode: res.StatusCode, 5214 }, 5215 } 5216 target := &ret 5217 if err := gensupport.DecodeResponse(target, res); err != nil { 5218 return nil, err 5219 } 5220 return ret, nil 5221 // { 5222 // "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.", 5223 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:cancelWipe", 5224 // "httpMethod": "POST", 5225 // "id": "cloudidentity.devices.deviceUsers.cancelWipe", 5226 // "parameterOrder": [ 5227 // "name" 5228 // ], 5229 // "parameters": { 5230 // "name": { 5231 // "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.", 5232 // "location": "path", 5233 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5234 // "required": true, 5235 // "type": "string" 5236 // } 5237 // }, 5238 // "path": "v1beta1/{+name}:cancelWipe", 5239 // "request": { 5240 // "$ref": "CancelWipeDeviceUserRequest" 5241 // }, 5242 // "response": { 5243 // "$ref": "Operation" 5244 // } 5245 // } 5246 5247} 5248 5249// method id "cloudidentity.devices.deviceUsers.delete": 5250 5251type DevicesDeviceUsersDeleteCall struct { 5252 s *Service 5253 name string 5254 urlParams_ gensupport.URLParams 5255 ctx_ context.Context 5256 header_ http.Header 5257} 5258 5259// Delete: Deletes the specified DeviceUser. This also revokes the 5260// user's access to device data. 5261// 5262// - name: Resource name 5263// (https://cloud.google.com/apis/design/resource_names) of the Device 5264// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5265// where device_id is the unique ID assigned to the Device, and 5266// device_user_id is the unique ID assigned to the User. 5267func (r *DevicesDeviceUsersService) Delete(name string) *DevicesDeviceUsersDeleteCall { 5268 c := &DevicesDeviceUsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5269 c.name = name 5270 return c 5271} 5272 5273// Fields allows partial responses to be retrieved. See 5274// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5275// for more information. 5276func (c *DevicesDeviceUsersDeleteCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersDeleteCall { 5277 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5278 return c 5279} 5280 5281// Context sets the context to be used in this call's Do method. Any 5282// pending HTTP request will be aborted if the provided context is 5283// canceled. 5284func (c *DevicesDeviceUsersDeleteCall) Context(ctx context.Context) *DevicesDeviceUsersDeleteCall { 5285 c.ctx_ = ctx 5286 return c 5287} 5288 5289// Header returns an http.Header that can be modified by the caller to 5290// add HTTP headers to the request. 5291func (c *DevicesDeviceUsersDeleteCall) Header() http.Header { 5292 if c.header_ == nil { 5293 c.header_ = make(http.Header) 5294 } 5295 return c.header_ 5296} 5297 5298func (c *DevicesDeviceUsersDeleteCall) doRequest(alt string) (*http.Response, error) { 5299 reqHeaders := make(http.Header) 5300 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5301 for k, v := range c.header_ { 5302 reqHeaders[k] = v 5303 } 5304 reqHeaders.Set("User-Agent", c.s.userAgent()) 5305 var body io.Reader = nil 5306 c.urlParams_.Set("alt", alt) 5307 c.urlParams_.Set("prettyPrint", "false") 5308 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5309 urls += "?" + c.urlParams_.Encode() 5310 req, err := http.NewRequest("DELETE", urls, body) 5311 if err != nil { 5312 return nil, err 5313 } 5314 req.Header = reqHeaders 5315 googleapi.Expand(req.URL, map[string]string{ 5316 "name": c.name, 5317 }) 5318 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5319} 5320 5321// Do executes the "cloudidentity.devices.deviceUsers.delete" call. 5322// Exactly one of *Operation or error will be non-nil. Any non-2xx 5323// status code is an error. Response headers are in either 5324// *Operation.ServerResponse.Header or (if a response was returned at 5325// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5326// to check whether the returned error was because 5327// http.StatusNotModified was returned. 5328func (c *DevicesDeviceUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5329 gensupport.SetOptions(c.urlParams_, opts...) 5330 res, err := c.doRequest("json") 5331 if res != nil && res.StatusCode == http.StatusNotModified { 5332 if res.Body != nil { 5333 res.Body.Close() 5334 } 5335 return nil, &googleapi.Error{ 5336 Code: res.StatusCode, 5337 Header: res.Header, 5338 } 5339 } 5340 if err != nil { 5341 return nil, err 5342 } 5343 defer googleapi.CloseBody(res) 5344 if err := googleapi.CheckResponse(res); err != nil { 5345 return nil, err 5346 } 5347 ret := &Operation{ 5348 ServerResponse: googleapi.ServerResponse{ 5349 Header: res.Header, 5350 HTTPStatusCode: res.StatusCode, 5351 }, 5352 } 5353 target := &ret 5354 if err := gensupport.DecodeResponse(target, res); err != nil { 5355 return nil, err 5356 } 5357 return ret, nil 5358 // { 5359 // "description": "Deletes the specified DeviceUser. This also revokes the user's access to device data.", 5360 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}", 5361 // "httpMethod": "DELETE", 5362 // "id": "cloudidentity.devices.deviceUsers.delete", 5363 // "parameterOrder": [ 5364 // "name" 5365 // ], 5366 // "parameters": { 5367 // "name": { 5368 // "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.", 5369 // "location": "path", 5370 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5371 // "required": true, 5372 // "type": "string" 5373 // } 5374 // }, 5375 // "path": "v1beta1/{+name}", 5376 // "response": { 5377 // "$ref": "Operation" 5378 // } 5379 // } 5380 5381} 5382 5383// method id "cloudidentity.devices.deviceUsers.get": 5384 5385type DevicesDeviceUsersGetCall struct { 5386 s *Service 5387 name string 5388 urlParams_ gensupport.URLParams 5389 ifNoneMatch_ string 5390 ctx_ context.Context 5391 header_ http.Header 5392} 5393 5394// Get: Retrieves the specified DeviceUser 5395// 5396// - name: Resource name 5397// (https://cloud.google.com/apis/design/resource_names) of the Device 5398// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 5399// where device_id is the unique ID assigned to the Device, and 5400// device_user_id is the unique ID assigned to the User. 5401func (r *DevicesDeviceUsersService) Get(name string) *DevicesDeviceUsersGetCall { 5402 c := &DevicesDeviceUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5403 c.name = name 5404 return c 5405} 5406 5407// Fields allows partial responses to be retrieved. See 5408// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5409// for more information. 5410func (c *DevicesDeviceUsersGetCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersGetCall { 5411 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5412 return c 5413} 5414 5415// IfNoneMatch sets the optional parameter which makes the operation 5416// fail if the object's ETag matches the given value. This is useful for 5417// getting updates only after the object has changed since the last 5418// request. Use googleapi.IsNotModified to check whether the response 5419// error from Do is the result of In-None-Match. 5420func (c *DevicesDeviceUsersGetCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersGetCall { 5421 c.ifNoneMatch_ = entityTag 5422 return c 5423} 5424 5425// Context sets the context to be used in this call's Do method. Any 5426// pending HTTP request will be aborted if the provided context is 5427// canceled. 5428func (c *DevicesDeviceUsersGetCall) Context(ctx context.Context) *DevicesDeviceUsersGetCall { 5429 c.ctx_ = ctx 5430 return c 5431} 5432 5433// Header returns an http.Header that can be modified by the caller to 5434// add HTTP headers to the request. 5435func (c *DevicesDeviceUsersGetCall) Header() http.Header { 5436 if c.header_ == nil { 5437 c.header_ = make(http.Header) 5438 } 5439 return c.header_ 5440} 5441 5442func (c *DevicesDeviceUsersGetCall) doRequest(alt string) (*http.Response, error) { 5443 reqHeaders := make(http.Header) 5444 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5445 for k, v := range c.header_ { 5446 reqHeaders[k] = v 5447 } 5448 reqHeaders.Set("User-Agent", c.s.userAgent()) 5449 if c.ifNoneMatch_ != "" { 5450 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5451 } 5452 var body io.Reader = nil 5453 c.urlParams_.Set("alt", alt) 5454 c.urlParams_.Set("prettyPrint", "false") 5455 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5456 urls += "?" + c.urlParams_.Encode() 5457 req, err := http.NewRequest("GET", urls, body) 5458 if err != nil { 5459 return nil, err 5460 } 5461 req.Header = reqHeaders 5462 googleapi.Expand(req.URL, map[string]string{ 5463 "name": c.name, 5464 }) 5465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5466} 5467 5468// Do executes the "cloudidentity.devices.deviceUsers.get" call. 5469// Exactly one of *DeviceUser or error will be non-nil. Any non-2xx 5470// status code is an error. Response headers are in either 5471// *DeviceUser.ServerResponse.Header or (if a response was returned at 5472// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5473// to check whether the returned error was because 5474// http.StatusNotModified was returned. 5475func (c *DevicesDeviceUsersGetCall) Do(opts ...googleapi.CallOption) (*DeviceUser, error) { 5476 gensupport.SetOptions(c.urlParams_, opts...) 5477 res, err := c.doRequest("json") 5478 if res != nil && res.StatusCode == http.StatusNotModified { 5479 if res.Body != nil { 5480 res.Body.Close() 5481 } 5482 return nil, &googleapi.Error{ 5483 Code: res.StatusCode, 5484 Header: res.Header, 5485 } 5486 } 5487 if err != nil { 5488 return nil, err 5489 } 5490 defer googleapi.CloseBody(res) 5491 if err := googleapi.CheckResponse(res); err != nil { 5492 return nil, err 5493 } 5494 ret := &DeviceUser{ 5495 ServerResponse: googleapi.ServerResponse{ 5496 Header: res.Header, 5497 HTTPStatusCode: res.StatusCode, 5498 }, 5499 } 5500 target := &ret 5501 if err := gensupport.DecodeResponse(target, res); err != nil { 5502 return nil, err 5503 } 5504 return ret, nil 5505 // { 5506 // "description": "Retrieves the specified DeviceUser", 5507 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}", 5508 // "httpMethod": "GET", 5509 // "id": "cloudidentity.devices.deviceUsers.get", 5510 // "parameterOrder": [ 5511 // "name" 5512 // ], 5513 // "parameters": { 5514 // "name": { 5515 // "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.", 5516 // "location": "path", 5517 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 5518 // "required": true, 5519 // "type": "string" 5520 // } 5521 // }, 5522 // "path": "v1beta1/{+name}", 5523 // "response": { 5524 // "$ref": "DeviceUser" 5525 // } 5526 // } 5527 5528} 5529 5530// method id "cloudidentity.devices.deviceUsers.list": 5531 5532type DevicesDeviceUsersListCall struct { 5533 s *Service 5534 parent string 5535 urlParams_ gensupport.URLParams 5536 ifNoneMatch_ string 5537 ctx_ context.Context 5538 header_ http.Header 5539} 5540 5541// List: Lists/Searches DeviceUsers. 5542// 5543// - parent: To list all DeviceUsers, set this to "devices/-". To list 5544// all DeviceUsers owned by a device, set this to the resource name of 5545// the device. Format: devices/{device}. 5546func (r *DevicesDeviceUsersService) List(parent string) *DevicesDeviceUsersListCall { 5547 c := &DevicesDeviceUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5548 c.parent = parent 5549 return c 5550} 5551 5552// Filter sets the optional parameter "filter": Additional restrictions 5553// when fetching list of devices. For a list of search fields, refer to 5554// Mobile device search fields 5555// (https://developers.google.com/admin-sdk/directory/v1/search-operators). 5556// Multiple search fields are separated by the space character. 5557func (c *DevicesDeviceUsersListCall) Filter(filter string) *DevicesDeviceUsersListCall { 5558 c.urlParams_.Set("filter", filter) 5559 return c 5560} 5561 5562// OrderBy sets the optional parameter "orderBy": Order specification 5563// for devices in the response. 5564func (c *DevicesDeviceUsersListCall) OrderBy(orderBy string) *DevicesDeviceUsersListCall { 5565 c.urlParams_.Set("orderBy", orderBy) 5566 return c 5567} 5568 5569// PageSize sets the optional parameter "pageSize": The maximum number 5570// of DeviceUsers to return. If unspecified, at most 5 DeviceUsers will 5571// be returned. The maximum value is 20; values above 20 will be coerced 5572// to 20. 5573func (c *DevicesDeviceUsersListCall) PageSize(pageSize int64) *DevicesDeviceUsersListCall { 5574 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5575 return c 5576} 5577 5578// PageToken sets the optional parameter "pageToken": A page token, 5579// received from a previous `ListDeviceUsers` call. Provide this to 5580// retrieve the subsequent page. When paginating, all other parameters 5581// provided to `ListBooks` must match the call that provided the page 5582// token. 5583func (c *DevicesDeviceUsersListCall) PageToken(pageToken string) *DevicesDeviceUsersListCall { 5584 c.urlParams_.Set("pageToken", pageToken) 5585 return c 5586} 5587 5588// Fields allows partial responses to be retrieved. See 5589// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5590// for more information. 5591func (c *DevicesDeviceUsersListCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersListCall { 5592 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5593 return c 5594} 5595 5596// IfNoneMatch sets the optional parameter which makes the operation 5597// fail if the object's ETag matches the given value. This is useful for 5598// getting updates only after the object has changed since the last 5599// request. Use googleapi.IsNotModified to check whether the response 5600// error from Do is the result of In-None-Match. 5601func (c *DevicesDeviceUsersListCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersListCall { 5602 c.ifNoneMatch_ = entityTag 5603 return c 5604} 5605 5606// Context sets the context to be used in this call's Do method. Any 5607// pending HTTP request will be aborted if the provided context is 5608// canceled. 5609func (c *DevicesDeviceUsersListCall) Context(ctx context.Context) *DevicesDeviceUsersListCall { 5610 c.ctx_ = ctx 5611 return c 5612} 5613 5614// Header returns an http.Header that can be modified by the caller to 5615// add HTTP headers to the request. 5616func (c *DevicesDeviceUsersListCall) Header() http.Header { 5617 if c.header_ == nil { 5618 c.header_ = make(http.Header) 5619 } 5620 return c.header_ 5621} 5622 5623func (c *DevicesDeviceUsersListCall) doRequest(alt string) (*http.Response, error) { 5624 reqHeaders := make(http.Header) 5625 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5626 for k, v := range c.header_ { 5627 reqHeaders[k] = v 5628 } 5629 reqHeaders.Set("User-Agent", c.s.userAgent()) 5630 if c.ifNoneMatch_ != "" { 5631 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5632 } 5633 var body io.Reader = nil 5634 c.urlParams_.Set("alt", alt) 5635 c.urlParams_.Set("prettyPrint", "false") 5636 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deviceUsers") 5637 urls += "?" + c.urlParams_.Encode() 5638 req, err := http.NewRequest("GET", urls, body) 5639 if err != nil { 5640 return nil, err 5641 } 5642 req.Header = reqHeaders 5643 googleapi.Expand(req.URL, map[string]string{ 5644 "parent": c.parent, 5645 }) 5646 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5647} 5648 5649// Do executes the "cloudidentity.devices.deviceUsers.list" call. 5650// Exactly one of *ListDeviceUsersResponse or error will be non-nil. Any 5651// non-2xx status code is an error. Response headers are in either 5652// *ListDeviceUsersResponse.ServerResponse.Header or (if a response was 5653// returned at all) in error.(*googleapi.Error).Header. Use 5654// googleapi.IsNotModified to check whether the returned error was 5655// because http.StatusNotModified was returned. 5656func (c *DevicesDeviceUsersListCall) Do(opts ...googleapi.CallOption) (*ListDeviceUsersResponse, error) { 5657 gensupport.SetOptions(c.urlParams_, opts...) 5658 res, err := c.doRequest("json") 5659 if res != nil && res.StatusCode == http.StatusNotModified { 5660 if res.Body != nil { 5661 res.Body.Close() 5662 } 5663 return nil, &googleapi.Error{ 5664 Code: res.StatusCode, 5665 Header: res.Header, 5666 } 5667 } 5668 if err != nil { 5669 return nil, err 5670 } 5671 defer googleapi.CloseBody(res) 5672 if err := googleapi.CheckResponse(res); err != nil { 5673 return nil, err 5674 } 5675 ret := &ListDeviceUsersResponse{ 5676 ServerResponse: googleapi.ServerResponse{ 5677 Header: res.Header, 5678 HTTPStatusCode: res.StatusCode, 5679 }, 5680 } 5681 target := &ret 5682 if err := gensupport.DecodeResponse(target, res); err != nil { 5683 return nil, err 5684 } 5685 return ret, nil 5686 // { 5687 // "description": "Lists/Searches DeviceUsers.", 5688 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers", 5689 // "httpMethod": "GET", 5690 // "id": "cloudidentity.devices.deviceUsers.list", 5691 // "parameterOrder": [ 5692 // "parent" 5693 // ], 5694 // "parameters": { 5695 // "filter": { 5696 // "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.", 5697 // "location": "query", 5698 // "type": "string" 5699 // }, 5700 // "orderBy": { 5701 // "description": "Optional. Order specification for devices in the response.", 5702 // "location": "query", 5703 // "type": "string" 5704 // }, 5705 // "pageSize": { 5706 // "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.", 5707 // "format": "int32", 5708 // "location": "query", 5709 // "type": "integer" 5710 // }, 5711 // "pageToken": { 5712 // "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.", 5713 // "location": "query", 5714 // "type": "string" 5715 // }, 5716 // "parent": { 5717 // "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}", 5718 // "location": "path", 5719 // "pattern": "^devices/[^/]+$", 5720 // "required": true, 5721 // "type": "string" 5722 // } 5723 // }, 5724 // "path": "v1beta1/{+parent}/deviceUsers", 5725 // "response": { 5726 // "$ref": "ListDeviceUsersResponse" 5727 // } 5728 // } 5729 5730} 5731 5732// Pages invokes f for each page of results. 5733// A non-nil error returned from f will halt the iteration. 5734// The provided context supersedes any context provided to the Context method. 5735func (c *DevicesDeviceUsersListCall) Pages(ctx context.Context, f func(*ListDeviceUsersResponse) error) error { 5736 c.ctx_ = ctx 5737 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5738 for { 5739 x, err := c.Do() 5740 if err != nil { 5741 return err 5742 } 5743 if err := f(x); err != nil { 5744 return err 5745 } 5746 if x.NextPageToken == "" { 5747 return nil 5748 } 5749 c.PageToken(x.NextPageToken) 5750 } 5751} 5752 5753// method id "cloudidentity.devices.deviceUsers.lookup": 5754 5755type DevicesDeviceUsersLookupCall struct { 5756 s *Service 5757 parent string 5758 urlParams_ gensupport.URLParams 5759 ifNoneMatch_ string 5760 ctx_ context.Context 5761 header_ http.Header 5762} 5763 5764// Lookup: Looks up resource names of the DeviceUsers associated with 5765// the caller's credentials, as well as the properties provided in the 5766// request. This method must be called with end-user credentials with 5767// the scope: 5768// https://www.googleapis.com/auth/cloud-identity.devices.lookup If 5769// multiple properties are provided, only DeviceUsers having all of 5770// these properties are considered as matches - i.e. the query behaves 5771// like an AND. Different platforms require different amounts of 5772// information from the caller to ensure that the DeviceUser is uniquely 5773// identified. - iOS: No properties need to be passed, the caller's 5774// credentials are sufficient to identify the corresponding DeviceUser. 5775// - Android: Specifying the 'android_id' field is required. - Desktop: 5776// Specifying the 'raw_resource_id' field is required. 5777// 5778// - parent: Must be set to "devices/-/deviceUsers" to search across all 5779// DeviceUser belonging to the user. 5780func (r *DevicesDeviceUsersService) Lookup(parent string) *DevicesDeviceUsersLookupCall { 5781 c := &DevicesDeviceUsersLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5782 c.parent = parent 5783 return c 5784} 5785 5786// AndroidId sets the optional parameter "androidId": Android Id 5787// returned by Settings.Secure#ANDROID_ID 5788// (https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). 5789func (c *DevicesDeviceUsersLookupCall) AndroidId(androidId string) *DevicesDeviceUsersLookupCall { 5790 c.urlParams_.Set("androidId", androidId) 5791 return c 5792} 5793 5794// PageSize sets the optional parameter "pageSize": The maximum number 5795// of DeviceUsers to return. If unspecified, at most 20 DeviceUsers will 5796// be returned. The maximum value is 20; values above 20 will be coerced 5797// to 20. 5798func (c *DevicesDeviceUsersLookupCall) PageSize(pageSize int64) *DevicesDeviceUsersLookupCall { 5799 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5800 return c 5801} 5802 5803// PageToken sets the optional parameter "pageToken": A page token, 5804// received from a previous `LookupDeviceUsers` call. Provide this to 5805// retrieve the subsequent page. When paginating, all other parameters 5806// provided to `LookupDeviceUsers` must match the call that provided the 5807// page token. 5808func (c *DevicesDeviceUsersLookupCall) PageToken(pageToken string) *DevicesDeviceUsersLookupCall { 5809 c.urlParams_.Set("pageToken", pageToken) 5810 return c 5811} 5812 5813// RawResourceId sets the optional parameter "rawResourceId": Raw 5814// Resource Id used by Google Endpoint Verification. If the user is 5815// enrolled into Google Endpoint Verification, this id will be saved as 5816// the 'device_resource_id' field in the following platform dependent 5817// files. Mac: ~/.secureConnect/context_aware_config.json Windows: 5818// C:\Users\%USERPROFILE%\.secureConnect\context_aware_config.json 5819// Linux: ~/.secureConnect/context_aware_config.json 5820func (c *DevicesDeviceUsersLookupCall) RawResourceId(rawResourceId string) *DevicesDeviceUsersLookupCall { 5821 c.urlParams_.Set("rawResourceId", rawResourceId) 5822 return c 5823} 5824 5825// UserId sets the optional parameter "userId": The user whose 5826// DeviceUser's resource name will be fetched. Must be set to 'me' to 5827// fetch the DeviceUser's resource name for the calling user. 5828func (c *DevicesDeviceUsersLookupCall) UserId(userId string) *DevicesDeviceUsersLookupCall { 5829 c.urlParams_.Set("userId", userId) 5830 return c 5831} 5832 5833// Fields allows partial responses to be retrieved. See 5834// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5835// for more information. 5836func (c *DevicesDeviceUsersLookupCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersLookupCall { 5837 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5838 return c 5839} 5840 5841// IfNoneMatch sets the optional parameter which makes the operation 5842// fail if the object's ETag matches the given value. This is useful for 5843// getting updates only after the object has changed since the last 5844// request. Use googleapi.IsNotModified to check whether the response 5845// error from Do is the result of In-None-Match. 5846func (c *DevicesDeviceUsersLookupCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersLookupCall { 5847 c.ifNoneMatch_ = entityTag 5848 return c 5849} 5850 5851// Context sets the context to be used in this call's Do method. Any 5852// pending HTTP request will be aborted if the provided context is 5853// canceled. 5854func (c *DevicesDeviceUsersLookupCall) Context(ctx context.Context) *DevicesDeviceUsersLookupCall { 5855 c.ctx_ = ctx 5856 return c 5857} 5858 5859// Header returns an http.Header that can be modified by the caller to 5860// add HTTP headers to the request. 5861func (c *DevicesDeviceUsersLookupCall) Header() http.Header { 5862 if c.header_ == nil { 5863 c.header_ = make(http.Header) 5864 } 5865 return c.header_ 5866} 5867 5868func (c *DevicesDeviceUsersLookupCall) doRequest(alt string) (*http.Response, error) { 5869 reqHeaders := make(http.Header) 5870 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5871 for k, v := range c.header_ { 5872 reqHeaders[k] = v 5873 } 5874 reqHeaders.Set("User-Agent", c.s.userAgent()) 5875 if c.ifNoneMatch_ != "" { 5876 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5877 } 5878 var body io.Reader = nil 5879 c.urlParams_.Set("alt", alt) 5880 c.urlParams_.Set("prettyPrint", "false") 5881 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:lookup") 5882 urls += "?" + c.urlParams_.Encode() 5883 req, err := http.NewRequest("GET", urls, body) 5884 if err != nil { 5885 return nil, err 5886 } 5887 req.Header = reqHeaders 5888 googleapi.Expand(req.URL, map[string]string{ 5889 "parent": c.parent, 5890 }) 5891 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5892} 5893 5894// Do executes the "cloudidentity.devices.deviceUsers.lookup" call. 5895// Exactly one of *LookupSelfDeviceUsersResponse or error will be 5896// non-nil. Any non-2xx status code is an error. Response headers are in 5897// either *LookupSelfDeviceUsersResponse.ServerResponse.Header or (if a 5898// response was returned at all) in error.(*googleapi.Error).Header. Use 5899// googleapi.IsNotModified to check whether the returned error was 5900// because http.StatusNotModified was returned. 5901func (c *DevicesDeviceUsersLookupCall) Do(opts ...googleapi.CallOption) (*LookupSelfDeviceUsersResponse, error) { 5902 gensupport.SetOptions(c.urlParams_, opts...) 5903 res, err := c.doRequest("json") 5904 if res != nil && res.StatusCode == http.StatusNotModified { 5905 if res.Body != nil { 5906 res.Body.Close() 5907 } 5908 return nil, &googleapi.Error{ 5909 Code: res.StatusCode, 5910 Header: res.Header, 5911 } 5912 } 5913 if err != nil { 5914 return nil, err 5915 } 5916 defer googleapi.CloseBody(res) 5917 if err := googleapi.CheckResponse(res); err != nil { 5918 return nil, err 5919 } 5920 ret := &LookupSelfDeviceUsersResponse{ 5921 ServerResponse: googleapi.ServerResponse{ 5922 Header: res.Header, 5923 HTTPStatusCode: res.StatusCode, 5924 }, 5925 } 5926 target := &ret 5927 if err := gensupport.DecodeResponse(target, res); err != nil { 5928 return nil, err 5929 } 5930 return ret, nil 5931 // { 5932 // "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.", 5933 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers:lookup", 5934 // "httpMethod": "GET", 5935 // "id": "cloudidentity.devices.deviceUsers.lookup", 5936 // "parameterOrder": [ 5937 // "parent" 5938 // ], 5939 // "parameters": { 5940 // "androidId": { 5941 // "description": "Android Id returned by [Settings.Secure#ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID).", 5942 // "location": "query", 5943 // "type": "string" 5944 // }, 5945 // "pageSize": { 5946 // "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.", 5947 // "format": "int32", 5948 // "location": "query", 5949 // "type": "integer" 5950 // }, 5951 // "pageToken": { 5952 // "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.", 5953 // "location": "query", 5954 // "type": "string" 5955 // }, 5956 // "parent": { 5957 // "description": "Must be set to \"devices/-/deviceUsers\" to search across all DeviceUser belonging to the user.", 5958 // "location": "path", 5959 // "pattern": "^devices/[^/]+/deviceUsers$", 5960 // "required": true, 5961 // "type": "string" 5962 // }, 5963 // "rawResourceId": { 5964 // "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", 5965 // "location": "query", 5966 // "type": "string" 5967 // }, 5968 // "userId": { 5969 // "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.", 5970 // "location": "query", 5971 // "type": "string" 5972 // } 5973 // }, 5974 // "path": "v1beta1/{+parent}:lookup", 5975 // "response": { 5976 // "$ref": "LookupSelfDeviceUsersResponse" 5977 // }, 5978 // "scopes": [ 5979 // "https://www.googleapis.com/auth/cloud-identity.devices.lookup" 5980 // ] 5981 // } 5982 5983} 5984 5985// Pages invokes f for each page of results. 5986// A non-nil error returned from f will halt the iteration. 5987// The provided context supersedes any context provided to the Context method. 5988func (c *DevicesDeviceUsersLookupCall) Pages(ctx context.Context, f func(*LookupSelfDeviceUsersResponse) error) error { 5989 c.ctx_ = ctx 5990 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5991 for { 5992 x, err := c.Do() 5993 if err != nil { 5994 return err 5995 } 5996 if err := f(x); err != nil { 5997 return err 5998 } 5999 if x.NextPageToken == "" { 6000 return nil 6001 } 6002 c.PageToken(x.NextPageToken) 6003 } 6004} 6005 6006// method id "cloudidentity.devices.deviceUsers.wipe": 6007 6008type DevicesDeviceUsersWipeCall struct { 6009 s *Service 6010 name string 6011 wipedeviceuserrequest *WipeDeviceUserRequest 6012 urlParams_ gensupport.URLParams 6013 ctx_ context.Context 6014 header_ http.Header 6015} 6016 6017// Wipe: Wipes the user's account on a device. 6018// 6019// - name: Resource name 6020// (https://cloud.google.com/apis/design/resource_names) of the Device 6021// in format: `devices/{device_id}/deviceUsers/{device_user_id}`, 6022// where device_id is the unique ID assigned to the Device, and 6023// device_user_id is the unique ID assigned to the User. 6024func (r *DevicesDeviceUsersService) Wipe(name string, wipedeviceuserrequest *WipeDeviceUserRequest) *DevicesDeviceUsersWipeCall { 6025 c := &DevicesDeviceUsersWipeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6026 c.name = name 6027 c.wipedeviceuserrequest = wipedeviceuserrequest 6028 return c 6029} 6030 6031// Fields allows partial responses to be retrieved. See 6032// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6033// for more information. 6034func (c *DevicesDeviceUsersWipeCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersWipeCall { 6035 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6036 return c 6037} 6038 6039// Context sets the context to be used in this call's Do method. Any 6040// pending HTTP request will be aborted if the provided context is 6041// canceled. 6042func (c *DevicesDeviceUsersWipeCall) Context(ctx context.Context) *DevicesDeviceUsersWipeCall { 6043 c.ctx_ = ctx 6044 return c 6045} 6046 6047// Header returns an http.Header that can be modified by the caller to 6048// add HTTP headers to the request. 6049func (c *DevicesDeviceUsersWipeCall) Header() http.Header { 6050 if c.header_ == nil { 6051 c.header_ = make(http.Header) 6052 } 6053 return c.header_ 6054} 6055 6056func (c *DevicesDeviceUsersWipeCall) doRequest(alt string) (*http.Response, error) { 6057 reqHeaders := make(http.Header) 6058 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6059 for k, v := range c.header_ { 6060 reqHeaders[k] = v 6061 } 6062 reqHeaders.Set("User-Agent", c.s.userAgent()) 6063 var body io.Reader = nil 6064 body, err := googleapi.WithoutDataWrapper.JSONReader(c.wipedeviceuserrequest) 6065 if err != nil { 6066 return nil, err 6067 } 6068 reqHeaders.Set("Content-Type", "application/json") 6069 c.urlParams_.Set("alt", alt) 6070 c.urlParams_.Set("prettyPrint", "false") 6071 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:wipe") 6072 urls += "?" + c.urlParams_.Encode() 6073 req, err := http.NewRequest("POST", urls, body) 6074 if err != nil { 6075 return nil, err 6076 } 6077 req.Header = reqHeaders 6078 googleapi.Expand(req.URL, map[string]string{ 6079 "name": c.name, 6080 }) 6081 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6082} 6083 6084// Do executes the "cloudidentity.devices.deviceUsers.wipe" call. 6085// Exactly one of *Operation or error will be non-nil. Any non-2xx 6086// status code is an error. Response headers are in either 6087// *Operation.ServerResponse.Header or (if a response was returned at 6088// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6089// to check whether the returned error was because 6090// http.StatusNotModified was returned. 6091func (c *DevicesDeviceUsersWipeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6092 gensupport.SetOptions(c.urlParams_, opts...) 6093 res, err := c.doRequest("json") 6094 if res != nil && res.StatusCode == http.StatusNotModified { 6095 if res.Body != nil { 6096 res.Body.Close() 6097 } 6098 return nil, &googleapi.Error{ 6099 Code: res.StatusCode, 6100 Header: res.Header, 6101 } 6102 } 6103 if err != nil { 6104 return nil, err 6105 } 6106 defer googleapi.CloseBody(res) 6107 if err := googleapi.CheckResponse(res); err != nil { 6108 return nil, err 6109 } 6110 ret := &Operation{ 6111 ServerResponse: googleapi.ServerResponse{ 6112 Header: res.Header, 6113 HTTPStatusCode: res.StatusCode, 6114 }, 6115 } 6116 target := &ret 6117 if err := gensupport.DecodeResponse(target, res); err != nil { 6118 return nil, err 6119 } 6120 return ret, nil 6121 // { 6122 // "description": "Wipes the user's account on a device.", 6123 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}:wipe", 6124 // "httpMethod": "POST", 6125 // "id": "cloudidentity.devices.deviceUsers.wipe", 6126 // "parameterOrder": [ 6127 // "name" 6128 // ], 6129 // "parameters": { 6130 // "name": { 6131 // "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.", 6132 // "location": "path", 6133 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+$", 6134 // "required": true, 6135 // "type": "string" 6136 // } 6137 // }, 6138 // "path": "v1beta1/{+name}:wipe", 6139 // "request": { 6140 // "$ref": "WipeDeviceUserRequest" 6141 // }, 6142 // "response": { 6143 // "$ref": "Operation" 6144 // } 6145 // } 6146 6147} 6148 6149// method id "cloudidentity.devices.deviceUsers.clientStates.get": 6150 6151type DevicesDeviceUsersClientStatesGetCall struct { 6152 s *Service 6153 name string 6154 urlParams_ gensupport.URLParams 6155 ifNoneMatch_ string 6156 ctx_ context.Context 6157 header_ http.Header 6158} 6159 6160// Get: Gets the client state for the device user 6161// 6162// - name: Resource name 6163// (https://cloud.google.com/apis/design/resource_names) of the 6164// ClientState in format: 6165// `devices/{device_id}/deviceUsers/{device_user_id}/clientStates/{part 6166// ner_id}`, where `device_id` is the unique ID assigned to the 6167// Device, `device_user_id` is the unique ID assigned to the User and 6168// `partner_id` identifies the partner storing the data. To get the 6169// client state for devices belonging to your own organization, the 6170// `partnerId` is in the format: `customerId-*anystring*`. Where the 6171// `customerId` is your organization's customer ID and `anystring` is 6172// any suffix. This suffix is used in setting up Custom Access Levels 6173// in Context-Aware Access. You may use `my_customer` instead of the 6174// customer ID for devices managed by your own organization. You may 6175// specify `-` in place of the `{device_id}`, so the ClientState 6176// resource name can be: 6177// `devices/-/deviceUsers/{device_user_resource_id}/clientStates/{partn 6178// er_id}`. 6179func (r *DevicesDeviceUsersClientStatesService) Get(name string) *DevicesDeviceUsersClientStatesGetCall { 6180 c := &DevicesDeviceUsersClientStatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6181 c.name = name 6182 return c 6183} 6184 6185// Customer sets the optional parameter "customer": Resource name 6186// (https://cloud.google.com/apis/design/resource_names) of the 6187// customer. If you're using this API for your own organization, use 6188// `customers/my_customer` If you're using this API to manage another 6189// organization, use `customers/{customer_id}`, where customer_id is the 6190// customer to whom the device belongs. 6191func (c *DevicesDeviceUsersClientStatesGetCall) Customer(customer string) *DevicesDeviceUsersClientStatesGetCall { 6192 c.urlParams_.Set("customer", customer) 6193 return c 6194} 6195 6196// Fields allows partial responses to be retrieved. See 6197// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6198// for more information. 6199func (c *DevicesDeviceUsersClientStatesGetCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersClientStatesGetCall { 6200 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6201 return c 6202} 6203 6204// IfNoneMatch sets the optional parameter which makes the operation 6205// fail if the object's ETag matches the given value. This is useful for 6206// getting updates only after the object has changed since the last 6207// request. Use googleapi.IsNotModified to check whether the response 6208// error from Do is the result of In-None-Match. 6209func (c *DevicesDeviceUsersClientStatesGetCall) IfNoneMatch(entityTag string) *DevicesDeviceUsersClientStatesGetCall { 6210 c.ifNoneMatch_ = entityTag 6211 return c 6212} 6213 6214// Context sets the context to be used in this call's Do method. Any 6215// pending HTTP request will be aborted if the provided context is 6216// canceled. 6217func (c *DevicesDeviceUsersClientStatesGetCall) Context(ctx context.Context) *DevicesDeviceUsersClientStatesGetCall { 6218 c.ctx_ = ctx 6219 return c 6220} 6221 6222// Header returns an http.Header that can be modified by the caller to 6223// add HTTP headers to the request. 6224func (c *DevicesDeviceUsersClientStatesGetCall) Header() http.Header { 6225 if c.header_ == nil { 6226 c.header_ = make(http.Header) 6227 } 6228 return c.header_ 6229} 6230 6231func (c *DevicesDeviceUsersClientStatesGetCall) doRequest(alt string) (*http.Response, error) { 6232 reqHeaders := make(http.Header) 6233 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6234 for k, v := range c.header_ { 6235 reqHeaders[k] = v 6236 } 6237 reqHeaders.Set("User-Agent", c.s.userAgent()) 6238 if c.ifNoneMatch_ != "" { 6239 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6240 } 6241 var body io.Reader = nil 6242 c.urlParams_.Set("alt", alt) 6243 c.urlParams_.Set("prettyPrint", "false") 6244 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6245 urls += "?" + c.urlParams_.Encode() 6246 req, err := http.NewRequest("GET", urls, body) 6247 if err != nil { 6248 return nil, err 6249 } 6250 req.Header = reqHeaders 6251 googleapi.Expand(req.URL, map[string]string{ 6252 "name": c.name, 6253 }) 6254 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6255} 6256 6257// Do executes the "cloudidentity.devices.deviceUsers.clientStates.get" call. 6258// Exactly one of *ClientState or error will be non-nil. Any non-2xx 6259// status code is an error. Response headers are in either 6260// *ClientState.ServerResponse.Header or (if a response was returned at 6261// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6262// to check whether the returned error was because 6263// http.StatusNotModified was returned. 6264func (c *DevicesDeviceUsersClientStatesGetCall) Do(opts ...googleapi.CallOption) (*ClientState, error) { 6265 gensupport.SetOptions(c.urlParams_, opts...) 6266 res, err := c.doRequest("json") 6267 if res != nil && res.StatusCode == http.StatusNotModified { 6268 if res.Body != nil { 6269 res.Body.Close() 6270 } 6271 return nil, &googleapi.Error{ 6272 Code: res.StatusCode, 6273 Header: res.Header, 6274 } 6275 } 6276 if err != nil { 6277 return nil, err 6278 } 6279 defer googleapi.CloseBody(res) 6280 if err := googleapi.CheckResponse(res); err != nil { 6281 return nil, err 6282 } 6283 ret := &ClientState{ 6284 ServerResponse: googleapi.ServerResponse{ 6285 Header: res.Header, 6286 HTTPStatusCode: res.StatusCode, 6287 }, 6288 } 6289 target := &ret 6290 if err := gensupport.DecodeResponse(target, res); err != nil { 6291 return nil, err 6292 } 6293 return ret, nil 6294 // { 6295 // "description": "Gets the client state for the device user", 6296 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}", 6297 // "httpMethod": "GET", 6298 // "id": "cloudidentity.devices.deviceUsers.clientStates.get", 6299 // "parameterOrder": [ 6300 // "name" 6301 // ], 6302 // "parameters": { 6303 // "customer": { 6304 // "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.", 6305 // "location": "query", 6306 // "type": "string" 6307 // }, 6308 // "name": { 6309 // "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}`.", 6310 // "location": "path", 6311 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+/clientStates/[^/]+$", 6312 // "required": true, 6313 // "type": "string" 6314 // } 6315 // }, 6316 // "path": "v1beta1/{+name}", 6317 // "response": { 6318 // "$ref": "ClientState" 6319 // } 6320 // } 6321 6322} 6323 6324// method id "cloudidentity.devices.deviceUsers.clientStates.patch": 6325 6326type DevicesDeviceUsersClientStatesPatchCall struct { 6327 s *Service 6328 name string 6329 clientstate *ClientState 6330 urlParams_ gensupport.URLParams 6331 ctx_ context.Context 6332 header_ http.Header 6333} 6334 6335// Patch: Updates the client state for the device user **Note**: This 6336// method is available only to customers who have one of the following 6337// SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, 6338// and Cloud Identity Premium 6339// 6340// - name: Output only. Resource name 6341// (https://cloud.google.com/apis/design/resource_names) of the 6342// ClientState in format: 6343// `devices/{device_id}/deviceUsers/{device_user_id}/clientState/{partn 6344// er_id}`, where partner_id corresponds to the partner storing the 6345// data. 6346func (r *DevicesDeviceUsersClientStatesService) Patch(name string, clientstate *ClientState) *DevicesDeviceUsersClientStatesPatchCall { 6347 c := &DevicesDeviceUsersClientStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6348 c.name = name 6349 c.clientstate = clientstate 6350 return c 6351} 6352 6353// Customer sets the optional parameter "customer": Resource name 6354// (https://cloud.google.com/apis/design/resource_names) of the 6355// customer. If you're using this API for your own organization, use 6356// `customers/my_customer` If you're using this API to manage another 6357// organization, use `customers/{customer_id}`, where customer_id is the 6358// customer to whom the device belongs. 6359func (c *DevicesDeviceUsersClientStatesPatchCall) Customer(customer string) *DevicesDeviceUsersClientStatesPatchCall { 6360 c.urlParams_.Set("customer", customer) 6361 return c 6362} 6363 6364// UpdateMask sets the optional parameter "updateMask": Comma-separated 6365// list of fully qualified names of fields to be updated. If not 6366// specified, all updatable fields in ClientState are updated. 6367func (c *DevicesDeviceUsersClientStatesPatchCall) UpdateMask(updateMask string) *DevicesDeviceUsersClientStatesPatchCall { 6368 c.urlParams_.Set("updateMask", updateMask) 6369 return c 6370} 6371 6372// Fields allows partial responses to be retrieved. See 6373// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6374// for more information. 6375func (c *DevicesDeviceUsersClientStatesPatchCall) Fields(s ...googleapi.Field) *DevicesDeviceUsersClientStatesPatchCall { 6376 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6377 return c 6378} 6379 6380// Context sets the context to be used in this call's Do method. Any 6381// pending HTTP request will be aborted if the provided context is 6382// canceled. 6383func (c *DevicesDeviceUsersClientStatesPatchCall) Context(ctx context.Context) *DevicesDeviceUsersClientStatesPatchCall { 6384 c.ctx_ = ctx 6385 return c 6386} 6387 6388// Header returns an http.Header that can be modified by the caller to 6389// add HTTP headers to the request. 6390func (c *DevicesDeviceUsersClientStatesPatchCall) Header() http.Header { 6391 if c.header_ == nil { 6392 c.header_ = make(http.Header) 6393 } 6394 return c.header_ 6395} 6396 6397func (c *DevicesDeviceUsersClientStatesPatchCall) doRequest(alt string) (*http.Response, error) { 6398 reqHeaders := make(http.Header) 6399 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6400 for k, v := range c.header_ { 6401 reqHeaders[k] = v 6402 } 6403 reqHeaders.Set("User-Agent", c.s.userAgent()) 6404 var body io.Reader = nil 6405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientstate) 6406 if err != nil { 6407 return nil, err 6408 } 6409 reqHeaders.Set("Content-Type", "application/json") 6410 c.urlParams_.Set("alt", alt) 6411 c.urlParams_.Set("prettyPrint", "false") 6412 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6413 urls += "?" + c.urlParams_.Encode() 6414 req, err := http.NewRequest("PATCH", urls, body) 6415 if err != nil { 6416 return nil, err 6417 } 6418 req.Header = reqHeaders 6419 googleapi.Expand(req.URL, map[string]string{ 6420 "name": c.name, 6421 }) 6422 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6423} 6424 6425// Do executes the "cloudidentity.devices.deviceUsers.clientStates.patch" call. 6426// Exactly one of *Operation or error will be non-nil. Any non-2xx 6427// status code is an error. Response headers are in either 6428// *Operation.ServerResponse.Header or (if a response was returned at 6429// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6430// to check whether the returned error was because 6431// http.StatusNotModified was returned. 6432func (c *DevicesDeviceUsersClientStatesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6433 gensupport.SetOptions(c.urlParams_, opts...) 6434 res, err := c.doRequest("json") 6435 if res != nil && res.StatusCode == http.StatusNotModified { 6436 if res.Body != nil { 6437 res.Body.Close() 6438 } 6439 return nil, &googleapi.Error{ 6440 Code: res.StatusCode, 6441 Header: res.Header, 6442 } 6443 } 6444 if err != nil { 6445 return nil, err 6446 } 6447 defer googleapi.CloseBody(res) 6448 if err := googleapi.CheckResponse(res); err != nil { 6449 return nil, err 6450 } 6451 ret := &Operation{ 6452 ServerResponse: googleapi.ServerResponse{ 6453 Header: res.Header, 6454 HTTPStatusCode: res.StatusCode, 6455 }, 6456 } 6457 target := &ret 6458 if err := gensupport.DecodeResponse(target, res); err != nil { 6459 return nil, err 6460 } 6461 return ret, nil 6462 // { 6463 // "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", 6464 // "flatPath": "v1beta1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}", 6465 // "httpMethod": "PATCH", 6466 // "id": "cloudidentity.devices.deviceUsers.clientStates.patch", 6467 // "parameterOrder": [ 6468 // "name" 6469 // ], 6470 // "parameters": { 6471 // "customer": { 6472 // "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.", 6473 // "location": "query", 6474 // "type": "string" 6475 // }, 6476 // "name": { 6477 // "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.", 6478 // "location": "path", 6479 // "pattern": "^devices/[^/]+/deviceUsers/[^/]+/clientStates/[^/]+$", 6480 // "required": true, 6481 // "type": "string" 6482 // }, 6483 // "updateMask": { 6484 // "description": "Optional. Comma-separated list of fully qualified names of fields to be updated. If not specified, all updatable fields in ClientState are updated.", 6485 // "format": "google-fieldmask", 6486 // "location": "query", 6487 // "type": "string" 6488 // } 6489 // }, 6490 // "path": "v1beta1/{+name}", 6491 // "request": { 6492 // "$ref": "ClientState" 6493 // }, 6494 // "response": { 6495 // "$ref": "Operation" 6496 // } 6497 // } 6498 6499} 6500 6501// method id "cloudidentity.groups.create": 6502 6503type GroupsCreateCall struct { 6504 s *Service 6505 group *Group 6506 urlParams_ gensupport.URLParams 6507 ctx_ context.Context 6508 header_ http.Header 6509} 6510 6511// Create: Creates a `Group`. 6512func (r *GroupsService) Create(group *Group) *GroupsCreateCall { 6513 c := &GroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6514 c.group = group 6515 return c 6516} 6517 6518// InitialGroupConfig sets the optional parameter "initialGroupConfig": 6519// Required. The initial configuration option for the `Group`. 6520// 6521// Possible values: 6522// "INITIAL_GROUP_CONFIG_UNSPECIFIED" - Default. Should not be used. 6523// "WITH_INITIAL_OWNER" - The end user making the request will be 6524// added as the initial owner of the `Group`. 6525// "EMPTY" - An empty group is created without any initial owners. 6526// This can only be used by admins of the domain. 6527func (c *GroupsCreateCall) InitialGroupConfig(initialGroupConfig string) *GroupsCreateCall { 6528 c.urlParams_.Set("initialGroupConfig", initialGroupConfig) 6529 return c 6530} 6531 6532// Fields allows partial responses to be retrieved. See 6533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6534// for more information. 6535func (c *GroupsCreateCall) Fields(s ...googleapi.Field) *GroupsCreateCall { 6536 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6537 return c 6538} 6539 6540// Context sets the context to be used in this call's Do method. Any 6541// pending HTTP request will be aborted if the provided context is 6542// canceled. 6543func (c *GroupsCreateCall) Context(ctx context.Context) *GroupsCreateCall { 6544 c.ctx_ = ctx 6545 return c 6546} 6547 6548// Header returns an http.Header that can be modified by the caller to 6549// add HTTP headers to the request. 6550func (c *GroupsCreateCall) Header() http.Header { 6551 if c.header_ == nil { 6552 c.header_ = make(http.Header) 6553 } 6554 return c.header_ 6555} 6556 6557func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) { 6558 reqHeaders := make(http.Header) 6559 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6560 for k, v := range c.header_ { 6561 reqHeaders[k] = v 6562 } 6563 reqHeaders.Set("User-Agent", c.s.userAgent()) 6564 var body io.Reader = nil 6565 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 6566 if err != nil { 6567 return nil, err 6568 } 6569 reqHeaders.Set("Content-Type", "application/json") 6570 c.urlParams_.Set("alt", alt) 6571 c.urlParams_.Set("prettyPrint", "false") 6572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups") 6573 urls += "?" + c.urlParams_.Encode() 6574 req, err := http.NewRequest("POST", urls, body) 6575 if err != nil { 6576 return nil, err 6577 } 6578 req.Header = reqHeaders 6579 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6580} 6581 6582// Do executes the "cloudidentity.groups.create" call. 6583// Exactly one of *Operation or error will be non-nil. Any non-2xx 6584// status code is an error. Response headers are in either 6585// *Operation.ServerResponse.Header or (if a response was returned at 6586// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6587// to check whether the returned error was because 6588// http.StatusNotModified was returned. 6589func (c *GroupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6590 gensupport.SetOptions(c.urlParams_, opts...) 6591 res, err := c.doRequest("json") 6592 if res != nil && res.StatusCode == http.StatusNotModified { 6593 if res.Body != nil { 6594 res.Body.Close() 6595 } 6596 return nil, &googleapi.Error{ 6597 Code: res.StatusCode, 6598 Header: res.Header, 6599 } 6600 } 6601 if err != nil { 6602 return nil, err 6603 } 6604 defer googleapi.CloseBody(res) 6605 if err := googleapi.CheckResponse(res); err != nil { 6606 return nil, err 6607 } 6608 ret := &Operation{ 6609 ServerResponse: googleapi.ServerResponse{ 6610 Header: res.Header, 6611 HTTPStatusCode: res.StatusCode, 6612 }, 6613 } 6614 target := &ret 6615 if err := gensupport.DecodeResponse(target, res); err != nil { 6616 return nil, err 6617 } 6618 return ret, nil 6619 // { 6620 // "description": "Creates a `Group`.", 6621 // "flatPath": "v1beta1/groups", 6622 // "httpMethod": "POST", 6623 // "id": "cloudidentity.groups.create", 6624 // "parameterOrder": [], 6625 // "parameters": { 6626 // "initialGroupConfig": { 6627 // "description": "Required. The initial configuration option for the `Group`.", 6628 // "enum": [ 6629 // "INITIAL_GROUP_CONFIG_UNSPECIFIED", 6630 // "WITH_INITIAL_OWNER", 6631 // "EMPTY" 6632 // ], 6633 // "enumDescriptions": [ 6634 // "Default. Should not be used.", 6635 // "The end user making the request will be added as the initial owner of the `Group`.", 6636 // "An empty group is created without any initial owners. This can only be used by admins of the domain." 6637 // ], 6638 // "location": "query", 6639 // "type": "string" 6640 // } 6641 // }, 6642 // "path": "v1beta1/groups", 6643 // "request": { 6644 // "$ref": "Group" 6645 // }, 6646 // "response": { 6647 // "$ref": "Operation" 6648 // }, 6649 // "scopes": [ 6650 // "https://www.googleapis.com/auth/cloud-identity.groups", 6651 // "https://www.googleapis.com/auth/cloud-platform" 6652 // ] 6653 // } 6654 6655} 6656 6657// method id "cloudidentity.groups.delete": 6658 6659type GroupsDeleteCall struct { 6660 s *Service 6661 name string 6662 urlParams_ gensupport.URLParams 6663 ctx_ context.Context 6664 header_ http.Header 6665} 6666 6667// Delete: Deletes a `Group`. 6668// 6669// - name: The resource name 6670// (https://cloud.google.com/apis/design/resource_names) of the 6671// `Group` to retrieve. Must be of the form `groups/{group_id}`. 6672func (r *GroupsService) Delete(name string) *GroupsDeleteCall { 6673 c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6674 c.name = name 6675 return c 6676} 6677 6678// Fields allows partial responses to be retrieved. See 6679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6680// for more information. 6681func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { 6682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6683 return c 6684} 6685 6686// Context sets the context to be used in this call's Do method. Any 6687// pending HTTP request will be aborted if the provided context is 6688// canceled. 6689func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { 6690 c.ctx_ = ctx 6691 return c 6692} 6693 6694// Header returns an http.Header that can be modified by the caller to 6695// add HTTP headers to the request. 6696func (c *GroupsDeleteCall) Header() http.Header { 6697 if c.header_ == nil { 6698 c.header_ = make(http.Header) 6699 } 6700 return c.header_ 6701} 6702 6703func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 6704 reqHeaders := make(http.Header) 6705 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6706 for k, v := range c.header_ { 6707 reqHeaders[k] = v 6708 } 6709 reqHeaders.Set("User-Agent", c.s.userAgent()) 6710 var body io.Reader = nil 6711 c.urlParams_.Set("alt", alt) 6712 c.urlParams_.Set("prettyPrint", "false") 6713 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6714 urls += "?" + c.urlParams_.Encode() 6715 req, err := http.NewRequest("DELETE", urls, body) 6716 if err != nil { 6717 return nil, err 6718 } 6719 req.Header = reqHeaders 6720 googleapi.Expand(req.URL, map[string]string{ 6721 "name": c.name, 6722 }) 6723 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6724} 6725 6726// Do executes the "cloudidentity.groups.delete" call. 6727// Exactly one of *Operation or error will be non-nil. Any non-2xx 6728// status code is an error. Response headers are in either 6729// *Operation.ServerResponse.Header or (if a response was returned at 6730// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6731// to check whether the returned error was because 6732// http.StatusNotModified was returned. 6733func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6734 gensupport.SetOptions(c.urlParams_, opts...) 6735 res, err := c.doRequest("json") 6736 if res != nil && res.StatusCode == http.StatusNotModified { 6737 if res.Body != nil { 6738 res.Body.Close() 6739 } 6740 return nil, &googleapi.Error{ 6741 Code: res.StatusCode, 6742 Header: res.Header, 6743 } 6744 } 6745 if err != nil { 6746 return nil, err 6747 } 6748 defer googleapi.CloseBody(res) 6749 if err := googleapi.CheckResponse(res); err != nil { 6750 return nil, err 6751 } 6752 ret := &Operation{ 6753 ServerResponse: googleapi.ServerResponse{ 6754 Header: res.Header, 6755 HTTPStatusCode: res.StatusCode, 6756 }, 6757 } 6758 target := &ret 6759 if err := gensupport.DecodeResponse(target, res); err != nil { 6760 return nil, err 6761 } 6762 return ret, nil 6763 // { 6764 // "description": "Deletes a `Group`.", 6765 // "flatPath": "v1beta1/groups/{groupsId}", 6766 // "httpMethod": "DELETE", 6767 // "id": "cloudidentity.groups.delete", 6768 // "parameterOrder": [ 6769 // "name" 6770 // ], 6771 // "parameters": { 6772 // "name": { 6773 // "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}`.", 6774 // "location": "path", 6775 // "pattern": "^groups/[^/]+$", 6776 // "required": true, 6777 // "type": "string" 6778 // } 6779 // }, 6780 // "path": "v1beta1/{+name}", 6781 // "response": { 6782 // "$ref": "Operation" 6783 // }, 6784 // "scopes": [ 6785 // "https://www.googleapis.com/auth/cloud-identity.groups", 6786 // "https://www.googleapis.com/auth/cloud-platform" 6787 // ] 6788 // } 6789 6790} 6791 6792// method id "cloudidentity.groups.get": 6793 6794type GroupsGetCall struct { 6795 s *Service 6796 name string 6797 urlParams_ gensupport.URLParams 6798 ifNoneMatch_ string 6799 ctx_ context.Context 6800 header_ http.Header 6801} 6802 6803// Get: Retrieves a `Group`. 6804// 6805// - name: The resource name 6806// (https://cloud.google.com/apis/design/resource_names) of the 6807// `Group` to retrieve. Must be of the form `groups/{group_id}`. 6808func (r *GroupsService) Get(name string) *GroupsGetCall { 6809 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6810 c.name = name 6811 return c 6812} 6813 6814// Fields allows partial responses to be retrieved. See 6815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6816// for more information. 6817func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 6818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6819 return c 6820} 6821 6822// IfNoneMatch sets the optional parameter which makes the operation 6823// fail if the object's ETag matches the given value. This is useful for 6824// getting updates only after the object has changed since the last 6825// request. Use googleapi.IsNotModified to check whether the response 6826// error from Do is the result of In-None-Match. 6827func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 6828 c.ifNoneMatch_ = entityTag 6829 return c 6830} 6831 6832// Context sets the context to be used in this call's Do method. Any 6833// pending HTTP request will be aborted if the provided context is 6834// canceled. 6835func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 6836 c.ctx_ = ctx 6837 return c 6838} 6839 6840// Header returns an http.Header that can be modified by the caller to 6841// add HTTP headers to the request. 6842func (c *GroupsGetCall) Header() http.Header { 6843 if c.header_ == nil { 6844 c.header_ = make(http.Header) 6845 } 6846 return c.header_ 6847} 6848 6849func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 6850 reqHeaders := make(http.Header) 6851 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6852 for k, v := range c.header_ { 6853 reqHeaders[k] = v 6854 } 6855 reqHeaders.Set("User-Agent", c.s.userAgent()) 6856 if c.ifNoneMatch_ != "" { 6857 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6858 } 6859 var body io.Reader = nil 6860 c.urlParams_.Set("alt", alt) 6861 c.urlParams_.Set("prettyPrint", "false") 6862 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6863 urls += "?" + c.urlParams_.Encode() 6864 req, err := http.NewRequest("GET", urls, body) 6865 if err != nil { 6866 return nil, err 6867 } 6868 req.Header = reqHeaders 6869 googleapi.Expand(req.URL, map[string]string{ 6870 "name": c.name, 6871 }) 6872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6873} 6874 6875// Do executes the "cloudidentity.groups.get" call. 6876// Exactly one of *Group or error will be non-nil. Any non-2xx status 6877// code is an error. Response headers are in either 6878// *Group.ServerResponse.Header or (if a response was returned at all) 6879// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6880// check whether the returned error was because http.StatusNotModified 6881// was returned. 6882func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 6883 gensupport.SetOptions(c.urlParams_, opts...) 6884 res, err := c.doRequest("json") 6885 if res != nil && res.StatusCode == http.StatusNotModified { 6886 if res.Body != nil { 6887 res.Body.Close() 6888 } 6889 return nil, &googleapi.Error{ 6890 Code: res.StatusCode, 6891 Header: res.Header, 6892 } 6893 } 6894 if err != nil { 6895 return nil, err 6896 } 6897 defer googleapi.CloseBody(res) 6898 if err := googleapi.CheckResponse(res); err != nil { 6899 return nil, err 6900 } 6901 ret := &Group{ 6902 ServerResponse: googleapi.ServerResponse{ 6903 Header: res.Header, 6904 HTTPStatusCode: res.StatusCode, 6905 }, 6906 } 6907 target := &ret 6908 if err := gensupport.DecodeResponse(target, res); err != nil { 6909 return nil, err 6910 } 6911 return ret, nil 6912 // { 6913 // "description": "Retrieves a `Group`.", 6914 // "flatPath": "v1beta1/groups/{groupsId}", 6915 // "httpMethod": "GET", 6916 // "id": "cloudidentity.groups.get", 6917 // "parameterOrder": [ 6918 // "name" 6919 // ], 6920 // "parameters": { 6921 // "name": { 6922 // "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}`.", 6923 // "location": "path", 6924 // "pattern": "^groups/[^/]+$", 6925 // "required": true, 6926 // "type": "string" 6927 // } 6928 // }, 6929 // "path": "v1beta1/{+name}", 6930 // "response": { 6931 // "$ref": "Group" 6932 // }, 6933 // "scopes": [ 6934 // "https://www.googleapis.com/auth/cloud-identity.groups", 6935 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 6936 // "https://www.googleapis.com/auth/cloud-platform" 6937 // ] 6938 // } 6939 6940} 6941 6942// method id "cloudidentity.groups.list": 6943 6944type GroupsListCall struct { 6945 s *Service 6946 urlParams_ gensupport.URLParams 6947 ifNoneMatch_ string 6948 ctx_ context.Context 6949 header_ http.Header 6950} 6951 6952// List: Lists the `Group` resources under a customer or namespace. 6953func (r *GroupsService) List() *GroupsListCall { 6954 c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6955 return c 6956} 6957 6958// PageSize sets the optional parameter "pageSize": The maximum number 6959// of results to return. Note that the number of results returned may be 6960// less than this value even if there are more available results. To 6961// fetch all results, clients must continue calling this method 6962// repeatedly until the response no longer contains a `next_page_token`. 6963// If unspecified, defaults to 200 for `View.BASIC` and to 50 for 6964// `View.FULL`. Must not be greater than 1000 for `View.BASIC` or 500 6965// for `View.FULL`. 6966func (c *GroupsListCall) PageSize(pageSize int64) *GroupsListCall { 6967 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6968 return c 6969} 6970 6971// PageToken sets the optional parameter "pageToken": The 6972// `next_page_token` value returned from a previous list request, if 6973// any. 6974func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { 6975 c.urlParams_.Set("pageToken", pageToken) 6976 return c 6977} 6978 6979// Parent sets the optional parameter "parent": Required. The parent 6980// resource under which to list all `Group` resources. Must be of the 6981// form `identitysources/{identity_source_id}` for external- 6982// identity-mapped groups or `customers/{customer_id}` for Google 6983// Groups. The `customer_id` must begin with "C" (for example, 6984// 'C046psxkn'). 6985func (c *GroupsListCall) Parent(parent string) *GroupsListCall { 6986 c.urlParams_.Set("parent", parent) 6987 return c 6988} 6989 6990// View sets the optional parameter "view": The level of detail to be 6991// returned. If unspecified, defaults to `View.BASIC`. 6992// 6993// Possible values: 6994// "VIEW_UNSPECIFIED" - Default. Should not be used. 6995// "BASIC" - Only basic resource information is returned. 6996// "FULL" - All resource information is returned. 6997func (c *GroupsListCall) View(view string) *GroupsListCall { 6998 c.urlParams_.Set("view", view) 6999 return c 7000} 7001 7002// Fields allows partial responses to be retrieved. See 7003// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7004// for more information. 7005func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { 7006 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7007 return c 7008} 7009 7010// IfNoneMatch sets the optional parameter which makes the operation 7011// fail if the object's ETag matches the given value. This is useful for 7012// getting updates only after the object has changed since the last 7013// request. Use googleapi.IsNotModified to check whether the response 7014// error from Do is the result of In-None-Match. 7015func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { 7016 c.ifNoneMatch_ = entityTag 7017 return c 7018} 7019 7020// Context sets the context to be used in this call's Do method. Any 7021// pending HTTP request will be aborted if the provided context is 7022// canceled. 7023func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { 7024 c.ctx_ = ctx 7025 return c 7026} 7027 7028// Header returns an http.Header that can be modified by the caller to 7029// add HTTP headers to the request. 7030func (c *GroupsListCall) Header() http.Header { 7031 if c.header_ == nil { 7032 c.header_ = make(http.Header) 7033 } 7034 return c.header_ 7035} 7036 7037func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { 7038 reqHeaders := make(http.Header) 7039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7040 for k, v := range c.header_ { 7041 reqHeaders[k] = v 7042 } 7043 reqHeaders.Set("User-Agent", c.s.userAgent()) 7044 if c.ifNoneMatch_ != "" { 7045 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7046 } 7047 var body io.Reader = nil 7048 c.urlParams_.Set("alt", alt) 7049 c.urlParams_.Set("prettyPrint", "false") 7050 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups") 7051 urls += "?" + c.urlParams_.Encode() 7052 req, err := http.NewRequest("GET", urls, body) 7053 if err != nil { 7054 return nil, err 7055 } 7056 req.Header = reqHeaders 7057 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7058} 7059 7060// Do executes the "cloudidentity.groups.list" call. 7061// Exactly one of *ListGroupsResponse or error will be non-nil. Any 7062// non-2xx status code is an error. Response headers are in either 7063// *ListGroupsResponse.ServerResponse.Header or (if a response was 7064// returned at all) in error.(*googleapi.Error).Header. Use 7065// googleapi.IsNotModified to check whether the returned error was 7066// because http.StatusNotModified was returned. 7067func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*ListGroupsResponse, error) { 7068 gensupport.SetOptions(c.urlParams_, opts...) 7069 res, err := c.doRequest("json") 7070 if res != nil && res.StatusCode == http.StatusNotModified { 7071 if res.Body != nil { 7072 res.Body.Close() 7073 } 7074 return nil, &googleapi.Error{ 7075 Code: res.StatusCode, 7076 Header: res.Header, 7077 } 7078 } 7079 if err != nil { 7080 return nil, err 7081 } 7082 defer googleapi.CloseBody(res) 7083 if err := googleapi.CheckResponse(res); err != nil { 7084 return nil, err 7085 } 7086 ret := &ListGroupsResponse{ 7087 ServerResponse: googleapi.ServerResponse{ 7088 Header: res.Header, 7089 HTTPStatusCode: res.StatusCode, 7090 }, 7091 } 7092 target := &ret 7093 if err := gensupport.DecodeResponse(target, res); err != nil { 7094 return nil, err 7095 } 7096 return ret, nil 7097 // { 7098 // "description": "Lists the `Group` resources under a customer or namespace.", 7099 // "flatPath": "v1beta1/groups", 7100 // "httpMethod": "GET", 7101 // "id": "cloudidentity.groups.list", 7102 // "parameterOrder": [], 7103 // "parameters": { 7104 // "pageSize": { 7105 // "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`.", 7106 // "format": "int32", 7107 // "location": "query", 7108 // "type": "integer" 7109 // }, 7110 // "pageToken": { 7111 // "description": "The `next_page_token` value returned from a previous list request, if any.", 7112 // "location": "query", 7113 // "type": "string" 7114 // }, 7115 // "parent": { 7116 // "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').", 7117 // "location": "query", 7118 // "type": "string" 7119 // }, 7120 // "view": { 7121 // "description": "The level of detail to be returned. If unspecified, defaults to `View.BASIC`.", 7122 // "enum": [ 7123 // "VIEW_UNSPECIFIED", 7124 // "BASIC", 7125 // "FULL" 7126 // ], 7127 // "enumDescriptions": [ 7128 // "Default. Should not be used.", 7129 // "Only basic resource information is returned.", 7130 // "All resource information is returned." 7131 // ], 7132 // "location": "query", 7133 // "type": "string" 7134 // } 7135 // }, 7136 // "path": "v1beta1/groups", 7137 // "response": { 7138 // "$ref": "ListGroupsResponse" 7139 // }, 7140 // "scopes": [ 7141 // "https://www.googleapis.com/auth/cloud-identity.groups", 7142 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7143 // "https://www.googleapis.com/auth/cloud-platform" 7144 // ] 7145 // } 7146 7147} 7148 7149// Pages invokes f for each page of results. 7150// A non-nil error returned from f will halt the iteration. 7151// The provided context supersedes any context provided to the Context method. 7152func (c *GroupsListCall) Pages(ctx context.Context, f func(*ListGroupsResponse) error) error { 7153 c.ctx_ = ctx 7154 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7155 for { 7156 x, err := c.Do() 7157 if err != nil { 7158 return err 7159 } 7160 if err := f(x); err != nil { 7161 return err 7162 } 7163 if x.NextPageToken == "" { 7164 return nil 7165 } 7166 c.PageToken(x.NextPageToken) 7167 } 7168} 7169 7170// method id "cloudidentity.groups.lookup": 7171 7172type GroupsLookupCall struct { 7173 s *Service 7174 urlParams_ gensupport.URLParams 7175 ifNoneMatch_ string 7176 ctx_ context.Context 7177 header_ http.Header 7178} 7179 7180// Lookup: Looks up the resource name 7181// (https://cloud.google.com/apis/design/resource_names) of a `Group` by 7182// its `EntityKey`. 7183func (r *GroupsService) Lookup() *GroupsLookupCall { 7184 c := &GroupsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7185 return c 7186} 7187 7188// GroupKeyId sets the optional parameter "groupKey.id": The ID of the 7189// entity. For Google-managed entities, the `id` must be the email 7190// address of an existing group or user. For external-identity-mapped 7191// entities, the `id` must be a string conforming to the Identity 7192// Source's requirements. Must be unique within a `namespace`. 7193func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall { 7194 c.urlParams_.Set("groupKey.id", groupKeyId) 7195 return c 7196} 7197 7198// GroupKeyNamespace sets the optional parameter "groupKey.namespace": 7199// The namespace in which the entity exists. If not specified, the 7200// `EntityKey` represents a Google-managed entity such as a Google user 7201// or a Google Group. If specified, the `EntityKey` represents an 7202// external-identity-mapped group. The namespace must correspond to an 7203// identity source created in Admin Console and must be in the form of 7204// `identitysources/{identity_source_id}`. 7205func (c *GroupsLookupCall) GroupKeyNamespace(groupKeyNamespace string) *GroupsLookupCall { 7206 c.urlParams_.Set("groupKey.namespace", groupKeyNamespace) 7207 return c 7208} 7209 7210// Fields allows partial responses to be retrieved. See 7211// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7212// for more information. 7213func (c *GroupsLookupCall) Fields(s ...googleapi.Field) *GroupsLookupCall { 7214 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7215 return c 7216} 7217 7218// IfNoneMatch sets the optional parameter which makes the operation 7219// fail if the object's ETag matches the given value. This is useful for 7220// getting updates only after the object has changed since the last 7221// request. Use googleapi.IsNotModified to check whether the response 7222// error from Do is the result of In-None-Match. 7223func (c *GroupsLookupCall) IfNoneMatch(entityTag string) *GroupsLookupCall { 7224 c.ifNoneMatch_ = entityTag 7225 return c 7226} 7227 7228// Context sets the context to be used in this call's Do method. Any 7229// pending HTTP request will be aborted if the provided context is 7230// canceled. 7231func (c *GroupsLookupCall) Context(ctx context.Context) *GroupsLookupCall { 7232 c.ctx_ = ctx 7233 return c 7234} 7235 7236// Header returns an http.Header that can be modified by the caller to 7237// add HTTP headers to the request. 7238func (c *GroupsLookupCall) Header() http.Header { 7239 if c.header_ == nil { 7240 c.header_ = make(http.Header) 7241 } 7242 return c.header_ 7243} 7244 7245func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) { 7246 reqHeaders := make(http.Header) 7247 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7248 for k, v := range c.header_ { 7249 reqHeaders[k] = v 7250 } 7251 reqHeaders.Set("User-Agent", c.s.userAgent()) 7252 if c.ifNoneMatch_ != "" { 7253 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7254 } 7255 var body io.Reader = nil 7256 c.urlParams_.Set("alt", alt) 7257 c.urlParams_.Set("prettyPrint", "false") 7258 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:lookup") 7259 urls += "?" + c.urlParams_.Encode() 7260 req, err := http.NewRequest("GET", urls, body) 7261 if err != nil { 7262 return nil, err 7263 } 7264 req.Header = reqHeaders 7265 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7266} 7267 7268// Do executes the "cloudidentity.groups.lookup" call. 7269// Exactly one of *LookupGroupNameResponse or error will be non-nil. Any 7270// non-2xx status code is an error. Response headers are in either 7271// *LookupGroupNameResponse.ServerResponse.Header or (if a response was 7272// returned at all) in error.(*googleapi.Error).Header. Use 7273// googleapi.IsNotModified to check whether the returned error was 7274// because http.StatusNotModified was returned. 7275func (c *GroupsLookupCall) Do(opts ...googleapi.CallOption) (*LookupGroupNameResponse, error) { 7276 gensupport.SetOptions(c.urlParams_, opts...) 7277 res, err := c.doRequest("json") 7278 if res != nil && res.StatusCode == http.StatusNotModified { 7279 if res.Body != nil { 7280 res.Body.Close() 7281 } 7282 return nil, &googleapi.Error{ 7283 Code: res.StatusCode, 7284 Header: res.Header, 7285 } 7286 } 7287 if err != nil { 7288 return nil, err 7289 } 7290 defer googleapi.CloseBody(res) 7291 if err := googleapi.CheckResponse(res); err != nil { 7292 return nil, err 7293 } 7294 ret := &LookupGroupNameResponse{ 7295 ServerResponse: googleapi.ServerResponse{ 7296 Header: res.Header, 7297 HTTPStatusCode: res.StatusCode, 7298 }, 7299 } 7300 target := &ret 7301 if err := gensupport.DecodeResponse(target, res); err != nil { 7302 return nil, err 7303 } 7304 return ret, nil 7305 // { 7306 // "description": "Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Group` by its `EntityKey`.", 7307 // "flatPath": "v1beta1/groups:lookup", 7308 // "httpMethod": "GET", 7309 // "id": "cloudidentity.groups.lookup", 7310 // "parameterOrder": [], 7311 // "parameters": { 7312 // "groupKey.id": { 7313 // "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`.", 7314 // "location": "query", 7315 // "type": "string" 7316 // }, 7317 // "groupKey.namespace": { 7318 // "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}`.", 7319 // "location": "query", 7320 // "type": "string" 7321 // } 7322 // }, 7323 // "path": "v1beta1/groups:lookup", 7324 // "response": { 7325 // "$ref": "LookupGroupNameResponse" 7326 // }, 7327 // "scopes": [ 7328 // "https://www.googleapis.com/auth/cloud-identity.groups", 7329 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7330 // "https://www.googleapis.com/auth/cloud-platform" 7331 // ] 7332 // } 7333 7334} 7335 7336// method id "cloudidentity.groups.patch": 7337 7338type GroupsPatchCall struct { 7339 s *Service 7340 name string 7341 group *Group 7342 urlParams_ gensupport.URLParams 7343 ctx_ context.Context 7344 header_ http.Header 7345} 7346 7347// Patch: Updates a `Group`. 7348// 7349// - name: Output only. The resource name 7350// (https://cloud.google.com/apis/design/resource_names) of the 7351// `Group`. Shall be of the form `groups/{group_id}`. 7352func (r *GroupsService) Patch(name string, group *Group) *GroupsPatchCall { 7353 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7354 c.name = name 7355 c.group = group 7356 return c 7357} 7358 7359// UpdateMask sets the optional parameter "updateMask": Required. The 7360// names of fields to update. May only contain the following fields: 7361// `display_name`, `description`, `labels`, `dynamic_group_metadata`, 7362// `posix_groups`. 7363func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall { 7364 c.urlParams_.Set("updateMask", updateMask) 7365 return c 7366} 7367 7368// Fields allows partial responses to be retrieved. See 7369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7370// for more information. 7371func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 7372 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7373 return c 7374} 7375 7376// Context sets the context to be used in this call's Do method. Any 7377// pending HTTP request will be aborted if the provided context is 7378// canceled. 7379func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 7380 c.ctx_ = ctx 7381 return c 7382} 7383 7384// Header returns an http.Header that can be modified by the caller to 7385// add HTTP headers to the request. 7386func (c *GroupsPatchCall) Header() http.Header { 7387 if c.header_ == nil { 7388 c.header_ = make(http.Header) 7389 } 7390 return c.header_ 7391} 7392 7393func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 7394 reqHeaders := make(http.Header) 7395 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7396 for k, v := range c.header_ { 7397 reqHeaders[k] = v 7398 } 7399 reqHeaders.Set("User-Agent", c.s.userAgent()) 7400 var body io.Reader = nil 7401 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 7402 if err != nil { 7403 return nil, err 7404 } 7405 reqHeaders.Set("Content-Type", "application/json") 7406 c.urlParams_.Set("alt", alt) 7407 c.urlParams_.Set("prettyPrint", "false") 7408 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7409 urls += "?" + c.urlParams_.Encode() 7410 req, err := http.NewRequest("PATCH", urls, body) 7411 if err != nil { 7412 return nil, err 7413 } 7414 req.Header = reqHeaders 7415 googleapi.Expand(req.URL, map[string]string{ 7416 "name": c.name, 7417 }) 7418 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7419} 7420 7421// Do executes the "cloudidentity.groups.patch" call. 7422// Exactly one of *Operation or error will be non-nil. Any non-2xx 7423// status code is an error. Response headers are in either 7424// *Operation.ServerResponse.Header or (if a response was returned at 7425// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7426// to check whether the returned error was because 7427// http.StatusNotModified was returned. 7428func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7429 gensupport.SetOptions(c.urlParams_, opts...) 7430 res, err := c.doRequest("json") 7431 if res != nil && res.StatusCode == http.StatusNotModified { 7432 if res.Body != nil { 7433 res.Body.Close() 7434 } 7435 return nil, &googleapi.Error{ 7436 Code: res.StatusCode, 7437 Header: res.Header, 7438 } 7439 } 7440 if err != nil { 7441 return nil, err 7442 } 7443 defer googleapi.CloseBody(res) 7444 if err := googleapi.CheckResponse(res); err != nil { 7445 return nil, err 7446 } 7447 ret := &Operation{ 7448 ServerResponse: googleapi.ServerResponse{ 7449 Header: res.Header, 7450 HTTPStatusCode: res.StatusCode, 7451 }, 7452 } 7453 target := &ret 7454 if err := gensupport.DecodeResponse(target, res); err != nil { 7455 return nil, err 7456 } 7457 return ret, nil 7458 // { 7459 // "description": "Updates a `Group`.", 7460 // "flatPath": "v1beta1/groups/{groupsId}", 7461 // "httpMethod": "PATCH", 7462 // "id": "cloudidentity.groups.patch", 7463 // "parameterOrder": [ 7464 // "name" 7465 // ], 7466 // "parameters": { 7467 // "name": { 7468 // "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}`.", 7469 // "location": "path", 7470 // "pattern": "^groups/[^/]+$", 7471 // "required": true, 7472 // "type": "string" 7473 // }, 7474 // "updateMask": { 7475 // "description": "Required. The names of fields to update. May only contain the following fields: `display_name`, `description`, `labels`, `dynamic_group_metadata`, `posix_groups`.", 7476 // "format": "google-fieldmask", 7477 // "location": "query", 7478 // "type": "string" 7479 // } 7480 // }, 7481 // "path": "v1beta1/{+name}", 7482 // "request": { 7483 // "$ref": "Group" 7484 // }, 7485 // "response": { 7486 // "$ref": "Operation" 7487 // }, 7488 // "scopes": [ 7489 // "https://www.googleapis.com/auth/cloud-identity.groups", 7490 // "https://www.googleapis.com/auth/cloud-platform" 7491 // ] 7492 // } 7493 7494} 7495 7496// method id "cloudidentity.groups.search": 7497 7498type GroupsSearchCall struct { 7499 s *Service 7500 urlParams_ gensupport.URLParams 7501 ifNoneMatch_ string 7502 ctx_ context.Context 7503 header_ http.Header 7504} 7505 7506// Search: Searches for `Group` resources matching a specified query. 7507func (r *GroupsService) Search() *GroupsSearchCall { 7508 c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7509 return c 7510} 7511 7512// PageSize sets the optional parameter "pageSize": The maximum number 7513// of results to return. Note that the number of results returned may be 7514// less than this value even if there are more available results. To 7515// fetch all results, clients must continue calling this method 7516// repeatedly until the response no longer contains a `next_page_token`. 7517// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for 7518// `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` 7519// or 500 for `GroupView.FULL`. 7520func (c *GroupsSearchCall) PageSize(pageSize int64) *GroupsSearchCall { 7521 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7522 return c 7523} 7524 7525// PageToken sets the optional parameter "pageToken": The 7526// `next_page_token` value returned from a previous search request, if 7527// any. 7528func (c *GroupsSearchCall) PageToken(pageToken string) *GroupsSearchCall { 7529 c.urlParams_.Set("pageToken", pageToken) 7530 return c 7531} 7532 7533// Query sets the optional parameter "query": Required. The search 7534// query. Must be specified in Common Expression Language 7535// (https://opensource.google/projects/cel). May only contain equality 7536// operators on the parent and inclusion operators on labels (e.g., 7537// `parent == 'customers/{customer_id}' && 7538// 'cloudidentity.googleapis.com/groups.discussion_forum' in labels`). 7539// The `customer_id` must begin with "C" (for example, 'C046psxkn'). 7540func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall { 7541 c.urlParams_.Set("query", query) 7542 return c 7543} 7544 7545// View sets the optional parameter "view": The level of detail to be 7546// returned. If unspecified, defaults to `View.BASIC`. 7547// 7548// Possible values: 7549// "BASIC" - Default. Only basic resource information is returned. 7550// "FULL" - All resource information is returned. 7551func (c *GroupsSearchCall) View(view string) *GroupsSearchCall { 7552 c.urlParams_.Set("view", view) 7553 return c 7554} 7555 7556// Fields allows partial responses to be retrieved. See 7557// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7558// for more information. 7559func (c *GroupsSearchCall) Fields(s ...googleapi.Field) *GroupsSearchCall { 7560 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7561 return c 7562} 7563 7564// IfNoneMatch sets the optional parameter which makes the operation 7565// fail if the object's ETag matches the given value. This is useful for 7566// getting updates only after the object has changed since the last 7567// request. Use googleapi.IsNotModified to check whether the response 7568// error from Do is the result of In-None-Match. 7569func (c *GroupsSearchCall) IfNoneMatch(entityTag string) *GroupsSearchCall { 7570 c.ifNoneMatch_ = entityTag 7571 return c 7572} 7573 7574// Context sets the context to be used in this call's Do method. Any 7575// pending HTTP request will be aborted if the provided context is 7576// canceled. 7577func (c *GroupsSearchCall) Context(ctx context.Context) *GroupsSearchCall { 7578 c.ctx_ = ctx 7579 return c 7580} 7581 7582// Header returns an http.Header that can be modified by the caller to 7583// add HTTP headers to the request. 7584func (c *GroupsSearchCall) Header() http.Header { 7585 if c.header_ == nil { 7586 c.header_ = make(http.Header) 7587 } 7588 return c.header_ 7589} 7590 7591func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) { 7592 reqHeaders := make(http.Header) 7593 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7594 for k, v := range c.header_ { 7595 reqHeaders[k] = v 7596 } 7597 reqHeaders.Set("User-Agent", c.s.userAgent()) 7598 if c.ifNoneMatch_ != "" { 7599 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7600 } 7601 var body io.Reader = nil 7602 c.urlParams_.Set("alt", alt) 7603 c.urlParams_.Set("prettyPrint", "false") 7604 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:search") 7605 urls += "?" + c.urlParams_.Encode() 7606 req, err := http.NewRequest("GET", urls, body) 7607 if err != nil { 7608 return nil, err 7609 } 7610 req.Header = reqHeaders 7611 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7612} 7613 7614// Do executes the "cloudidentity.groups.search" call. 7615// Exactly one of *SearchGroupsResponse or error will be non-nil. Any 7616// non-2xx status code is an error. Response headers are in either 7617// *SearchGroupsResponse.ServerResponse.Header or (if a response was 7618// returned at all) in error.(*googleapi.Error).Header. Use 7619// googleapi.IsNotModified to check whether the returned error was 7620// because http.StatusNotModified was returned. 7621func (c *GroupsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGroupsResponse, error) { 7622 gensupport.SetOptions(c.urlParams_, opts...) 7623 res, err := c.doRequest("json") 7624 if res != nil && res.StatusCode == http.StatusNotModified { 7625 if res.Body != nil { 7626 res.Body.Close() 7627 } 7628 return nil, &googleapi.Error{ 7629 Code: res.StatusCode, 7630 Header: res.Header, 7631 } 7632 } 7633 if err != nil { 7634 return nil, err 7635 } 7636 defer googleapi.CloseBody(res) 7637 if err := googleapi.CheckResponse(res); err != nil { 7638 return nil, err 7639 } 7640 ret := &SearchGroupsResponse{ 7641 ServerResponse: googleapi.ServerResponse{ 7642 Header: res.Header, 7643 HTTPStatusCode: res.StatusCode, 7644 }, 7645 } 7646 target := &ret 7647 if err := gensupport.DecodeResponse(target, res); err != nil { 7648 return nil, err 7649 } 7650 return ret, nil 7651 // { 7652 // "description": "Searches for `Group` resources matching a specified query.", 7653 // "flatPath": "v1beta1/groups:search", 7654 // "httpMethod": "GET", 7655 // "id": "cloudidentity.groups.search", 7656 // "parameterOrder": [], 7657 // "parameters": { 7658 // "pageSize": { 7659 // "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`.", 7660 // "format": "int32", 7661 // "location": "query", 7662 // "type": "integer" 7663 // }, 7664 // "pageToken": { 7665 // "description": "The `next_page_token` value returned from a previous search request, if any.", 7666 // "location": "query", 7667 // "type": "string" 7668 // }, 7669 // "query": { 7670 // "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').", 7671 // "location": "query", 7672 // "type": "string" 7673 // }, 7674 // "view": { 7675 // "description": "The level of detail to be returned. If unspecified, defaults to `View.BASIC`.", 7676 // "enum": [ 7677 // "BASIC", 7678 // "FULL" 7679 // ], 7680 // "enumDescriptions": [ 7681 // "Default. Only basic resource information is returned.", 7682 // "All resource information is returned." 7683 // ], 7684 // "location": "query", 7685 // "type": "string" 7686 // } 7687 // }, 7688 // "path": "v1beta1/groups:search", 7689 // "response": { 7690 // "$ref": "SearchGroupsResponse" 7691 // }, 7692 // "scopes": [ 7693 // "https://www.googleapis.com/auth/cloud-identity.groups", 7694 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7695 // "https://www.googleapis.com/auth/cloud-platform" 7696 // ] 7697 // } 7698 7699} 7700 7701// Pages invokes f for each page of results. 7702// A non-nil error returned from f will halt the iteration. 7703// The provided context supersedes any context provided to the Context method. 7704func (c *GroupsSearchCall) Pages(ctx context.Context, f func(*SearchGroupsResponse) error) error { 7705 c.ctx_ = ctx 7706 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7707 for { 7708 x, err := c.Do() 7709 if err != nil { 7710 return err 7711 } 7712 if err := f(x); err != nil { 7713 return err 7714 } 7715 if x.NextPageToken == "" { 7716 return nil 7717 } 7718 c.PageToken(x.NextPageToken) 7719 } 7720} 7721 7722// method id "cloudidentity.groups.memberships.checkTransitiveMembership": 7723 7724type GroupsMembershipsCheckTransitiveMembershipCall struct { 7725 s *Service 7726 parent string 7727 urlParams_ gensupport.URLParams 7728 ifNoneMatch_ string 7729 ctx_ context.Context 7730 header_ http.Header 7731} 7732 7733// CheckTransitiveMembership: Check a potential member for membership in 7734// a group. **Note:** This feature is only available to Google Workspace 7735// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 7736// and Cloud Identity Premium accounts. A member has membership to a 7737// group as long as there is a single viewable transitive membership 7738// between the group and the member. The actor must have view 7739// permissions to at least one transitive membership between the member 7740// and group. 7741// 7742// - parent: Resource name 7743// (https://cloud.google.com/apis/design/resource_names) of the group 7744// to check the transitive membership in. Format: `groups/{group_id}`, 7745// where `group_id` is the unique id assigned to the Group to which 7746// the Membership belongs to. 7747func (r *GroupsMembershipsService) CheckTransitiveMembership(parent string) *GroupsMembershipsCheckTransitiveMembershipCall { 7748 c := &GroupsMembershipsCheckTransitiveMembershipCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7749 c.parent = parent 7750 return c 7751} 7752 7753// Query sets the optional parameter "query": Required. A CEL expression 7754// that MUST include member specification. This is a `required` field. 7755// Certain groups are uniquely identified by both a 'member_key_id' and 7756// a 'member_key_namespace', which requires an additional query input: 7757// 'member_key_namespace'. Example query: `member_key_id == 7758// 'member_key_id_value'` 7759func (c *GroupsMembershipsCheckTransitiveMembershipCall) Query(query string) *GroupsMembershipsCheckTransitiveMembershipCall { 7760 c.urlParams_.Set("query", query) 7761 return c 7762} 7763 7764// Fields allows partial responses to be retrieved. See 7765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7766// for more information. 7767func (c *GroupsMembershipsCheckTransitiveMembershipCall) Fields(s ...googleapi.Field) *GroupsMembershipsCheckTransitiveMembershipCall { 7768 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7769 return c 7770} 7771 7772// IfNoneMatch sets the optional parameter which makes the operation 7773// fail if the object's ETag matches the given value. This is useful for 7774// getting updates only after the object has changed since the last 7775// request. Use googleapi.IsNotModified to check whether the response 7776// error from Do is the result of In-None-Match. 7777func (c *GroupsMembershipsCheckTransitiveMembershipCall) IfNoneMatch(entityTag string) *GroupsMembershipsCheckTransitiveMembershipCall { 7778 c.ifNoneMatch_ = entityTag 7779 return c 7780} 7781 7782// Context sets the context to be used in this call's Do method. Any 7783// pending HTTP request will be aborted if the provided context is 7784// canceled. 7785func (c *GroupsMembershipsCheckTransitiveMembershipCall) Context(ctx context.Context) *GroupsMembershipsCheckTransitiveMembershipCall { 7786 c.ctx_ = ctx 7787 return c 7788} 7789 7790// Header returns an http.Header that can be modified by the caller to 7791// add HTTP headers to the request. 7792func (c *GroupsMembershipsCheckTransitiveMembershipCall) Header() http.Header { 7793 if c.header_ == nil { 7794 c.header_ = make(http.Header) 7795 } 7796 return c.header_ 7797} 7798 7799func (c *GroupsMembershipsCheckTransitiveMembershipCall) doRequest(alt string) (*http.Response, error) { 7800 reqHeaders := make(http.Header) 7801 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7802 for k, v := range c.header_ { 7803 reqHeaders[k] = v 7804 } 7805 reqHeaders.Set("User-Agent", c.s.userAgent()) 7806 if c.ifNoneMatch_ != "" { 7807 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7808 } 7809 var body io.Reader = nil 7810 c.urlParams_.Set("alt", alt) 7811 c.urlParams_.Set("prettyPrint", "false") 7812 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:checkTransitiveMembership") 7813 urls += "?" + c.urlParams_.Encode() 7814 req, err := http.NewRequest("GET", urls, body) 7815 if err != nil { 7816 return nil, err 7817 } 7818 req.Header = reqHeaders 7819 googleapi.Expand(req.URL, map[string]string{ 7820 "parent": c.parent, 7821 }) 7822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7823} 7824 7825// Do executes the "cloudidentity.groups.memberships.checkTransitiveMembership" call. 7826// Exactly one of *CheckTransitiveMembershipResponse or error will be 7827// non-nil. Any non-2xx status code is an error. Response headers are in 7828// either *CheckTransitiveMembershipResponse.ServerResponse.Header or 7829// (if a response was returned at all) in 7830// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7831// whether the returned error was because http.StatusNotModified was 7832// returned. 7833func (c *GroupsMembershipsCheckTransitiveMembershipCall) Do(opts ...googleapi.CallOption) (*CheckTransitiveMembershipResponse, error) { 7834 gensupport.SetOptions(c.urlParams_, opts...) 7835 res, err := c.doRequest("json") 7836 if res != nil && res.StatusCode == http.StatusNotModified { 7837 if res.Body != nil { 7838 res.Body.Close() 7839 } 7840 return nil, &googleapi.Error{ 7841 Code: res.StatusCode, 7842 Header: res.Header, 7843 } 7844 } 7845 if err != nil { 7846 return nil, err 7847 } 7848 defer googleapi.CloseBody(res) 7849 if err := googleapi.CheckResponse(res); err != nil { 7850 return nil, err 7851 } 7852 ret := &CheckTransitiveMembershipResponse{ 7853 ServerResponse: googleapi.ServerResponse{ 7854 Header: res.Header, 7855 HTTPStatusCode: res.StatusCode, 7856 }, 7857 } 7858 target := &ret 7859 if err := gensupport.DecodeResponse(target, res); err != nil { 7860 return nil, err 7861 } 7862 return ret, nil 7863 // { 7864 // "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.", 7865 // "flatPath": "v1beta1/groups/{groupsId}/memberships:checkTransitiveMembership", 7866 // "httpMethod": "GET", 7867 // "id": "cloudidentity.groups.memberships.checkTransitiveMembership", 7868 // "parameterOrder": [ 7869 // "parent" 7870 // ], 7871 // "parameters": { 7872 // "parent": { 7873 // "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.", 7874 // "location": "path", 7875 // "pattern": "^groups/[^/]+$", 7876 // "required": true, 7877 // "type": "string" 7878 // }, 7879 // "query": { 7880 // "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'`", 7881 // "location": "query", 7882 // "type": "string" 7883 // } 7884 // }, 7885 // "path": "v1beta1/{+parent}/memberships:checkTransitiveMembership", 7886 // "response": { 7887 // "$ref": "CheckTransitiveMembershipResponse" 7888 // }, 7889 // "scopes": [ 7890 // "https://www.googleapis.com/auth/cloud-identity.groups", 7891 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 7892 // "https://www.googleapis.com/auth/cloud-platform" 7893 // ] 7894 // } 7895 7896} 7897 7898// method id "cloudidentity.groups.memberships.create": 7899 7900type GroupsMembershipsCreateCall struct { 7901 s *Service 7902 parent string 7903 membership *Membership 7904 urlParams_ gensupport.URLParams 7905 ctx_ context.Context 7906 header_ http.Header 7907} 7908 7909// Create: Creates a `Membership`. 7910// 7911// - parent: The parent `Group` resource under which to create the 7912// `Membership`. Must be of the form `groups/{group_id}`. 7913func (r *GroupsMembershipsService) Create(parent string, membership *Membership) *GroupsMembershipsCreateCall { 7914 c := &GroupsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7915 c.parent = parent 7916 c.membership = membership 7917 return c 7918} 7919 7920// Fields allows partial responses to be retrieved. See 7921// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7922// for more information. 7923func (c *GroupsMembershipsCreateCall) Fields(s ...googleapi.Field) *GroupsMembershipsCreateCall { 7924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7925 return c 7926} 7927 7928// Context sets the context to be used in this call's Do method. Any 7929// pending HTTP request will be aborted if the provided context is 7930// canceled. 7931func (c *GroupsMembershipsCreateCall) Context(ctx context.Context) *GroupsMembershipsCreateCall { 7932 c.ctx_ = ctx 7933 return c 7934} 7935 7936// Header returns an http.Header that can be modified by the caller to 7937// add HTTP headers to the request. 7938func (c *GroupsMembershipsCreateCall) Header() http.Header { 7939 if c.header_ == nil { 7940 c.header_ = make(http.Header) 7941 } 7942 return c.header_ 7943} 7944 7945func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { 7946 reqHeaders := make(http.Header) 7947 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7948 for k, v := range c.header_ { 7949 reqHeaders[k] = v 7950 } 7951 reqHeaders.Set("User-Agent", c.s.userAgent()) 7952 var body io.Reader = nil 7953 body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) 7954 if err != nil { 7955 return nil, err 7956 } 7957 reqHeaders.Set("Content-Type", "application/json") 7958 c.urlParams_.Set("alt", alt) 7959 c.urlParams_.Set("prettyPrint", "false") 7960 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 7961 urls += "?" + c.urlParams_.Encode() 7962 req, err := http.NewRequest("POST", urls, body) 7963 if err != nil { 7964 return nil, err 7965 } 7966 req.Header = reqHeaders 7967 googleapi.Expand(req.URL, map[string]string{ 7968 "parent": c.parent, 7969 }) 7970 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7971} 7972 7973// Do executes the "cloudidentity.groups.memberships.create" call. 7974// Exactly one of *Operation or error will be non-nil. Any non-2xx 7975// status code is an error. Response headers are in either 7976// *Operation.ServerResponse.Header or (if a response was returned at 7977// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7978// to check whether the returned error was because 7979// http.StatusNotModified was returned. 7980func (c *GroupsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7981 gensupport.SetOptions(c.urlParams_, opts...) 7982 res, err := c.doRequest("json") 7983 if res != nil && res.StatusCode == http.StatusNotModified { 7984 if res.Body != nil { 7985 res.Body.Close() 7986 } 7987 return nil, &googleapi.Error{ 7988 Code: res.StatusCode, 7989 Header: res.Header, 7990 } 7991 } 7992 if err != nil { 7993 return nil, err 7994 } 7995 defer googleapi.CloseBody(res) 7996 if err := googleapi.CheckResponse(res); err != nil { 7997 return nil, err 7998 } 7999 ret := &Operation{ 8000 ServerResponse: googleapi.ServerResponse{ 8001 Header: res.Header, 8002 HTTPStatusCode: res.StatusCode, 8003 }, 8004 } 8005 target := &ret 8006 if err := gensupport.DecodeResponse(target, res); err != nil { 8007 return nil, err 8008 } 8009 return ret, nil 8010 // { 8011 // "description": "Creates a `Membership`.", 8012 // "flatPath": "v1beta1/groups/{groupsId}/memberships", 8013 // "httpMethod": "POST", 8014 // "id": "cloudidentity.groups.memberships.create", 8015 // "parameterOrder": [ 8016 // "parent" 8017 // ], 8018 // "parameters": { 8019 // "parent": { 8020 // "description": "Required. The parent `Group` resource under which to create the `Membership`. Must be of the form `groups/{group_id}`.", 8021 // "location": "path", 8022 // "pattern": "^groups/[^/]+$", 8023 // "required": true, 8024 // "type": "string" 8025 // } 8026 // }, 8027 // "path": "v1beta1/{+parent}/memberships", 8028 // "request": { 8029 // "$ref": "Membership" 8030 // }, 8031 // "response": { 8032 // "$ref": "Operation" 8033 // }, 8034 // "scopes": [ 8035 // "https://www.googleapis.com/auth/cloud-identity.groups", 8036 // "https://www.googleapis.com/auth/cloud-platform" 8037 // ] 8038 // } 8039 8040} 8041 8042// method id "cloudidentity.groups.memberships.delete": 8043 8044type GroupsMembershipsDeleteCall struct { 8045 s *Service 8046 name string 8047 urlParams_ gensupport.URLParams 8048 ctx_ context.Context 8049 header_ http.Header 8050} 8051 8052// Delete: Deletes a `Membership`. 8053// 8054// - name: The resource name 8055// (https://cloud.google.com/apis/design/resource_names) of the 8056// `Membership` to delete. Must be of the form 8057// `groups/{group_id}/memberships/{membership_id}`. 8058func (r *GroupsMembershipsService) Delete(name string) *GroupsMembershipsDeleteCall { 8059 c := &GroupsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8060 c.name = name 8061 return c 8062} 8063 8064// Fields allows partial responses to be retrieved. See 8065// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8066// for more information. 8067func (c *GroupsMembershipsDeleteCall) Fields(s ...googleapi.Field) *GroupsMembershipsDeleteCall { 8068 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8069 return c 8070} 8071 8072// Context sets the context to be used in this call's Do method. Any 8073// pending HTTP request will be aborted if the provided context is 8074// canceled. 8075func (c *GroupsMembershipsDeleteCall) Context(ctx context.Context) *GroupsMembershipsDeleteCall { 8076 c.ctx_ = ctx 8077 return c 8078} 8079 8080// Header returns an http.Header that can be modified by the caller to 8081// add HTTP headers to the request. 8082func (c *GroupsMembershipsDeleteCall) Header() http.Header { 8083 if c.header_ == nil { 8084 c.header_ = make(http.Header) 8085 } 8086 return c.header_ 8087} 8088 8089func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { 8090 reqHeaders := make(http.Header) 8091 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8092 for k, v := range c.header_ { 8093 reqHeaders[k] = v 8094 } 8095 reqHeaders.Set("User-Agent", c.s.userAgent()) 8096 var body io.Reader = nil 8097 c.urlParams_.Set("alt", alt) 8098 c.urlParams_.Set("prettyPrint", "false") 8099 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8100 urls += "?" + c.urlParams_.Encode() 8101 req, err := http.NewRequest("DELETE", urls, body) 8102 if err != nil { 8103 return nil, err 8104 } 8105 req.Header = reqHeaders 8106 googleapi.Expand(req.URL, map[string]string{ 8107 "name": c.name, 8108 }) 8109 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8110} 8111 8112// Do executes the "cloudidentity.groups.memberships.delete" call. 8113// Exactly one of *Operation or error will be non-nil. Any non-2xx 8114// status code is an error. Response headers are in either 8115// *Operation.ServerResponse.Header or (if a response was returned at 8116// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8117// to check whether the returned error was because 8118// http.StatusNotModified was returned. 8119func (c *GroupsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8120 gensupport.SetOptions(c.urlParams_, opts...) 8121 res, err := c.doRequest("json") 8122 if res != nil && res.StatusCode == http.StatusNotModified { 8123 if res.Body != nil { 8124 res.Body.Close() 8125 } 8126 return nil, &googleapi.Error{ 8127 Code: res.StatusCode, 8128 Header: res.Header, 8129 } 8130 } 8131 if err != nil { 8132 return nil, err 8133 } 8134 defer googleapi.CloseBody(res) 8135 if err := googleapi.CheckResponse(res); err != nil { 8136 return nil, err 8137 } 8138 ret := &Operation{ 8139 ServerResponse: googleapi.ServerResponse{ 8140 Header: res.Header, 8141 HTTPStatusCode: res.StatusCode, 8142 }, 8143 } 8144 target := &ret 8145 if err := gensupport.DecodeResponse(target, res); err != nil { 8146 return nil, err 8147 } 8148 return ret, nil 8149 // { 8150 // "description": "Deletes a `Membership`.", 8151 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}", 8152 // "httpMethod": "DELETE", 8153 // "id": "cloudidentity.groups.memberships.delete", 8154 // "parameterOrder": [ 8155 // "name" 8156 // ], 8157 // "parameters": { 8158 // "name": { 8159 // "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}`.", 8160 // "location": "path", 8161 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 8162 // "required": true, 8163 // "type": "string" 8164 // } 8165 // }, 8166 // "path": "v1beta1/{+name}", 8167 // "response": { 8168 // "$ref": "Operation" 8169 // }, 8170 // "scopes": [ 8171 // "https://www.googleapis.com/auth/cloud-identity.groups", 8172 // "https://www.googleapis.com/auth/cloud-platform" 8173 // ] 8174 // } 8175 8176} 8177 8178// method id "cloudidentity.groups.memberships.get": 8179 8180type GroupsMembershipsGetCall struct { 8181 s *Service 8182 name string 8183 urlParams_ gensupport.URLParams 8184 ifNoneMatch_ string 8185 ctx_ context.Context 8186 header_ http.Header 8187} 8188 8189// Get: Retrieves a `Membership`. 8190// 8191// - name: The resource name 8192// (https://cloud.google.com/apis/design/resource_names) of the 8193// `Membership` to retrieve. Must be of the form 8194// `groups/{group_id}/memberships/{membership_id}`. 8195func (r *GroupsMembershipsService) Get(name string) *GroupsMembershipsGetCall { 8196 c := &GroupsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8197 c.name = name 8198 return c 8199} 8200 8201// Fields allows partial responses to be retrieved. See 8202// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8203// for more information. 8204func (c *GroupsMembershipsGetCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetCall { 8205 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8206 return c 8207} 8208 8209// IfNoneMatch sets the optional parameter which makes the operation 8210// fail if the object's ETag matches the given value. This is useful for 8211// getting updates only after the object has changed since the last 8212// request. Use googleapi.IsNotModified to check whether the response 8213// error from Do is the result of In-None-Match. 8214func (c *GroupsMembershipsGetCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetCall { 8215 c.ifNoneMatch_ = entityTag 8216 return c 8217} 8218 8219// Context sets the context to be used in this call's Do method. Any 8220// pending HTTP request will be aborted if the provided context is 8221// canceled. 8222func (c *GroupsMembershipsGetCall) Context(ctx context.Context) *GroupsMembershipsGetCall { 8223 c.ctx_ = ctx 8224 return c 8225} 8226 8227// Header returns an http.Header that can be modified by the caller to 8228// add HTTP headers to the request. 8229func (c *GroupsMembershipsGetCall) Header() http.Header { 8230 if c.header_ == nil { 8231 c.header_ = make(http.Header) 8232 } 8233 return c.header_ 8234} 8235 8236func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) { 8237 reqHeaders := make(http.Header) 8238 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8239 for k, v := range c.header_ { 8240 reqHeaders[k] = v 8241 } 8242 reqHeaders.Set("User-Agent", c.s.userAgent()) 8243 if c.ifNoneMatch_ != "" { 8244 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8245 } 8246 var body io.Reader = nil 8247 c.urlParams_.Set("alt", alt) 8248 c.urlParams_.Set("prettyPrint", "false") 8249 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 8250 urls += "?" + c.urlParams_.Encode() 8251 req, err := http.NewRequest("GET", urls, body) 8252 if err != nil { 8253 return nil, err 8254 } 8255 req.Header = reqHeaders 8256 googleapi.Expand(req.URL, map[string]string{ 8257 "name": c.name, 8258 }) 8259 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8260} 8261 8262// Do executes the "cloudidentity.groups.memberships.get" call. 8263// Exactly one of *Membership or error will be non-nil. Any non-2xx 8264// status code is an error. Response headers are in either 8265// *Membership.ServerResponse.Header or (if a response was returned at 8266// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8267// to check whether the returned error was because 8268// http.StatusNotModified was returned. 8269func (c *GroupsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) { 8270 gensupport.SetOptions(c.urlParams_, opts...) 8271 res, err := c.doRequest("json") 8272 if res != nil && res.StatusCode == http.StatusNotModified { 8273 if res.Body != nil { 8274 res.Body.Close() 8275 } 8276 return nil, &googleapi.Error{ 8277 Code: res.StatusCode, 8278 Header: res.Header, 8279 } 8280 } 8281 if err != nil { 8282 return nil, err 8283 } 8284 defer googleapi.CloseBody(res) 8285 if err := googleapi.CheckResponse(res); err != nil { 8286 return nil, err 8287 } 8288 ret := &Membership{ 8289 ServerResponse: googleapi.ServerResponse{ 8290 Header: res.Header, 8291 HTTPStatusCode: res.StatusCode, 8292 }, 8293 } 8294 target := &ret 8295 if err := gensupport.DecodeResponse(target, res); err != nil { 8296 return nil, err 8297 } 8298 return ret, nil 8299 // { 8300 // "description": "Retrieves a `Membership`.", 8301 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}", 8302 // "httpMethod": "GET", 8303 // "id": "cloudidentity.groups.memberships.get", 8304 // "parameterOrder": [ 8305 // "name" 8306 // ], 8307 // "parameters": { 8308 // "name": { 8309 // "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}`.", 8310 // "location": "path", 8311 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 8312 // "required": true, 8313 // "type": "string" 8314 // } 8315 // }, 8316 // "path": "v1beta1/{+name}", 8317 // "response": { 8318 // "$ref": "Membership" 8319 // }, 8320 // "scopes": [ 8321 // "https://www.googleapis.com/auth/cloud-identity.groups", 8322 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8323 // "https://www.googleapis.com/auth/cloud-platform" 8324 // ] 8325 // } 8326 8327} 8328 8329// method id "cloudidentity.groups.memberships.getMembershipGraph": 8330 8331type GroupsMembershipsGetMembershipGraphCall struct { 8332 s *Service 8333 parent string 8334 urlParams_ gensupport.URLParams 8335 ifNoneMatch_ string 8336 ctx_ context.Context 8337 header_ http.Header 8338} 8339 8340// GetMembershipGraph: Get a membership graph of just a member or both a 8341// member and a group. **Note:** This feature is only available to 8342// Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise 8343// for Education; and Cloud Identity Premium accounts. Given a member, 8344// the response will contain all membership paths from the member. Given 8345// both a group and a member, the response will contain all membership 8346// paths between the group and the member. 8347// 8348// - parent: Resource name 8349// (https://cloud.google.com/apis/design/resource_names) of the group 8350// to search transitive memberships in. Format: `groups/{group_id}`, 8351// where `group_id` is the unique ID assigned to the Group to which 8352// the Membership belongs to. group_id can be a wildcard collection id 8353// "-". When a group_id is specified, the membership graph will be 8354// constrained to paths between the member (defined in the query) and 8355// the parent. If a wildcard collection is provided, all membership 8356// paths connected to the member will be returned. 8357func (r *GroupsMembershipsService) GetMembershipGraph(parent string) *GroupsMembershipsGetMembershipGraphCall { 8358 c := &GroupsMembershipsGetMembershipGraphCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8359 c.parent = parent 8360 return c 8361} 8362 8363// Query sets the optional parameter "query": Required. A CEL expression 8364// that MUST include member specification AND label(s). Certain groups 8365// are uniquely identified by both a 'member_key_id' and a 8366// 'member_key_namespace', which requires an additional query input: 8367// 'member_key_namespace'. Example query: `member_key_id == 8368// 'member_key_id_value' && in labels` 8369func (c *GroupsMembershipsGetMembershipGraphCall) Query(query string) *GroupsMembershipsGetMembershipGraphCall { 8370 c.urlParams_.Set("query", query) 8371 return c 8372} 8373 8374// Fields allows partial responses to be retrieved. See 8375// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8376// for more information. 8377func (c *GroupsMembershipsGetMembershipGraphCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetMembershipGraphCall { 8378 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8379 return c 8380} 8381 8382// IfNoneMatch sets the optional parameter which makes the operation 8383// fail if the object's ETag matches the given value. This is useful for 8384// getting updates only after the object has changed since the last 8385// request. Use googleapi.IsNotModified to check whether the response 8386// error from Do is the result of In-None-Match. 8387func (c *GroupsMembershipsGetMembershipGraphCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetMembershipGraphCall { 8388 c.ifNoneMatch_ = entityTag 8389 return c 8390} 8391 8392// Context sets the context to be used in this call's Do method. Any 8393// pending HTTP request will be aborted if the provided context is 8394// canceled. 8395func (c *GroupsMembershipsGetMembershipGraphCall) Context(ctx context.Context) *GroupsMembershipsGetMembershipGraphCall { 8396 c.ctx_ = ctx 8397 return c 8398} 8399 8400// Header returns an http.Header that can be modified by the caller to 8401// add HTTP headers to the request. 8402func (c *GroupsMembershipsGetMembershipGraphCall) Header() http.Header { 8403 if c.header_ == nil { 8404 c.header_ = make(http.Header) 8405 } 8406 return c.header_ 8407} 8408 8409func (c *GroupsMembershipsGetMembershipGraphCall) doRequest(alt string) (*http.Response, error) { 8410 reqHeaders := make(http.Header) 8411 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8412 for k, v := range c.header_ { 8413 reqHeaders[k] = v 8414 } 8415 reqHeaders.Set("User-Agent", c.s.userAgent()) 8416 if c.ifNoneMatch_ != "" { 8417 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8418 } 8419 var body io.Reader = nil 8420 c.urlParams_.Set("alt", alt) 8421 c.urlParams_.Set("prettyPrint", "false") 8422 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:getMembershipGraph") 8423 urls += "?" + c.urlParams_.Encode() 8424 req, err := http.NewRequest("GET", urls, body) 8425 if err != nil { 8426 return nil, err 8427 } 8428 req.Header = reqHeaders 8429 googleapi.Expand(req.URL, map[string]string{ 8430 "parent": c.parent, 8431 }) 8432 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8433} 8434 8435// Do executes the "cloudidentity.groups.memberships.getMembershipGraph" call. 8436// Exactly one of *Operation or error will be non-nil. Any non-2xx 8437// status code is an error. Response headers are in either 8438// *Operation.ServerResponse.Header or (if a response was returned at 8439// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8440// to check whether the returned error was because 8441// http.StatusNotModified was returned. 8442func (c *GroupsMembershipsGetMembershipGraphCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8443 gensupport.SetOptions(c.urlParams_, opts...) 8444 res, err := c.doRequest("json") 8445 if res != nil && res.StatusCode == http.StatusNotModified { 8446 if res.Body != nil { 8447 res.Body.Close() 8448 } 8449 return nil, &googleapi.Error{ 8450 Code: res.StatusCode, 8451 Header: res.Header, 8452 } 8453 } 8454 if err != nil { 8455 return nil, err 8456 } 8457 defer googleapi.CloseBody(res) 8458 if err := googleapi.CheckResponse(res); err != nil { 8459 return nil, err 8460 } 8461 ret := &Operation{ 8462 ServerResponse: googleapi.ServerResponse{ 8463 Header: res.Header, 8464 HTTPStatusCode: res.StatusCode, 8465 }, 8466 } 8467 target := &ret 8468 if err := gensupport.DecodeResponse(target, res); err != nil { 8469 return nil, err 8470 } 8471 return ret, nil 8472 // { 8473 // "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.", 8474 // "flatPath": "v1beta1/groups/{groupsId}/memberships:getMembershipGraph", 8475 // "httpMethod": "GET", 8476 // "id": "cloudidentity.groups.memberships.getMembershipGraph", 8477 // "parameterOrder": [ 8478 // "parent" 8479 // ], 8480 // "parameters": { 8481 // "parent": { 8482 // "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.", 8483 // "location": "path", 8484 // "pattern": "^groups/[^/]+$", 8485 // "required": true, 8486 // "type": "string" 8487 // }, 8488 // "query": { 8489 // "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`", 8490 // "location": "query", 8491 // "type": "string" 8492 // } 8493 // }, 8494 // "path": "v1beta1/{+parent}/memberships:getMembershipGraph", 8495 // "response": { 8496 // "$ref": "Operation" 8497 // }, 8498 // "scopes": [ 8499 // "https://www.googleapis.com/auth/cloud-identity.groups", 8500 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8501 // "https://www.googleapis.com/auth/cloud-platform" 8502 // ] 8503 // } 8504 8505} 8506 8507// method id "cloudidentity.groups.memberships.list": 8508 8509type GroupsMembershipsListCall struct { 8510 s *Service 8511 parent string 8512 urlParams_ gensupport.URLParams 8513 ifNoneMatch_ string 8514 ctx_ context.Context 8515 header_ http.Header 8516} 8517 8518// List: Lists the `Membership`s within a `Group`. 8519// 8520// - parent: The parent `Group` resource under which to lookup the 8521// `Membership` name. Must be of the form `groups/{group_id}`. 8522func (r *GroupsMembershipsService) List(parent string) *GroupsMembershipsListCall { 8523 c := &GroupsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8524 c.parent = parent 8525 return c 8526} 8527 8528// PageSize sets the optional parameter "pageSize": The maximum number 8529// of results to return. Note that the number of results returned may be 8530// less than this value even if there are more available results. To 8531// fetch all results, clients must continue calling this method 8532// repeatedly until the response no longer contains a `next_page_token`. 8533// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for 8534// `GroupView.FULL`. Must not be greater than 1000 for `GroupView.BASIC` 8535// or 500 for `GroupView.FULL`. 8536func (c *GroupsMembershipsListCall) PageSize(pageSize int64) *GroupsMembershipsListCall { 8537 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8538 return c 8539} 8540 8541// PageToken sets the optional parameter "pageToken": The 8542// `next_page_token` value returned from a previous search request, if 8543// any. 8544func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall { 8545 c.urlParams_.Set("pageToken", pageToken) 8546 return c 8547} 8548 8549// View sets the optional parameter "view": The level of detail to be 8550// returned. If unspecified, defaults to `MembershipView.BASIC`. 8551// 8552// Possible values: 8553// "BASIC" - Default. Only basic resource information is returned. 8554// "FULL" - All resource information is returned. 8555func (c *GroupsMembershipsListCall) View(view string) *GroupsMembershipsListCall { 8556 c.urlParams_.Set("view", view) 8557 return c 8558} 8559 8560// Fields allows partial responses to be retrieved. See 8561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8562// for more information. 8563func (c *GroupsMembershipsListCall) Fields(s ...googleapi.Field) *GroupsMembershipsListCall { 8564 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8565 return c 8566} 8567 8568// IfNoneMatch sets the optional parameter which makes the operation 8569// fail if the object's ETag matches the given value. This is useful for 8570// getting updates only after the object has changed since the last 8571// request. Use googleapi.IsNotModified to check whether the response 8572// error from Do is the result of In-None-Match. 8573func (c *GroupsMembershipsListCall) IfNoneMatch(entityTag string) *GroupsMembershipsListCall { 8574 c.ifNoneMatch_ = entityTag 8575 return c 8576} 8577 8578// Context sets the context to be used in this call's Do method. Any 8579// pending HTTP request will be aborted if the provided context is 8580// canceled. 8581func (c *GroupsMembershipsListCall) Context(ctx context.Context) *GroupsMembershipsListCall { 8582 c.ctx_ = ctx 8583 return c 8584} 8585 8586// Header returns an http.Header that can be modified by the caller to 8587// add HTTP headers to the request. 8588func (c *GroupsMembershipsListCall) Header() http.Header { 8589 if c.header_ == nil { 8590 c.header_ = make(http.Header) 8591 } 8592 return c.header_ 8593} 8594 8595func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error) { 8596 reqHeaders := make(http.Header) 8597 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8598 for k, v := range c.header_ { 8599 reqHeaders[k] = v 8600 } 8601 reqHeaders.Set("User-Agent", c.s.userAgent()) 8602 if c.ifNoneMatch_ != "" { 8603 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8604 } 8605 var body io.Reader = nil 8606 c.urlParams_.Set("alt", alt) 8607 c.urlParams_.Set("prettyPrint", "false") 8608 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 8609 urls += "?" + c.urlParams_.Encode() 8610 req, err := http.NewRequest("GET", urls, body) 8611 if err != nil { 8612 return nil, err 8613 } 8614 req.Header = reqHeaders 8615 googleapi.Expand(req.URL, map[string]string{ 8616 "parent": c.parent, 8617 }) 8618 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8619} 8620 8621// Do executes the "cloudidentity.groups.memberships.list" call. 8622// Exactly one of *ListMembershipsResponse or error will be non-nil. Any 8623// non-2xx status code is an error. Response headers are in either 8624// *ListMembershipsResponse.ServerResponse.Header or (if a response was 8625// returned at all) in error.(*googleapi.Error).Header. Use 8626// googleapi.IsNotModified to check whether the returned error was 8627// because http.StatusNotModified was returned. 8628func (c *GroupsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) { 8629 gensupport.SetOptions(c.urlParams_, opts...) 8630 res, err := c.doRequest("json") 8631 if res != nil && res.StatusCode == http.StatusNotModified { 8632 if res.Body != nil { 8633 res.Body.Close() 8634 } 8635 return nil, &googleapi.Error{ 8636 Code: res.StatusCode, 8637 Header: res.Header, 8638 } 8639 } 8640 if err != nil { 8641 return nil, err 8642 } 8643 defer googleapi.CloseBody(res) 8644 if err := googleapi.CheckResponse(res); err != nil { 8645 return nil, err 8646 } 8647 ret := &ListMembershipsResponse{ 8648 ServerResponse: googleapi.ServerResponse{ 8649 Header: res.Header, 8650 HTTPStatusCode: res.StatusCode, 8651 }, 8652 } 8653 target := &ret 8654 if err := gensupport.DecodeResponse(target, res); err != nil { 8655 return nil, err 8656 } 8657 return ret, nil 8658 // { 8659 // "description": "Lists the `Membership`s within a `Group`.", 8660 // "flatPath": "v1beta1/groups/{groupsId}/memberships", 8661 // "httpMethod": "GET", 8662 // "id": "cloudidentity.groups.memberships.list", 8663 // "parameterOrder": [ 8664 // "parent" 8665 // ], 8666 // "parameters": { 8667 // "pageSize": { 8668 // "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`.", 8669 // "format": "int32", 8670 // "location": "query", 8671 // "type": "integer" 8672 // }, 8673 // "pageToken": { 8674 // "description": "The `next_page_token` value returned from a previous search request, if any.", 8675 // "location": "query", 8676 // "type": "string" 8677 // }, 8678 // "parent": { 8679 // "description": "Required. The parent `Group` resource under which to lookup the `Membership` name. Must be of the form `groups/{group_id}`.", 8680 // "location": "path", 8681 // "pattern": "^groups/[^/]+$", 8682 // "required": true, 8683 // "type": "string" 8684 // }, 8685 // "view": { 8686 // "description": "The level of detail to be returned. If unspecified, defaults to `MembershipView.BASIC`.", 8687 // "enum": [ 8688 // "BASIC", 8689 // "FULL" 8690 // ], 8691 // "enumDescriptions": [ 8692 // "Default. Only basic resource information is returned.", 8693 // "All resource information is returned." 8694 // ], 8695 // "location": "query", 8696 // "type": "string" 8697 // } 8698 // }, 8699 // "path": "v1beta1/{+parent}/memberships", 8700 // "response": { 8701 // "$ref": "ListMembershipsResponse" 8702 // }, 8703 // "scopes": [ 8704 // "https://www.googleapis.com/auth/cloud-identity.groups", 8705 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8706 // "https://www.googleapis.com/auth/cloud-platform" 8707 // ] 8708 // } 8709 8710} 8711 8712// Pages invokes f for each page of results. 8713// A non-nil error returned from f will halt the iteration. 8714// The provided context supersedes any context provided to the Context method. 8715func (c *GroupsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error { 8716 c.ctx_ = ctx 8717 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8718 for { 8719 x, err := c.Do() 8720 if err != nil { 8721 return err 8722 } 8723 if err := f(x); err != nil { 8724 return err 8725 } 8726 if x.NextPageToken == "" { 8727 return nil 8728 } 8729 c.PageToken(x.NextPageToken) 8730 } 8731} 8732 8733// method id "cloudidentity.groups.memberships.lookup": 8734 8735type GroupsMembershipsLookupCall struct { 8736 s *Service 8737 parent string 8738 urlParams_ gensupport.URLParams 8739 ifNoneMatch_ string 8740 ctx_ context.Context 8741 header_ http.Header 8742} 8743 8744// Lookup: Looks up the resource name 8745// (https://cloud.google.com/apis/design/resource_names) of a 8746// `Membership` by its `EntityKey`. 8747// 8748// - parent: The parent `Group` resource under which to lookup the 8749// `Membership` name. Must be of the form `groups/{group_id}`. 8750func (r *GroupsMembershipsService) Lookup(parent string) *GroupsMembershipsLookupCall { 8751 c := &GroupsMembershipsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8752 c.parent = parent 8753 return c 8754} 8755 8756// MemberKeyId sets the optional parameter "memberKey.id": The ID of the 8757// entity. For Google-managed entities, the `id` must be the email 8758// address of an existing group or user. For external-identity-mapped 8759// entities, the `id` must be a string conforming to the Identity 8760// Source's requirements. Must be unique within a `namespace`. 8761func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall { 8762 c.urlParams_.Set("memberKey.id", memberKeyId) 8763 return c 8764} 8765 8766// MemberKeyNamespace sets the optional parameter "memberKey.namespace": 8767// The namespace in which the entity exists. If not specified, the 8768// `EntityKey` represents a Google-managed entity such as a Google user 8769// or a Google Group. If specified, the `EntityKey` represents an 8770// external-identity-mapped group. The namespace must correspond to an 8771// identity source created in Admin Console and must be in the form of 8772// `identitysources/{identity_source_id}`. 8773func (c *GroupsMembershipsLookupCall) MemberKeyNamespace(memberKeyNamespace string) *GroupsMembershipsLookupCall { 8774 c.urlParams_.Set("memberKey.namespace", memberKeyNamespace) 8775 return c 8776} 8777 8778// Fields allows partial responses to be retrieved. See 8779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8780// for more information. 8781func (c *GroupsMembershipsLookupCall) Fields(s ...googleapi.Field) *GroupsMembershipsLookupCall { 8782 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8783 return c 8784} 8785 8786// IfNoneMatch sets the optional parameter which makes the operation 8787// fail if the object's ETag matches the given value. This is useful for 8788// getting updates only after the object has changed since the last 8789// request. Use googleapi.IsNotModified to check whether the response 8790// error from Do is the result of In-None-Match. 8791func (c *GroupsMembershipsLookupCall) IfNoneMatch(entityTag string) *GroupsMembershipsLookupCall { 8792 c.ifNoneMatch_ = entityTag 8793 return c 8794} 8795 8796// Context sets the context to be used in this call's Do method. Any 8797// pending HTTP request will be aborted if the provided context is 8798// canceled. 8799func (c *GroupsMembershipsLookupCall) Context(ctx context.Context) *GroupsMembershipsLookupCall { 8800 c.ctx_ = ctx 8801 return c 8802} 8803 8804// Header returns an http.Header that can be modified by the caller to 8805// add HTTP headers to the request. 8806func (c *GroupsMembershipsLookupCall) Header() http.Header { 8807 if c.header_ == nil { 8808 c.header_ = make(http.Header) 8809 } 8810 return c.header_ 8811} 8812 8813func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, error) { 8814 reqHeaders := make(http.Header) 8815 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8816 for k, v := range c.header_ { 8817 reqHeaders[k] = v 8818 } 8819 reqHeaders.Set("User-Agent", c.s.userAgent()) 8820 if c.ifNoneMatch_ != "" { 8821 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8822 } 8823 var body io.Reader = nil 8824 c.urlParams_.Set("alt", alt) 8825 c.urlParams_.Set("prettyPrint", "false") 8826 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:lookup") 8827 urls += "?" + c.urlParams_.Encode() 8828 req, err := http.NewRequest("GET", urls, body) 8829 if err != nil { 8830 return nil, err 8831 } 8832 req.Header = reqHeaders 8833 googleapi.Expand(req.URL, map[string]string{ 8834 "parent": c.parent, 8835 }) 8836 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8837} 8838 8839// Do executes the "cloudidentity.groups.memberships.lookup" call. 8840// Exactly one of *LookupMembershipNameResponse or error will be 8841// non-nil. Any non-2xx status code is an error. Response headers are in 8842// either *LookupMembershipNameResponse.ServerResponse.Header or (if a 8843// response was returned at all) in error.(*googleapi.Error).Header. Use 8844// googleapi.IsNotModified to check whether the returned error was 8845// because http.StatusNotModified was returned. 8846func (c *GroupsMembershipsLookupCall) Do(opts ...googleapi.CallOption) (*LookupMembershipNameResponse, error) { 8847 gensupport.SetOptions(c.urlParams_, opts...) 8848 res, err := c.doRequest("json") 8849 if res != nil && res.StatusCode == http.StatusNotModified { 8850 if res.Body != nil { 8851 res.Body.Close() 8852 } 8853 return nil, &googleapi.Error{ 8854 Code: res.StatusCode, 8855 Header: res.Header, 8856 } 8857 } 8858 if err != nil { 8859 return nil, err 8860 } 8861 defer googleapi.CloseBody(res) 8862 if err := googleapi.CheckResponse(res); err != nil { 8863 return nil, err 8864 } 8865 ret := &LookupMembershipNameResponse{ 8866 ServerResponse: googleapi.ServerResponse{ 8867 Header: res.Header, 8868 HTTPStatusCode: res.StatusCode, 8869 }, 8870 } 8871 target := &ret 8872 if err := gensupport.DecodeResponse(target, res); err != nil { 8873 return nil, err 8874 } 8875 return ret, nil 8876 // { 8877 // "description": "Looks up the [resource name](https://cloud.google.com/apis/design/resource_names) of a `Membership` by its `EntityKey`.", 8878 // "flatPath": "v1beta1/groups/{groupsId}/memberships:lookup", 8879 // "httpMethod": "GET", 8880 // "id": "cloudidentity.groups.memberships.lookup", 8881 // "parameterOrder": [ 8882 // "parent" 8883 // ], 8884 // "parameters": { 8885 // "memberKey.id": { 8886 // "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`.", 8887 // "location": "query", 8888 // "type": "string" 8889 // }, 8890 // "memberKey.namespace": { 8891 // "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}`.", 8892 // "location": "query", 8893 // "type": "string" 8894 // }, 8895 // "parent": { 8896 // "description": "Required. The parent `Group` resource under which to lookup the `Membership` name. Must be of the form `groups/{group_id}`.", 8897 // "location": "path", 8898 // "pattern": "^groups/[^/]+$", 8899 // "required": true, 8900 // "type": "string" 8901 // } 8902 // }, 8903 // "path": "v1beta1/{+parent}/memberships:lookup", 8904 // "response": { 8905 // "$ref": "LookupMembershipNameResponse" 8906 // }, 8907 // "scopes": [ 8908 // "https://www.googleapis.com/auth/cloud-identity.groups", 8909 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 8910 // "https://www.googleapis.com/auth/cloud-platform" 8911 // ] 8912 // } 8913 8914} 8915 8916// method id "cloudidentity.groups.memberships.modifyMembershipRoles": 8917 8918type GroupsMembershipsModifyMembershipRolesCall struct { 8919 s *Service 8920 name string 8921 modifymembershiprolesrequest *ModifyMembershipRolesRequest 8922 urlParams_ gensupport.URLParams 8923 ctx_ context.Context 8924 header_ http.Header 8925} 8926 8927// ModifyMembershipRoles: Modifies the `MembershipRole`s of a 8928// `Membership`. 8929// 8930// - name: The resource name 8931// (https://cloud.google.com/apis/design/resource_names) of the 8932// `Membership` whose roles are to be modified. Must be of the form 8933// `groups/{group_id}/memberships/{membership_id}`. 8934func (r *GroupsMembershipsService) ModifyMembershipRoles(name string, modifymembershiprolesrequest *ModifyMembershipRolesRequest) *GroupsMembershipsModifyMembershipRolesCall { 8935 c := &GroupsMembershipsModifyMembershipRolesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8936 c.name = name 8937 c.modifymembershiprolesrequest = modifymembershiprolesrequest 8938 return c 8939} 8940 8941// Fields allows partial responses to be retrieved. See 8942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8943// for more information. 8944func (c *GroupsMembershipsModifyMembershipRolesCall) Fields(s ...googleapi.Field) *GroupsMembershipsModifyMembershipRolesCall { 8945 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8946 return c 8947} 8948 8949// Context sets the context to be used in this call's Do method. Any 8950// pending HTTP request will be aborted if the provided context is 8951// canceled. 8952func (c *GroupsMembershipsModifyMembershipRolesCall) Context(ctx context.Context) *GroupsMembershipsModifyMembershipRolesCall { 8953 c.ctx_ = ctx 8954 return c 8955} 8956 8957// Header returns an http.Header that can be modified by the caller to 8958// add HTTP headers to the request. 8959func (c *GroupsMembershipsModifyMembershipRolesCall) Header() http.Header { 8960 if c.header_ == nil { 8961 c.header_ = make(http.Header) 8962 } 8963 return c.header_ 8964} 8965 8966func (c *GroupsMembershipsModifyMembershipRolesCall) doRequest(alt string) (*http.Response, error) { 8967 reqHeaders := make(http.Header) 8968 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8969 for k, v := range c.header_ { 8970 reqHeaders[k] = v 8971 } 8972 reqHeaders.Set("User-Agent", c.s.userAgent()) 8973 var body io.Reader = nil 8974 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymembershiprolesrequest) 8975 if err != nil { 8976 return nil, err 8977 } 8978 reqHeaders.Set("Content-Type", "application/json") 8979 c.urlParams_.Set("alt", alt) 8980 c.urlParams_.Set("prettyPrint", "false") 8981 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:modifyMembershipRoles") 8982 urls += "?" + c.urlParams_.Encode() 8983 req, err := http.NewRequest("POST", urls, body) 8984 if err != nil { 8985 return nil, err 8986 } 8987 req.Header = reqHeaders 8988 googleapi.Expand(req.URL, map[string]string{ 8989 "name": c.name, 8990 }) 8991 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8992} 8993 8994// Do executes the "cloudidentity.groups.memberships.modifyMembershipRoles" call. 8995// Exactly one of *ModifyMembershipRolesResponse or error will be 8996// non-nil. Any non-2xx status code is an error. Response headers are in 8997// either *ModifyMembershipRolesResponse.ServerResponse.Header or (if a 8998// response was returned at all) in error.(*googleapi.Error).Header. Use 8999// googleapi.IsNotModified to check whether the returned error was 9000// because http.StatusNotModified was returned. 9001func (c *GroupsMembershipsModifyMembershipRolesCall) Do(opts ...googleapi.CallOption) (*ModifyMembershipRolesResponse, error) { 9002 gensupport.SetOptions(c.urlParams_, opts...) 9003 res, err := c.doRequest("json") 9004 if res != nil && res.StatusCode == http.StatusNotModified { 9005 if res.Body != nil { 9006 res.Body.Close() 9007 } 9008 return nil, &googleapi.Error{ 9009 Code: res.StatusCode, 9010 Header: res.Header, 9011 } 9012 } 9013 if err != nil { 9014 return nil, err 9015 } 9016 defer googleapi.CloseBody(res) 9017 if err := googleapi.CheckResponse(res); err != nil { 9018 return nil, err 9019 } 9020 ret := &ModifyMembershipRolesResponse{ 9021 ServerResponse: googleapi.ServerResponse{ 9022 Header: res.Header, 9023 HTTPStatusCode: res.StatusCode, 9024 }, 9025 } 9026 target := &ret 9027 if err := gensupport.DecodeResponse(target, res); err != nil { 9028 return nil, err 9029 } 9030 return ret, nil 9031 // { 9032 // "description": "Modifies the `MembershipRole`s of a `Membership`.", 9033 // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}:modifyMembershipRoles", 9034 // "httpMethod": "POST", 9035 // "id": "cloudidentity.groups.memberships.modifyMembershipRoles", 9036 // "parameterOrder": [ 9037 // "name" 9038 // ], 9039 // "parameters": { 9040 // "name": { 9041 // "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}`.", 9042 // "location": "path", 9043 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 9044 // "required": true, 9045 // "type": "string" 9046 // } 9047 // }, 9048 // "path": "v1beta1/{+name}:modifyMembershipRoles", 9049 // "request": { 9050 // "$ref": "ModifyMembershipRolesRequest" 9051 // }, 9052 // "response": { 9053 // "$ref": "ModifyMembershipRolesResponse" 9054 // }, 9055 // "scopes": [ 9056 // "https://www.googleapis.com/auth/cloud-identity.groups", 9057 // "https://www.googleapis.com/auth/cloud-platform" 9058 // ] 9059 // } 9060 9061} 9062 9063// method id "cloudidentity.groups.memberships.searchTransitiveGroups": 9064 9065type GroupsMembershipsSearchTransitiveGroupsCall struct { 9066 s *Service 9067 parent string 9068 urlParams_ gensupport.URLParams 9069 ifNoneMatch_ string 9070 ctx_ context.Context 9071 header_ http.Header 9072} 9073 9074// SearchTransitiveGroups: Search transitive groups of a member. 9075// **Note:** This feature is only available to Google Workspace 9076// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 9077// and Cloud Identity Premium accounts. A transitive group is any group 9078// that has a direct or indirect membership to the member. Actor must 9079// have view permissions all transitive groups. 9080// 9081// - parent: Resource name 9082// (https://cloud.google.com/apis/design/resource_names) of the group 9083// to search transitive memberships in. Format: `groups/{group_id}`, 9084// where `group_id` is always '-' as this API will search across all 9085// groups for a given member. 9086func (r *GroupsMembershipsService) SearchTransitiveGroups(parent string) *GroupsMembershipsSearchTransitiveGroupsCall { 9087 c := &GroupsMembershipsSearchTransitiveGroupsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9088 c.parent = parent 9089 return c 9090} 9091 9092// PageSize sets the optional parameter "pageSize": The default page 9093// size is 200 (max 1000). 9094func (c *GroupsMembershipsSearchTransitiveGroupsCall) PageSize(pageSize int64) *GroupsMembershipsSearchTransitiveGroupsCall { 9095 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9096 return c 9097} 9098 9099// PageToken sets the optional parameter "pageToken": The 9100// next_page_token value returned from a previous list request, if any. 9101func (c *GroupsMembershipsSearchTransitiveGroupsCall) PageToken(pageToken string) *GroupsMembershipsSearchTransitiveGroupsCall { 9102 c.urlParams_.Set("pageToken", pageToken) 9103 return c 9104} 9105 9106// Query sets the optional parameter "query": Required. A CEL expression 9107// that MUST include member specification AND label(s). This is a 9108// `required` field. Users can search on label attributes of groups. 9109// CONTAINS match ('in') is supported on labels. Identity-mapped groups 9110// are uniquely identified by both a `member_key_id` and a 9111// `member_key_namespace`, which requires an additional query input: 9112// `member_key_namespace`. Example query: `member_key_id == 9113// 'member_key_id_value' && in labels` 9114func (c *GroupsMembershipsSearchTransitiveGroupsCall) Query(query string) *GroupsMembershipsSearchTransitiveGroupsCall { 9115 c.urlParams_.Set("query", query) 9116 return c 9117} 9118 9119// Fields allows partial responses to be retrieved. See 9120// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9121// for more information. 9122func (c *GroupsMembershipsSearchTransitiveGroupsCall) Fields(s ...googleapi.Field) *GroupsMembershipsSearchTransitiveGroupsCall { 9123 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9124 return c 9125} 9126 9127// IfNoneMatch sets the optional parameter which makes the operation 9128// fail if the object's ETag matches the given value. This is useful for 9129// getting updates only after the object has changed since the last 9130// request. Use googleapi.IsNotModified to check whether the response 9131// error from Do is the result of In-None-Match. 9132func (c *GroupsMembershipsSearchTransitiveGroupsCall) IfNoneMatch(entityTag string) *GroupsMembershipsSearchTransitiveGroupsCall { 9133 c.ifNoneMatch_ = entityTag 9134 return c 9135} 9136 9137// Context sets the context to be used in this call's Do method. Any 9138// pending HTTP request will be aborted if the provided context is 9139// canceled. 9140func (c *GroupsMembershipsSearchTransitiveGroupsCall) Context(ctx context.Context) *GroupsMembershipsSearchTransitiveGroupsCall { 9141 c.ctx_ = ctx 9142 return c 9143} 9144 9145// Header returns an http.Header that can be modified by the caller to 9146// add HTTP headers to the request. 9147func (c *GroupsMembershipsSearchTransitiveGroupsCall) Header() http.Header { 9148 if c.header_ == nil { 9149 c.header_ = make(http.Header) 9150 } 9151 return c.header_ 9152} 9153 9154func (c *GroupsMembershipsSearchTransitiveGroupsCall) doRequest(alt string) (*http.Response, error) { 9155 reqHeaders := make(http.Header) 9156 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9157 for k, v := range c.header_ { 9158 reqHeaders[k] = v 9159 } 9160 reqHeaders.Set("User-Agent", c.s.userAgent()) 9161 if c.ifNoneMatch_ != "" { 9162 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9163 } 9164 var body io.Reader = nil 9165 c.urlParams_.Set("alt", alt) 9166 c.urlParams_.Set("prettyPrint", "false") 9167 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveGroups") 9168 urls += "?" + c.urlParams_.Encode() 9169 req, err := http.NewRequest("GET", urls, body) 9170 if err != nil { 9171 return nil, err 9172 } 9173 req.Header = reqHeaders 9174 googleapi.Expand(req.URL, map[string]string{ 9175 "parent": c.parent, 9176 }) 9177 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9178} 9179 9180// Do executes the "cloudidentity.groups.memberships.searchTransitiveGroups" call. 9181// Exactly one of *SearchTransitiveGroupsResponse or error will be 9182// non-nil. Any non-2xx status code is an error. Response headers are in 9183// either *SearchTransitiveGroupsResponse.ServerResponse.Header or (if a 9184// response was returned at all) in error.(*googleapi.Error).Header. Use 9185// googleapi.IsNotModified to check whether the returned error was 9186// because http.StatusNotModified was returned. 9187func (c *GroupsMembershipsSearchTransitiveGroupsCall) Do(opts ...googleapi.CallOption) (*SearchTransitiveGroupsResponse, error) { 9188 gensupport.SetOptions(c.urlParams_, opts...) 9189 res, err := c.doRequest("json") 9190 if res != nil && res.StatusCode == http.StatusNotModified { 9191 if res.Body != nil { 9192 res.Body.Close() 9193 } 9194 return nil, &googleapi.Error{ 9195 Code: res.StatusCode, 9196 Header: res.Header, 9197 } 9198 } 9199 if err != nil { 9200 return nil, err 9201 } 9202 defer googleapi.CloseBody(res) 9203 if err := googleapi.CheckResponse(res); err != nil { 9204 return nil, err 9205 } 9206 ret := &SearchTransitiveGroupsResponse{ 9207 ServerResponse: googleapi.ServerResponse{ 9208 Header: res.Header, 9209 HTTPStatusCode: res.StatusCode, 9210 }, 9211 } 9212 target := &ret 9213 if err := gensupport.DecodeResponse(target, res); err != nil { 9214 return nil, err 9215 } 9216 return ret, nil 9217 // { 9218 // "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.", 9219 // "flatPath": "v1beta1/groups/{groupsId}/memberships:searchTransitiveGroups", 9220 // "httpMethod": "GET", 9221 // "id": "cloudidentity.groups.memberships.searchTransitiveGroups", 9222 // "parameterOrder": [ 9223 // "parent" 9224 // ], 9225 // "parameters": { 9226 // "pageSize": { 9227 // "description": "The default page size is 200 (max 1000).", 9228 // "format": "int32", 9229 // "location": "query", 9230 // "type": "integer" 9231 // }, 9232 // "pageToken": { 9233 // "description": "The next_page_token value returned from a previous list request, if any.", 9234 // "location": "query", 9235 // "type": "string" 9236 // }, 9237 // "parent": { 9238 // "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.", 9239 // "location": "path", 9240 // "pattern": "^groups/[^/]+$", 9241 // "required": true, 9242 // "type": "string" 9243 // }, 9244 // "query": { 9245 // "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`", 9246 // "location": "query", 9247 // "type": "string" 9248 // } 9249 // }, 9250 // "path": "v1beta1/{+parent}/memberships:searchTransitiveGroups", 9251 // "response": { 9252 // "$ref": "SearchTransitiveGroupsResponse" 9253 // }, 9254 // "scopes": [ 9255 // "https://www.googleapis.com/auth/cloud-identity.groups", 9256 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9257 // "https://www.googleapis.com/auth/cloud-platform" 9258 // ] 9259 // } 9260 9261} 9262 9263// Pages invokes f for each page of results. 9264// A non-nil error returned from f will halt the iteration. 9265// The provided context supersedes any context provided to the Context method. 9266func (c *GroupsMembershipsSearchTransitiveGroupsCall) Pages(ctx context.Context, f func(*SearchTransitiveGroupsResponse) error) error { 9267 c.ctx_ = ctx 9268 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9269 for { 9270 x, err := c.Do() 9271 if err != nil { 9272 return err 9273 } 9274 if err := f(x); err != nil { 9275 return err 9276 } 9277 if x.NextPageToken == "" { 9278 return nil 9279 } 9280 c.PageToken(x.NextPageToken) 9281 } 9282} 9283 9284// method id "cloudidentity.groups.memberships.searchTransitiveMemberships": 9285 9286type GroupsMembershipsSearchTransitiveMembershipsCall struct { 9287 s *Service 9288 parent string 9289 urlParams_ gensupport.URLParams 9290 ifNoneMatch_ string 9291 ctx_ context.Context 9292 header_ http.Header 9293} 9294 9295// SearchTransitiveMemberships: Search transitive memberships of a 9296// group. **Note:** This feature is only available to Google Workspace 9297// Enterprise Standard, Enterprise Plus, and Enterprise for Education; 9298// and Cloud Identity Premium accounts. A transitive membership is any 9299// direct or indirect membership of a group. Actor must have view 9300// permissions to all transitive memberships. 9301// 9302// - parent: Resource name 9303// (https://cloud.google.com/apis/design/resource_names) of the group 9304// to search transitive memberships in. Format: `groups/{group_id}`, 9305// where `group_id` is the unique ID assigned to the Group. 9306func (r *GroupsMembershipsService) SearchTransitiveMemberships(parent string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9307 c := &GroupsMembershipsSearchTransitiveMembershipsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9308 c.parent = parent 9309 return c 9310} 9311 9312// PageSize sets the optional parameter "pageSize": The default page 9313// size is 200 (max 1000). 9314func (c *GroupsMembershipsSearchTransitiveMembershipsCall) PageSize(pageSize int64) *GroupsMembershipsSearchTransitiveMembershipsCall { 9315 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9316 return c 9317} 9318 9319// PageToken sets the optional parameter "pageToken": The 9320// next_page_token value returned from a previous list request, if any. 9321func (c *GroupsMembershipsSearchTransitiveMembershipsCall) PageToken(pageToken string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9322 c.urlParams_.Set("pageToken", pageToken) 9323 return c 9324} 9325 9326// Fields allows partial responses to be retrieved. See 9327// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9328// for more information. 9329func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Fields(s ...googleapi.Field) *GroupsMembershipsSearchTransitiveMembershipsCall { 9330 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9331 return c 9332} 9333 9334// IfNoneMatch sets the optional parameter which makes the operation 9335// fail if the object's ETag matches the given value. This is useful for 9336// getting updates only after the object has changed since the last 9337// request. Use googleapi.IsNotModified to check whether the response 9338// error from Do is the result of In-None-Match. 9339func (c *GroupsMembershipsSearchTransitiveMembershipsCall) IfNoneMatch(entityTag string) *GroupsMembershipsSearchTransitiveMembershipsCall { 9340 c.ifNoneMatch_ = entityTag 9341 return c 9342} 9343 9344// Context sets the context to be used in this call's Do method. Any 9345// pending HTTP request will be aborted if the provided context is 9346// canceled. 9347func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Context(ctx context.Context) *GroupsMembershipsSearchTransitiveMembershipsCall { 9348 c.ctx_ = ctx 9349 return c 9350} 9351 9352// Header returns an http.Header that can be modified by the caller to 9353// add HTTP headers to the request. 9354func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Header() http.Header { 9355 if c.header_ == nil { 9356 c.header_ = make(http.Header) 9357 } 9358 return c.header_ 9359} 9360 9361func (c *GroupsMembershipsSearchTransitiveMembershipsCall) doRequest(alt string) (*http.Response, error) { 9362 reqHeaders := make(http.Header) 9363 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9364 for k, v := range c.header_ { 9365 reqHeaders[k] = v 9366 } 9367 reqHeaders.Set("User-Agent", c.s.userAgent()) 9368 if c.ifNoneMatch_ != "" { 9369 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9370 } 9371 var body io.Reader = nil 9372 c.urlParams_.Set("alt", alt) 9373 c.urlParams_.Set("prettyPrint", "false") 9374 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:searchTransitiveMemberships") 9375 urls += "?" + c.urlParams_.Encode() 9376 req, err := http.NewRequest("GET", urls, body) 9377 if err != nil { 9378 return nil, err 9379 } 9380 req.Header = reqHeaders 9381 googleapi.Expand(req.URL, map[string]string{ 9382 "parent": c.parent, 9383 }) 9384 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9385} 9386 9387// Do executes the "cloudidentity.groups.memberships.searchTransitiveMemberships" call. 9388// Exactly one of *SearchTransitiveMembershipsResponse or error will be 9389// non-nil. Any non-2xx status code is an error. Response headers are in 9390// either *SearchTransitiveMembershipsResponse.ServerResponse.Header or 9391// (if a response was returned at all) in 9392// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9393// whether the returned error was because http.StatusNotModified was 9394// returned. 9395func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Do(opts ...googleapi.CallOption) (*SearchTransitiveMembershipsResponse, error) { 9396 gensupport.SetOptions(c.urlParams_, opts...) 9397 res, err := c.doRequest("json") 9398 if res != nil && res.StatusCode == http.StatusNotModified { 9399 if res.Body != nil { 9400 res.Body.Close() 9401 } 9402 return nil, &googleapi.Error{ 9403 Code: res.StatusCode, 9404 Header: res.Header, 9405 } 9406 } 9407 if err != nil { 9408 return nil, err 9409 } 9410 defer googleapi.CloseBody(res) 9411 if err := googleapi.CheckResponse(res); err != nil { 9412 return nil, err 9413 } 9414 ret := &SearchTransitiveMembershipsResponse{ 9415 ServerResponse: googleapi.ServerResponse{ 9416 Header: res.Header, 9417 HTTPStatusCode: res.StatusCode, 9418 }, 9419 } 9420 target := &ret 9421 if err := gensupport.DecodeResponse(target, res); err != nil { 9422 return nil, err 9423 } 9424 return ret, nil 9425 // { 9426 // "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.", 9427 // "flatPath": "v1beta1/groups/{groupsId}/memberships:searchTransitiveMemberships", 9428 // "httpMethod": "GET", 9429 // "id": "cloudidentity.groups.memberships.searchTransitiveMemberships", 9430 // "parameterOrder": [ 9431 // "parent" 9432 // ], 9433 // "parameters": { 9434 // "pageSize": { 9435 // "description": "The default page size is 200 (max 1000).", 9436 // "format": "int32", 9437 // "location": "query", 9438 // "type": "integer" 9439 // }, 9440 // "pageToken": { 9441 // "description": "The next_page_token value returned from a previous list request, if any.", 9442 // "location": "query", 9443 // "type": "string" 9444 // }, 9445 // "parent": { 9446 // "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.", 9447 // "location": "path", 9448 // "pattern": "^groups/[^/]+$", 9449 // "required": true, 9450 // "type": "string" 9451 // } 9452 // }, 9453 // "path": "v1beta1/{+parent}/memberships:searchTransitiveMemberships", 9454 // "response": { 9455 // "$ref": "SearchTransitiveMembershipsResponse" 9456 // }, 9457 // "scopes": [ 9458 // "https://www.googleapis.com/auth/cloud-identity.groups", 9459 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 9460 // "https://www.googleapis.com/auth/cloud-platform" 9461 // ] 9462 // } 9463 9464} 9465 9466// Pages invokes f for each page of results. 9467// A non-nil error returned from f will halt the iteration. 9468// The provided context supersedes any context provided to the Context method. 9469func (c *GroupsMembershipsSearchTransitiveMembershipsCall) Pages(ctx context.Context, f func(*SearchTransitiveMembershipsResponse) error) error { 9470 c.ctx_ = ctx 9471 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9472 for { 9473 x, err := c.Do() 9474 if err != nil { 9475 return err 9476 } 9477 if err := f(x); err != nil { 9478 return err 9479 } 9480 if x.NextPageToken == "" { 9481 return nil 9482 } 9483 c.PageToken(x.NextPageToken) 9484 } 9485} 9486