|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462 |
- // Copyright 2019 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.CloudIdentityGroupsReadonlyScope))
- //
- // 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"
-
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- 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"
- )
-
- // 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",
- )
- // 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: An EntityKey uniquely identifies an Entity. Namespaces are
- // used to provide
- // isolation for ids. A single Id can be reused across namespaces but
- // the
- // combination of a namespace and an id must be unique.
- type EntityKey struct {
- // Id: The id of the entity within the given namespace. The id must be
- // unique
- // within its namespace.
- Id string `json:"id,omitempty"`
-
- // Namespace: Namespaces provide isolation for ids, i.e an id only needs
- // to be unique
- // within its namespace.
- //
- // Namespaces are currently only created as part of IdentitySource
- // creation
- // from Admin Console. A namespace
- // "identitysources/{identity_source_id}" is
- // created corresponding to every Identity Source `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)
- }
-
- // Group: Resource representing a Group
- type Group struct {
- // AdditionalGroupKeys: Optional. Additional entity key aliases for a
- // Group
- AdditionalGroupKeys []*EntityKey `json:"additionalGroupKeys,omitempty"`
-
- // CreateTime: The time when the Group was created.
- // Output only
- CreateTime string `json:"createTime,omitempty"`
-
- // Description: An extended description to help users determine the
- // purpose of a Group. For
- // example, you can include information about who should join the Group,
- // the
- // types of messages to send to the Group, links to FAQs about the
- // Group, or
- // related Groups. Maximum length is 4,096 characters.
- Description string `json:"description,omitempty"`
-
- // DisplayName: The Group's display name.
- DisplayName string `json:"displayName,omitempty"`
-
- // GroupKey: EntityKey of the Group.
- //
- // Must be set when creating a Group, read-only afterwards.
- GroupKey *EntityKey `json:"groupKey,omitempty"`
-
- // Labels: Labels for Group resource.
- // Required.
- // For creating Groups under a namespace, set label key
- // to
- // 'labels/system/groups/external' and label value as empty.
- Labels map[string]string `json:"labels,omitempty"`
-
- // Name: [Resource
- // name](https://cloud.google.com/apis/design/resource_names) of
- // the
- // Group in the format: `groups/{group_id}`, where group_id is the
- // unique id
- // assigned to the Group.
- //
- // Must be left blank while creating a Group
- Name string `json:"name,omitempty"`
-
- // Parent: The entity under which this Group resides in Cloud Identity
- // resource
- // hierarchy. Must be set when creating a Group, read-only
- // afterwards.
- //
- // Currently allowed types: 'identitysources'.
- Parent string `json:"parent,omitempty"`
-
- // UpdateTime: The time when the Group was last updated.
- // Output only
- 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)
- }
-
- type ListMembershipsResponse struct {
- // Memberships: List of Memberships
- Memberships []*Membership `json:"memberships,omitempty"`
-
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results available for listing.
- 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)
- }
-
- type LookupGroupNameResponse struct {
- // Name: [Resource
- // name](https://cloud.google.com/apis/design/resource_names) of
- // the
- // Group in the format: `groups/{group_id}`, where `group_id` is the
- // unique id
- // assigned to the 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)
- }
-
- type LookupMembershipNameResponse struct {
- // Name: [Resource
- // name](https://cloud.google.com/apis/design/resource_names) of
- // the
- // Membership being looked up.
- //
- // Format: `groups/{group_id}/memberships/{member_id}`, where `group_id`
- // is
- // the unique id assigned to the Group to which Membership belongs to,
- // and
- // `member_id` is the unique id assigned to the member.
- 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: Resource representing a Membership within a Group
- type Membership struct {
- // CreateTime: Creation timestamp of the Membership.
- CreateTime string `json:"createTime,omitempty"`
-
- // MemberKey: EntityKey of the entity to be added as the member. Must be
- // set while
- // creating a Membership, read-only afterwards.
- //
- // Currently allowed entity types: `Users`, `Groups`.
- MemberKey *EntityKey `json:"memberKey,omitempty"`
-
- // Name: [Resource
- // name](https://cloud.google.com/apis/design/resource_names) of
- // the
- // Membership in the format:
- // `groups/{group_id}/memberships/{member_id}`,
- // where group_id is the unique id assigned to the Group to which
- // Membership
- // belongs to, and member_id is the unique id assigned to the
- // member
- //
- // Must be left blank while creating a Membership.
- Name string `json:"name,omitempty"`
-
- // Roles: Roles for a member within the Group.
- //
- // Currently supported MembershipRoles: "MEMBER".
- Roles []*MembershipRole `json:"roles,omitempty"`
-
- // UpdateTime: Last updated timestamp of the Membership.
- 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: Resource representing a role within a Membership.
- type MembershipRole struct {
- // Name: MembershipRole in string format.
- //
- // Currently supported MembershipRoles: "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)
- }
-
- // 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 have the format of `operations/some/unique/name`.
- 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)
- }
-
- type SearchGroupsResponse struct {
- // Groups: List of Groups satisfying the search query.
- Groups []*Group `json:"groups,omitempty"`
-
- // NextPageToken: Token to retrieve the next page of results, or empty
- // if there are no
- // more results available for specified query.
- 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). The error model is designed
- // to be:
- //
- // - Simple to use and understand for most users
- // - Flexible enough to meet unexpected needs
- //
- // # Overview
- //
- // The `Status` message contains three pieces of data: error code,
- // error
- // message, and error details. The error code should be an enum value
- // of
- // google.rpc.Code, but it may accept additional error codes if needed.
- // The
- // error message should be a developer-facing English message that
- // helps
- // developers *understand* and *resolve* the error. If a localized
- // user-facing
- // error message is needed, put the localized message in the error
- // details or
- // localize it in the client. The optional error details may contain
- // arbitrary
- // information about the error. There is a predefined set of error
- // detail types
- // in the package `google.rpc` that can be used for common error
- // conditions.
- //
- // # Language mapping
- //
- // The `Status` message is the logical representation of the error
- // model, but it
- // is not necessarily the actual wire format. When the `Status` message
- // is
- // exposed in different client libraries and different wire protocols,
- // it can be
- // mapped differently. For example, it will likely be mapped to some
- // exceptions
- // in Java, but more likely mapped to some error codes in C.
- //
- // # Other uses
- //
- // The error model and the `Status` message can be used in a variety
- // of
- // environments, either with or without APIs, to provide a
- // consistent developer experience across different
- // environments.
- //
- // Example uses of this error model include:
- //
- // - Partial errors. If a service needs to return partial errors to the
- // client,
- // it may embed the `Status` in the normal response to indicate the
- // partial
- // errors.
- //
- // - Workflow errors. A typical workflow has multiple steps. Each step
- // may
- // have a `Status` message for error reporting.
- //
- // - Batch operations. If a client uses batch request and batch
- // response, the
- // `Status` message should be used directly inside batch response,
- // one for
- // each error sub-response.
- //
- // - Asynchronous operations. If an API call embeds asynchronous
- // operation
- // results in its response, the status of those operations should
- // be
- // represented directly using the `Status` message.
- //
- // - Logging. If some API errors are stored in logs, the message
- // `Status` could
- // be used directly after any stripping needed for security/privacy
- // reasons.
- 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)
- }
-
- // 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
- }
-
- // 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)
- 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": {},
- // "path": "v1beta1/groups",
- // "request": {
- // "$ref": "Group"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-identity.groups"
- // ]
- // }
-
- }
-
- // 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where `group_id` is the unique id\nassigned to the Group.",
- // "location": "path",
- // "pattern": "^groups/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta1/{+name}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-identity.groups"
- // ]
- // }
-
- }
-
- // 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where `group_id` is the unique id\nassigned to the Group.",
- // "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"
- // ]
- // }
-
- }
-
- // method id "cloudidentity.groups.lookup":
-
- type GroupsLookupCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Lookup: Looks up
- // [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 within the given namespace. The id must be unique
- // within its namespace.
- func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall {
- c.urlParams_.Set("groupKey.id", groupKeyId)
- return c
- }
-
- // GroupKeyNamespace sets the optional parameter "groupKey.namespace":
- // Namespaces provide isolation for ids, i.e an id only needs to be
- // unique
- // within its namespace.
- //
- // Namespaces are currently only created as part of IdentitySource
- // creation
- // from Admin Console. A namespace
- // "identitysources/{identity_source_id}" is
- // created corresponding to every Identity Source `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)
- 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 [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 within the given namespace. The id must be unique\nwithin its namespace.",
- // "location": "query",
- // "type": "string"
- // },
- // "groupKey.namespace": {
- // "description": "Namespaces provide isolation for ids, i.e an id only needs to be unique\nwithin its namespace.\n\nNamespaces are currently only created as part of IdentitySource creation\nfrom Admin Console. A namespace `\"identitysources/{identity_source_id}\"` is\ncreated corresponding to every Identity Source `identity_source_id`.",
- // "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"
- // ]
- // }
-
- }
-
- // 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": Editable 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup in the format: `groups/{group_id}`, where group_id is the unique id\nassigned to the Group.\n\nMust be left blank while creating a Group",
- // "location": "path",
- // "pattern": "^groups/[^/]+$",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Editable 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"
- // ]
- // }
-
- }
-
- // method id "cloudidentity.groups.search":
-
- type GroupsSearchCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Search: Searches for Groups.
- func (r *GroupsService) Search() *GroupsSearchCall {
- c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The default page
- // size is 200 (max 1000) for the BASIC view, and 50
- // (max 500) for the FULL view.
- 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": Query string for
- // performing search on groups.
- // Users can search on namespace and label attributes of groups.
- // EXACT match ('=') is supported on namespace, and CONTAINS match (':')
- // is
- // supported on labels. This is a `required` field.
- // Multiple queries can be combined using `AND` operator. The operator
- // is case
- // sensitive.
- // An example query would be:
- // "namespace=<namespace_value> AND labels:<labels_value>".
- func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall {
- c.urlParams_.Set("query", query)
- return c
- }
-
- // View sets the optional parameter "view": Group resource view to be
- // returned. Defaults to [GroupView.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)
- 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 Groups.",
- // "flatPath": "v1beta1/groups:search",
- // "httpMethod": "GET",
- // "id": "cloudidentity.groups.search",
- // "parameterOrder": [],
- // "parameters": {
- // "pageSize": {
- // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "The next_page_token value returned from a previous search request, if any.",
- // "location": "query",
- // "type": "string"
- // },
- // "query": {
- // "description": "Query string for performing search on groups.\nUsers can search on namespace and label attributes of groups.\nEXACT match ('=') is supported on namespace, and CONTAINS match (':') is\nsupported on labels. This is a `required` field.\nMultiple queries can be combined using `AND` operator. The operator is case\nsensitive.\nAn example query would be:\n\"namespace=\u003cnamespace_value\u003e AND labels:\u003clabels_value\u003e\".",
- // "location": "query",
- // "type": "string"
- // },
- // "view": {
- // "description": "Group resource view to be returned. Defaults to [GroupView.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"
- // ]
- // }
-
- }
-
- // 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to create Membership within. Format: `groups/{group_id}`, where\n`group_id` is the unique id assigned to the Group.",
- // "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"
- // ]
- // }
-
- }
-
- // 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nMembership to be deleted.\n\nFormat: `groups/{group_id}/memberships/{member_id}`, where `group_id` is\nthe unique id assigned to the Group to which Membership belongs to, and\nmember_id is the unique id assigned to the member.",
- // "location": "path",
- // "pattern": "^groups/[^/]+/memberships/[^/]+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta1/{+name}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-identity.groups"
- // ]
- // }
-
- }
-
- // 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)
- 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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nMembership to be retrieved.\n\nFormat: `groups/{group_id}/memberships/{member_id}`, where `group_id` is\nthe unique id assigned to the Group to which Membership belongs to, and\n`member_id` is the unique id assigned to the member.",
- // "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"
- // ]
- // }
-
- }
-
- // 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: List Memberships 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 default page
- // size is 200 (max 1000) for the BASIC view, and 50
- // (max 500) for the FULL view.
- 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 list request, if any
- func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // View sets the optional parameter "view": Membership resource view to
- // be returned. 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)
- 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": "List Memberships within a Group.",
- // "flatPath": "v1beta1/groups/{groupsId}/memberships",
- // "httpMethod": "GET",
- // "id": "cloudidentity.groups.memberships.list",
- // "parameterOrder": [
- // "parent"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.",
- // "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": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to list Memberships within.\n\nFormat: `groups/{group_id}`, where `group_id` is the unique id assigned to\nthe Group.",
- // "location": "path",
- // "pattern": "^groups/[^/]+$",
- // "required": true,
- // "type": "string"
- // },
- // "view": {
- // "description": "Membership resource view to be returned. 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"
- // ]
- // }
-
- }
-
- // 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
- // [resource
- // name](https://cloud.google.com/apis/design/resource_names) of a
- // Membership
- // within a Group by member's 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 within the given namespace. The id must be unique
- // within its namespace.
- func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall {
- c.urlParams_.Set("memberKey.id", memberKeyId)
- return c
- }
-
- // MemberKeyNamespace sets the optional parameter "memberKey.namespace":
- // Namespaces provide isolation for ids, i.e an id only needs to be
- // unique
- // within its namespace.
- //
- // Namespaces are currently only created as part of IdentitySource
- // creation
- // from Admin Console. A namespace
- // "identitysources/{identity_source_id}" is
- // created corresponding to every Identity Source `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)
- 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 [resource\nname](https://cloud.google.com/apis/design/resource_names) of a Membership\nwithin a Group by member's 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 within the given namespace. The id must be unique\nwithin its namespace.",
- // "location": "query",
- // "type": "string"
- // },
- // "memberKey.namespace": {
- // "description": "Namespaces provide isolation for ids, i.e an id only needs to be unique\nwithin its namespace.\n\nNamespaces are currently only created as part of IdentitySource creation\nfrom Admin Console. A namespace `\"identitysources/{identity_source_id}\"` is\ncreated corresponding to every Identity Source `identity_source_id`.",
- // "location": "query",
- // "type": "string"
- // },
- // "parent": {
- // "description": "[Resource name](https://cloud.google.com/apis/design/resource_names) of the\nGroup to lookup Membership within.\n\nFormat: `groups/{group_id}`, where `group_id` is the unique id assigned to\nthe Group.",
- // "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"
- // ]
- // }
-
- }
|