blob: dc710921752680937094609a7822c85e2882c7c2 [file] [log] [blame]
// Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package cloudidentity provides access to the Cloud Identity API.
//
// For product documentation, see: https://cloud.google.com/identity/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudidentity/v1beta1"
// ...
// ctx := context.Background()
// cloudidentityService, err := cloudidentity.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithScopes(cloudidentity.CloudPlatformScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudidentityService, err := cloudidentity.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudidentity // import "google.golang.org/api/cloudidentity/v1beta1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "cloudidentity:v1beta1"
const apiName = "cloudidentity"
const apiVersion = "v1beta1"
const basePath = "https://cloudidentity.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, change, create, and delete any of the Cloud Identity Groups that
// you can access, including the members of each group
CloudIdentityGroupsScope = "https://www.googleapis.com/auth/cloud-identity.groups"
// See any Cloud Identity Groups that you can access, including group
// members and their emails
CloudIdentityGroupsReadonlyScope = "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-identity.groups",
"https://www.googleapis.com/auth/cloud-identity.groups.readonly",
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Groups = NewGroupsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Groups *GroupsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewGroupsService(s *Service) *GroupsService {
rs := &GroupsService{s: s}
rs.Memberships = NewGroupsMembershipsService(s)
return rs
}
type GroupsService struct {
s *Service
Memberships *GroupsMembershipsService
}
func NewGroupsMembershipsService(s *Service) *GroupsMembershipsService {
rs := &GroupsMembershipsService{s: s}
return rs
}
type GroupsMembershipsService struct {
s *Service
}
// EntityKey: A unique identifier for an entity in the Cloud Identity
// Groups API.
//
// An entity can represent either a group with an optional `namespace`
// or a user
// without a `namespace`. The combination of `id` and `namespace` must
// be
// unique; however, the same `id` can be used with different
// `namespace`s.
type EntityKey struct {
// Id: The ID of the entity.
//
// For Google-managed entities, the `id` must be the email address of
// an
// existing group or user.
//
// For external-identity-mapped entities, the `id` must be a string
// conforming
// to the Identity Source's requirements.
//
// Must be unique within a `namespace`.
Id string `json:"id,omitempty"`
// Namespace: The namespace in which the entity exists.
//
// If not specified, the `EntityKey` represents a Google-managed entity
// such
// as a Google user or a Google Group.
//
// If specified, the `EntityKey` represents an external-identity-mapped
// group
// created through Admin Console. Must be of the
// form
// `identitysources/{identity_source_id}.
Namespace string `json:"namespace,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Id") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *EntityKey) MarshalJSON() ([]byte, error) {
type NoMethod EntityKey
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1AndroidAttributes: Resource
// representing the Android specific attributes of a Device.
type GoogleAppsCloudidentityDevicesV1alpha1AndroidAttributes struct {
// BasebandVersion: Baseband version of Android device.
BasebandVersion string `json:"basebandVersion,omitempty"`
// BootloaderVersion: Device bootloader version. Example: 0.6.7.
BootloaderVersion string `json:"bootloaderVersion,omitempty"`
// BuildNumber: Build number of Android device.
BuildNumber string `json:"buildNumber,omitempty"`
// EnabledDeveloperOptions: Whether developer options is enabled on
// device.
EnabledDeveloperOptions bool `json:"enabledDeveloperOptions,omitempty"`
// EnabledUnknownSources: Whether applications from unknown sources can
// be installed on device.
EnabledUnknownSources bool `json:"enabledUnknownSources,omitempty"`
// EnabledUsbDebugging: Whether adb (USB debugging) is enabled on
// device.
EnabledUsbDebugging bool `json:"enabledUsbDebugging,omitempty"`
// EncryptionState: Device encryption state.
//
// Possible values:
// "ENCRYPTION_STATE_UNSPECIFIED" - Encryption Status is not set.
// "UNSUPPORTED_BY_DEVICE" - Device doesn't support encryption.
// "ENCRYPTED" - Device is encrypted.
// "NOT_ENCRYPTED" - Device is not encrypted.
EncryptionState string `json:"encryptionState,omitempty"`
// Hardware: Device hardware. Example: Sprout.
Hardware string `json:"hardware,omitempty"`
// KernelVersion: Kernel version of Android device.
KernelVersion string `json:"kernelVersion,omitempty"`
// OtherAccounts: Domain name for Google accounts on device. Type for
// other accounts on
// device. Will only be populated if |ownership_privilege|
// is
// |PROFILE_OWNER| or |DEVICE_OWNER|. Does not include the account
// signed in
// to the device policy app if that account's domain has only one
// account.
// Examples: "com.example", "xyz.com".
OtherAccounts []string `json:"otherAccounts,omitempty"`
// OwnerProfileAccount: Whether this account is on an owner/primary
// profile.
// For phones, only true for owner profiles. Android 4+ devices
// can have secondary or restricted user profiles.
OwnerProfileAccount bool `json:"ownerProfileAccount,omitempty"`
// OwnershipPrivilege: Ownership privileges on device.
//
// Possible values:
// "OWNERSHIP_PRIVILEGE_UNSPECIFIED" - Ownership privilege is not set.
// "DEVICE_ADMINISTRATOR" - Active device administrator privileges on
// the device.
// "PROFILE_OWNER" - Profile Owner privileges.
// The account is in a managed corporate profile.
// "DEVICE_OWNER" - Device Owner privileges on the device.
OwnershipPrivilege string `json:"ownershipPrivilege,omitempty"`
// SecurityPatchTime: OS security patch update time on device.
SecurityPatchTime string `json:"securityPatchTime,omitempty"`
// SupportsWorkProfile: Whether device supports Android work profiles.
// If false, this service
// will not block access to corp data even if an administrator turns on
// the
// "Enforce Work Profile" policy.
SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"`
// ForceSendFields is a list of field names (e.g. "BasebandVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BasebandVersion") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1AndroidAttributes) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1AndroidAttributes
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1ApproveDeviceUserResponse:
// Response message for approving the device to access user data.
type GoogleAppsCloudidentityDevicesV1alpha1ApproveDeviceUserResponse struct {
// DeviceUser: Resultant DeviceUser object for the action.
DeviceUser *GoogleAppsCloudidentityDevicesV1alpha1DeviceUser `json:"deviceUser,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceUser") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeviceUser") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1ApproveDeviceUserResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1ApproveDeviceUserResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1BlockDeviceUserResponse:
// Response message for blocking the device from accessing user data.
type GoogleAppsCloudidentityDevicesV1alpha1BlockDeviceUserResponse struct {
// DeviceUser: Resultant DeviceUser object for the action.
DeviceUser *GoogleAppsCloudidentityDevicesV1alpha1DeviceUser `json:"deviceUser,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceUser") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeviceUser") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1BlockDeviceUserResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1BlockDeviceUserResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceResponse:
// Response message for cancelling an unfinished device wipe.
type GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceResponse struct {
// Device: Resultant Device object for the action. Note that asset tags
// will not be
// returned in the device object.
Device *GoogleAppsCloudidentityDevicesV1alpha1Device `json:"device,omitempty"`
// ForceSendFields is a list of field names (e.g. "Device") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Device") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceUserResponse:
// Response message for cancelling an unfinished user account wipe.
type GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceUserResponse struct {
// DeviceUser: Resultant DeviceUser object for the action.
DeviceUser *GoogleAppsCloudidentityDevicesV1alpha1DeviceUser `json:"deviceUser,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceUser") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeviceUser") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceUserResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1CancelWipeDeviceUserResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1Device: Resource representing a
// Device.
type GoogleAppsCloudidentityDevicesV1alpha1Device struct {
// AndroidSpecificAttributes: Output only. Attributes specific to
// Android devices.
AndroidSpecificAttributes *GoogleAppsCloudidentityDevicesV1alpha1AndroidAttributes `json:"androidSpecificAttributes,omitempty"`
// AssetTag: Asset tag of the device.
AssetTag string `json:"assetTag,omitempty"`
// Brand: Output only. Device brand. Example: Samsung.
Brand string `json:"brand,omitempty"`
// CompromisedState: Output only. Represents whether the Device is
// compromised.
//
// Possible values:
// "COMPROMISED_STATE_UNSPECIFIED" - Default value.
// "COMPROMISED" - The device is compromised (currently, this means
// Android device is
// rooted).
// "UNCOMPROMISED" - The device is safe (currently, this means Android
// device is unrooted).
CompromisedState string `json:"compromisedState,omitempty"`
// CreateTime: Output only. When the Company-Owned device was imported.
// This field is empty for BYOD
// devices.
CreateTime string `json:"createTime,omitempty"`
// DeviceType: Output only. Type of device.
//
// Possible values:
// "DEVICE_TYPE_UNSPECIFIED" - Unknown device type
// "ANDROID" - Device is an Android device
// "IOS" - Device is an iOS device
// "GOOGLE_SYNC" - Device is a Google Sync device.
// "WINDOWS" - Device is a Windows device.
// "MAC_OS" - Device is a MacOS device.
// "LINUX" - Device is a Linux device.
// "CHROME_OS" - Device is a ChromeOS device.
DeviceType string `json:"deviceType,omitempty"`
// Imei: Output only. IMEI number of device if GSM device; empty
// otherwise.
Imei string `json:"imei,omitempty"`
// LastSyncTime: Most recent time when device synced with this service.
LastSyncTime string `json:"lastSyncTime,omitempty"`
// ManagementState: Output only. Management state of the device
//
// Possible values:
// "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "APPROVED" - Device is approved.
// "BLOCKED" - Device is blocked.
// "PENDING" - Device is pending approval.
// "UNPROVISIONED" - The device is not provisioned. Device will start
// from this state until
// some action is taken (i.e. a user starts using the device).
// "WIPING" - Data and settings on the device are being removed.
// "WIPED" - All data and settings on the device are removed.
ManagementState string `json:"managementState,omitempty"`
// Manufacturer: Output only. Device manufacturer. Example: Motorola.
Manufacturer string `json:"manufacturer,omitempty"`
// Meid: Output only. MEID number of device if CDMA device; empty
// otherwise.
Meid string `json:"meid,omitempty"`
// Model: Output only. Model name of device. Example: Pixel 3.
Model string `json:"model,omitempty"`
// Name: Output only. [Resource
// name](https://cloud.google.com/apis/design/resource_names)
// of the Device in format: `devices/{device_id}`, where device_id
// is
// the unique id assigned to the Device.
Name string `json:"name,omitempty"`
// NetworkOperator: Output only. Mobile or network operator of device,
// if available.
NetworkOperator string `json:"networkOperator,omitempty"`
// OsVersion: Output only. OS version of the device. Example: Android
// 8.1.0.
OsVersion string `json:"osVersion,omitempty"`
// OwnerType: Whether the device is owned by the company or an
// individual
//
// Possible values:
// "DEVICE_OWNERSHIP_UNSPECIFIED" - Default value. The value is
// unused.
// "COMPANY" - Company owns the device.
// "BYOD" - Bring Your Own Device (i.e. individual owns the device)
OwnerType string `json:"ownerType,omitempty"`
// ReleaseVersion: Output only. OS release version. Example: 6.0.
ReleaseVersion string `json:"releaseVersion,omitempty"`
// SerialNumber: Serial Number of device. Example: HT82V1A01076.
SerialNumber string `json:"serialNumber,omitempty"`
// WifiMacAddresses: WiFi MAC addresses of device.
WifiMacAddresses []string `json:"wifiMacAddresses,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AndroidSpecificAttributes") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "AndroidSpecificAttributes") to include in API requests with the JSON
// null value. By default, fields with empty values are omitted from API
// requests. However, any field with an empty value appearing in
// NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1Device) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1Device
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1DeviceUser: Resource
// representing a user's use of a Device
type GoogleAppsCloudidentityDevicesV1alpha1DeviceUser struct {
// CompromisedState: Compromised State of the DeviceUser object
//
// Possible values:
// "COMPROMISED_STATE_UNSPECIFIED" - Compromised state of Device User
// account is unknown or unspecified.
// "COMPROMISED" - Device User Account is compromised.
// "NOT_COMPROMISED" - Device User Account is not compromised.
CompromisedState string `json:"compromisedState,omitempty"`
// FirstSyncTime: Output only. Most recent time when user registered
// with this service.
FirstSyncTime string `json:"firstSyncTime,omitempty"`
// LanguageCode: Output only. Default locale used on device, in IETF
// BCP-47 format.
LanguageCode string `json:"languageCode,omitempty"`
// LastSyncTime: Output only. Last time when user synced with policies.
LastSyncTime string `json:"lastSyncTime,omitempty"`
// ManagementState: Output only. Management state of the user on the
// device.
//
// Possible values:
// "MANAGEMENT_STATE_UNSPECIFIED" - Default value. This value is
// unused.
// "WIPING" - This user's data and profile is being removed from the
// device.
// "WIPED" - This user's data and profile is removed from the device.
// "APPROVED" - User is approved to access data on the device.
// "BLOCKED" - User is blocked from accessing data on the device.
// "PENDING_APPROVAL" - User is awaiting approval.
// "UNENROLLED" - User is unenrolled from Advanced Windows Management,
// but the Windows
// account is still intact.
ManagementState string `json:"managementState,omitempty"`
// Name: Output only. [Resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the DeviceUser in format:
// `devices/{device_id}/deviceUsers/{user_id}`,
// where user_id is the ID of the user associated with the user session.
Name string `json:"name,omitempty"`
// PasswordState: Password state of the DeviceUser object
//
// Possible values:
// "PASSWORD_STATE_UNSPECIFIED" - Password state not set.
// "PASSWORD_SET" - Password set in object.
// "PASSWORD_NOT_SET" - Password not set in object.
PasswordState string `json:"passwordState,omitempty"`
// UserAgent: Output only. User agent on the device for this specific
// user
UserAgent string `json:"userAgent,omitempty"`
// UserEmail: Email address of the user registered on the device.
UserEmail string `json:"userEmail,omitempty"`
// ForceSendFields is a list of field names (e.g. "CompromisedState") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompromisedState") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1DeviceUser) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1DeviceUser
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1EndpointApp: Next ID to use: 7
type GoogleAppsCloudidentityDevicesV1alpha1EndpointApp struct {
// DisplayName: Output only. Name of the app displayed to the user
DisplayName string `json:"displayName,omitempty"`
// Name: Output only. [Resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the EndpointApp in
// format:
// `devices/{device}/deviceUsers/{device_user}/endpointApps/{endp
// oint_app}`,
// where client_app_id is the ID of the app associated with the Device.
Name string `json:"name,omitempty"`
// PackageName: Output only. Full package name of the installed app
PackageName string `json:"packageName,omitempty"`
// Permissions: Output only. Names of all permissions granted to the
// installed app
Permissions []string `json:"permissions,omitempty"`
// VersionCode: Output only. Version code of the installed app
VersionCode int64 `json:"versionCode,omitempty"`
// VersionName: Output only. Version name of the installed app
VersionName string `json:"versionName,omitempty"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DisplayName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1EndpointApp) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1EndpointApp
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1ListDeviceUsersResponse:
// Response message that is returned in LRO result of ListDeviceUsers
// Operation.
type GoogleAppsCloudidentityDevicesV1alpha1ListDeviceUsersResponse struct {
// DeviceUsers: Devices meeting the list restrictions.
DeviceUsers []*GoogleAppsCloudidentityDevicesV1alpha1DeviceUser `json:"deviceUsers,omitempty"`
// NextPageToken: Token to retrieve the next page of results. Empty if
// there are no more
// results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceUsers") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeviceUsers") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1ListDeviceUsersResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1ListDeviceUsersResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1ListDevicesResponse: Response
// message that is returned in LRO result of ListDevices Operation.
type GoogleAppsCloudidentityDevicesV1alpha1ListDevicesResponse struct {
// Devices: Devices meeting the list restrictions.
Devices []*GoogleAppsCloudidentityDevicesV1alpha1Device `json:"devices,omitempty"`
// NextPageToken: Token to retrieve the next page of results. Empty if
// there are no more
// results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "Devices") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Devices") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1ListDevicesResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1ListDevicesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1ListEndpointAppsResponse:
// Response message for listing all apps on the device.
type GoogleAppsCloudidentityDevicesV1alpha1ListEndpointAppsResponse struct {
// EndpointApps: The list of matching EndpointApps found as a result of
// the request.
EndpointApps []*GoogleAppsCloudidentityDevicesV1alpha1EndpointApp `json:"endpointApps,omitempty"`
// NextPageToken: Token to retrieve the next page of results. Empty if
// there are no more
// results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndpointApps") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndpointApps") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1ListEndpointAppsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1ListEndpointAppsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceResponse: Response
// message for wiping all data on the device.
type GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceResponse struct {
// Device: Resultant Device object for the action. Note that asset tags
// will not be
// returned in the device object.
Device *GoogleAppsCloudidentityDevicesV1alpha1Device `json:"device,omitempty"`
// ForceSendFields is a list of field names (e.g. "Device") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Device") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceUserResponse:
// Response message for wiping the user's account from the device.
type GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceUserResponse struct {
// DeviceUser: Resultant DeviceUser object for the action.
DeviceUser *GoogleAppsCloudidentityDevicesV1alpha1DeviceUser `json:"deviceUser,omitempty"`
// ForceSendFields is a list of field names (e.g. "DeviceUser") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DeviceUser") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceUserResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleAppsCloudidentityDevicesV1alpha1WipeDeviceUserResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Group: A group within the Cloud Identity Groups API.
//
// A `Group` is a collection of entities, where each entity is either a
// user or
// another group.
type Group struct {
// AdditionalGroupKeys: Optional. Additional entity key aliases for a
// Group.
AdditionalGroupKeys []*EntityKey `json:"additionalGroupKeys,omitempty"`
// CreateTime: Output only. The time when the `Group` was created.
CreateTime string `json:"createTime,omitempty"`
// Description: An extended description to help users determine the
// purpose of a `Group`.
//
// Must not be longer than 4,096 characters.
Description string `json:"description,omitempty"`
// DisplayName: The display name of the `Group`.
DisplayName string `json:"displayName,omitempty"`
// GroupKey: Required. Immutable. The `EntityKey` of the `Group`.
GroupKey *EntityKey `json:"groupKey,omitempty"`
// Labels: Required. The labels that apply to the `Group`.
//
// Must not contain more than one entry. Must contain the
// entry
// `'cloudidentity.googleapis.com/groups.discussion_forum': ''` if the
// `Group`
// is a Google Group or `'system/groups/external': ''` if the `Group` is
// an
// external-identity-mapped group.
Labels map[string]string `json:"labels,omitempty"`
// Name: Output only. The [resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the `Group`.
//
// Shall be of the form `groups/{group_id}`.
Name string `json:"name,omitempty"`
// Parent: Required. Immutable. The resource name of the entity under
// which this `Group` resides in the
// Cloud Identity resource hierarchy.
//
// Must be of the form `identitysources/{identity_source_id}` for
// external-
// identity-mapped groups or `customers/{customer_id}` for Google
// Groups.
Parent string `json:"parent,omitempty"`
// UpdateTime: Output only. The time when the `Group` was last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AdditionalGroupKeys")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AdditionalGroupKeys") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Group) MarshalJSON() ([]byte, error) {
type NoMethod Group
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListGroupsResponse: The response message for
// GroupsService.ListGroups.
type ListGroupsResponse struct {
// Groups: The `Group`s under the specified `parent`.
Groups []*Group `json:"groups,omitempty"`
// NextPageToken: A continuation token to retrieve the next page of
// results, or empty if
// there are no more results available.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Groups") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Groups") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListGroupsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListGroupsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMembershipsResponse: The response message for
// MembershipsService.ListMemberships.
type ListMembershipsResponse struct {
// Memberships: The `Membership`s under the specified `parent`.
Memberships []*Membership `json:"memberships,omitempty"`
// NextPageToken: A continuation token to retrieve the next page of
// results, or empty if
// there are no more results available.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Memberships") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Memberships") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListMembershipsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LookupGroupNameResponse: The response message for
// GroupsService.LookupGroupName.
type LookupGroupNameResponse struct {
// Name: Output only. The [resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the looked-up `Group`.
Name string `json:"name,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LookupGroupNameResponse) MarshalJSON() ([]byte, error) {
type NoMethod LookupGroupNameResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LookupMembershipNameResponse: The response message for
// MembershipsService.LookupMembershipName.
type LookupMembershipNameResponse struct {
// Name: The [resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the looked-up `Membership`.
//
// Must be of the form `groups/{group_id}/memberships/{membership_id}`.
Name string `json:"name,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LookupMembershipNameResponse) MarshalJSON() ([]byte, error) {
type NoMethod LookupMembershipNameResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Membership: A membership within the Cloud Identity Groups API.
//
// A `Membership` defines a relationship between a `Group` and an
// entity
// belonging to that `Group`, referred to as a "member".
type Membership struct {
// CreateTime: Output only. The time when the `Membership` was created.
CreateTime string `json:"createTime,omitempty"`
// MemberKey: Immutable. The `EntityKey` of the member.
//
// Either `member_key` or `preferred_member_key` must be set when
// calling
// MembershipsService.CreateMembership but not both; both shall be
// set
// when returned.
MemberKey *EntityKey `json:"memberKey,omitempty"`
// Name: Output only. The [resource
// name](https://cloud.google.com/apis/design/resource_names) of
// the `Membership`.
//
// Shall be of the form `groups/{group_id}/memberships/{membership_id}`.
Name string `json:"name,omitempty"`
// PreferredMemberKey: Required. Immutable. The `EntityKey` of the
// member.
//
// Either `member_key` or `preferred_member_key` must be set when
// calling
// MembershipsService.CreateMembership but not both; both shall be
// set
// when returned.
PreferredMemberKey *EntityKey `json:"preferredMemberKey,omitempty"`
// Roles: The `MembershipRole`s that apply to the `Membership`.
//
// If unspecified, defaults to a single `MembershipRole` with `name`
// `MEMBER`.
//
// Must not contain duplicate `MembershipRole`s with the same `name`.
Roles []*MembershipRole `json:"roles,omitempty"`
// UpdateTime: Output only. The time when the `Membership` was last
// updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Membership) MarshalJSON() ([]byte, error) {
type NoMethod Membership
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MembershipRole: A membership role within the Cloud Identity Groups
// API.
//
// A `MembershipRole` defines the privileges granted to a `Membership`.
type MembershipRole struct {
// Name: The name of the `MembershipRole`.
//
// Must be one of `OWNER`, `MANAGER`, `MEMBER`.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MembershipRole) MarshalJSON() ([]byte, error) {
type NoMethod MembershipRole
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ModifyMembershipRolesRequest: The request message for
// MembershipsService.ModifyMembershipRoles.
type ModifyMembershipRolesRequest struct {
// AddRoles: The `MembershipRole`s to be added.
//
// Adding or removing roles in the same request as updating roles is
// not
// supported.
//
// Must not be set if `update_roles_params` is set.
AddRoles []*MembershipRole `json:"addRoles,omitempty"`
// RemoveRoles: The `name`s of the `MembershipRole`s to be
// removed.
//
// Adding or removing roles in the same request as updating roles is
// not
// supported.
//
// It is not possible to remove the `MEMBER` `MembershipRole`. If you
// wish to
// delete a `Membership`, call
// MembershipsService.DeleteMembership
// instead.
//
// Must not contain `MEMBER`. Must not be set if `update_roles_params`
// is set.
RemoveRoles []string `json:"removeRoles,omitempty"`
// UpdateRolesParams: The `MembershipRole`s to be updated.
//
// Updating roles in the same request as adding or removing roles is
// not
// supported.
//
// Must not be set if either `add_roles` or `remove_roles` is set.
UpdateRolesParams []*UpdateMembershipRolesParams `json:"updateRolesParams,omitempty"`
// ForceSendFields is a list of field names (e.g. "AddRoles") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AddRoles") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ModifyMembershipRolesRequest) MarshalJSON() ([]byte, error) {
type NoMethod ModifyMembershipRolesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ModifyMembershipRolesResponse: The response message for
// MembershipsService.ModifyMembershipRoles.
type ModifyMembershipRolesResponse struct {
// Membership: The `Membership` resource after modifying its
// `MembershipRole`s.
Membership *Membership `json:"membership,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Membership") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Membership") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ModifyMembershipRolesResponse) MarshalJSON() ([]byte, error) {
type NoMethod ModifyMembershipRolesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Operation: This resource represents a long-running operation that is
// the result of a
// network API call.
type Operation struct {
// Done: If the value is `false`, it means the operation is still in
// progress.
// If `true`, the operation is completed, and either `error` or
// `response` is
// available.
Done bool `json:"done,omitempty"`
// Error: The error result of the operation in case of failure or
// cancellation.
Error *Status `json:"error,omitempty"`
// Metadata: Service-specific metadata associated with the operation.
// It typically
// contains progress information and common metadata such as create
// time.
// Some services might not provide such metadata. Any method that
// returns a
// long-running operation should document the metadata type, if any.
Metadata googleapi.RawMessage `json:"metadata,omitempty"`
// Name: The server-assigned name, which is only unique within the same
// service that
// originally returns it. If you use the default HTTP mapping,
// the
// `name` should be a resource name ending with
// `operations/{unique_id}`.
Name string `json:"name,omitempty"`
// Response: The normal response of the operation in case of success.
// If the original
// method returns no data on success, such as `Delete`, the response
// is
// `google.protobuf.Empty`. If the original method is
// standard
// `Get`/`Create`/`Update`, the response should be the resource. For
// other
// methods, the response should have the type `XxxResponse`, where
// `Xxx`
// is the original method name. For example, if the original method
// name
// is `TakeSnapshot()`, the inferred response type
// is
// `TakeSnapshotResponse`.
Response googleapi.RawMessage `json:"response,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Done") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Done") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Operation) MarshalJSON() ([]byte, error) {
type NoMethod Operation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SearchGroupsResponse: The response message for
// GroupsService.SearchGroups.
type SearchGroupsResponse struct {
// Groups: The `Group`s that match the search query.
Groups []*Group `json:"groups,omitempty"`
// NextPageToken: A continuation token to retrieve the next page of
// results, or empty if
// there are no more results available.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Groups") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Groups") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SearchGroupsResponse) MarshalJSON() ([]byte, error) {
type NoMethod SearchGroupsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Status: The `Status` type defines a logical error model that is
// suitable for
// different programming environments, including REST APIs and RPC APIs.
// It is
// used by [gRPC](https://github.com/grpc). Each `Status` message
// contains
// three pieces of data: error code, error message, and error
// details.
//
// You can find out more about this error model and how to work with it
// in the
// [API Design Guide](https://cloud.google.com/apis/design/errors).
type Status struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of
// message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any
// user-facing error message should be localized and sent in
// the
// google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Status) MarshalJSON() ([]byte, error) {
type NoMethod Status
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// UpdateMembershipRolesParams: The details of an update to a
// `MembershipRole`.
type UpdateMembershipRolesParams struct {
// FieldMask: The fully-qualified names of fields to update.
//
// May only contain the field `expiry_detail`.
FieldMask string `json:"fieldMask,omitempty"`
// MembershipRole: The `MembershipRole`s to be updated.
//
// Only `MEMBER` `MembershipRoles` can currently be updated.
//
// May only contain a `MembershipRole` with `name` `MEMBER`.
MembershipRole *MembershipRole `json:"membershipRole,omitempty"`
// ForceSendFields is a list of field names (e.g. "FieldMask") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FieldMask") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *UpdateMembershipRolesParams) MarshalJSON() ([]byte, error) {
type NoMethod UpdateMembershipRolesParams
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "cloudidentity.groups.create":
type GroupsCreateCall struct {
s *Service
group *Group
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a `Group`.
func (r *GroupsService) Create(group *Group) *GroupsCreateCall {
c := &GroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.group = group
return c
}
// InitialGroupConfig sets the optional parameter "initialGroupConfig":
// Required. The initial configuration option for the `Group`.
//
// Possible values:
// "INITIAL_GROUP_CONFIG_UNSPECIFIED"
// "WITH_INITIAL_OWNER"
// "EMPTY"
func (c *GroupsCreateCall) InitialGroupConfig(initialGroupConfig string) *GroupsCreateCall {
c.urlParams_.Set("initialGroupConfig", initialGroupConfig)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsCreateCall) Fields(s ...googleapi.Field) *GroupsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsCreateCall) Context(ctx context.Context) *GroupsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.create" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a `Group`.",
// "flatPath": "v1beta1/groups",
// "httpMethod": "POST",
// "id": "cloudidentity.groups.create",
// "parameterOrder": [],
// "parameters": {
// "initialGroupConfig": {
// "description": "Required. The initial configuration option for the `Group`.",
// "enum": [
// "INITIAL_GROUP_CONFIG_UNSPECIFIED",
// "WITH_INITIAL_OWNER",
// "EMPTY"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/groups",
// "request": {
// "$ref": "Group"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.delete":
type GroupsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a `Group`.
func (r *GroupsService) Delete(name string) *GroupsDeleteCall {
c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.delete" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a `Group`.",
// "flatPath": "v1beta1/groups/{groupsId}",
// "httpMethod": "DELETE",
// "id": "cloudidentity.groups.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Group` to retrieve.\n\nMust be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.get":
type GroupsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves a `Group`.
func (r *GroupsService) Get(name string) *GroupsGetCall {
c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.get" call.
// Exactly one of *Group or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Group.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Group{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a `Group`.",
// "flatPath": "v1beta1/groups/{groupsId}",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Group` to retrieve.\n\nMust be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "response": {
// "$ref": "Group"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.list":
type GroupsListCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists the `Group`s within a customer or namespace.
func (r *GroupsService) List() *GroupsListCall {
c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results to return.
//
// Note that the number of results returned may be less than this value
// even
// if there are more available results. To fetch all results, clients
// must
// continue calling this method repeatedly until the response no
// longer
// contains a `next_page_token`.
//
// If unspecified, defaults to 200 for `View.BASIC` and to 50 for
// `View.FULL`.
//
// Must not be greater than 1000 for `View.BASIC` or 500 for
// `View.FULL`.
func (c *GroupsListCall) PageSize(pageSize int64) *GroupsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The
// `next_page_token` value returned from a previous list request, if
// any.
func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Parent sets the optional parameter "parent": Required. The parent
// resource under which to list all `Group`s.
//
// Must be of the form `identitysources/{identity_source_id}` for
// external-
// identity-mapped groups or `customers/{customer_id}` for Google
// Groups.
func (c *GroupsListCall) Parent(parent string) *GroupsListCall {
c.urlParams_.Set("parent", parent)
return c
}
// View sets the optional parameter "view": The level of detail to be
// returned.
//
// If unspecified, defaults to `View.BASIC`.
//
// Possible values:
// "VIEW_UNSPECIFIED"
// "BASIC"
// "FULL"
func (c *GroupsListCall) View(view string) *GroupsListCall {
c.urlParams_.Set("view", view)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.list" call.
// Exactly one of *ListGroupsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListGroupsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*ListGroupsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListGroupsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists the `Group`s within a customer or namespace.",
// "flatPath": "v1beta1/groups",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.list",
// "parameterOrder": [],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of results to return.\n\nNote that the number of results returned may be less than this value even\nif there are more available results. To fetch all results, clients must\ncontinue calling this method repeatedly until the response no longer\ncontains a `next_page_token`.\n\nIf unspecified, defaults to 200 for `View.BASIC` and to 50 for `View.FULL`.\n\nMust not be greater than 1000 for `View.BASIC` or 500 for `View.FULL`.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The `next_page_token` value returned from a previous list request, if any.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent resource under which to list all `Group`s.\n\nMust be of the form `identitysources/{identity_source_id}` for external-\nidentity-mapped groups or `customers/{customer_id}` for Google Groups.",
// "location": "query",
// "type": "string"
// },
// "view": {
// "description": "The level of detail to be returned.\n\nIf unspecified, defaults to `View.BASIC`.",
// "enum": [
// "VIEW_UNSPECIFIED",
// "BASIC",
// "FULL"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/groups",
// "response": {
// "$ref": "ListGroupsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *GroupsListCall) Pages(ctx context.Context, f func(*ListGroupsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "cloudidentity.groups.lookup":
type GroupsLookupCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Lookup: Looks up the
// [resource
// name](https://cloud.google.com/apis/design/resource_names) of a
// `Group` by
// its `EntityKey`.
func (r *GroupsService) Lookup() *GroupsLookupCall {
c := &GroupsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// GroupKeyId sets the optional parameter "groupKey.id": The ID of the
// entity.
//
// For Google-managed entities, the `id` must be the email address of
// an
// existing group or user.
//
// For external-identity-mapped entities, the `id` must be a string
// conforming
// to the Identity Source's requirements.
//
// Must be unique within a `namespace`.
func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall {
c.urlParams_.Set("groupKey.id", groupKeyId)
return c
}
// GroupKeyNamespace sets the optional parameter "groupKey.namespace":
// The namespace in which the entity exists.
//
// If not specified, the `EntityKey` represents a Google-managed entity
// such
// as a Google user or a Google Group.
//
// If specified, the `EntityKey` represents an external-identity-mapped
// group
// created through Admin Console. Must be of the
// form
// `identitysources/{identity_source_id}.
func (c *GroupsLookupCall) GroupKeyNamespace(groupKeyNamespace string) *GroupsLookupCall {
c.urlParams_.Set("groupKey.namespace", groupKeyNamespace)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsLookupCall) Fields(s ...googleapi.Field) *GroupsLookupCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsLookupCall) IfNoneMatch(entityTag string) *GroupsLookupCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsLookupCall) Context(ctx context.Context) *GroupsLookupCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsLookupCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:lookup")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.lookup" call.
// Exactly one of *LookupGroupNameResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *LookupGroupNameResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsLookupCall) Do(opts ...googleapi.CallOption) (*LookupGroupNameResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &LookupGroupNameResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Looks up the [resource\nname](https://cloud.google.com/apis/design/resource_names) of a `Group` by\nits `EntityKey`.",
// "flatPath": "v1beta1/groups:lookup",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.lookup",
// "parameterOrder": [],
// "parameters": {
// "groupKey.id": {
// "description": "The ID of the entity.\n\nFor Google-managed entities, the `id` must be the email address of an\nexisting group or user.\n\nFor external-identity-mapped entities, the `id` must be a string conforming\nto the Identity Source's requirements.\n\nMust be unique within a `namespace`.",
// "location": "query",
// "type": "string"
// },
// "groupKey.namespace": {
// "description": "The namespace in which the entity exists.\n\nIf not specified, the `EntityKey` represents a Google-managed entity such\nas a Google user or a Google Group.\n\nIf specified, the `EntityKey` represents an external-identity-mapped group\ncreated through Admin Console. Must be of the form\n`identitysources/{identity_source_id}.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/groups:lookup",
// "response": {
// "$ref": "LookupGroupNameResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.patch":
type GroupsPatchCall struct {
s *Service
name string
group *Group
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates a `Group`.
func (r *GroupsService) Patch(name string, group *Group) *GroupsPatchCall {
c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.group = group
return c
}
// UpdateMask sets the optional parameter "updateMask": Required. The
// fully-qualified names of fields to update.
//
// May only contain the following fields: `display_name`, `description`.
func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.patch" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates a `Group`.",
// "flatPath": "v1beta1/groups/{groupsId}",
// "httpMethod": "PATCH",
// "id": "cloudidentity.groups.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Output only. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Group`.\n\nShall be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "Required. The fully-qualified names of fields to update.\n\nMay only contain the following fields: `display_name`, `description`.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "request": {
// "$ref": "Group"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.search":
type GroupsSearchCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Search: Searches for `Group`s matching a specified query.
func (r *GroupsService) Search() *GroupsSearchCall {
c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results to return.
//
// Note that the number of results returned may be less than this value
// even
// if there are more available results. To fetch all results, clients
// must
// continue calling this method repeatedly until the response no
// longer
// contains a `next_page_token`.
//
// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50
// for
// `GroupView.FULL`.
//
// Must not be greater than 1000 for `GroupView.BASIC` or 500
// for
// `GroupView.FULL`.
func (c *GroupsSearchCall) PageSize(pageSize int64) *GroupsSearchCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The
// `next_page_token` value returned from a previous search request,
// if
// any.
func (c *GroupsSearchCall) PageToken(pageToken string) *GroupsSearchCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Query sets the optional parameter "query": Required. The search
// query.
//
// Must be specified in [Common
// Expression
// Language](https://opensource.google/projects/cel). May only
// contain
// equality operators on the parent and inclusion operators on labels
// (e.g.,
// `parent == 'customers/{customer_id}'
// &&
// 'cloudidentity.googleapis.com/groups.discussion_forum' in labels`).
func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall {
c.urlParams_.Set("query", query)
return c
}
// View sets the optional parameter "view": The level of detail to be
// returned.
//
// If unspecified, defaults to `View.BASIC`.
//
// Possible values:
// "BASIC"
// "FULL"
func (c *GroupsSearchCall) View(view string) *GroupsSearchCall {
c.urlParams_.Set("view", view)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsSearchCall) Fields(s ...googleapi.Field) *GroupsSearchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsSearchCall) IfNoneMatch(entityTag string) *GroupsSearchCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsSearchCall) Context(ctx context.Context) *GroupsSearchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsSearchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:search")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.search" call.
// Exactly one of *SearchGroupsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SearchGroupsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGroupsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SearchGroupsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Searches for `Group`s matching a specified query.",
// "flatPath": "v1beta1/groups:search",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.search",
// "parameterOrder": [],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of results to return.\n\nNote that the number of results returned may be less than this value even\nif there are more available results. To fetch all results, clients must\ncontinue calling this method repeatedly until the response no longer\ncontains a `next_page_token`.\n\nIf unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for\n`GroupView.FULL`.\n\nMust not be greater than 1000 for `GroupView.BASIC` or 500 for\n`GroupView.FULL`.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The `next_page_token` value returned from a previous search request, if\nany.",
// "location": "query",
// "type": "string"
// },
// "query": {
// "description": "Required. The search query.\n\nMust be specified in [Common Expression\nLanguage](https://opensource.google/projects/cel). May only contain\nequality operators on the parent and inclusion operators on labels (e.g.,\n`parent == 'customers/{customer_id}' \u0026\u0026\n'cloudidentity.googleapis.com/groups.discussion_forum' in labels`).",
// "location": "query",
// "type": "string"
// },
// "view": {
// "description": "The level of detail to be returned.\n\nIf unspecified, defaults to `View.BASIC`.",
// "enum": [
// "BASIC",
// "FULL"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/groups:search",
// "response": {
// "$ref": "SearchGroupsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *GroupsSearchCall) Pages(ctx context.Context, f func(*SearchGroupsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "cloudidentity.groups.memberships.create":
type GroupsMembershipsCreateCall struct {
s *Service
parent string
membership *Membership
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a `Membership`.
func (r *GroupsMembershipsService) Create(parent string, membership *Membership) *GroupsMembershipsCreateCall {
c := &GroupsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.membership = membership
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsCreateCall) Fields(s ...googleapi.Field) *GroupsMembershipsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsCreateCall) Context(ctx context.Context) *GroupsMembershipsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.create" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a `Membership`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships",
// "httpMethod": "POST",
// "id": "cloudidentity.groups.memberships.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The parent `Group` resource under which to create the `Membership`.\n\nMust be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+parent}/memberships",
// "request": {
// "$ref": "Membership"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.memberships.delete":
type GroupsMembershipsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a `Membership`.
func (r *GroupsMembershipsService) Delete(name string) *GroupsMembershipsDeleteCall {
c := &GroupsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsDeleteCall) Fields(s ...googleapi.Field) *GroupsMembershipsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsDeleteCall) Context(ctx context.Context) *GroupsMembershipsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.delete" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a `Membership`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}",
// "httpMethod": "DELETE",
// "id": "cloudidentity.groups.memberships.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Membership` to delete.\n\nMust be of the form `groups/{group_id}/memberships/{membership_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+/memberships/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.memberships.get":
type GroupsMembershipsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves a `Membership`.
func (r *GroupsMembershipsService) Get(name string) *GroupsMembershipsGetCall {
c := &GroupsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsGetCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsMembershipsGetCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsGetCall) Context(ctx context.Context) *GroupsMembershipsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.get" call.
// Exactly one of *Membership or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Membership.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GroupsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Membership{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a `Membership`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.memberships.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Membership` to retrieve.\n\nMust be of the form `groups/{group_id}/memberships/{membership_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+/memberships/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "response": {
// "$ref": "Membership"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.memberships.list":
type GroupsMembershipsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists the `Membership`s within a `Group`.
func (r *GroupsMembershipsService) List(parent string) *GroupsMembershipsListCall {
c := &GroupsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of results to return.
//
// Note that the number of results returned may be less than this value
// even
// if there are more available results. To fetch all results, clients
// must
// continue calling this method repeatedly until the response no
// longer
// contains a `next_page_token`.
//
// If unspecified, defaults to 200 for `GroupView.BASIC` and to 50
// for
// `GroupView.FULL`.
//
// Must not be greater than 1000 for `GroupView.BASIC` or 500
// for
// `GroupView.FULL`.
func (c *GroupsMembershipsListCall) PageSize(pageSize int64) *GroupsMembershipsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": The
// `next_page_token` value returned from a previous search request,
// if
// any.
func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// View sets the optional parameter "view": The level of detail to be
// returned.
//
// If unspecified, defaults to `MembershipView.BASIC`.
//
// Possible values:
// "BASIC"
// "FULL"
func (c *GroupsMembershipsListCall) View(view string) *GroupsMembershipsListCall {
c.urlParams_.Set("view", view)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsListCall) Fields(s ...googleapi.Field) *GroupsMembershipsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsMembershipsListCall) IfNoneMatch(entityTag string) *GroupsMembershipsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsListCall) Context(ctx context.Context) *GroupsMembershipsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.list" call.
// Exactly one of *ListMembershipsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListMembershipsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListMembershipsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists the `Membership`s within a `Group`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.memberships.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of results to return.\n\nNote that the number of results returned may be less than this value even\nif there are more available results. To fetch all results, clients must\ncontinue calling this method repeatedly until the response no longer\ncontains a `next_page_token`.\n\nIf unspecified, defaults to 200 for `GroupView.BASIC` and to 50 for\n`GroupView.FULL`.\n\nMust not be greater than 1000 for `GroupView.BASIC` or 500 for\n`GroupView.FULL`.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The `next_page_token` value returned from a previous search request, if\nany.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent `Group` resource under which to lookup the `Membership` name.\n\nMust be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// },
// "view": {
// "description": "The level of detail to be returned.\n\nIf unspecified, defaults to `MembershipView.BASIC`.",
// "enum": [
// "BASIC",
// "FULL"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1beta1/{+parent}/memberships",
// "response": {
// "$ref": "ListMembershipsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *GroupsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "cloudidentity.groups.memberships.lookup":
type GroupsMembershipsLookupCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Lookup: Looks up the
// [resource
// name](https://cloud.google.com/apis/design/resource_names) of
// a
// `Membership` by its `EntityKey`.
func (r *GroupsMembershipsService) Lookup(parent string) *GroupsMembershipsLookupCall {
c := &GroupsMembershipsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// MemberKeyId sets the optional parameter "memberKey.id": The ID of the
// entity.
//
// For Google-managed entities, the `id` must be the email address of
// an
// existing group or user.
//
// For external-identity-mapped entities, the `id` must be a string
// conforming
// to the Identity Source's requirements.
//
// Must be unique within a `namespace`.
func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall {
c.urlParams_.Set("memberKey.id", memberKeyId)
return c
}
// MemberKeyNamespace sets the optional parameter "memberKey.namespace":
// The namespace in which the entity exists.
//
// If not specified, the `EntityKey` represents a Google-managed entity
// such
// as a Google user or a Google Group.
//
// If specified, the `EntityKey` represents an external-identity-mapped
// group
// created through Admin Console. Must be of the
// form
// `identitysources/{identity_source_id}.
func (c *GroupsMembershipsLookupCall) MemberKeyNamespace(memberKeyNamespace string) *GroupsMembershipsLookupCall {
c.urlParams_.Set("memberKey.namespace", memberKeyNamespace)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsLookupCall) Fields(s ...googleapi.Field) *GroupsMembershipsLookupCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GroupsMembershipsLookupCall) IfNoneMatch(entityTag string) *GroupsMembershipsLookupCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsLookupCall) Context(ctx context.Context) *GroupsMembershipsLookupCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsLookupCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:lookup")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.lookup" call.
// Exactly one of *LookupMembershipNameResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *LookupMembershipNameResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsMembershipsLookupCall) Do(opts ...googleapi.CallOption) (*LookupMembershipNameResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &LookupMembershipNameResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Looks up the [resource\nname](https://cloud.google.com/apis/design/resource_names) of a\n`Membership` by its `EntityKey`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships:lookup",
// "httpMethod": "GET",
// "id": "cloudidentity.groups.memberships.lookup",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "memberKey.id": {
// "description": "The ID of the entity.\n\nFor Google-managed entities, the `id` must be the email address of an\nexisting group or user.\n\nFor external-identity-mapped entities, the `id` must be a string conforming\nto the Identity Source's requirements.\n\nMust be unique within a `namespace`.",
// "location": "query",
// "type": "string"
// },
// "memberKey.namespace": {
// "description": "The namespace in which the entity exists.\n\nIf not specified, the `EntityKey` represents a Google-managed entity such\nas a Google user or a Google Group.\n\nIf specified, the `EntityKey` represents an external-identity-mapped group\ncreated through Admin Console. Must be of the form\n`identitysources/{identity_source_id}.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent `Group` resource under which to lookup the `Membership` name.\n\nMust be of the form `groups/{group_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+parent}/memberships:lookup",
// "response": {
// "$ref": "LookupMembershipNameResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudidentity.groups.memberships.modifyMembershipRoles":
type GroupsMembershipsModifyMembershipRolesCall struct {
s *Service
name string
modifymembershiprolesrequest *ModifyMembershipRolesRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ModifyMembershipRoles: Modifies the `MembershipRole`s of a
// `Membership`.
func (r *GroupsMembershipsService) ModifyMembershipRoles(name string, modifymembershiprolesrequest *ModifyMembershipRolesRequest) *GroupsMembershipsModifyMembershipRolesCall {
c := &GroupsMembershipsModifyMembershipRolesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.modifymembershiprolesrequest = modifymembershiprolesrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GroupsMembershipsModifyMembershipRolesCall) Fields(s ...googleapi.Field) *GroupsMembershipsModifyMembershipRolesCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *GroupsMembershipsModifyMembershipRolesCall) Context(ctx context.Context) *GroupsMembershipsModifyMembershipRolesCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *GroupsMembershipsModifyMembershipRolesCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *GroupsMembershipsModifyMembershipRolesCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20200210")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymembershiprolesrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:modifyMembershipRoles")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "cloudidentity.groups.memberships.modifyMembershipRoles" call.
// Exactly one of *ModifyMembershipRolesResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ModifyMembershipRolesResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GroupsMembershipsModifyMembershipRolesCall) Do(opts ...googleapi.CallOption) (*ModifyMembershipRolesResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ModifyMembershipRolesResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Modifies the `MembershipRole`s of a `Membership`.",
// "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}:modifyMembershipRoles",
// "httpMethod": "POST",
// "id": "cloudidentity.groups.memberships.modifyMembershipRoles",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The [resource name](https://cloud.google.com/apis/design/resource_names) of\nthe `Membership` whose roles are to be modified.\n\nMust be of the form `groups/{group_id}/memberships/{membership_id}`.",
// "location": "path",
// "pattern": "^groups/[^/]+/memberships/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}:modifyMembershipRoles",
// "request": {
// "$ref": "ModifyMembershipRolesRequest"
// },
// "response": {
// "$ref": "ModifyMembershipRolesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-identity.groups",
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}