1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package 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/v1" 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/v1" 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:v1" 79const apiName = "cloudidentity" 80const apiVersion = "v1" 81const basePath = "https://cloudidentity.googleapis.com/" 82 83// OAuth2 scopes used by this API. 84const ( 85 // See, change, create, and delete any of the Cloud Identity Groups that 86 // you can access, including the members of each group 87 CloudIdentityGroupsScope = "https://www.googleapis.com/auth/cloud-identity.groups" 88 89 // See any Cloud Identity Groups that you can access, including group 90 // members and their emails 91 CloudIdentityGroupsReadonlyScope = "https://www.googleapis.com/auth/cloud-identity.groups.readonly" 92 93 // View and manage your data across Google Cloud Platform services 94 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 95) 96 97// NewService creates a new Service. 98func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 99 scopesOption := option.WithScopes( 100 "https://www.googleapis.com/auth/cloud-identity.groups", 101 "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 102 "https://www.googleapis.com/auth/cloud-platform", 103 ) 104 // NOTE: prepend, so we don't override user-specified scopes. 105 opts = append([]option.ClientOption{scopesOption}, opts...) 106 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 107 client, endpoint, err := htransport.NewClient(ctx, opts...) 108 if err != nil { 109 return nil, err 110 } 111 s, err := New(client) 112 if err != nil { 113 return nil, err 114 } 115 if endpoint != "" { 116 s.BasePath = endpoint 117 } 118 return s, nil 119} 120 121// New creates a new Service. It uses the provided http.Client for requests. 122// 123// Deprecated: please use NewService instead. 124// To provide a custom HTTP client, use option.WithHTTPClient. 125// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 126func New(client *http.Client) (*Service, error) { 127 if client == nil { 128 return nil, errors.New("client is nil") 129 } 130 s := &Service{client: client, BasePath: basePath} 131 s.Groups = NewGroupsService(s) 132 return s, nil 133} 134 135type Service struct { 136 client *http.Client 137 BasePath string // API endpoint base URL 138 UserAgent string // optional additional User-Agent fragment 139 140 Groups *GroupsService 141} 142 143func (s *Service) userAgent() string { 144 if s.UserAgent == "" { 145 return googleapi.UserAgent 146 } 147 return googleapi.UserAgent + " " + s.UserAgent 148} 149 150func NewGroupsService(s *Service) *GroupsService { 151 rs := &GroupsService{s: s} 152 rs.Memberships = NewGroupsMembershipsService(s) 153 return rs 154} 155 156type GroupsService struct { 157 s *Service 158 159 Memberships *GroupsMembershipsService 160} 161 162func NewGroupsMembershipsService(s *Service) *GroupsMembershipsService { 163 rs := &GroupsMembershipsService{s: s} 164 return rs 165} 166 167type GroupsMembershipsService struct { 168 s *Service 169} 170 171// AndroidAttributes: Resource representing the Android specific 172// attributes of a Device. 173type AndroidAttributes struct { 174 // BasebandVersion: Baseband version of Android device. 175 BasebandVersion string `json:"basebandVersion,omitempty"` 176 177 // BootloaderVersion: Device bootloader version. Example: 0.6.7. 178 BootloaderVersion string `json:"bootloaderVersion,omitempty"` 179 180 // BuildNumber: Build number of Android device. 181 BuildNumber string `json:"buildNumber,omitempty"` 182 183 // EnabledDeveloperOptions: Whether developer options is enabled on 184 // device. 185 EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"` 186 187 // EnabledUnknownSources: Whether applications from unknown sources can 188 // be installed on device. 189 EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"` 190 191 // EnabledUsbDebugging: Whether adb (USB debugging) is enabled on 192 // device. 193 EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"` 194 195 // EncryptionState: Device encryption state. 196 // 197 // Possible values: 198 // "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set. 199 // "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption. 200 // "ENCRYPTED" - Device is encrypted. 201 // "NOT_ENCRYPTED" - Device is not encrypted. 202 EncryptionState string `json:"encryptionState,omitempty"` 203 204 // Hardware: Device hardware. Example: Sprout. 205 Hardware string `json:"hardware,omitempty"` 206 207 // KernelVersion: Kernel version of Android device. 208 KernelVersion string `json:"kernelVersion,omitempty"` 209 210 // OtherAccounts: Domain name for Google accounts on device. Type for 211 // other accounts on 212 // device. Will only be populated if |ownership_privilege| 213 // is 214 // |PROFILE_OWNER| or |DEVICE_OWNER|. Does not include the account 215 // signed in 216 // to the device policy app if that account's domain has only one 217 // account. 218 // Examples: "com.example", "xyz.com". 219 OtherAccounts []string `json:"otherAccounts,omitempty"` 220 221 // OwnerProfileAccount: Whether this account is on an owner/primary 222 // profile. 223 // For phones, only true for owner profiles. Android 4+ devices 224 // can have secondary or restricted user profiles. 225 OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"` 226 227 // OwnershipPrivilege: Ownership privileges on device. 228 // 229 // Possible values: 230 // "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set. 231 // "DEVICE_ADMINISTRATOR" - Active device administrator privileges on 232 // the device. 233 // "PROFILE_OWNER" - Profile Owner privileges. 234 // The account is in a managed corporate profile. 235 // "DEVICE_OWNER" - Device Owner privileges on the device. 236 OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"` 237 238 // SecurityPatchTime: OS security patch update time on device. 239 SecurityPatchTime string `json:"securityPatchTime,omitempty"` 240 241 // SupportsWorkProfile: Whether device supports Android work profiles. 242 // If false, this service 243 // will not block access to corp data even if an administrator turns on 244 // the 245 // "Enforce Work Profile" policy. 246 SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` 247 248 // ForceSendFields is a list of field names (e.g. "BasebandVersion") to 249 // unconditionally include in API requests. By default, fields with 250 // empty values are omitted from API requests. However, any non-pointer, 251 // non-interface field appearing in ForceSendFields will be sent to the 252 // server regardless of whether the field is empty or not. This may be 253 // used to include empty fields in Patch requests. 254 ForceSendFields []string `json:"-"` 255 256 // NullFields is a list of field names (e.g. "BasebandVersion") to 257 // include in API requests with the JSON null value. By default, fields 258 // with empty values are omitted from API requests. However, any field 259 // with an empty value appearing in NullFields will be sent to the 260 // server as null. It is an error if a field in this list has a 261 // non-empty value. This may be used to include null fields in Patch 262 // requests. 263 NullFields []string `json:"-"` 264} 265 266func (s *AndroidAttributes) MarshalJSON() ([]byte, error) { 267 type NoMethod AndroidAttributes 268 raw := NoMethod(*s) 269 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 270} 271 272// ApproveDeviceUserResponse: Response message for approving the device 273// to access user data. 274type ApproveDeviceUserResponse struct { 275 // DeviceUser: Resultant DeviceUser object for the action. 276 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 277 278 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 279 // unconditionally include in API requests. By default, fields with 280 // empty values are omitted from API requests. However, any non-pointer, 281 // non-interface field appearing in ForceSendFields will be sent to the 282 // server regardless of whether the field is empty or not. This may be 283 // used to include empty fields in Patch requests. 284 ForceSendFields []string `json:"-"` 285 286 // NullFields is a list of field names (e.g. "DeviceUser") to include in 287 // API requests with the JSON null value. By default, fields with empty 288 // values are omitted from API requests. However, any field with an 289 // empty value appearing in NullFields will be sent to the server as 290 // null. It is an error if a field in this list has a non-empty value. 291 // This may be used to include null fields in Patch requests. 292 NullFields []string `json:"-"` 293} 294 295func (s *ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) { 296 type NoMethod ApproveDeviceUserResponse 297 raw := NoMethod(*s) 298 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 299} 300 301// BlockDeviceUserResponse: Response message for blocking the device 302// from accessing user data. 303type BlockDeviceUserResponse struct { 304 // DeviceUser: Resultant DeviceUser object for the action. 305 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 306 307 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 308 // unconditionally include in API requests. By default, fields with 309 // empty values are omitted from API requests. However, any non-pointer, 310 // non-interface field appearing in ForceSendFields will be sent to the 311 // server regardless of whether the field is empty or not. This may be 312 // used to include empty fields in Patch requests. 313 ForceSendFields []string `json:"-"` 314 315 // NullFields is a list of field names (e.g. "DeviceUser") to include in 316 // API requests with the JSON null value. By default, fields with empty 317 // values are omitted from API requests. However, any field with an 318 // empty value appearing in NullFields will be sent to the server as 319 // null. It is an error if a field in this list has a non-empty value. 320 // This may be used to include null fields in Patch requests. 321 NullFields []string `json:"-"` 322} 323 324func (s *BlockDeviceUserResponse) MarshalJSON() ([]byte, error) { 325 type NoMethod BlockDeviceUserResponse 326 raw := NoMethod(*s) 327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 328} 329 330// CancelWipeDeviceResponse: Response message for cancelling an 331// unfinished device wipe. 332type CancelWipeDeviceResponse struct { 333 // Device: Resultant Device object for the action. Note that asset tags 334 // will not be 335 // returned in the device object. 336 Device *Device `json:"device,omitempty"` 337 338 // ForceSendFields is a list of field names (e.g. "Device") to 339 // unconditionally include in API requests. By default, fields with 340 // empty values are omitted from API requests. However, any non-pointer, 341 // non-interface field appearing in ForceSendFields will be sent to the 342 // server regardless of whether the field is empty or not. This may be 343 // used to include empty fields in Patch requests. 344 ForceSendFields []string `json:"-"` 345 346 // NullFields is a list of field names (e.g. "Device") to include in API 347 // requests with the JSON null value. By default, fields with empty 348 // values are omitted from API requests. However, any field with an 349 // empty value appearing in NullFields will be sent to the server as 350 // null. It is an error if a field in this list has a non-empty value. 351 // This may be used to include null fields in Patch requests. 352 NullFields []string `json:"-"` 353} 354 355func (s *CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) { 356 type NoMethod CancelWipeDeviceResponse 357 raw := NoMethod(*s) 358 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 359} 360 361// CancelWipeDeviceUserResponse: Response message for cancelling an 362// unfinished user account wipe. 363type CancelWipeDeviceUserResponse struct { 364 // DeviceUser: Resultant DeviceUser object for the action. 365 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 366 367 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 368 // unconditionally include in API requests. By default, fields with 369 // empty values are omitted from API requests. However, any non-pointer, 370 // non-interface field appearing in ForceSendFields will be sent to the 371 // server regardless of whether the field is empty or not. This may be 372 // used to include empty fields in Patch requests. 373 ForceSendFields []string `json:"-"` 374 375 // NullFields is a list of field names (e.g. "DeviceUser") to include in 376 // API requests with the JSON null value. By default, fields with empty 377 // values are omitted from API requests. However, any field with an 378 // empty value appearing in NullFields will be sent to the server as 379 // null. It is an error if a field in this list has a non-empty value. 380 // This may be used to include null fields in Patch requests. 381 NullFields []string `json:"-"` 382} 383 384func (s *CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 385 type NoMethod CancelWipeDeviceUserResponse 386 raw := NoMethod(*s) 387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 388} 389 390// Device: Represents a Device known to Google Cloud, independent of the 391// device 392// ownership, type, and whether it is assigned or in use by a user. 393type Device struct { 394 // AndroidSpecificAttributes: Output only. Attributes specific to 395 // Android devices. 396 AndroidSpecificAttributes *AndroidAttributes `json:"androidSpecificAttributes,omitempty"` 397 398 // AssetTag: Asset tag of the device. 399 AssetTag string `json:"assetTag,omitempty"` 400 401 // Brand: Output only. Device brand. Example: Samsung. 402 Brand string `json:"brand,omitempty"` 403 404 // CompromisedState: Output only. Represents whether the Device is 405 // compromised. 406 // 407 // Possible values: 408 // "COMPROMISED_STATE_UNSPECIFIED" - Default value. 409 // "COMPROMISED" - The device is compromised (currently, this means 410 // Android device is 411 // rooted). 412 // "UNCOMPROMISED" - The device is safe (currently, this means Android 413 // device is unrooted). 414 CompromisedState string `json:"compromisedState,omitempty"` 415 416 // CreateTime: Output only. When the Company-Owned device was imported. 417 // This field is empty for BYOD 418 // devices. 419 CreateTime string `json:"createTime,omitempty"` 420 421 // DeviceType: Output only. Type of device. 422 // 423 // Possible values: 424 // "DEVICE_TYPE_UNSPECIFIED" - Unknown device type 425 // "ANDROID" - Device is an Android device 426 // "IOS" - Device is an iOS device 427 // "GOOGLE_SYNC" - Device is a Google Sync device. 428 // "WINDOWS" - Device is a Windows device. 429 // "MAC_OS" - Device is a MacOS device. 430 // "LINUX" - Device is a Linux device. 431 // "CHROME_OS" - Device is a ChromeOS device. 432 DeviceType string `json:"deviceType,omitempty"` 433 434 // Imei: Output only. IMEI number of device if GSM device; empty 435 // otherwise. 436 Imei string `json:"imei,omitempty"` 437 438 // LastSyncTime: Most recent time when device synced with this service. 439 LastSyncTime string `json:"lastSyncTime,omitempty"` 440 441 // ManagementState: Output only. Management state of the device 442 // 443 // Possible values: 444 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 445 // unused. 446 // "APPROVED" - Device is approved. 447 // "BLOCKED" - Device is blocked. 448 // "PENDING" - Device is pending approval. 449 // "UNPROVISIONED" - The device is not provisioned. Device will start 450 // from this state until 451 // some action is taken (i.e. a user starts using the device). 452 // "WIPING" - Data and settings on the device are being removed. 453 // "WIPED" - All data and settings on the device are removed. 454 ManagementState string `json:"managementState,omitempty"` 455 456 // Manufacturer: Output only. Device manufacturer. Example: Motorola. 457 Manufacturer string `json:"manufacturer,omitempty"` 458 459 // Meid: Output only. MEID number of device if CDMA device; empty 460 // otherwise. 461 Meid string `json:"meid,omitempty"` 462 463 // Model: Output only. Model name of device. Example: Pixel 3. 464 Model string `json:"model,omitempty"` 465 466 // Name: Output only. [Resource 467 // name](https://cloud.google.com/apis/design/resource_names) 468 // of the Device in format: `devices/{device_id}`, where device_id 469 // is 470 // the unique id assigned to the Device. 471 Name string `json:"name,omitempty"` 472 473 // NetworkOperator: Output only. Mobile or network operator of device, 474 // if available. 475 NetworkOperator string `json:"networkOperator,omitempty"` 476 477 // OsVersion: Output only. OS version of the device. Example: Android 478 // 8.1.0. 479 OsVersion string `json:"osVersion,omitempty"` 480 481 // OwnerType: Whether the device is owned by the company or an 482 // individual 483 // 484 // Possible values: 485 // "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is 486 // unused. 487 // "COMPANY" - Company owns the device. 488 // "BYOD" - Bring Your Own Device (i.e. individual owns the device) 489 OwnerType string `json:"ownerType,omitempty"` 490 491 // ReleaseVersion: Output only. OS release version. Example: 6.0. 492 ReleaseVersion string `json:"releaseVersion,omitempty"` 493 494 // SerialNumber: Serial Number of device. Example: HT82V1A01076. 495 SerialNumber string `json:"serialNumber,omitempty"` 496 497 // WifiMacAddresses: WiFi MAC addresses of device. 498 WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"` 499 500 // ForceSendFields is a list of field names (e.g. 501 // "AndroidSpecificAttributes") to unconditionally include in API 502 // requests. By default, fields with empty values are omitted from API 503 // requests. However, any non-pointer, non-interface field appearing in 504 // ForceSendFields will be sent to the server regardless of whether the 505 // field is empty or not. This may be used to include empty fields in 506 // Patch requests. 507 ForceSendFields []string `json:"-"` 508 509 // NullFields is a list of field names (e.g. 510 // "AndroidSpecificAttributes") to include in API requests with the JSON 511 // null value. By default, fields with empty values are omitted from API 512 // requests. However, any field with an empty value appearing in 513 // NullFields will be sent to the server as null. It is an error if a 514 // field in this list has a non-empty value. This may be used to include 515 // null fields in Patch requests. 516 NullFields []string `json:"-"` 517} 518 519func (s *Device) MarshalJSON() ([]byte, error) { 520 type NoMethod Device 521 raw := NoMethod(*s) 522 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 523} 524 525// DeviceUser: A DeviceUser is a resource representing a user's use of a 526// Device 527type DeviceUser struct { 528 // CompromisedState: Compromised State of the DeviceUser object 529 // 530 // Possible values: 531 // "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User 532 // account is unknown or unspecified. 533 // "COMPROMISED" - Device User Account is compromised. 534 // "NOT_COMPROMISED" - Device User Account is not compromised. 535 CompromisedState string `json:"compromisedState,omitempty"` 536 537 // FirstSyncTime: Output only. Most recent time when user registered 538 // with this service. 539 FirstSyncTime string `json:"firstSyncTime,omitempty"` 540 541 // LanguageCode: Output only. Default locale used on device, in IETF 542 // BCP-47 format. 543 LanguageCode string `json:"languageCode,omitempty"` 544 545 // LastSyncTime: Output only. Last time when user synced with policies. 546 LastSyncTime string `json:"lastSyncTime,omitempty"` 547 548 // ManagementState: Output only. Management state of the user on the 549 // device. 550 // 551 // Possible values: 552 // "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is 553 // unused. 554 // "WIPING" - This user's data and profile is being removed from the 555 // device. 556 // "WIPED" - This user's data and profile is removed from the device. 557 // "APPROVED" - User is approved to access data on the device. 558 // "BLOCKED" - User is blocked from accessing data on the device. 559 // "PENDING_APPROVAL" - User is awaiting approval. 560 // "UNENROLLED" - User is unenrolled from Advanced Windows Management, 561 // but the Windows 562 // account is still intact. 563 ManagementState string `json:"managementState,omitempty"` 564 565 // Name: Output only. [Resource 566 // name](https://cloud.google.com/apis/design/resource_names) of 567 // the DeviceUser in format: 568 // `devices/{device_id}/deviceUsers/{user_id}`, 569 // where user_id is the ID of the user associated with the user session. 570 Name string `json:"name,omitempty"` 571 572 // PasswordState: Password state of the DeviceUser object 573 // 574 // Possible values: 575 // "PASSWORD_STATE_UNSPECIFIED" - Password state not set. 576 // "PASSWORD_SET" - Password set in object. 577 // "PASSWORD_NOT_SET" - Password not set in object. 578 PasswordState string `json:"passwordState,omitempty"` 579 580 // UserAgent: Output only. User agent on the device for this specific 581 // user 582 UserAgent string `json:"userAgent,omitempty"` 583 584 // UserEmail: Email address of the user registered on the device. 585 UserEmail string `json:"userEmail,omitempty"` 586 587 // ForceSendFields is a list of field names (e.g. "CompromisedState") to 588 // unconditionally include in API requests. By default, fields with 589 // empty values are omitted from API requests. However, any non-pointer, 590 // non-interface field appearing in ForceSendFields will be sent to the 591 // server regardless of whether the field is empty or not. This may be 592 // used to include empty fields in Patch requests. 593 ForceSendFields []string `json:"-"` 594 595 // NullFields is a list of field names (e.g. "CompromisedState") to 596 // include in API requests with the JSON null value. By default, fields 597 // with empty values are omitted from API requests. However, any field 598 // with an empty value appearing in NullFields will be sent to the 599 // server as null. It is an error if a field in this list has a 600 // non-empty value. This may be used to include null fields in Patch 601 // requests. 602 NullFields []string `json:"-"` 603} 604 605func (s *DeviceUser) MarshalJSON() ([]byte, error) { 606 type NoMethod DeviceUser 607 raw := NoMethod(*s) 608 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 609} 610 611// EndpointApp: An EndpointApp represents an app that is installed on a 612// device 613// Next ID to use: 7 614type EndpointApp struct { 615 // DisplayName: Output only. Name of the app displayed to the user 616 DisplayName string `json:"displayName,omitempty"` 617 618 // Name: Output only. [Resource 619 // name](https://cloud.google.com/apis/design/resource_names) of 620 // the EndpointApp in 621 // format: 622 // `devices/{device}/deviceUsers/{device_user}/endpointApps/{endp 623 // oint_app}`, 624 // where client_app_id is the ID of the app associated with the Device. 625 Name string `json:"name,omitempty"` 626 627 // PackageName: Output only. Full package name of the installed app 628 PackageName string `json:"packageName,omitempty"` 629 630 // Permissions: Output only. Names of all permissions granted to the 631 // installed app 632 Permissions []string `json:"permissions,omitempty"` 633 634 // VersionCode: Output only. Version code of the installed app 635 VersionCode int64 `json:"versionCode,omitempty"` 636 637 // VersionName: Output only. Version name of the installed app 638 VersionName string `json:"versionName,omitempty"` 639 640 // ForceSendFields is a list of field names (e.g. "DisplayName") to 641 // unconditionally include in API requests. By default, fields with 642 // empty values are omitted from API requests. However, any non-pointer, 643 // non-interface field appearing in ForceSendFields will be sent to the 644 // server regardless of whether the field is empty or not. This may be 645 // used to include empty fields in Patch requests. 646 ForceSendFields []string `json:"-"` 647 648 // NullFields is a list of field names (e.g. "DisplayName") to include 649 // in API requests with the JSON null value. By default, fields with 650 // empty values are omitted from API requests. However, any field with 651 // an empty value appearing in NullFields will be sent to the server as 652 // null. It is an error if a field in this list has a non-empty value. 653 // This may be used to include null fields in Patch requests. 654 NullFields []string `json:"-"` 655} 656 657func (s *EndpointApp) MarshalJSON() ([]byte, error) { 658 type NoMethod EndpointApp 659 raw := NoMethod(*s) 660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 661} 662 663// EntityKey: An EntityKey uniquely identifies an Entity. Namespaces are 664// used to provide 665// isolation for IDs. A single ID can be reused across namespaces but 666// the 667// combination of a namespace and an ID must be unique. 668type EntityKey struct { 669 // Id: The ID of the entity within the given namespace. The ID must be 670 // unique 671 // within its namespace. 672 Id string `json:"id,omitempty"` 673 674 // Namespace: Namespaces provide isolation for IDs, so an ID only needs 675 // to be unique 676 // within its namespace. 677 // 678 // Namespaces are currently only created as part of IdentitySource 679 // creation 680 // from Admin Console. A namespace 681 // "identitysources/{identity_source_id}" is 682 // created corresponding to every Identity Source `identity_source_id`. 683 Namespace string `json:"namespace,omitempty"` 684 685 // ForceSendFields is a list of field names (e.g. "Id") to 686 // unconditionally include in API requests. By default, fields with 687 // empty values are omitted from API requests. However, any non-pointer, 688 // non-interface field appearing in ForceSendFields will be sent to the 689 // server regardless of whether the field is empty or not. This may be 690 // used to include empty fields in Patch requests. 691 ForceSendFields []string `json:"-"` 692 693 // NullFields is a list of field names (e.g. "Id") to include in API 694 // requests with the JSON null value. By default, fields with empty 695 // values are omitted from API requests. However, any field with an 696 // empty value appearing in NullFields will be sent to the server as 697 // null. It is an error if a field in this list has a non-empty value. 698 // This may be used to include null fields in Patch requests. 699 NullFields []string `json:"-"` 700} 701 702func (s *EntityKey) MarshalJSON() ([]byte, error) { 703 type NoMethod EntityKey 704 raw := NoMethod(*s) 705 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 706} 707 708// Group: Resource representing a Group. 709type Group struct { 710 // CreateTime: Output only. The time when the Group was created. 711 // Output only. 712 CreateTime string `json:"createTime,omitempty"` 713 714 // Description: An extended description to help users determine the 715 // purpose of a Group. For 716 // example, you can include information about who should join the Group, 717 // the 718 // types of messages to send to the Group, links to FAQs about the 719 // Group, or 720 // related Groups. Maximum length is 4,096 characters. 721 Description string `json:"description,omitempty"` 722 723 // DisplayName: The Group's display name. 724 DisplayName string `json:"displayName,omitempty"` 725 726 // GroupKey: Required. Immutable. EntityKey of the Group. 727 // 728 // Must be set when creating a Group, read-only afterwards. 729 GroupKey *EntityKey `json:"groupKey,omitempty"` 730 731 // Labels: Required. `Required`. Labels for Group resource. 732 // For creating Groups under a namespace, set label key 733 // to 734 // 'labels/system/groups/external' and label value as empty. 735 Labels map[string]string `json:"labels,omitempty"` 736 737 // Name: Output only. [Resource 738 // name](https://cloud.google.com/apis/design/resource_names) of 739 // the 740 // Group in the format: `groups/{group_id}`, where group_id is the 741 // unique ID 742 // assigned to the Group. 743 // 744 // Must be left blank while creating a Group. 745 Name string `json:"name,omitempty"` 746 747 // Parent: Required. Immutable. The entity under which this Group 748 // resides in Cloud Identity resource 749 // hierarchy. Must be set when creating a Group, read-only 750 // afterwards. 751 // 752 // Currently allowed types: `identitysources`. 753 Parent string `json:"parent,omitempty"` 754 755 // UpdateTime: Output only. The time when the Group was last 756 // updated. 757 // Output only. 758 UpdateTime string `json:"updateTime,omitempty"` 759 760 // ServerResponse contains the HTTP response code and headers from the 761 // server. 762 googleapi.ServerResponse `json:"-"` 763 764 // ForceSendFields is a list of field names (e.g. "CreateTime") to 765 // unconditionally include in API requests. By default, fields with 766 // empty values are omitted from API requests. However, any non-pointer, 767 // non-interface field appearing in ForceSendFields will be sent to the 768 // server regardless of whether the field is empty or not. This may be 769 // used to include empty fields in Patch requests. 770 ForceSendFields []string `json:"-"` 771 772 // NullFields is a list of field names (e.g. "CreateTime") to include in 773 // API requests with the JSON null value. By default, fields with empty 774 // values are omitted from API requests. However, any field with an 775 // empty value appearing in NullFields will be sent to the server as 776 // null. It is an error if a field in this list has a non-empty value. 777 // This may be used to include null fields in Patch requests. 778 NullFields []string `json:"-"` 779} 780 781func (s *Group) MarshalJSON() ([]byte, error) { 782 type NoMethod Group 783 raw := NoMethod(*s) 784 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 785} 786 787// ListDeviceUsersResponse: Response message that is returned in LRO 788// result of ListDeviceUsers Operation. 789type ListDeviceUsersResponse struct { 790 // DeviceUsers: Devices meeting the list restrictions. 791 DeviceUsers []*DeviceUser `json:"deviceUsers,omitempty"` 792 793 // NextPageToken: Token to retrieve the next page of results. Empty if 794 // there are no more 795 // results. 796 NextPageToken string `json:"nextPageToken,omitempty"` 797 798 // ForceSendFields is a list of field names (e.g. "DeviceUsers") to 799 // unconditionally include in API requests. By default, fields with 800 // empty values are omitted from API requests. However, any non-pointer, 801 // non-interface field appearing in ForceSendFields will be sent to the 802 // server regardless of whether the field is empty or not. This may be 803 // used to include empty fields in Patch requests. 804 ForceSendFields []string `json:"-"` 805 806 // NullFields is a list of field names (e.g. "DeviceUsers") to include 807 // in API requests with the JSON null value. By default, fields with 808 // empty values are omitted from API requests. However, any field with 809 // an empty value appearing in NullFields will be sent to the server as 810 // null. It is an error if a field in this list has a non-empty value. 811 // This may be used to include null fields in Patch requests. 812 NullFields []string `json:"-"` 813} 814 815func (s *ListDeviceUsersResponse) MarshalJSON() ([]byte, error) { 816 type NoMethod ListDeviceUsersResponse 817 raw := NoMethod(*s) 818 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 819} 820 821// ListDevicesResponse: Response message that is returned in LRO result 822// of ListDevices Operation. 823type ListDevicesResponse struct { 824 // Devices: Devices meeting the list restrictions. 825 Devices []*Device `json:"devices,omitempty"` 826 827 // NextPageToken: Token to retrieve the next page of results. Empty if 828 // there are no more 829 // results. 830 NextPageToken string `json:"nextPageToken,omitempty"` 831 832 // ForceSendFields is a list of field names (e.g. "Devices") to 833 // unconditionally include in API requests. By default, fields with 834 // empty values are omitted from API requests. However, any non-pointer, 835 // non-interface field appearing in ForceSendFields will be sent to the 836 // server regardless of whether the field is empty or not. This may be 837 // used to include empty fields in Patch requests. 838 ForceSendFields []string `json:"-"` 839 840 // NullFields is a list of field names (e.g. "Devices") to include in 841 // API requests with the JSON null value. By default, fields with empty 842 // values are omitted from API requests. However, any field with an 843 // empty value appearing in NullFields will be sent to the server as 844 // null. It is an error if a field in this list has a non-empty value. 845 // This may be used to include null fields in Patch requests. 846 NullFields []string `json:"-"` 847} 848 849func (s *ListDevicesResponse) MarshalJSON() ([]byte, error) { 850 type NoMethod ListDevicesResponse 851 raw := NoMethod(*s) 852 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 853} 854 855// ListEndpointAppsResponse: Response message for listing all apps on 856// the device. 857type ListEndpointAppsResponse struct { 858 // EndpointApps: The list of matching EndpointApps found as a result of 859 // the request. 860 EndpointApps []*EndpointApp `json:"endpointApps,omitempty"` 861 862 // NextPageToken: Token to retrieve the next page of results. Empty if 863 // there are no more 864 // results. 865 NextPageToken string `json:"nextPageToken,omitempty"` 866 867 // ForceSendFields is a list of field names (e.g. "EndpointApps") to 868 // unconditionally include in API requests. By default, fields with 869 // empty values are omitted from API requests. However, any non-pointer, 870 // non-interface field appearing in ForceSendFields will be sent to the 871 // server regardless of whether the field is empty or not. This may be 872 // used to include empty fields in Patch requests. 873 ForceSendFields []string `json:"-"` 874 875 // NullFields is a list of field names (e.g. "EndpointApps") to include 876 // in API requests with the JSON null value. By default, fields with 877 // empty values are omitted from API requests. However, any field with 878 // an empty value appearing in NullFields will be sent to the server as 879 // null. It is an error if a field in this list has a non-empty value. 880 // This may be used to include null fields in Patch requests. 881 NullFields []string `json:"-"` 882} 883 884func (s *ListEndpointAppsResponse) MarshalJSON() ([]byte, error) { 885 type NoMethod ListEndpointAppsResponse 886 raw := NoMethod(*s) 887 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 888} 889 890// ListGroupsResponse: Response message for ListGroups operation. 891type ListGroupsResponse struct { 892 // Groups: Groups returned in response to list request. 893 // The results are not sorted. 894 Groups []*Group `json:"groups,omitempty"` 895 896 // NextPageToken: Token to retrieve the next page of results, or empty 897 // if there are no 898 // more results available for listing. 899 NextPageToken string `json:"nextPageToken,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. "Groups") to 906 // unconditionally include in API requests. By default, fields with 907 // empty values are omitted from API requests. However, any non-pointer, 908 // non-interface field appearing in ForceSendFields will be sent to the 909 // server regardless of whether the field is empty or not. This may be 910 // used to include empty fields in Patch requests. 911 ForceSendFields []string `json:"-"` 912 913 // NullFields is a list of field names (e.g. "Groups") to include in API 914 // requests with the JSON null value. By default, fields with empty 915 // values are omitted from API requests. However, any field with an 916 // empty value appearing in NullFields will be sent to the server as 917 // null. It is an error if a field in this list has a non-empty value. 918 // This may be used to include null fields in Patch requests. 919 NullFields []string `json:"-"` 920} 921 922func (s *ListGroupsResponse) MarshalJSON() ([]byte, error) { 923 type NoMethod ListGroupsResponse 924 raw := NoMethod(*s) 925 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 926} 927 928type ListMembershipsResponse struct { 929 // Memberships: List of Memberships. 930 Memberships []*Membership `json:"memberships,omitempty"` 931 932 // NextPageToken: Token to retrieve the next page of results, or empty 933 // if there are no 934 // more results available for listing. 935 NextPageToken string `json:"nextPageToken,omitempty"` 936 937 // ServerResponse contains the HTTP response code and headers from the 938 // server. 939 googleapi.ServerResponse `json:"-"` 940 941 // ForceSendFields is a list of field names (e.g. "Memberships") to 942 // unconditionally include in API requests. By default, fields with 943 // empty values are omitted from API requests. However, any non-pointer, 944 // non-interface field appearing in ForceSendFields will be sent to the 945 // server regardless of whether the field is empty or not. This may be 946 // used to include empty fields in Patch requests. 947 ForceSendFields []string `json:"-"` 948 949 // NullFields is a list of field names (e.g. "Memberships") to include 950 // in API requests with the JSON null value. By default, fields with 951 // empty values are omitted from API requests. However, any field with 952 // an empty value appearing in NullFields will be sent to the server as 953 // null. It is an error if a field in this list has a non-empty value. 954 // This may be used to include null fields in Patch requests. 955 NullFields []string `json:"-"` 956} 957 958func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) { 959 type NoMethod ListMembershipsResponse 960 raw := NoMethod(*s) 961 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 962} 963 964type LookupGroupNameResponse struct { 965 // Name: [Resource 966 // name](https://cloud.google.com/apis/design/resource_names) of 967 // the 968 // Group in the format: `groups/{group_id}`, where `group_id` is the 969 // unique ID 970 // assigned to the Group. 971 Name string `json:"name,omitempty"` 972 973 // ServerResponse contains the HTTP response code and headers from the 974 // server. 975 googleapi.ServerResponse `json:"-"` 976 977 // ForceSendFields is a list of field names (e.g. "Name") to 978 // unconditionally include in API requests. By default, fields with 979 // empty values are omitted from API requests. However, any non-pointer, 980 // non-interface field appearing in ForceSendFields will be sent to the 981 // server regardless of whether the field is empty or not. This may be 982 // used to include empty fields in Patch requests. 983 ForceSendFields []string `json:"-"` 984 985 // NullFields is a list of field names (e.g. "Name") to include in API 986 // requests with the JSON null value. By default, fields with empty 987 // values are omitted from API requests. However, any field with an 988 // empty value appearing in NullFields will be sent to the server as 989 // null. It is an error if a field in this list has a non-empty value. 990 // This may be used to include null fields in Patch requests. 991 NullFields []string `json:"-"` 992} 993 994func (s *LookupGroupNameResponse) MarshalJSON() ([]byte, error) { 995 type NoMethod LookupGroupNameResponse 996 raw := NoMethod(*s) 997 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 998} 999 1000type LookupMembershipNameResponse struct { 1001 // Name: [Resource 1002 // name](https://cloud.google.com/apis/design/resource_names) of 1003 // the 1004 // Membership being looked up. 1005 // 1006 // Format: `groups/{group_id}/memberships/{member_id}`, where `group_id` 1007 // is 1008 // the unique ID assigned to the Group to which Membership belongs to, 1009 // and 1010 // `member_id` is the unique ID assigned to the member. 1011 Name string `json:"name,omitempty"` 1012 1013 // ServerResponse contains the HTTP response code and headers from the 1014 // server. 1015 googleapi.ServerResponse `json:"-"` 1016 1017 // ForceSendFields is a list of field names (e.g. "Name") to 1018 // unconditionally include in API requests. By default, fields with 1019 // empty values are omitted from API requests. However, any non-pointer, 1020 // non-interface field appearing in ForceSendFields will be sent to the 1021 // server regardless of whether the field is empty or not. This may be 1022 // used to include empty fields in Patch requests. 1023 ForceSendFields []string `json:"-"` 1024 1025 // NullFields is a list of field names (e.g. "Name") to include in API 1026 // requests with the JSON null value. By default, fields with empty 1027 // values are omitted from API requests. However, any field with an 1028 // empty value appearing in NullFields will be sent to the server as 1029 // null. It is an error if a field in this list has a non-empty value. 1030 // This may be used to include null fields in Patch requests. 1031 NullFields []string `json:"-"` 1032} 1033 1034func (s *LookupMembershipNameResponse) MarshalJSON() ([]byte, error) { 1035 type NoMethod LookupMembershipNameResponse 1036 raw := NoMethod(*s) 1037 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1038} 1039 1040// Membership: Resource representing a Membership within a Group 1041type Membership struct { 1042 // CreateTime: Output only. Creation timestamp of the Membership. Output 1043 // only. 1044 CreateTime string `json:"createTime,omitempty"` 1045 1046 // Name: Output only. [Resource 1047 // name](https://cloud.google.com/apis/design/resource_names) of 1048 // the 1049 // Membership in the format: 1050 // `groups/{group_id}/memberships/{member_id}`, 1051 // where group_id is the unique ID assigned to the Group to which 1052 // Membership 1053 // belongs to, and member_id is the unique ID assigned to the 1054 // member 1055 // 1056 // Must be left blank while creating a Membership. 1057 Name string `json:"name,omitempty"` 1058 1059 // PreferredMemberKey: Required. Immutable. EntityKey of the entity to 1060 // be added as the member. Must be set while 1061 // creating a Membership, read-only afterwards. 1062 // 1063 // Currently allowed entity types: `Users`, `Groups`. 1064 PreferredMemberKey *EntityKey `json:"preferredMemberKey,omitempty"` 1065 1066 // Roles: Roles for a member within the Group. 1067 // 1068 // Currently supported MembershipRoles: "MEMBER". 1069 Roles []*MembershipRole `json:"roles,omitempty"` 1070 1071 // UpdateTime: Output only. Last updated timestamp of the Membership. 1072 // Output only. 1073 UpdateTime string `json:"updateTime,omitempty"` 1074 1075 // ServerResponse contains the HTTP response code and headers from the 1076 // server. 1077 googleapi.ServerResponse `json:"-"` 1078 1079 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1080 // unconditionally include in API requests. By default, fields with 1081 // empty values are omitted from API requests. However, any non-pointer, 1082 // non-interface field appearing in ForceSendFields will be sent to the 1083 // server regardless of whether the field is empty or not. This may be 1084 // used to include empty fields in Patch requests. 1085 ForceSendFields []string `json:"-"` 1086 1087 // NullFields is a list of field names (e.g. "CreateTime") to include in 1088 // API requests with the JSON null value. By default, fields with empty 1089 // values are omitted from API requests. However, any field with an 1090 // empty value appearing in NullFields will be sent to the server as 1091 // null. It is an error if a field in this list has a non-empty value. 1092 // This may be used to include null fields in Patch requests. 1093 NullFields []string `json:"-"` 1094} 1095 1096func (s *Membership) MarshalJSON() ([]byte, error) { 1097 type NoMethod Membership 1098 raw := NoMethod(*s) 1099 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1100} 1101 1102// MembershipRole: Resource representing a role within a Membership. 1103type MembershipRole struct { 1104 // Name: MembershipRole in string format. 1105 // 1106 // Currently supported MembershipRoles: "MEMBER". 1107 Name string `json:"name,omitempty"` 1108 1109 // ForceSendFields is a list of field names (e.g. "Name") to 1110 // unconditionally include in API requests. By default, fields with 1111 // empty values are omitted from API requests. However, any non-pointer, 1112 // non-interface field appearing in ForceSendFields will be sent to the 1113 // server regardless of whether the field is empty or not. This may be 1114 // used to include empty fields in Patch requests. 1115 ForceSendFields []string `json:"-"` 1116 1117 // NullFields is a list of field names (e.g. "Name") to include in API 1118 // requests with the JSON null value. By default, fields with empty 1119 // values are omitted from API requests. However, any field with an 1120 // empty value appearing in NullFields will be sent to the server as 1121 // null. It is an error if a field in this list has a non-empty value. 1122 // This may be used to include null fields in Patch requests. 1123 NullFields []string `json:"-"` 1124} 1125 1126func (s *MembershipRole) MarshalJSON() ([]byte, error) { 1127 type NoMethod MembershipRole 1128 raw := NoMethod(*s) 1129 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1130} 1131 1132// Operation: This resource represents a long-running operation that is 1133// the result of a 1134// network API call. 1135type Operation struct { 1136 // Done: If the value is `false`, it means the operation is still in 1137 // progress. 1138 // If `true`, the operation is completed, and either `error` or 1139 // `response` is 1140 // available. 1141 Done bool `json:"done,omitempty"` 1142 1143 // Error: The error result of the operation in case of failure or 1144 // cancellation. 1145 Error *Status `json:"error,omitempty"` 1146 1147 // Metadata: Service-specific metadata associated with the operation. 1148 // It typically 1149 // contains progress information and common metadata such as create 1150 // time. 1151 // Some services might not provide such metadata. Any method that 1152 // returns a 1153 // long-running operation should document the metadata type, if any. 1154 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1155 1156 // Name: The server-assigned name, which is only unique within the same 1157 // service that 1158 // originally returns it. If you use the default HTTP mapping, 1159 // the 1160 // `name` should be a resource name ending with 1161 // `operations/{unique_id}`. 1162 Name string `json:"name,omitempty"` 1163 1164 // Response: The normal response of the operation in case of success. 1165 // If the original 1166 // method returns no data on success, such as `Delete`, the response 1167 // is 1168 // `google.protobuf.Empty`. If the original method is 1169 // standard 1170 // `Get`/`Create`/`Update`, the response should be the resource. For 1171 // other 1172 // methods, the response should have the type `XxxResponse`, where 1173 // `Xxx` 1174 // is the original method name. For example, if the original method 1175 // name 1176 // is `TakeSnapshot()`, the inferred response type 1177 // is 1178 // `TakeSnapshotResponse`. 1179 Response googleapi.RawMessage `json:"response,omitempty"` 1180 1181 // ServerResponse contains the HTTP response code and headers from the 1182 // server. 1183 googleapi.ServerResponse `json:"-"` 1184 1185 // ForceSendFields is a list of field names (e.g. "Done") to 1186 // unconditionally include in API requests. By default, fields with 1187 // empty values are omitted from API requests. However, any non-pointer, 1188 // non-interface field appearing in ForceSendFields will be sent to the 1189 // server regardless of whether the field is empty or not. This may be 1190 // used to include empty fields in Patch requests. 1191 ForceSendFields []string `json:"-"` 1192 1193 // NullFields is a list of field names (e.g. "Done") to include in API 1194 // requests with the JSON null value. By default, fields with empty 1195 // values are omitted from API requests. However, any field with an 1196 // empty value appearing in NullFields will be sent to the server as 1197 // null. It is an error if a field in this list has a non-empty value. 1198 // This may be used to include null fields in Patch requests. 1199 NullFields []string `json:"-"` 1200} 1201 1202func (s *Operation) MarshalJSON() ([]byte, error) { 1203 type NoMethod Operation 1204 raw := NoMethod(*s) 1205 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1206} 1207 1208type SearchGroupsResponse struct { 1209 // Groups: List of Groups satisfying the search query. 1210 Groups []*Group `json:"groups,omitempty"` 1211 1212 // NextPageToken: Token to retrieve the next page of results, or empty 1213 // if there are no 1214 // more results available for specified query. 1215 NextPageToken string `json:"nextPageToken,omitempty"` 1216 1217 // ServerResponse contains the HTTP response code and headers from the 1218 // server. 1219 googleapi.ServerResponse `json:"-"` 1220 1221 // ForceSendFields is a list of field names (e.g. "Groups") to 1222 // unconditionally include in API requests. By default, fields with 1223 // empty values are omitted from API requests. However, any non-pointer, 1224 // non-interface field appearing in ForceSendFields will be sent to the 1225 // server regardless of whether the field is empty or not. This may be 1226 // used to include empty fields in Patch requests. 1227 ForceSendFields []string `json:"-"` 1228 1229 // NullFields is a list of field names (e.g. "Groups") to include in API 1230 // requests with the JSON null value. By default, fields with empty 1231 // values are omitted from API requests. However, any field with an 1232 // empty value appearing in NullFields will be sent to the server as 1233 // null. It is an error if a field in this list has a non-empty value. 1234 // This may be used to include null fields in Patch requests. 1235 NullFields []string `json:"-"` 1236} 1237 1238func (s *SearchGroupsResponse) MarshalJSON() ([]byte, error) { 1239 type NoMethod SearchGroupsResponse 1240 raw := NoMethod(*s) 1241 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1242} 1243 1244// Status: The `Status` type defines a logical error model that is 1245// suitable for 1246// different programming environments, including REST APIs and RPC APIs. 1247// It is 1248// used by [gRPC](https://github.com/grpc). Each `Status` message 1249// contains 1250// three pieces of data: error code, error message, and error 1251// details. 1252// 1253// You can find out more about this error model and how to work with it 1254// in the 1255// [API Design Guide](https://cloud.google.com/apis/design/errors). 1256type Status struct { 1257 // Code: The status code, which should be an enum value of 1258 // google.rpc.Code. 1259 Code int64 `json:"code,omitempty"` 1260 1261 // Details: A list of messages that carry the error details. There is a 1262 // common set of 1263 // message types for APIs to use. 1264 Details []googleapi.RawMessage `json:"details,omitempty"` 1265 1266 // Message: A developer-facing error message, which should be in 1267 // English. Any 1268 // user-facing error message should be localized and sent in 1269 // the 1270 // google.rpc.Status.details field, or localized by the client. 1271 Message string `json:"message,omitempty"` 1272 1273 // ForceSendFields is a list of field names (e.g. "Code") to 1274 // unconditionally include in API requests. By default, fields with 1275 // empty values are omitted from API requests. However, any non-pointer, 1276 // non-interface field appearing in ForceSendFields will be sent to the 1277 // server regardless of whether the field is empty or not. This may be 1278 // used to include empty fields in Patch requests. 1279 ForceSendFields []string `json:"-"` 1280 1281 // NullFields is a list of field names (e.g. "Code") to include in API 1282 // requests with the JSON null value. By default, fields with empty 1283 // values are omitted from API requests. However, any field with an 1284 // empty value appearing in NullFields will be sent to the server as 1285 // null. It is an error if a field in this list has a non-empty value. 1286 // This may be used to include null fields in Patch requests. 1287 NullFields []string `json:"-"` 1288} 1289 1290func (s *Status) MarshalJSON() ([]byte, error) { 1291 type NoMethod Status 1292 raw := NoMethod(*s) 1293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1294} 1295 1296// WipeDeviceResponse: Response message for wiping all data on the 1297// device. 1298type WipeDeviceResponse struct { 1299 // Device: Resultant Device object for the action. Note that asset tags 1300 // will not be 1301 // returned in the device object. 1302 Device *Device `json:"device,omitempty"` 1303 1304 // ForceSendFields is a list of field names (e.g. "Device") to 1305 // unconditionally include in API requests. By default, fields with 1306 // empty values are omitted from API requests. However, any non-pointer, 1307 // non-interface field appearing in ForceSendFields will be sent to the 1308 // server regardless of whether the field is empty or not. This may be 1309 // used to include empty fields in Patch requests. 1310 ForceSendFields []string `json:"-"` 1311 1312 // NullFields is a list of field names (e.g. "Device") to include in API 1313 // requests with the JSON null value. By default, fields with empty 1314 // values are omitted from API requests. However, any field with an 1315 // empty value appearing in NullFields will be sent to the server as 1316 // null. It is an error if a field in this list has a non-empty value. 1317 // This may be used to include null fields in Patch requests. 1318 NullFields []string `json:"-"` 1319} 1320 1321func (s *WipeDeviceResponse) MarshalJSON() ([]byte, error) { 1322 type NoMethod WipeDeviceResponse 1323 raw := NoMethod(*s) 1324 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1325} 1326 1327// WipeDeviceUserResponse: Response message for wiping the user's 1328// account from the device. 1329type WipeDeviceUserResponse struct { 1330 // DeviceUser: Resultant DeviceUser object for the action. 1331 DeviceUser *DeviceUser `json:"deviceUser,omitempty"` 1332 1333 // ForceSendFields is a list of field names (e.g. "DeviceUser") to 1334 // unconditionally include in API requests. By default, fields with 1335 // empty values are omitted from API requests. However, any non-pointer, 1336 // non-interface field appearing in ForceSendFields will be sent to the 1337 // server regardless of whether the field is empty or not. This may be 1338 // used to include empty fields in Patch requests. 1339 ForceSendFields []string `json:"-"` 1340 1341 // NullFields is a list of field names (e.g. "DeviceUser") to include in 1342 // API requests with the JSON null value. By default, fields with empty 1343 // values are omitted from API requests. However, any field with an 1344 // empty value appearing in NullFields will be sent to the server as 1345 // null. It is an error if a field in this list has a non-empty value. 1346 // This may be used to include null fields in Patch requests. 1347 NullFields []string `json:"-"` 1348} 1349 1350func (s *WipeDeviceUserResponse) MarshalJSON() ([]byte, error) { 1351 type NoMethod WipeDeviceUserResponse 1352 raw := NoMethod(*s) 1353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1354} 1355 1356// method id "cloudidentity.groups.create": 1357 1358type GroupsCreateCall struct { 1359 s *Service 1360 group *Group 1361 urlParams_ gensupport.URLParams 1362 ctx_ context.Context 1363 header_ http.Header 1364} 1365 1366// Create: Creates a Group. 1367func (r *GroupsService) Create(group *Group) *GroupsCreateCall { 1368 c := &GroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1369 c.group = group 1370 return c 1371} 1372 1373// Fields allows partial responses to be retrieved. See 1374// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1375// for more information. 1376func (c *GroupsCreateCall) Fields(s ...googleapi.Field) *GroupsCreateCall { 1377 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1378 return c 1379} 1380 1381// Context sets the context to be used in this call's Do method. Any 1382// pending HTTP request will be aborted if the provided context is 1383// canceled. 1384func (c *GroupsCreateCall) Context(ctx context.Context) *GroupsCreateCall { 1385 c.ctx_ = ctx 1386 return c 1387} 1388 1389// Header returns an http.Header that can be modified by the caller to 1390// add HTTP headers to the request. 1391func (c *GroupsCreateCall) Header() http.Header { 1392 if c.header_ == nil { 1393 c.header_ = make(http.Header) 1394 } 1395 return c.header_ 1396} 1397 1398func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) { 1399 reqHeaders := make(http.Header) 1400 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1401 for k, v := range c.header_ { 1402 reqHeaders[k] = v 1403 } 1404 reqHeaders.Set("User-Agent", c.s.userAgent()) 1405 var body io.Reader = nil 1406 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 1407 if err != nil { 1408 return nil, err 1409 } 1410 reqHeaders.Set("Content-Type", "application/json") 1411 c.urlParams_.Set("alt", alt) 1412 c.urlParams_.Set("prettyPrint", "false") 1413 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups") 1414 urls += "?" + c.urlParams_.Encode() 1415 req, err := http.NewRequest("POST", urls, body) 1416 if err != nil { 1417 return nil, err 1418 } 1419 req.Header = reqHeaders 1420 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1421} 1422 1423// Do executes the "cloudidentity.groups.create" call. 1424// Exactly one of *Operation or error will be non-nil. Any non-2xx 1425// status code is an error. Response headers are in either 1426// *Operation.ServerResponse.Header or (if a response was returned at 1427// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1428// to check whether the returned error was because 1429// http.StatusNotModified was returned. 1430func (c *GroupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1431 gensupport.SetOptions(c.urlParams_, opts...) 1432 res, err := c.doRequest("json") 1433 if res != nil && res.StatusCode == http.StatusNotModified { 1434 if res.Body != nil { 1435 res.Body.Close() 1436 } 1437 return nil, &googleapi.Error{ 1438 Code: res.StatusCode, 1439 Header: res.Header, 1440 } 1441 } 1442 if err != nil { 1443 return nil, err 1444 } 1445 defer googleapi.CloseBody(res) 1446 if err := googleapi.CheckResponse(res); err != nil { 1447 return nil, err 1448 } 1449 ret := &Operation{ 1450 ServerResponse: googleapi.ServerResponse{ 1451 Header: res.Header, 1452 HTTPStatusCode: res.StatusCode, 1453 }, 1454 } 1455 target := &ret 1456 if err := gensupport.DecodeResponse(target, res); err != nil { 1457 return nil, err 1458 } 1459 return ret, nil 1460 // { 1461 // "description": "Creates a Group.", 1462 // "flatPath": "v1/groups", 1463 // "httpMethod": "POST", 1464 // "id": "cloudidentity.groups.create", 1465 // "parameterOrder": [], 1466 // "parameters": {}, 1467 // "path": "v1/groups", 1468 // "request": { 1469 // "$ref": "Group" 1470 // }, 1471 // "response": { 1472 // "$ref": "Operation" 1473 // }, 1474 // "scopes": [ 1475 // "https://www.googleapis.com/auth/cloud-identity.groups", 1476 // "https://www.googleapis.com/auth/cloud-platform" 1477 // ] 1478 // } 1479 1480} 1481 1482// method id "cloudidentity.groups.delete": 1483 1484type GroupsDeleteCall struct { 1485 s *Service 1486 name string 1487 urlParams_ gensupport.URLParams 1488 ctx_ context.Context 1489 header_ http.Header 1490} 1491 1492// Delete: Deletes a Group. 1493func (r *GroupsService) Delete(name string) *GroupsDeleteCall { 1494 c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1495 c.name = name 1496 return c 1497} 1498 1499// Fields allows partial responses to be retrieved. See 1500// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1501// for more information. 1502func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { 1503 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1504 return c 1505} 1506 1507// Context sets the context to be used in this call's Do method. Any 1508// pending HTTP request will be aborted if the provided context is 1509// canceled. 1510func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { 1511 c.ctx_ = ctx 1512 return c 1513} 1514 1515// Header returns an http.Header that can be modified by the caller to 1516// add HTTP headers to the request. 1517func (c *GroupsDeleteCall) Header() http.Header { 1518 if c.header_ == nil { 1519 c.header_ = make(http.Header) 1520 } 1521 return c.header_ 1522} 1523 1524func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 1525 reqHeaders := make(http.Header) 1526 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1527 for k, v := range c.header_ { 1528 reqHeaders[k] = v 1529 } 1530 reqHeaders.Set("User-Agent", c.s.userAgent()) 1531 var body io.Reader = nil 1532 c.urlParams_.Set("alt", alt) 1533 c.urlParams_.Set("prettyPrint", "false") 1534 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1535 urls += "?" + c.urlParams_.Encode() 1536 req, err := http.NewRequest("DELETE", urls, body) 1537 if err != nil { 1538 return nil, err 1539 } 1540 req.Header = reqHeaders 1541 googleapi.Expand(req.URL, map[string]string{ 1542 "name": c.name, 1543 }) 1544 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1545} 1546 1547// Do executes the "cloudidentity.groups.delete" call. 1548// Exactly one of *Operation or error will be non-nil. Any non-2xx 1549// status code is an error. Response headers are in either 1550// *Operation.ServerResponse.Header or (if a response was returned at 1551// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1552// to check whether the returned error was because 1553// http.StatusNotModified was returned. 1554func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1555 gensupport.SetOptions(c.urlParams_, opts...) 1556 res, err := c.doRequest("json") 1557 if res != nil && res.StatusCode == http.StatusNotModified { 1558 if res.Body != nil { 1559 res.Body.Close() 1560 } 1561 return nil, &googleapi.Error{ 1562 Code: res.StatusCode, 1563 Header: res.Header, 1564 } 1565 } 1566 if err != nil { 1567 return nil, err 1568 } 1569 defer googleapi.CloseBody(res) 1570 if err := googleapi.CheckResponse(res); err != nil { 1571 return nil, err 1572 } 1573 ret := &Operation{ 1574 ServerResponse: googleapi.ServerResponse{ 1575 Header: res.Header, 1576 HTTPStatusCode: res.StatusCode, 1577 }, 1578 } 1579 target := &ret 1580 if err := gensupport.DecodeResponse(target, res); err != nil { 1581 return nil, err 1582 } 1583 return ret, nil 1584 // { 1585 // "description": "Deletes a Group.", 1586 // "flatPath": "v1/groups/{groupsId}", 1587 // "httpMethod": "DELETE", 1588 // "id": "cloudidentity.groups.delete", 1589 // "parameterOrder": [ 1590 // "name" 1591 // ], 1592 // "parameters": { 1593 // "name": { 1594 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where `group_id` is the unique ID\nassigned to the Group.", 1595 // "location": "path", 1596 // "pattern": "^groups/[^/]+$", 1597 // "required": true, 1598 // "type": "string" 1599 // } 1600 // }, 1601 // "path": "v1/{+name}", 1602 // "response": { 1603 // "$ref": "Operation" 1604 // }, 1605 // "scopes": [ 1606 // "https://www.googleapis.com/auth/cloud-identity.groups", 1607 // "https://www.googleapis.com/auth/cloud-platform" 1608 // ] 1609 // } 1610 1611} 1612 1613// method id "cloudidentity.groups.get": 1614 1615type GroupsGetCall struct { 1616 s *Service 1617 name string 1618 urlParams_ gensupport.URLParams 1619 ifNoneMatch_ string 1620 ctx_ context.Context 1621 header_ http.Header 1622} 1623 1624// Get: Retrieves a Group. 1625func (r *GroupsService) Get(name string) *GroupsGetCall { 1626 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1627 c.name = name 1628 return c 1629} 1630 1631// Fields allows partial responses to be retrieved. See 1632// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1633// for more information. 1634func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 1635 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1636 return c 1637} 1638 1639// IfNoneMatch sets the optional parameter which makes the operation 1640// fail if the object's ETag matches the given value. This is useful for 1641// getting updates only after the object has changed since the last 1642// request. Use googleapi.IsNotModified to check whether the response 1643// error from Do is the result of In-None-Match. 1644func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 1645 c.ifNoneMatch_ = entityTag 1646 return c 1647} 1648 1649// Context sets the context to be used in this call's Do method. Any 1650// pending HTTP request will be aborted if the provided context is 1651// canceled. 1652func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 1653 c.ctx_ = ctx 1654 return c 1655} 1656 1657// Header returns an http.Header that can be modified by the caller to 1658// add HTTP headers to the request. 1659func (c *GroupsGetCall) Header() http.Header { 1660 if c.header_ == nil { 1661 c.header_ = make(http.Header) 1662 } 1663 return c.header_ 1664} 1665 1666func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 1667 reqHeaders := make(http.Header) 1668 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1669 for k, v := range c.header_ { 1670 reqHeaders[k] = v 1671 } 1672 reqHeaders.Set("User-Agent", c.s.userAgent()) 1673 if c.ifNoneMatch_ != "" { 1674 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1675 } 1676 var body io.Reader = nil 1677 c.urlParams_.Set("alt", alt) 1678 c.urlParams_.Set("prettyPrint", "false") 1679 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1680 urls += "?" + c.urlParams_.Encode() 1681 req, err := http.NewRequest("GET", urls, body) 1682 if err != nil { 1683 return nil, err 1684 } 1685 req.Header = reqHeaders 1686 googleapi.Expand(req.URL, map[string]string{ 1687 "name": c.name, 1688 }) 1689 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1690} 1691 1692// Do executes the "cloudidentity.groups.get" call. 1693// Exactly one of *Group or error will be non-nil. Any non-2xx status 1694// code is an error. Response headers are in either 1695// *Group.ServerResponse.Header or (if a response was returned at all) 1696// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1697// check whether the returned error was because http.StatusNotModified 1698// was returned. 1699func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 1700 gensupport.SetOptions(c.urlParams_, opts...) 1701 res, err := c.doRequest("json") 1702 if res != nil && res.StatusCode == http.StatusNotModified { 1703 if res.Body != nil { 1704 res.Body.Close() 1705 } 1706 return nil, &googleapi.Error{ 1707 Code: res.StatusCode, 1708 Header: res.Header, 1709 } 1710 } 1711 if err != nil { 1712 return nil, err 1713 } 1714 defer googleapi.CloseBody(res) 1715 if err := googleapi.CheckResponse(res); err != nil { 1716 return nil, err 1717 } 1718 ret := &Group{ 1719 ServerResponse: googleapi.ServerResponse{ 1720 Header: res.Header, 1721 HTTPStatusCode: res.StatusCode, 1722 }, 1723 } 1724 target := &ret 1725 if err := gensupport.DecodeResponse(target, res); err != nil { 1726 return nil, err 1727 } 1728 return ret, nil 1729 // { 1730 // "description": "Retrieves a Group.", 1731 // "flatPath": "v1/groups/{groupsId}", 1732 // "httpMethod": "GET", 1733 // "id": "cloudidentity.groups.get", 1734 // "parameterOrder": [ 1735 // "name" 1736 // ], 1737 // "parameters": { 1738 // "name": { 1739 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where `group_id` is the unique ID\nassigned to the Group.", 1740 // "location": "path", 1741 // "pattern": "^groups/[^/]+$", 1742 // "required": true, 1743 // "type": "string" 1744 // } 1745 // }, 1746 // "path": "v1/{+name}", 1747 // "response": { 1748 // "$ref": "Group" 1749 // }, 1750 // "scopes": [ 1751 // "https://www.googleapis.com/auth/cloud-identity.groups", 1752 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 1753 // "https://www.googleapis.com/auth/cloud-platform" 1754 // ] 1755 // } 1756 1757} 1758 1759// method id "cloudidentity.groups.list": 1760 1761type GroupsListCall struct { 1762 s *Service 1763 urlParams_ gensupport.URLParams 1764 ifNoneMatch_ string 1765 ctx_ context.Context 1766 header_ http.Header 1767} 1768 1769// List: Lists groups within a customer or a domain. 1770func (r *GroupsService) List() *GroupsListCall { 1771 c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1772 return c 1773} 1774 1775// PageSize sets the optional parameter "pageSize": The default page 1776// size is 200 (max 1000) for the BASIC view, and 50 1777// (max 500) for the FULL view. 1778func (c *GroupsListCall) PageSize(pageSize int64) *GroupsListCall { 1779 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1780 return c 1781} 1782 1783// PageToken sets the optional parameter "pageToken": The 1784// next_page_token value returned from a previous list request, if any. 1785func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { 1786 c.urlParams_.Set("pageToken", pageToken) 1787 return c 1788} 1789 1790// Parent sets the optional parameter "parent": Required. Customer ID to 1791// list all groups from. 1792func (c *GroupsListCall) Parent(parent string) *GroupsListCall { 1793 c.urlParams_.Set("parent", parent) 1794 return c 1795} 1796 1797// View sets the optional parameter "view": Group resource view to be 1798// returned. Defaults to [View.BASIC](). 1799// 1800// Possible values: 1801// "VIEW_UNSPECIFIED" 1802// "BASIC" 1803// "FULL" 1804func (c *GroupsListCall) View(view string) *GroupsListCall { 1805 c.urlParams_.Set("view", view) 1806 return c 1807} 1808 1809// Fields allows partial responses to be retrieved. See 1810// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1811// for more information. 1812func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { 1813 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1814 return c 1815} 1816 1817// IfNoneMatch sets the optional parameter which makes the operation 1818// fail if the object's ETag matches the given value. This is useful for 1819// getting updates only after the object has changed since the last 1820// request. Use googleapi.IsNotModified to check whether the response 1821// error from Do is the result of In-None-Match. 1822func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { 1823 c.ifNoneMatch_ = entityTag 1824 return c 1825} 1826 1827// Context sets the context to be used in this call's Do method. Any 1828// pending HTTP request will be aborted if the provided context is 1829// canceled. 1830func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { 1831 c.ctx_ = ctx 1832 return c 1833} 1834 1835// Header returns an http.Header that can be modified by the caller to 1836// add HTTP headers to the request. 1837func (c *GroupsListCall) Header() http.Header { 1838 if c.header_ == nil { 1839 c.header_ = make(http.Header) 1840 } 1841 return c.header_ 1842} 1843 1844func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { 1845 reqHeaders := make(http.Header) 1846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1847 for k, v := range c.header_ { 1848 reqHeaders[k] = v 1849 } 1850 reqHeaders.Set("User-Agent", c.s.userAgent()) 1851 if c.ifNoneMatch_ != "" { 1852 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1853 } 1854 var body io.Reader = nil 1855 c.urlParams_.Set("alt", alt) 1856 c.urlParams_.Set("prettyPrint", "false") 1857 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups") 1858 urls += "?" + c.urlParams_.Encode() 1859 req, err := http.NewRequest("GET", urls, body) 1860 if err != nil { 1861 return nil, err 1862 } 1863 req.Header = reqHeaders 1864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1865} 1866 1867// Do executes the "cloudidentity.groups.list" call. 1868// Exactly one of *ListGroupsResponse or error will be non-nil. Any 1869// non-2xx status code is an error. Response headers are in either 1870// *ListGroupsResponse.ServerResponse.Header or (if a response was 1871// returned at all) in error.(*googleapi.Error).Header. Use 1872// googleapi.IsNotModified to check whether the returned error was 1873// because http.StatusNotModified was returned. 1874func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*ListGroupsResponse, error) { 1875 gensupport.SetOptions(c.urlParams_, opts...) 1876 res, err := c.doRequest("json") 1877 if res != nil && res.StatusCode == http.StatusNotModified { 1878 if res.Body != nil { 1879 res.Body.Close() 1880 } 1881 return nil, &googleapi.Error{ 1882 Code: res.StatusCode, 1883 Header: res.Header, 1884 } 1885 } 1886 if err != nil { 1887 return nil, err 1888 } 1889 defer googleapi.CloseBody(res) 1890 if err := googleapi.CheckResponse(res); err != nil { 1891 return nil, err 1892 } 1893 ret := &ListGroupsResponse{ 1894 ServerResponse: googleapi.ServerResponse{ 1895 Header: res.Header, 1896 HTTPStatusCode: res.StatusCode, 1897 }, 1898 } 1899 target := &ret 1900 if err := gensupport.DecodeResponse(target, res); err != nil { 1901 return nil, err 1902 } 1903 return ret, nil 1904 // { 1905 // "description": "Lists groups within a customer or a domain.", 1906 // "flatPath": "v1/groups", 1907 // "httpMethod": "GET", 1908 // "id": "cloudidentity.groups.list", 1909 // "parameterOrder": [], 1910 // "parameters": { 1911 // "pageSize": { 1912 // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.", 1913 // "format": "int32", 1914 // "location": "query", 1915 // "type": "integer" 1916 // }, 1917 // "pageToken": { 1918 // "description": "The next_page_token value returned from a previous list request, if any.", 1919 // "location": "query", 1920 // "type": "string" 1921 // }, 1922 // "parent": { 1923 // "description": "Required. Customer ID to list all groups from.", 1924 // "location": "query", 1925 // "type": "string" 1926 // }, 1927 // "view": { 1928 // "description": "Group resource view to be returned. Defaults to [View.BASIC]().", 1929 // "enum": [ 1930 // "VIEW_UNSPECIFIED", 1931 // "BASIC", 1932 // "FULL" 1933 // ], 1934 // "location": "query", 1935 // "type": "string" 1936 // } 1937 // }, 1938 // "path": "v1/groups", 1939 // "response": { 1940 // "$ref": "ListGroupsResponse" 1941 // }, 1942 // "scopes": [ 1943 // "https://www.googleapis.com/auth/cloud-identity.groups", 1944 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 1945 // "https://www.googleapis.com/auth/cloud-platform" 1946 // ] 1947 // } 1948 1949} 1950 1951// Pages invokes f for each page of results. 1952// A non-nil error returned from f will halt the iteration. 1953// The provided context supersedes any context provided to the Context method. 1954func (c *GroupsListCall) Pages(ctx context.Context, f func(*ListGroupsResponse) error) error { 1955 c.ctx_ = ctx 1956 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1957 for { 1958 x, err := c.Do() 1959 if err != nil { 1960 return err 1961 } 1962 if err := f(x); err != nil { 1963 return err 1964 } 1965 if x.NextPageToken == "" { 1966 return nil 1967 } 1968 c.PageToken(x.NextPageToken) 1969 } 1970} 1971 1972// method id "cloudidentity.groups.lookup": 1973 1974type GroupsLookupCall struct { 1975 s *Service 1976 urlParams_ gensupport.URLParams 1977 ifNoneMatch_ string 1978 ctx_ context.Context 1979 header_ http.Header 1980} 1981 1982// Lookup: Looks up 1983// [resource 1984// name](https://cloud.google.com/apis/design/resource_names) of a Group 1985// by 1986// its EntityKey. 1987func (r *GroupsService) Lookup() *GroupsLookupCall { 1988 c := &GroupsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1989 return c 1990} 1991 1992// GroupKeyId sets the optional parameter "groupKey.id": The ID of the 1993// entity within the given namespace. The ID must be unique 1994// within its namespace. 1995func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall { 1996 c.urlParams_.Set("groupKey.id", groupKeyId) 1997 return c 1998} 1999 2000// GroupKeyNamespace sets the optional parameter "groupKey.namespace": 2001// Namespaces provide isolation for IDs, so an ID only needs to be 2002// unique 2003// within its namespace. 2004// 2005// Namespaces are currently only created as part of IdentitySource 2006// creation 2007// from Admin Console. A namespace 2008// "identitysources/{identity_source_id}" is 2009// created corresponding to every Identity Source `identity_source_id`. 2010func (c *GroupsLookupCall) GroupKeyNamespace(groupKeyNamespace string) *GroupsLookupCall { 2011 c.urlParams_.Set("groupKey.namespace", groupKeyNamespace) 2012 return c 2013} 2014 2015// Fields allows partial responses to be retrieved. See 2016// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2017// for more information. 2018func (c *GroupsLookupCall) Fields(s ...googleapi.Field) *GroupsLookupCall { 2019 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2020 return c 2021} 2022 2023// IfNoneMatch sets the optional parameter which makes the operation 2024// fail if the object's ETag matches the given value. This is useful for 2025// getting updates only after the object has changed since the last 2026// request. Use googleapi.IsNotModified to check whether the response 2027// error from Do is the result of In-None-Match. 2028func (c *GroupsLookupCall) IfNoneMatch(entityTag string) *GroupsLookupCall { 2029 c.ifNoneMatch_ = entityTag 2030 return c 2031} 2032 2033// Context sets the context to be used in this call's Do method. Any 2034// pending HTTP request will be aborted if the provided context is 2035// canceled. 2036func (c *GroupsLookupCall) Context(ctx context.Context) *GroupsLookupCall { 2037 c.ctx_ = ctx 2038 return c 2039} 2040 2041// Header returns an http.Header that can be modified by the caller to 2042// add HTTP headers to the request. 2043func (c *GroupsLookupCall) Header() http.Header { 2044 if c.header_ == nil { 2045 c.header_ = make(http.Header) 2046 } 2047 return c.header_ 2048} 2049 2050func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) { 2051 reqHeaders := make(http.Header) 2052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2053 for k, v := range c.header_ { 2054 reqHeaders[k] = v 2055 } 2056 reqHeaders.Set("User-Agent", c.s.userAgent()) 2057 if c.ifNoneMatch_ != "" { 2058 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2059 } 2060 var body io.Reader = nil 2061 c.urlParams_.Set("alt", alt) 2062 c.urlParams_.Set("prettyPrint", "false") 2063 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups:lookup") 2064 urls += "?" + c.urlParams_.Encode() 2065 req, err := http.NewRequest("GET", urls, body) 2066 if err != nil { 2067 return nil, err 2068 } 2069 req.Header = reqHeaders 2070 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2071} 2072 2073// Do executes the "cloudidentity.groups.lookup" call. 2074// Exactly one of *LookupGroupNameResponse or error will be non-nil. Any 2075// non-2xx status code is an error. Response headers are in either 2076// *LookupGroupNameResponse.ServerResponse.Header or (if a response was 2077// returned at all) in error.(*googleapi.Error).Header. Use 2078// googleapi.IsNotModified to check whether the returned error was 2079// because http.StatusNotModified was returned. 2080func (c *GroupsLookupCall) Do(opts ...googleapi.CallOption) (*LookupGroupNameResponse, error) { 2081 gensupport.SetOptions(c.urlParams_, opts...) 2082 res, err := c.doRequest("json") 2083 if res != nil && res.StatusCode == http.StatusNotModified { 2084 if res.Body != nil { 2085 res.Body.Close() 2086 } 2087 return nil, &googleapi.Error{ 2088 Code: res.StatusCode, 2089 Header: res.Header, 2090 } 2091 } 2092 if err != nil { 2093 return nil, err 2094 } 2095 defer googleapi.CloseBody(res) 2096 if err := googleapi.CheckResponse(res); err != nil { 2097 return nil, err 2098 } 2099 ret := &LookupGroupNameResponse{ 2100 ServerResponse: googleapi.ServerResponse{ 2101 Header: res.Header, 2102 HTTPStatusCode: res.StatusCode, 2103 }, 2104 } 2105 target := &ret 2106 if err := gensupport.DecodeResponse(target, res); err != nil { 2107 return nil, err 2108 } 2109 return ret, nil 2110 // { 2111 // "description": "Looks up [resource\nname](https://cloud.google.com/apis/design/resource_names) of a Group by\nits EntityKey.", 2112 // "flatPath": "v1/groups:lookup", 2113 // "httpMethod": "GET", 2114 // "id": "cloudidentity.groups.lookup", 2115 // "parameterOrder": [], 2116 // "parameters": { 2117 // "groupKey.id": { 2118 // "description": "The ID of the entity within the given namespace. The ID must be unique\nwithin its namespace.", 2119 // "location": "query", 2120 // "type": "string" 2121 // }, 2122 // "groupKey.namespace": { 2123 // "description": "Namespaces provide isolation for IDs, so an ID only needs to be unique\nwithin its namespace.\n\nNamespaces are currently only created as part of IdentitySource creation\nfrom Admin Console. A namespace `\"identitysources/{identity_source_id}\"` is\ncreated corresponding to every Identity Source `identity_source_id`.", 2124 // "location": "query", 2125 // "type": "string" 2126 // } 2127 // }, 2128 // "path": "v1/groups:lookup", 2129 // "response": { 2130 // "$ref": "LookupGroupNameResponse" 2131 // }, 2132 // "scopes": [ 2133 // "https://www.googleapis.com/auth/cloud-identity.groups", 2134 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 2135 // "https://www.googleapis.com/auth/cloud-platform" 2136 // ] 2137 // } 2138 2139} 2140 2141// method id "cloudidentity.groups.patch": 2142 2143type GroupsPatchCall struct { 2144 s *Service 2145 name string 2146 group *Group 2147 urlParams_ gensupport.URLParams 2148 ctx_ context.Context 2149 header_ http.Header 2150} 2151 2152// Patch: Updates a Group. 2153func (r *GroupsService) Patch(name string, group *Group) *GroupsPatchCall { 2154 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2155 c.name = name 2156 c.group = group 2157 return c 2158} 2159 2160// UpdateMask sets the optional parameter "updateMask": Required. 2161// Editable fields: `display_name`, `description` 2162func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall { 2163 c.urlParams_.Set("updateMask", updateMask) 2164 return c 2165} 2166 2167// Fields allows partial responses to be retrieved. See 2168// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2169// for more information. 2170func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 2171 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2172 return c 2173} 2174 2175// Context sets the context to be used in this call's Do method. Any 2176// pending HTTP request will be aborted if the provided context is 2177// canceled. 2178func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 2179 c.ctx_ = ctx 2180 return c 2181} 2182 2183// Header returns an http.Header that can be modified by the caller to 2184// add HTTP headers to the request. 2185func (c *GroupsPatchCall) Header() http.Header { 2186 if c.header_ == nil { 2187 c.header_ = make(http.Header) 2188 } 2189 return c.header_ 2190} 2191 2192func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 2193 reqHeaders := make(http.Header) 2194 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2195 for k, v := range c.header_ { 2196 reqHeaders[k] = v 2197 } 2198 reqHeaders.Set("User-Agent", c.s.userAgent()) 2199 var body io.Reader = nil 2200 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 2201 if err != nil { 2202 return nil, err 2203 } 2204 reqHeaders.Set("Content-Type", "application/json") 2205 c.urlParams_.Set("alt", alt) 2206 c.urlParams_.Set("prettyPrint", "false") 2207 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2208 urls += "?" + c.urlParams_.Encode() 2209 req, err := http.NewRequest("PATCH", urls, body) 2210 if err != nil { 2211 return nil, err 2212 } 2213 req.Header = reqHeaders 2214 googleapi.Expand(req.URL, map[string]string{ 2215 "name": c.name, 2216 }) 2217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2218} 2219 2220// Do executes the "cloudidentity.groups.patch" call. 2221// Exactly one of *Operation or error will be non-nil. Any non-2xx 2222// status code is an error. Response headers are in either 2223// *Operation.ServerResponse.Header or (if a response was returned at 2224// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2225// to check whether the returned error was because 2226// http.StatusNotModified was returned. 2227func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2228 gensupport.SetOptions(c.urlParams_, opts...) 2229 res, err := c.doRequest("json") 2230 if res != nil && res.StatusCode == http.StatusNotModified { 2231 if res.Body != nil { 2232 res.Body.Close() 2233 } 2234 return nil, &googleapi.Error{ 2235 Code: res.StatusCode, 2236 Header: res.Header, 2237 } 2238 } 2239 if err != nil { 2240 return nil, err 2241 } 2242 defer googleapi.CloseBody(res) 2243 if err := googleapi.CheckResponse(res); err != nil { 2244 return nil, err 2245 } 2246 ret := &Operation{ 2247 ServerResponse: googleapi.ServerResponse{ 2248 Header: res.Header, 2249 HTTPStatusCode: res.StatusCode, 2250 }, 2251 } 2252 target := &ret 2253 if err := gensupport.DecodeResponse(target, res); err != nil { 2254 return nil, err 2255 } 2256 return ret, nil 2257 // { 2258 // "description": "Updates a Group.", 2259 // "flatPath": "v1/groups/{groupsId}", 2260 // "httpMethod": "PATCH", 2261 // "id": "cloudidentity.groups.patch", 2262 // "parameterOrder": [ 2263 // "name" 2264 // ], 2265 // "parameters": { 2266 // "name": { 2267 // "description": "Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where group_id is the unique ID\nassigned to the Group.\n\nMust be left blank while creating a Group.", 2268 // "location": "path", 2269 // "pattern": "^groups/[^/]+$", 2270 // "required": true, 2271 // "type": "string" 2272 // }, 2273 // "updateMask": { 2274 // "description": "Required. Editable fields: `display_name`, `description`", 2275 // "format": "google-fieldmask", 2276 // "location": "query", 2277 // "type": "string" 2278 // } 2279 // }, 2280 // "path": "v1/{+name}", 2281 // "request": { 2282 // "$ref": "Group" 2283 // }, 2284 // "response": { 2285 // "$ref": "Operation" 2286 // }, 2287 // "scopes": [ 2288 // "https://www.googleapis.com/auth/cloud-identity.groups", 2289 // "https://www.googleapis.com/auth/cloud-platform" 2290 // ] 2291 // } 2292 2293} 2294 2295// method id "cloudidentity.groups.search": 2296 2297type GroupsSearchCall struct { 2298 s *Service 2299 urlParams_ gensupport.URLParams 2300 ifNoneMatch_ string 2301 ctx_ context.Context 2302 header_ http.Header 2303} 2304 2305// Search: Searches for Groups. 2306func (r *GroupsService) Search() *GroupsSearchCall { 2307 c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2308 return c 2309} 2310 2311// PageSize sets the optional parameter "pageSize": The default page 2312// size is 200 (max 1000) for the BASIC view, and 50 2313// (max 500) for the FULL view. 2314func (c *GroupsSearchCall) PageSize(pageSize int64) *GroupsSearchCall { 2315 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2316 return c 2317} 2318 2319// PageToken sets the optional parameter "pageToken": The 2320// next_page_token value returned from a previous search request, if 2321// any. 2322func (c *GroupsSearchCall) PageToken(pageToken string) *GroupsSearchCall { 2323 c.urlParams_.Set("pageToken", pageToken) 2324 return c 2325} 2326 2327// Query sets the optional parameter "query": Required. `Required`. 2328// Query string for performing search on groups. Users can search 2329// on parent and label attributes of groups. 2330// EXACT match ('==') is supported on parent, and CONTAINS match ('in') 2331// is 2332// supported on labels. 2333func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall { 2334 c.urlParams_.Set("query", query) 2335 return c 2336} 2337 2338// View sets the optional parameter "view": Group resource view to be 2339// returned. Defaults to [View.BASIC](). 2340// 2341// Possible values: 2342// "VIEW_UNSPECIFIED" 2343// "BASIC" 2344// "FULL" 2345func (c *GroupsSearchCall) View(view string) *GroupsSearchCall { 2346 c.urlParams_.Set("view", view) 2347 return c 2348} 2349 2350// Fields allows partial responses to be retrieved. See 2351// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2352// for more information. 2353func (c *GroupsSearchCall) Fields(s ...googleapi.Field) *GroupsSearchCall { 2354 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2355 return c 2356} 2357 2358// IfNoneMatch sets the optional parameter which makes the operation 2359// fail if the object's ETag matches the given value. This is useful for 2360// getting updates only after the object has changed since the last 2361// request. Use googleapi.IsNotModified to check whether the response 2362// error from Do is the result of In-None-Match. 2363func (c *GroupsSearchCall) IfNoneMatch(entityTag string) *GroupsSearchCall { 2364 c.ifNoneMatch_ = entityTag 2365 return c 2366} 2367 2368// Context sets the context to be used in this call's Do method. Any 2369// pending HTTP request will be aborted if the provided context is 2370// canceled. 2371func (c *GroupsSearchCall) Context(ctx context.Context) *GroupsSearchCall { 2372 c.ctx_ = ctx 2373 return c 2374} 2375 2376// Header returns an http.Header that can be modified by the caller to 2377// add HTTP headers to the request. 2378func (c *GroupsSearchCall) Header() http.Header { 2379 if c.header_ == nil { 2380 c.header_ = make(http.Header) 2381 } 2382 return c.header_ 2383} 2384 2385func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) { 2386 reqHeaders := make(http.Header) 2387 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2388 for k, v := range c.header_ { 2389 reqHeaders[k] = v 2390 } 2391 reqHeaders.Set("User-Agent", c.s.userAgent()) 2392 if c.ifNoneMatch_ != "" { 2393 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2394 } 2395 var body io.Reader = nil 2396 c.urlParams_.Set("alt", alt) 2397 c.urlParams_.Set("prettyPrint", "false") 2398 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/groups:search") 2399 urls += "?" + c.urlParams_.Encode() 2400 req, err := http.NewRequest("GET", urls, body) 2401 if err != nil { 2402 return nil, err 2403 } 2404 req.Header = reqHeaders 2405 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2406} 2407 2408// Do executes the "cloudidentity.groups.search" call. 2409// Exactly one of *SearchGroupsResponse or error will be non-nil. Any 2410// non-2xx status code is an error. Response headers are in either 2411// *SearchGroupsResponse.ServerResponse.Header or (if a response was 2412// returned at all) in error.(*googleapi.Error).Header. Use 2413// googleapi.IsNotModified to check whether the returned error was 2414// because http.StatusNotModified was returned. 2415func (c *GroupsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGroupsResponse, error) { 2416 gensupport.SetOptions(c.urlParams_, opts...) 2417 res, err := c.doRequest("json") 2418 if res != nil && res.StatusCode == http.StatusNotModified { 2419 if res.Body != nil { 2420 res.Body.Close() 2421 } 2422 return nil, &googleapi.Error{ 2423 Code: res.StatusCode, 2424 Header: res.Header, 2425 } 2426 } 2427 if err != nil { 2428 return nil, err 2429 } 2430 defer googleapi.CloseBody(res) 2431 if err := googleapi.CheckResponse(res); err != nil { 2432 return nil, err 2433 } 2434 ret := &SearchGroupsResponse{ 2435 ServerResponse: googleapi.ServerResponse{ 2436 Header: res.Header, 2437 HTTPStatusCode: res.StatusCode, 2438 }, 2439 } 2440 target := &ret 2441 if err := gensupport.DecodeResponse(target, res); err != nil { 2442 return nil, err 2443 } 2444 return ret, nil 2445 // { 2446 // "description": "Searches for Groups.", 2447 // "flatPath": "v1/groups:search", 2448 // "httpMethod": "GET", 2449 // "id": "cloudidentity.groups.search", 2450 // "parameterOrder": [], 2451 // "parameters": { 2452 // "pageSize": { 2453 // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.", 2454 // "format": "int32", 2455 // "location": "query", 2456 // "type": "integer" 2457 // }, 2458 // "pageToken": { 2459 // "description": "The next_page_token value returned from a previous search request, if any.", 2460 // "location": "query", 2461 // "type": "string" 2462 // }, 2463 // "query": { 2464 // "description": "Required. `Required`. Query string for performing search on groups. Users can search\non parent and label attributes of groups.\nEXACT match ('==') is supported on parent, and CONTAINS match ('in') is\nsupported on labels.", 2465 // "location": "query", 2466 // "type": "string" 2467 // }, 2468 // "view": { 2469 // "description": "Group resource view to be returned. Defaults to [View.BASIC]().", 2470 // "enum": [ 2471 // "VIEW_UNSPECIFIED", 2472 // "BASIC", 2473 // "FULL" 2474 // ], 2475 // "location": "query", 2476 // "type": "string" 2477 // } 2478 // }, 2479 // "path": "v1/groups:search", 2480 // "response": { 2481 // "$ref": "SearchGroupsResponse" 2482 // }, 2483 // "scopes": [ 2484 // "https://www.googleapis.com/auth/cloud-identity.groups", 2485 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 2486 // "https://www.googleapis.com/auth/cloud-platform" 2487 // ] 2488 // } 2489 2490} 2491 2492// Pages invokes f for each page of results. 2493// A non-nil error returned from f will halt the iteration. 2494// The provided context supersedes any context provided to the Context method. 2495func (c *GroupsSearchCall) Pages(ctx context.Context, f func(*SearchGroupsResponse) error) error { 2496 c.ctx_ = ctx 2497 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2498 for { 2499 x, err := c.Do() 2500 if err != nil { 2501 return err 2502 } 2503 if err := f(x); err != nil { 2504 return err 2505 } 2506 if x.NextPageToken == "" { 2507 return nil 2508 } 2509 c.PageToken(x.NextPageToken) 2510 } 2511} 2512 2513// method id "cloudidentity.groups.memberships.create": 2514 2515type GroupsMembershipsCreateCall struct { 2516 s *Service 2517 parent string 2518 membership *Membership 2519 urlParams_ gensupport.URLParams 2520 ctx_ context.Context 2521 header_ http.Header 2522} 2523 2524// Create: Creates a Membership. 2525func (r *GroupsMembershipsService) Create(parent string, membership *Membership) *GroupsMembershipsCreateCall { 2526 c := &GroupsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2527 c.parent = parent 2528 c.membership = membership 2529 return c 2530} 2531 2532// Fields allows partial responses to be retrieved. See 2533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2534// for more information. 2535func (c *GroupsMembershipsCreateCall) Fields(s ...googleapi.Field) *GroupsMembershipsCreateCall { 2536 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2537 return c 2538} 2539 2540// Context sets the context to be used in this call's Do method. Any 2541// pending HTTP request will be aborted if the provided context is 2542// canceled. 2543func (c *GroupsMembershipsCreateCall) Context(ctx context.Context) *GroupsMembershipsCreateCall { 2544 c.ctx_ = ctx 2545 return c 2546} 2547 2548// Header returns an http.Header that can be modified by the caller to 2549// add HTTP headers to the request. 2550func (c *GroupsMembershipsCreateCall) Header() http.Header { 2551 if c.header_ == nil { 2552 c.header_ = make(http.Header) 2553 } 2554 return c.header_ 2555} 2556 2557func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { 2558 reqHeaders := make(http.Header) 2559 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2560 for k, v := range c.header_ { 2561 reqHeaders[k] = v 2562 } 2563 reqHeaders.Set("User-Agent", c.s.userAgent()) 2564 var body io.Reader = nil 2565 body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) 2566 if err != nil { 2567 return nil, err 2568 } 2569 reqHeaders.Set("Content-Type", "application/json") 2570 c.urlParams_.Set("alt", alt) 2571 c.urlParams_.Set("prettyPrint", "false") 2572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships") 2573 urls += "?" + c.urlParams_.Encode() 2574 req, err := http.NewRequest("POST", urls, body) 2575 if err != nil { 2576 return nil, err 2577 } 2578 req.Header = reqHeaders 2579 googleapi.Expand(req.URL, map[string]string{ 2580 "parent": c.parent, 2581 }) 2582 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2583} 2584 2585// Do executes the "cloudidentity.groups.memberships.create" call. 2586// Exactly one of *Operation or error will be non-nil. Any non-2xx 2587// status code is an error. Response headers are in either 2588// *Operation.ServerResponse.Header or (if a response was returned at 2589// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2590// to check whether the returned error was because 2591// http.StatusNotModified was returned. 2592func (c *GroupsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2593 gensupport.SetOptions(c.urlParams_, opts...) 2594 res, err := c.doRequest("json") 2595 if res != nil && res.StatusCode == http.StatusNotModified { 2596 if res.Body != nil { 2597 res.Body.Close() 2598 } 2599 return nil, &googleapi.Error{ 2600 Code: res.StatusCode, 2601 Header: res.Header, 2602 } 2603 } 2604 if err != nil { 2605 return nil, err 2606 } 2607 defer googleapi.CloseBody(res) 2608 if err := googleapi.CheckResponse(res); err != nil { 2609 return nil, err 2610 } 2611 ret := &Operation{ 2612 ServerResponse: googleapi.ServerResponse{ 2613 Header: res.Header, 2614 HTTPStatusCode: res.StatusCode, 2615 }, 2616 } 2617 target := &ret 2618 if err := gensupport.DecodeResponse(target, res); err != nil { 2619 return nil, err 2620 } 2621 return ret, nil 2622 // { 2623 // "description": "Creates a Membership.", 2624 // "flatPath": "v1/groups/{groupsId}/memberships", 2625 // "httpMethod": "POST", 2626 // "id": "cloudidentity.groups.memberships.create", 2627 // "parameterOrder": [ 2628 // "parent" 2629 // ], 2630 // "parameters": { 2631 // "parent": { 2632 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to create Membership within. Format: `groups/{group_id}`, where\n`group_id` is the unique ID assigned to the Group.", 2633 // "location": "path", 2634 // "pattern": "^groups/[^/]+$", 2635 // "required": true, 2636 // "type": "string" 2637 // } 2638 // }, 2639 // "path": "v1/{+parent}/memberships", 2640 // "request": { 2641 // "$ref": "Membership" 2642 // }, 2643 // "response": { 2644 // "$ref": "Operation" 2645 // }, 2646 // "scopes": [ 2647 // "https://www.googleapis.com/auth/cloud-identity.groups", 2648 // "https://www.googleapis.com/auth/cloud-platform" 2649 // ] 2650 // } 2651 2652} 2653 2654// method id "cloudidentity.groups.memberships.delete": 2655 2656type GroupsMembershipsDeleteCall struct { 2657 s *Service 2658 name string 2659 urlParams_ gensupport.URLParams 2660 ctx_ context.Context 2661 header_ http.Header 2662} 2663 2664// Delete: Deletes a Membership. 2665func (r *GroupsMembershipsService) Delete(name string) *GroupsMembershipsDeleteCall { 2666 c := &GroupsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2667 c.name = name 2668 return c 2669} 2670 2671// Fields allows partial responses to be retrieved. See 2672// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2673// for more information. 2674func (c *GroupsMembershipsDeleteCall) Fields(s ...googleapi.Field) *GroupsMembershipsDeleteCall { 2675 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2676 return c 2677} 2678 2679// Context sets the context to be used in this call's Do method. Any 2680// pending HTTP request will be aborted if the provided context is 2681// canceled. 2682func (c *GroupsMembershipsDeleteCall) Context(ctx context.Context) *GroupsMembershipsDeleteCall { 2683 c.ctx_ = ctx 2684 return c 2685} 2686 2687// Header returns an http.Header that can be modified by the caller to 2688// add HTTP headers to the request. 2689func (c *GroupsMembershipsDeleteCall) Header() http.Header { 2690 if c.header_ == nil { 2691 c.header_ = make(http.Header) 2692 } 2693 return c.header_ 2694} 2695 2696func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { 2697 reqHeaders := make(http.Header) 2698 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2699 for k, v := range c.header_ { 2700 reqHeaders[k] = v 2701 } 2702 reqHeaders.Set("User-Agent", c.s.userAgent()) 2703 var body io.Reader = nil 2704 c.urlParams_.Set("alt", alt) 2705 c.urlParams_.Set("prettyPrint", "false") 2706 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2707 urls += "?" + c.urlParams_.Encode() 2708 req, err := http.NewRequest("DELETE", urls, body) 2709 if err != nil { 2710 return nil, err 2711 } 2712 req.Header = reqHeaders 2713 googleapi.Expand(req.URL, map[string]string{ 2714 "name": c.name, 2715 }) 2716 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2717} 2718 2719// Do executes the "cloudidentity.groups.memberships.delete" call. 2720// Exactly one of *Operation or error will be non-nil. Any non-2xx 2721// status code is an error. Response headers are in either 2722// *Operation.ServerResponse.Header or (if a response was returned at 2723// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2724// to check whether the returned error was because 2725// http.StatusNotModified was returned. 2726func (c *GroupsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2727 gensupport.SetOptions(c.urlParams_, opts...) 2728 res, err := c.doRequest("json") 2729 if res != nil && res.StatusCode == http.StatusNotModified { 2730 if res.Body != nil { 2731 res.Body.Close() 2732 } 2733 return nil, &googleapi.Error{ 2734 Code: res.StatusCode, 2735 Header: res.Header, 2736 } 2737 } 2738 if err != nil { 2739 return nil, err 2740 } 2741 defer googleapi.CloseBody(res) 2742 if err := googleapi.CheckResponse(res); err != nil { 2743 return nil, err 2744 } 2745 ret := &Operation{ 2746 ServerResponse: googleapi.ServerResponse{ 2747 Header: res.Header, 2748 HTTPStatusCode: res.StatusCode, 2749 }, 2750 } 2751 target := &ret 2752 if err := gensupport.DecodeResponse(target, res); err != nil { 2753 return nil, err 2754 } 2755 return ret, nil 2756 // { 2757 // "description": "Deletes a Membership.", 2758 // "flatPath": "v1/groups/{groupsId}/memberships/{membershipsId}", 2759 // "httpMethod": "DELETE", 2760 // "id": "cloudidentity.groups.memberships.delete", 2761 // "parameterOrder": [ 2762 // "name" 2763 // ], 2764 // "parameters": { 2765 // "name": { 2766 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nMembership to be deleted.\n\nFormat: `groups/{group_id}/memberships/{member_id}`, where `group_id` is\nthe unique ID assigned to the Group to which Membership belongs to, and\nmember_id is the unique ID assigned to the member.", 2767 // "location": "path", 2768 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 2769 // "required": true, 2770 // "type": "string" 2771 // } 2772 // }, 2773 // "path": "v1/{+name}", 2774 // "response": { 2775 // "$ref": "Operation" 2776 // }, 2777 // "scopes": [ 2778 // "https://www.googleapis.com/auth/cloud-identity.groups", 2779 // "https://www.googleapis.com/auth/cloud-platform" 2780 // ] 2781 // } 2782 2783} 2784 2785// method id "cloudidentity.groups.memberships.get": 2786 2787type GroupsMembershipsGetCall struct { 2788 s *Service 2789 name string 2790 urlParams_ gensupport.URLParams 2791 ifNoneMatch_ string 2792 ctx_ context.Context 2793 header_ http.Header 2794} 2795 2796// Get: Retrieves a Membership. 2797func (r *GroupsMembershipsService) Get(name string) *GroupsMembershipsGetCall { 2798 c := &GroupsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2799 c.name = name 2800 return c 2801} 2802 2803// Fields allows partial responses to be retrieved. See 2804// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2805// for more information. 2806func (c *GroupsMembershipsGetCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetCall { 2807 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2808 return c 2809} 2810 2811// IfNoneMatch sets the optional parameter which makes the operation 2812// fail if the object's ETag matches the given value. This is useful for 2813// getting updates only after the object has changed since the last 2814// request. Use googleapi.IsNotModified to check whether the response 2815// error from Do is the result of In-None-Match. 2816func (c *GroupsMembershipsGetCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetCall { 2817 c.ifNoneMatch_ = entityTag 2818 return c 2819} 2820 2821// Context sets the context to be used in this call's Do method. Any 2822// pending HTTP request will be aborted if the provided context is 2823// canceled. 2824func (c *GroupsMembershipsGetCall) Context(ctx context.Context) *GroupsMembershipsGetCall { 2825 c.ctx_ = ctx 2826 return c 2827} 2828 2829// Header returns an http.Header that can be modified by the caller to 2830// add HTTP headers to the request. 2831func (c *GroupsMembershipsGetCall) Header() http.Header { 2832 if c.header_ == nil { 2833 c.header_ = make(http.Header) 2834 } 2835 return c.header_ 2836} 2837 2838func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) { 2839 reqHeaders := make(http.Header) 2840 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2841 for k, v := range c.header_ { 2842 reqHeaders[k] = v 2843 } 2844 reqHeaders.Set("User-Agent", c.s.userAgent()) 2845 if c.ifNoneMatch_ != "" { 2846 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2847 } 2848 var body io.Reader = nil 2849 c.urlParams_.Set("alt", alt) 2850 c.urlParams_.Set("prettyPrint", "false") 2851 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2852 urls += "?" + c.urlParams_.Encode() 2853 req, err := http.NewRequest("GET", urls, body) 2854 if err != nil { 2855 return nil, err 2856 } 2857 req.Header = reqHeaders 2858 googleapi.Expand(req.URL, map[string]string{ 2859 "name": c.name, 2860 }) 2861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2862} 2863 2864// Do executes the "cloudidentity.groups.memberships.get" call. 2865// Exactly one of *Membership or error will be non-nil. Any non-2xx 2866// status code is an error. Response headers are in either 2867// *Membership.ServerResponse.Header or (if a response was returned at 2868// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2869// to check whether the returned error was because 2870// http.StatusNotModified was returned. 2871func (c *GroupsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) { 2872 gensupport.SetOptions(c.urlParams_, opts...) 2873 res, err := c.doRequest("json") 2874 if res != nil && res.StatusCode == http.StatusNotModified { 2875 if res.Body != nil { 2876 res.Body.Close() 2877 } 2878 return nil, &googleapi.Error{ 2879 Code: res.StatusCode, 2880 Header: res.Header, 2881 } 2882 } 2883 if err != nil { 2884 return nil, err 2885 } 2886 defer googleapi.CloseBody(res) 2887 if err := googleapi.CheckResponse(res); err != nil { 2888 return nil, err 2889 } 2890 ret := &Membership{ 2891 ServerResponse: googleapi.ServerResponse{ 2892 Header: res.Header, 2893 HTTPStatusCode: res.StatusCode, 2894 }, 2895 } 2896 target := &ret 2897 if err := gensupport.DecodeResponse(target, res); err != nil { 2898 return nil, err 2899 } 2900 return ret, nil 2901 // { 2902 // "description": "Retrieves a Membership.", 2903 // "flatPath": "v1/groups/{groupsId}/memberships/{membershipsId}", 2904 // "httpMethod": "GET", 2905 // "id": "cloudidentity.groups.memberships.get", 2906 // "parameterOrder": [ 2907 // "name" 2908 // ], 2909 // "parameters": { 2910 // "name": { 2911 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nMembership to be retrieved.\n\nFormat: `groups/{group_id}/memberships/{member_id}`, where `group_id` is\nthe unique id assigned to the Group to which Membership belongs to, and\n`member_id` is the unique ID assigned to the member.", 2912 // "location": "path", 2913 // "pattern": "^groups/[^/]+/memberships/[^/]+$", 2914 // "required": true, 2915 // "type": "string" 2916 // } 2917 // }, 2918 // "path": "v1/{+name}", 2919 // "response": { 2920 // "$ref": "Membership" 2921 // }, 2922 // "scopes": [ 2923 // "https://www.googleapis.com/auth/cloud-identity.groups", 2924 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 2925 // "https://www.googleapis.com/auth/cloud-platform" 2926 // ] 2927 // } 2928 2929} 2930 2931// method id "cloudidentity.groups.memberships.list": 2932 2933type GroupsMembershipsListCall struct { 2934 s *Service 2935 parent string 2936 urlParams_ gensupport.URLParams 2937 ifNoneMatch_ string 2938 ctx_ context.Context 2939 header_ http.Header 2940} 2941 2942// List: Lists Memberships within a Group. 2943func (r *GroupsMembershipsService) List(parent string) *GroupsMembershipsListCall { 2944 c := &GroupsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2945 c.parent = parent 2946 return c 2947} 2948 2949// PageSize sets the optional parameter "pageSize": The default page 2950// size is 200 (max 1000) for the BASIC view, and 50 2951// (max 500) for the FULL view. 2952func (c *GroupsMembershipsListCall) PageSize(pageSize int64) *GroupsMembershipsListCall { 2953 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2954 return c 2955} 2956 2957// PageToken sets the optional parameter "pageToken": The 2958// next_page_token value returned from a previous list request, if any. 2959func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall { 2960 c.urlParams_.Set("pageToken", pageToken) 2961 return c 2962} 2963 2964// View sets the optional parameter "view": Membership resource view to 2965// be returned. Defaults to View.BASIC. 2966// 2967// Possible values: 2968// "VIEW_UNSPECIFIED" 2969// "BASIC" 2970// "FULL" 2971func (c *GroupsMembershipsListCall) View(view string) *GroupsMembershipsListCall { 2972 c.urlParams_.Set("view", view) 2973 return c 2974} 2975 2976// Fields allows partial responses to be retrieved. See 2977// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2978// for more information. 2979func (c *GroupsMembershipsListCall) Fields(s ...googleapi.Field) *GroupsMembershipsListCall { 2980 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2981 return c 2982} 2983 2984// IfNoneMatch sets the optional parameter which makes the operation 2985// fail if the object's ETag matches the given value. This is useful for 2986// getting updates only after the object has changed since the last 2987// request. Use googleapi.IsNotModified to check whether the response 2988// error from Do is the result of In-None-Match. 2989func (c *GroupsMembershipsListCall) IfNoneMatch(entityTag string) *GroupsMembershipsListCall { 2990 c.ifNoneMatch_ = entityTag 2991 return c 2992} 2993 2994// Context sets the context to be used in this call's Do method. Any 2995// pending HTTP request will be aborted if the provided context is 2996// canceled. 2997func (c *GroupsMembershipsListCall) Context(ctx context.Context) *GroupsMembershipsListCall { 2998 c.ctx_ = ctx 2999 return c 3000} 3001 3002// Header returns an http.Header that can be modified by the caller to 3003// add HTTP headers to the request. 3004func (c *GroupsMembershipsListCall) Header() http.Header { 3005 if c.header_ == nil { 3006 c.header_ = make(http.Header) 3007 } 3008 return c.header_ 3009} 3010 3011func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error) { 3012 reqHeaders := make(http.Header) 3013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 3014 for k, v := range c.header_ { 3015 reqHeaders[k] = v 3016 } 3017 reqHeaders.Set("User-Agent", c.s.userAgent()) 3018 if c.ifNoneMatch_ != "" { 3019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3020 } 3021 var body io.Reader = nil 3022 c.urlParams_.Set("alt", alt) 3023 c.urlParams_.Set("prettyPrint", "false") 3024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships") 3025 urls += "?" + c.urlParams_.Encode() 3026 req, err := http.NewRequest("GET", urls, body) 3027 if err != nil { 3028 return nil, err 3029 } 3030 req.Header = reqHeaders 3031 googleapi.Expand(req.URL, map[string]string{ 3032 "parent": c.parent, 3033 }) 3034 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3035} 3036 3037// Do executes the "cloudidentity.groups.memberships.list" call. 3038// Exactly one of *ListMembershipsResponse or error will be non-nil. Any 3039// non-2xx status code is an error. Response headers are in either 3040// *ListMembershipsResponse.ServerResponse.Header or (if a response was 3041// returned at all) in error.(*googleapi.Error).Header. Use 3042// googleapi.IsNotModified to check whether the returned error was 3043// because http.StatusNotModified was returned. 3044func (c *GroupsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) { 3045 gensupport.SetOptions(c.urlParams_, opts...) 3046 res, err := c.doRequest("json") 3047 if res != nil && res.StatusCode == http.StatusNotModified { 3048 if res.Body != nil { 3049 res.Body.Close() 3050 } 3051 return nil, &googleapi.Error{ 3052 Code: res.StatusCode, 3053 Header: res.Header, 3054 } 3055 } 3056 if err != nil { 3057 return nil, err 3058 } 3059 defer googleapi.CloseBody(res) 3060 if err := googleapi.CheckResponse(res); err != nil { 3061 return nil, err 3062 } 3063 ret := &ListMembershipsResponse{ 3064 ServerResponse: googleapi.ServerResponse{ 3065 Header: res.Header, 3066 HTTPStatusCode: res.StatusCode, 3067 }, 3068 } 3069 target := &ret 3070 if err := gensupport.DecodeResponse(target, res); err != nil { 3071 return nil, err 3072 } 3073 return ret, nil 3074 // { 3075 // "description": "Lists Memberships within a Group.", 3076 // "flatPath": "v1/groups/{groupsId}/memberships", 3077 // "httpMethod": "GET", 3078 // "id": "cloudidentity.groups.memberships.list", 3079 // "parameterOrder": [ 3080 // "parent" 3081 // ], 3082 // "parameters": { 3083 // "pageSize": { 3084 // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.", 3085 // "format": "int32", 3086 // "location": "query", 3087 // "type": "integer" 3088 // }, 3089 // "pageToken": { 3090 // "description": "The next_page_token value returned from a previous list request, if any.", 3091 // "location": "query", 3092 // "type": "string" 3093 // }, 3094 // "parent": { 3095 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to list Memberships within.\n\nFormat: `groups/{group_id}`, where `group_id` is the unique ID assigned to\nthe Group.", 3096 // "location": "path", 3097 // "pattern": "^groups/[^/]+$", 3098 // "required": true, 3099 // "type": "string" 3100 // }, 3101 // "view": { 3102 // "description": "Membership resource view to be returned. Defaults to View.BASIC.", 3103 // "enum": [ 3104 // "VIEW_UNSPECIFIED", 3105 // "BASIC", 3106 // "FULL" 3107 // ], 3108 // "location": "query", 3109 // "type": "string" 3110 // } 3111 // }, 3112 // "path": "v1/{+parent}/memberships", 3113 // "response": { 3114 // "$ref": "ListMembershipsResponse" 3115 // }, 3116 // "scopes": [ 3117 // "https://www.googleapis.com/auth/cloud-identity.groups", 3118 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 3119 // "https://www.googleapis.com/auth/cloud-platform" 3120 // ] 3121 // } 3122 3123} 3124 3125// Pages invokes f for each page of results. 3126// A non-nil error returned from f will halt the iteration. 3127// The provided context supersedes any context provided to the Context method. 3128func (c *GroupsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error { 3129 c.ctx_ = ctx 3130 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3131 for { 3132 x, err := c.Do() 3133 if err != nil { 3134 return err 3135 } 3136 if err := f(x); err != nil { 3137 return err 3138 } 3139 if x.NextPageToken == "" { 3140 return nil 3141 } 3142 c.PageToken(x.NextPageToken) 3143 } 3144} 3145 3146// method id "cloudidentity.groups.memberships.lookup": 3147 3148type GroupsMembershipsLookupCall struct { 3149 s *Service 3150 parent string 3151 urlParams_ gensupport.URLParams 3152 ifNoneMatch_ string 3153 ctx_ context.Context 3154 header_ http.Header 3155} 3156 3157// Lookup: Looks up 3158// [resource 3159// name](https://cloud.google.com/apis/design/resource_names) of a 3160// Membership 3161// within a Group by member's EntityKey. 3162func (r *GroupsMembershipsService) Lookup(parent string) *GroupsMembershipsLookupCall { 3163 c := &GroupsMembershipsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3164 c.parent = parent 3165 return c 3166} 3167 3168// MemberKeyId sets the optional parameter "memberKey.id": The ID of the 3169// entity within the given namespace. The ID must be unique 3170// within its namespace. 3171func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall { 3172 c.urlParams_.Set("memberKey.id", memberKeyId) 3173 return c 3174} 3175 3176// MemberKeyNamespace sets the optional parameter "memberKey.namespace": 3177// Namespaces provide isolation for IDs, so an ID only needs to be 3178// unique 3179// within its namespace. 3180// 3181// Namespaces are currently only created as part of IdentitySource 3182// creation 3183// from Admin Console. A namespace 3184// "identitysources/{identity_source_id}" is 3185// created corresponding to every Identity Source `identity_source_id`. 3186func (c *GroupsMembershipsLookupCall) MemberKeyNamespace(memberKeyNamespace string) *GroupsMembershipsLookupCall { 3187 c.urlParams_.Set("memberKey.namespace", memberKeyNamespace) 3188 return c 3189} 3190 3191// Fields allows partial responses to be retrieved. See 3192// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3193// for more information. 3194func (c *GroupsMembershipsLookupCall) Fields(s ...googleapi.Field) *GroupsMembershipsLookupCall { 3195 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3196 return c 3197} 3198 3199// IfNoneMatch sets the optional parameter which makes the operation 3200// fail if the object's ETag matches the given value. This is useful for 3201// getting updates only after the object has changed since the last 3202// request. Use googleapi.IsNotModified to check whether the response 3203// error from Do is the result of In-None-Match. 3204func (c *GroupsMembershipsLookupCall) IfNoneMatch(entityTag string) *GroupsMembershipsLookupCall { 3205 c.ifNoneMatch_ = entityTag 3206 return c 3207} 3208 3209// Context sets the context to be used in this call's Do method. Any 3210// pending HTTP request will be aborted if the provided context is 3211// canceled. 3212func (c *GroupsMembershipsLookupCall) Context(ctx context.Context) *GroupsMembershipsLookupCall { 3213 c.ctx_ = ctx 3214 return c 3215} 3216 3217// Header returns an http.Header that can be modified by the caller to 3218// add HTTP headers to the request. 3219func (c *GroupsMembershipsLookupCall) Header() http.Header { 3220 if c.header_ == nil { 3221 c.header_ = make(http.Header) 3222 } 3223 return c.header_ 3224} 3225 3226func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, error) { 3227 reqHeaders := make(http.Header) 3228 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 3229 for k, v := range c.header_ { 3230 reqHeaders[k] = v 3231 } 3232 reqHeaders.Set("User-Agent", c.s.userAgent()) 3233 if c.ifNoneMatch_ != "" { 3234 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3235 } 3236 var body io.Reader = nil 3237 c.urlParams_.Set("alt", alt) 3238 c.urlParams_.Set("prettyPrint", "false") 3239 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/memberships:lookup") 3240 urls += "?" + c.urlParams_.Encode() 3241 req, err := http.NewRequest("GET", urls, body) 3242 if err != nil { 3243 return nil, err 3244 } 3245 req.Header = reqHeaders 3246 googleapi.Expand(req.URL, map[string]string{ 3247 "parent": c.parent, 3248 }) 3249 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3250} 3251 3252// Do executes the "cloudidentity.groups.memberships.lookup" call. 3253// Exactly one of *LookupMembershipNameResponse or error will be 3254// non-nil. Any non-2xx status code is an error. Response headers are in 3255// either *LookupMembershipNameResponse.ServerResponse.Header or (if a 3256// response was returned at all) in error.(*googleapi.Error).Header. Use 3257// googleapi.IsNotModified to check whether the returned error was 3258// because http.StatusNotModified was returned. 3259func (c *GroupsMembershipsLookupCall) Do(opts ...googleapi.CallOption) (*LookupMembershipNameResponse, error) { 3260 gensupport.SetOptions(c.urlParams_, opts...) 3261 res, err := c.doRequest("json") 3262 if res != nil && res.StatusCode == http.StatusNotModified { 3263 if res.Body != nil { 3264 res.Body.Close() 3265 } 3266 return nil, &googleapi.Error{ 3267 Code: res.StatusCode, 3268 Header: res.Header, 3269 } 3270 } 3271 if err != nil { 3272 return nil, err 3273 } 3274 defer googleapi.CloseBody(res) 3275 if err := googleapi.CheckResponse(res); err != nil { 3276 return nil, err 3277 } 3278 ret := &LookupMembershipNameResponse{ 3279 ServerResponse: googleapi.ServerResponse{ 3280 Header: res.Header, 3281 HTTPStatusCode: res.StatusCode, 3282 }, 3283 } 3284 target := &ret 3285 if err := gensupport.DecodeResponse(target, res); err != nil { 3286 return nil, err 3287 } 3288 return ret, nil 3289 // { 3290 // "description": "Looks up [resource\nname](https://cloud.google.com/apis/design/resource_names) of a Membership\nwithin a Group by member's EntityKey.", 3291 // "flatPath": "v1/groups/{groupsId}/memberships:lookup", 3292 // "httpMethod": "GET", 3293 // "id": "cloudidentity.groups.memberships.lookup", 3294 // "parameterOrder": [ 3295 // "parent" 3296 // ], 3297 // "parameters": { 3298 // "memberKey.id": { 3299 // "description": "The ID of the entity within the given namespace. The ID must be unique\nwithin its namespace.", 3300 // "location": "query", 3301 // "type": "string" 3302 // }, 3303 // "memberKey.namespace": { 3304 // "description": "Namespaces provide isolation for IDs, so an ID only needs to be unique\nwithin its namespace.\n\nNamespaces are currently only created as part of IdentitySource creation\nfrom Admin Console. A namespace `\"identitysources/{identity_source_id}\"` is\ncreated corresponding to every Identity Source `identity_source_id`.", 3305 // "location": "query", 3306 // "type": "string" 3307 // }, 3308 // "parent": { 3309 // "description": "Required. [Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to lookup Membership within.\n\nFormat: `groups/{group_id}`, where `group_id` is the unique ID assigned to\nthe Group.", 3310 // "location": "path", 3311 // "pattern": "^groups/[^/]+$", 3312 // "required": true, 3313 // "type": "string" 3314 // } 3315 // }, 3316 // "path": "v1/{+parent}/memberships:lookup", 3317 // "response": { 3318 // "$ref": "LookupMembershipNameResponse" 3319 // }, 3320 // "scopes": [ 3321 // "https://www.googleapis.com/auth/cloud-identity.groups", 3322 // "https://www.googleapis.com/auth/cloud-identity.groups.readonly", 3323 // "https://www.googleapis.com/auth/cloud-platform" 3324 // ] 3325 // } 3326 3327} 3328