You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2463 lines
81 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package cloudidentity provides access to the Cloud Identity API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/identity/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/cloudidentity/v1beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // cloudidentityService, err := cloudidentity.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // cloudidentityService, err := cloudidentity.NewService(ctx, option.WithScopes(cloudidentity.CloudIdentityGroupsReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // cloudidentityService, err := cloudidentity.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // cloudidentityService, err := cloudidentity.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package cloudidentity // import "google.golang.org/api/cloudidentity/v1beta1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "cloudidentity:v1beta1"
  71. const apiName = "cloudidentity"
  72. const apiVersion = "v1beta1"
  73. const basePath = "https://cloudidentity.googleapis.com/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // See, change, create, and delete any of the Cloud Identity Groups that
  77. // you can access, including the members of each group
  78. CloudIdentityGroupsScope = "https://www.googleapis.com/auth/cloud-identity.groups"
  79. // See any Cloud Identity Groups that you can access, including group
  80. // members and their emails
  81. CloudIdentityGroupsReadonlyScope = "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-identity.groups",
  87. "https://www.googleapis.com/auth/cloud-identity.groups.readonly",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Groups = NewGroupsService(s)
  115. return s, nil
  116. }
  117. type Service struct {
  118. client *http.Client
  119. BasePath string // API endpoint base URL
  120. UserAgent string // optional additional User-Agent fragment
  121. Groups *GroupsService
  122. }
  123. func (s *Service) userAgent() string {
  124. if s.UserAgent == "" {
  125. return googleapi.UserAgent
  126. }
  127. return googleapi.UserAgent + " " + s.UserAgent
  128. }
  129. func NewGroupsService(s *Service) *GroupsService {
  130. rs := &GroupsService{s: s}
  131. rs.Memberships = NewGroupsMembershipsService(s)
  132. return rs
  133. }
  134. type GroupsService struct {
  135. s *Service
  136. Memberships *GroupsMembershipsService
  137. }
  138. func NewGroupsMembershipsService(s *Service) *GroupsMembershipsService {
  139. rs := &GroupsMembershipsService{s: s}
  140. return rs
  141. }
  142. type GroupsMembershipsService struct {
  143. s *Service
  144. }
  145. // EntityKey: An EntityKey uniquely identifies an Entity. Namespaces are
  146. // used to provide
  147. // isolation for ids. A single Id can be reused across namespaces but
  148. // the
  149. // combination of a namespace and an id must be unique.
  150. type EntityKey struct {
  151. // Id: The id of the entity within the given namespace. The id must be
  152. // unique
  153. // within its namespace.
  154. Id string `json:"id,omitempty"`
  155. // Namespace: Namespaces provide isolation for ids, i.e an id only needs
  156. // to be unique
  157. // within its namespace.
  158. //
  159. // Namespaces are currently only created as part of IdentitySource
  160. // creation
  161. // from Admin Console. A namespace
  162. // "identitysources/{identity_source_id}" is
  163. // created corresponding to every Identity Source `identity_source_id`.
  164. Namespace string `json:"namespace,omitempty"`
  165. // ForceSendFields is a list of field names (e.g. "Id") to
  166. // unconditionally include in API requests. By default, fields with
  167. // empty values are omitted from API requests. However, any non-pointer,
  168. // non-interface field appearing in ForceSendFields will be sent to the
  169. // server regardless of whether the field is empty or not. This may be
  170. // used to include empty fields in Patch requests.
  171. ForceSendFields []string `json:"-"`
  172. // NullFields is a list of field names (e.g. "Id") to include in API
  173. // requests with the JSON null value. By default, fields with empty
  174. // values are omitted from API requests. However, any field with an
  175. // empty value appearing in NullFields will be sent to the server as
  176. // null. It is an error if a field in this list has a non-empty value.
  177. // This may be used to include null fields in Patch requests.
  178. NullFields []string `json:"-"`
  179. }
  180. func (s *EntityKey) MarshalJSON() ([]byte, error) {
  181. type NoMethod EntityKey
  182. raw := NoMethod(*s)
  183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  184. }
  185. // Group: Resource representing a Group
  186. type Group struct {
  187. // AdditionalGroupKeys: Optional. Additional entity key aliases for a
  188. // Group
  189. AdditionalGroupKeys []*EntityKey `json:"additionalGroupKeys,omitempty"`
  190. // CreateTime: The time when the Group was created.
  191. // Output only
  192. CreateTime string `json:"createTime,omitempty"`
  193. // Description: An extended description to help users determine the
  194. // purpose of a Group. For
  195. // example, you can include information about who should join the Group,
  196. // the
  197. // types of messages to send to the Group, links to FAQs about the
  198. // Group, or
  199. // related Groups. Maximum length is 4,096 characters.
  200. Description string `json:"description,omitempty"`
  201. // DisplayName: The Group's display name.
  202. DisplayName string `json:"displayName,omitempty"`
  203. // GroupKey: EntityKey of the Group.
  204. //
  205. // Must be set when creating a Group, read-only afterwards.
  206. GroupKey *EntityKey `json:"groupKey,omitempty"`
  207. // Labels: Labels for Group resource.
  208. // Required.
  209. // For creating Groups under a namespace, set label key
  210. // to
  211. // 'labels/system/groups/external' and label value as empty.
  212. Labels map[string]string `json:"labels,omitempty"`
  213. // Name: [Resource
  214. // name](https://cloud.google.com/apis/design/resource_names) of
  215. // the
  216. // Group in the format: `groups/{group_id}`, where group_id is the
  217. // unique id
  218. // assigned to the Group.
  219. //
  220. // Must be left blank while creating a Group
  221. Name string `json:"name,omitempty"`
  222. // Parent: The entity under which this Group resides in Cloud Identity
  223. // resource
  224. // hierarchy. Must be set when creating a Group, read-only
  225. // afterwards.
  226. //
  227. // Currently allowed types: 'identitysources'.
  228. Parent string `json:"parent,omitempty"`
  229. // UpdateTime: The time when the Group was last updated.
  230. // Output only
  231. UpdateTime string `json:"updateTime,omitempty"`
  232. // ServerResponse contains the HTTP response code and headers from the
  233. // server.
  234. googleapi.ServerResponse `json:"-"`
  235. // ForceSendFields is a list of field names (e.g. "AdditionalGroupKeys")
  236. // to unconditionally include in API requests. By default, fields with
  237. // empty values are omitted from API requests. However, any non-pointer,
  238. // non-interface field appearing in ForceSendFields will be sent to the
  239. // server regardless of whether the field is empty or not. This may be
  240. // used to include empty fields in Patch requests.
  241. ForceSendFields []string `json:"-"`
  242. // NullFields is a list of field names (e.g. "AdditionalGroupKeys") to
  243. // include in API requests with the JSON null value. By default, fields
  244. // with empty values are omitted from API requests. However, any field
  245. // with an empty value appearing in NullFields will be sent to the
  246. // server as null. It is an error if a field in this list has a
  247. // non-empty value. This may be used to include null fields in Patch
  248. // requests.
  249. NullFields []string `json:"-"`
  250. }
  251. func (s *Group) MarshalJSON() ([]byte, error) {
  252. type NoMethod Group
  253. raw := NoMethod(*s)
  254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  255. }
  256. type ListMembershipsResponse struct {
  257. // Memberships: List of Memberships
  258. Memberships []*Membership `json:"memberships,omitempty"`
  259. // NextPageToken: Token to retrieve the next page of results, or empty
  260. // if there are no
  261. // more results available for listing.
  262. NextPageToken string `json:"nextPageToken,omitempty"`
  263. // ServerResponse contains the HTTP response code and headers from the
  264. // server.
  265. googleapi.ServerResponse `json:"-"`
  266. // ForceSendFields is a list of field names (e.g. "Memberships") to
  267. // unconditionally include in API requests. By default, fields with
  268. // empty values are omitted from API requests. However, any non-pointer,
  269. // non-interface field appearing in ForceSendFields will be sent to the
  270. // server regardless of whether the field is empty or not. This may be
  271. // used to include empty fields in Patch requests.
  272. ForceSendFields []string `json:"-"`
  273. // NullFields is a list of field names (e.g. "Memberships") to include
  274. // in API requests with the JSON null value. By default, fields with
  275. // empty values are omitted from API requests. However, any field with
  276. // an empty value appearing in NullFields will be sent to the server as
  277. // null. It is an error if a field in this list has a non-empty value.
  278. // This may be used to include null fields in Patch requests.
  279. NullFields []string `json:"-"`
  280. }
  281. func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) {
  282. type NoMethod ListMembershipsResponse
  283. raw := NoMethod(*s)
  284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  285. }
  286. type LookupGroupNameResponse struct {
  287. // Name: [Resource
  288. // name](https://cloud.google.com/apis/design/resource_names) of
  289. // the
  290. // Group in the format: `groups/{group_id}`, where `group_id` is the
  291. // unique id
  292. // assigned to the Group.
  293. Name string `json:"name,omitempty"`
  294. // ServerResponse contains the HTTP response code and headers from the
  295. // server.
  296. googleapi.ServerResponse `json:"-"`
  297. // ForceSendFields is a list of field names (e.g. "Name") to
  298. // unconditionally include in API requests. By default, fields with
  299. // empty values are omitted from API requests. However, any non-pointer,
  300. // non-interface field appearing in ForceSendFields will be sent to the
  301. // server regardless of whether the field is empty or not. This may be
  302. // used to include empty fields in Patch requests.
  303. ForceSendFields []string `json:"-"`
  304. // NullFields is a list of field names (e.g. "Name") to include in API
  305. // requests with the JSON null value. By default, fields with empty
  306. // values are omitted from API requests. However, any field with an
  307. // empty value appearing in NullFields will be sent to the server as
  308. // null. It is an error if a field in this list has a non-empty value.
  309. // This may be used to include null fields in Patch requests.
  310. NullFields []string `json:"-"`
  311. }
  312. func (s *LookupGroupNameResponse) MarshalJSON() ([]byte, error) {
  313. type NoMethod LookupGroupNameResponse
  314. raw := NoMethod(*s)
  315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  316. }
  317. type LookupMembershipNameResponse struct {
  318. // Name: [Resource
  319. // name](https://cloud.google.com/apis/design/resource_names) of
  320. // the
  321. // Membership being looked up.
  322. //
  323. // Format: `groups/{group_id}/memberships/{member_id}`, where `group_id`
  324. // is
  325. // the unique id assigned to the Group to which Membership belongs to,
  326. // and
  327. // `member_id` is the unique id assigned to the member.
  328. Name string `json:"name,omitempty"`
  329. // ServerResponse contains the HTTP response code and headers from the
  330. // server.
  331. googleapi.ServerResponse `json:"-"`
  332. // ForceSendFields is a list of field names (e.g. "Name") to
  333. // unconditionally include in API requests. By default, fields with
  334. // empty values are omitted from API requests. However, any non-pointer,
  335. // non-interface field appearing in ForceSendFields will be sent to the
  336. // server regardless of whether the field is empty or not. This may be
  337. // used to include empty fields in Patch requests.
  338. ForceSendFields []string `json:"-"`
  339. // NullFields is a list of field names (e.g. "Name") to include in API
  340. // requests with the JSON null value. By default, fields with empty
  341. // values are omitted from API requests. However, any field with an
  342. // empty value appearing in NullFields will be sent to the server as
  343. // null. It is an error if a field in this list has a non-empty value.
  344. // This may be used to include null fields in Patch requests.
  345. NullFields []string `json:"-"`
  346. }
  347. func (s *LookupMembershipNameResponse) MarshalJSON() ([]byte, error) {
  348. type NoMethod LookupMembershipNameResponse
  349. raw := NoMethod(*s)
  350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  351. }
  352. // Membership: Resource representing a Membership within a Group
  353. type Membership struct {
  354. // CreateTime: Creation timestamp of the Membership.
  355. CreateTime string `json:"createTime,omitempty"`
  356. // MemberKey: EntityKey of the entity to be added as the member. Must be
  357. // set while
  358. // creating a Membership, read-only afterwards.
  359. //
  360. // Currently allowed entity types: `Users`, `Groups`.
  361. MemberKey *EntityKey `json:"memberKey,omitempty"`
  362. // Name: [Resource
  363. // name](https://cloud.google.com/apis/design/resource_names) of
  364. // the
  365. // Membership in the format:
  366. // `groups/{group_id}/memberships/{member_id}`,
  367. // where group_id is the unique id assigned to the Group to which
  368. // Membership
  369. // belongs to, and member_id is the unique id assigned to the
  370. // member
  371. //
  372. // Must be left blank while creating a Membership.
  373. Name string `json:"name,omitempty"`
  374. // Roles: Roles for a member within the Group.
  375. //
  376. // Currently supported MembershipRoles: "MEMBER".
  377. Roles []*MembershipRole `json:"roles,omitempty"`
  378. // UpdateTime: Last updated timestamp of the Membership.
  379. UpdateTime string `json:"updateTime,omitempty"`
  380. // ServerResponse contains the HTTP response code and headers from the
  381. // server.
  382. googleapi.ServerResponse `json:"-"`
  383. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "CreateTime") to include in
  391. // API requests with the JSON null value. By default, fields with empty
  392. // values are omitted from API requests. However, any field with an
  393. // empty value appearing in NullFields will be sent to the server as
  394. // null. It is an error if a field in this list has a non-empty value.
  395. // This may be used to include null fields in Patch requests.
  396. NullFields []string `json:"-"`
  397. }
  398. func (s *Membership) MarshalJSON() ([]byte, error) {
  399. type NoMethod Membership
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // MembershipRole: Resource representing a role within a Membership.
  404. type MembershipRole struct {
  405. // Name: MembershipRole in string format.
  406. //
  407. // Currently supported MembershipRoles: "MEMBER".
  408. Name string `json:"name,omitempty"`
  409. // ForceSendFields is a list of field names (e.g. "Name") to
  410. // unconditionally include in API requests. By default, fields with
  411. // empty values are omitted from API requests. However, any non-pointer,
  412. // non-interface field appearing in ForceSendFields will be sent to the
  413. // server regardless of whether the field is empty or not. This may be
  414. // used to include empty fields in Patch requests.
  415. ForceSendFields []string `json:"-"`
  416. // NullFields is a list of field names (e.g. "Name") to include in API
  417. // requests with the JSON null value. By default, fields with empty
  418. // values are omitted from API requests. However, any field with an
  419. // empty value appearing in NullFields will be sent to the server as
  420. // null. It is an error if a field in this list has a non-empty value.
  421. // This may be used to include null fields in Patch requests.
  422. NullFields []string `json:"-"`
  423. }
  424. func (s *MembershipRole) MarshalJSON() ([]byte, error) {
  425. type NoMethod MembershipRole
  426. raw := NoMethod(*s)
  427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  428. }
  429. // Operation: This resource represents a long-running operation that is
  430. // the result of a
  431. // network API call.
  432. type Operation struct {
  433. // Done: If the value is `false`, it means the operation is still in
  434. // progress.
  435. // If `true`, the operation is completed, and either `error` or
  436. // `response` is
  437. // available.
  438. Done bool `json:"done,omitempty"`
  439. // Error: The error result of the operation in case of failure or
  440. // cancellation.
  441. Error *Status `json:"error,omitempty"`
  442. // Metadata: Service-specific metadata associated with the operation.
  443. // It typically
  444. // contains progress information and common metadata such as create
  445. // time.
  446. // Some services might not provide such metadata. Any method that
  447. // returns a
  448. // long-running operation should document the metadata type, if any.
  449. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  450. // Name: The server-assigned name, which is only unique within the same
  451. // service that
  452. // originally returns it. If you use the default HTTP mapping,
  453. // the
  454. // `name` should have the format of `operations/some/unique/name`.
  455. Name string `json:"name,omitempty"`
  456. // Response: The normal response of the operation in case of success.
  457. // If the original
  458. // method returns no data on success, such as `Delete`, the response
  459. // is
  460. // `google.protobuf.Empty`. If the original method is
  461. // standard
  462. // `Get`/`Create`/`Update`, the response should be the resource. For
  463. // other
  464. // methods, the response should have the type `XxxResponse`, where
  465. // `Xxx`
  466. // is the original method name. For example, if the original method
  467. // name
  468. // is `TakeSnapshot()`, the inferred response type
  469. // is
  470. // `TakeSnapshotResponse`.
  471. Response googleapi.RawMessage `json:"response,omitempty"`
  472. // ServerResponse contains the HTTP response code and headers from the
  473. // server.
  474. googleapi.ServerResponse `json:"-"`
  475. // ForceSendFields is a list of field names (e.g. "Done") to
  476. // unconditionally include in API requests. By default, fields with
  477. // empty values are omitted from API requests. However, any non-pointer,
  478. // non-interface field appearing in ForceSendFields will be sent to the
  479. // server regardless of whether the field is empty or not. This may be
  480. // used to include empty fields in Patch requests.
  481. ForceSendFields []string `json:"-"`
  482. // NullFields is a list of field names (e.g. "Done") to include in API
  483. // requests with the JSON null value. By default, fields with empty
  484. // values are omitted from API requests. However, any field with an
  485. // empty value appearing in NullFields will be sent to the server as
  486. // null. It is an error if a field in this list has a non-empty value.
  487. // This may be used to include null fields in Patch requests.
  488. NullFields []string `json:"-"`
  489. }
  490. func (s *Operation) MarshalJSON() ([]byte, error) {
  491. type NoMethod Operation
  492. raw := NoMethod(*s)
  493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  494. }
  495. type SearchGroupsResponse struct {
  496. // Groups: List of Groups satisfying the search query.
  497. Groups []*Group `json:"groups,omitempty"`
  498. // NextPageToken: Token to retrieve the next page of results, or empty
  499. // if there are no
  500. // more results available for specified query.
  501. NextPageToken string `json:"nextPageToken,omitempty"`
  502. // ServerResponse contains the HTTP response code and headers from the
  503. // server.
  504. googleapi.ServerResponse `json:"-"`
  505. // ForceSendFields is a list of field names (e.g. "Groups") to
  506. // unconditionally include in API requests. By default, fields with
  507. // empty values are omitted from API requests. However, any non-pointer,
  508. // non-interface field appearing in ForceSendFields will be sent to the
  509. // server regardless of whether the field is empty or not. This may be
  510. // used to include empty fields in Patch requests.
  511. ForceSendFields []string `json:"-"`
  512. // NullFields is a list of field names (e.g. "Groups") to include in API
  513. // requests with the JSON null value. By default, fields with empty
  514. // values are omitted from API requests. However, any field with an
  515. // empty value appearing in NullFields will be sent to the server as
  516. // null. It is an error if a field in this list has a non-empty value.
  517. // This may be used to include null fields in Patch requests.
  518. NullFields []string `json:"-"`
  519. }
  520. func (s *SearchGroupsResponse) MarshalJSON() ([]byte, error) {
  521. type NoMethod SearchGroupsResponse
  522. raw := NoMethod(*s)
  523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  524. }
  525. // Status: The `Status` type defines a logical error model that is
  526. // suitable for
  527. // different programming environments, including REST APIs and RPC APIs.
  528. // It is
  529. // used by [gRPC](https://github.com/grpc). The error model is designed
  530. // to be:
  531. //
  532. // - Simple to use and understand for most users
  533. // - Flexible enough to meet unexpected needs
  534. //
  535. // # Overview
  536. //
  537. // The `Status` message contains three pieces of data: error code,
  538. // error
  539. // message, and error details. The error code should be an enum value
  540. // of
  541. // google.rpc.Code, but it may accept additional error codes if needed.
  542. // The
  543. // error message should be a developer-facing English message that
  544. // helps
  545. // developers *understand* and *resolve* the error. If a localized
  546. // user-facing
  547. // error message is needed, put the localized message in the error
  548. // details or
  549. // localize it in the client. The optional error details may contain
  550. // arbitrary
  551. // information about the error. There is a predefined set of error
  552. // detail types
  553. // in the package `google.rpc` that can be used for common error
  554. // conditions.
  555. //
  556. // # Language mapping
  557. //
  558. // The `Status` message is the logical representation of the error
  559. // model, but it
  560. // is not necessarily the actual wire format. When the `Status` message
  561. // is
  562. // exposed in different client libraries and different wire protocols,
  563. // it can be
  564. // mapped differently. For example, it will likely be mapped to some
  565. // exceptions
  566. // in Java, but more likely mapped to some error codes in C.
  567. //
  568. // # Other uses
  569. //
  570. // The error model and the `Status` message can be used in a variety
  571. // of
  572. // environments, either with or without APIs, to provide a
  573. // consistent developer experience across different
  574. // environments.
  575. //
  576. // Example uses of this error model include:
  577. //
  578. // - Partial errors. If a service needs to return partial errors to the
  579. // client,
  580. // it may embed the `Status` in the normal response to indicate the
  581. // partial
  582. // errors.
  583. //
  584. // - Workflow errors. A typical workflow has multiple steps. Each step
  585. // may
  586. // have a `Status` message for error reporting.
  587. //
  588. // - Batch operations. If a client uses batch request and batch
  589. // response, the
  590. // `Status` message should be used directly inside batch response,
  591. // one for
  592. // each error sub-response.
  593. //
  594. // - Asynchronous operations. If an API call embeds asynchronous
  595. // operation
  596. // results in its response, the status of those operations should
  597. // be
  598. // represented directly using the `Status` message.
  599. //
  600. // - Logging. If some API errors are stored in logs, the message
  601. // `Status` could
  602. // be used directly after any stripping needed for security/privacy
  603. // reasons.
  604. type Status struct {
  605. // Code: The status code, which should be an enum value of
  606. // google.rpc.Code.
  607. Code int64 `json:"code,omitempty"`
  608. // Details: A list of messages that carry the error details. There is a
  609. // common set of
  610. // message types for APIs to use.
  611. Details []googleapi.RawMessage `json:"details,omitempty"`
  612. // Message: A developer-facing error message, which should be in
  613. // English. Any
  614. // user-facing error message should be localized and sent in
  615. // the
  616. // google.rpc.Status.details field, or localized by the client.
  617. Message string `json:"message,omitempty"`
  618. // ForceSendFields is a list of field names (e.g. "Code") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. // NullFields is a list of field names (e.g. "Code") to include in API
  626. // requests with the JSON null value. By default, fields with empty
  627. // values are omitted from API requests. However, any field with an
  628. // empty value appearing in NullFields will be sent to the server as
  629. // null. It is an error if a field in this list has a non-empty value.
  630. // This may be used to include null fields in Patch requests.
  631. NullFields []string `json:"-"`
  632. }
  633. func (s *Status) MarshalJSON() ([]byte, error) {
  634. type NoMethod Status
  635. raw := NoMethod(*s)
  636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  637. }
  638. // method id "cloudidentity.groups.create":
  639. type GroupsCreateCall struct {
  640. s *Service
  641. group *Group
  642. urlParams_ gensupport.URLParams
  643. ctx_ context.Context
  644. header_ http.Header
  645. }
  646. // Create: Creates a Group.
  647. func (r *GroupsService) Create(group *Group) *GroupsCreateCall {
  648. c := &GroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  649. c.group = group
  650. return c
  651. }
  652. // Fields allows partial responses to be retrieved. See
  653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  654. // for more information.
  655. func (c *GroupsCreateCall) Fields(s ...googleapi.Field) *GroupsCreateCall {
  656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  657. return c
  658. }
  659. // Context sets the context to be used in this call's Do method. Any
  660. // pending HTTP request will be aborted if the provided context is
  661. // canceled.
  662. func (c *GroupsCreateCall) Context(ctx context.Context) *GroupsCreateCall {
  663. c.ctx_ = ctx
  664. return c
  665. }
  666. // Header returns an http.Header that can be modified by the caller to
  667. // add HTTP headers to the request.
  668. func (c *GroupsCreateCall) Header() http.Header {
  669. if c.header_ == nil {
  670. c.header_ = make(http.Header)
  671. }
  672. return c.header_
  673. }
  674. func (c *GroupsCreateCall) doRequest(alt string) (*http.Response, error) {
  675. reqHeaders := make(http.Header)
  676. for k, v := range c.header_ {
  677. reqHeaders[k] = v
  678. }
  679. reqHeaders.Set("User-Agent", c.s.userAgent())
  680. var body io.Reader = nil
  681. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  682. if err != nil {
  683. return nil, err
  684. }
  685. reqHeaders.Set("Content-Type", "application/json")
  686. c.urlParams_.Set("alt", alt)
  687. c.urlParams_.Set("prettyPrint", "false")
  688. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups")
  689. urls += "?" + c.urlParams_.Encode()
  690. req, err := http.NewRequest("POST", urls, body)
  691. if err != nil {
  692. return nil, err
  693. }
  694. req.Header = reqHeaders
  695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  696. }
  697. // Do executes the "cloudidentity.groups.create" call.
  698. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  699. // status code is an error. Response headers are in either
  700. // *Operation.ServerResponse.Header or (if a response was returned at
  701. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  702. // to check whether the returned error was because
  703. // http.StatusNotModified was returned.
  704. func (c *GroupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  705. gensupport.SetOptions(c.urlParams_, opts...)
  706. res, err := c.doRequest("json")
  707. if res != nil && res.StatusCode == http.StatusNotModified {
  708. if res.Body != nil {
  709. res.Body.Close()
  710. }
  711. return nil, &googleapi.Error{
  712. Code: res.StatusCode,
  713. Header: res.Header,
  714. }
  715. }
  716. if err != nil {
  717. return nil, err
  718. }
  719. defer googleapi.CloseBody(res)
  720. if err := googleapi.CheckResponse(res); err != nil {
  721. return nil, err
  722. }
  723. ret := &Operation{
  724. ServerResponse: googleapi.ServerResponse{
  725. Header: res.Header,
  726. HTTPStatusCode: res.StatusCode,
  727. },
  728. }
  729. target := &ret
  730. if err := gensupport.DecodeResponse(target, res); err != nil {
  731. return nil, err
  732. }
  733. return ret, nil
  734. // {
  735. // "description": "Creates a Group.",
  736. // "flatPath": "v1beta1/groups",
  737. // "httpMethod": "POST",
  738. // "id": "cloudidentity.groups.create",
  739. // "parameterOrder": [],
  740. // "parameters": {},
  741. // "path": "v1beta1/groups",
  742. // "request": {
  743. // "$ref": "Group"
  744. // },
  745. // "response": {
  746. // "$ref": "Operation"
  747. // },
  748. // "scopes": [
  749. // "https://www.googleapis.com/auth/cloud-identity.groups"
  750. // ]
  751. // }
  752. }
  753. // method id "cloudidentity.groups.delete":
  754. type GroupsDeleteCall struct {
  755. s *Service
  756. name string
  757. urlParams_ gensupport.URLParams
  758. ctx_ context.Context
  759. header_ http.Header
  760. }
  761. // Delete: Deletes a Group.
  762. func (r *GroupsService) Delete(name string) *GroupsDeleteCall {
  763. c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  764. c.name = name
  765. return c
  766. }
  767. // Fields allows partial responses to be retrieved. See
  768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  769. // for more information.
  770. func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall {
  771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  772. return c
  773. }
  774. // Context sets the context to be used in this call's Do method. Any
  775. // pending HTTP request will be aborted if the provided context is
  776. // canceled.
  777. func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall {
  778. c.ctx_ = ctx
  779. return c
  780. }
  781. // Header returns an http.Header that can be modified by the caller to
  782. // add HTTP headers to the request.
  783. func (c *GroupsDeleteCall) Header() http.Header {
  784. if c.header_ == nil {
  785. c.header_ = make(http.Header)
  786. }
  787. return c.header_
  788. }
  789. func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  790. reqHeaders := make(http.Header)
  791. for k, v := range c.header_ {
  792. reqHeaders[k] = v
  793. }
  794. reqHeaders.Set("User-Agent", c.s.userAgent())
  795. var body io.Reader = nil
  796. c.urlParams_.Set("alt", alt)
  797. c.urlParams_.Set("prettyPrint", "false")
  798. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  799. urls += "?" + c.urlParams_.Encode()
  800. req, err := http.NewRequest("DELETE", urls, body)
  801. if err != nil {
  802. return nil, err
  803. }
  804. req.Header = reqHeaders
  805. googleapi.Expand(req.URL, map[string]string{
  806. "name": c.name,
  807. })
  808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  809. }
  810. // Do executes the "cloudidentity.groups.delete" call.
  811. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  812. // status code is an error. Response headers are in either
  813. // *Operation.ServerResponse.Header or (if a response was returned at
  814. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  815. // to check whether the returned error was because
  816. // http.StatusNotModified was returned.
  817. func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  818. gensupport.SetOptions(c.urlParams_, opts...)
  819. res, err := c.doRequest("json")
  820. if res != nil && res.StatusCode == http.StatusNotModified {
  821. if res.Body != nil {
  822. res.Body.Close()
  823. }
  824. return nil, &googleapi.Error{
  825. Code: res.StatusCode,
  826. Header: res.Header,
  827. }
  828. }
  829. if err != nil {
  830. return nil, err
  831. }
  832. defer googleapi.CloseBody(res)
  833. if err := googleapi.CheckResponse(res); err != nil {
  834. return nil, err
  835. }
  836. ret := &Operation{
  837. ServerResponse: googleapi.ServerResponse{
  838. Header: res.Header,
  839. HTTPStatusCode: res.StatusCode,
  840. },
  841. }
  842. target := &ret
  843. if err := gensupport.DecodeResponse(target, res); err != nil {
  844. return nil, err
  845. }
  846. return ret, nil
  847. // {
  848. // "description": "Deletes a Group.",
  849. // "flatPath": "v1beta1/groups/{groupsId}",
  850. // "httpMethod": "DELETE",
  851. // "id": "cloudidentity.groups.delete",
  852. // "parameterOrder": [
  853. // "name"
  854. // ],
  855. // "parameters": {
  856. // "name": {
  857. // "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.",
  858. // "location": "path",
  859. // "pattern": "^groups/[^/]+$",
  860. // "required": true,
  861. // "type": "string"
  862. // }
  863. // },
  864. // "path": "v1beta1/{+name}",
  865. // "response": {
  866. // "$ref": "Operation"
  867. // },
  868. // "scopes": [
  869. // "https://www.googleapis.com/auth/cloud-identity.groups"
  870. // ]
  871. // }
  872. }
  873. // method id "cloudidentity.groups.get":
  874. type GroupsGetCall struct {
  875. s *Service
  876. name string
  877. urlParams_ gensupport.URLParams
  878. ifNoneMatch_ string
  879. ctx_ context.Context
  880. header_ http.Header
  881. }
  882. // Get: Retrieves a Group.
  883. func (r *GroupsService) Get(name string) *GroupsGetCall {
  884. c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  885. c.name = name
  886. return c
  887. }
  888. // Fields allows partial responses to be retrieved. See
  889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  890. // for more information.
  891. func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall {
  892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  893. return c
  894. }
  895. // IfNoneMatch sets the optional parameter which makes the operation
  896. // fail if the object's ETag matches the given value. This is useful for
  897. // getting updates only after the object has changed since the last
  898. // request. Use googleapi.IsNotModified to check whether the response
  899. // error from Do is the result of In-None-Match.
  900. func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall {
  901. c.ifNoneMatch_ = entityTag
  902. return c
  903. }
  904. // Context sets the context to be used in this call's Do method. Any
  905. // pending HTTP request will be aborted if the provided context is
  906. // canceled.
  907. func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall {
  908. c.ctx_ = ctx
  909. return c
  910. }
  911. // Header returns an http.Header that can be modified by the caller to
  912. // add HTTP headers to the request.
  913. func (c *GroupsGetCall) Header() http.Header {
  914. if c.header_ == nil {
  915. c.header_ = make(http.Header)
  916. }
  917. return c.header_
  918. }
  919. func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) {
  920. reqHeaders := make(http.Header)
  921. for k, v := range c.header_ {
  922. reqHeaders[k] = v
  923. }
  924. reqHeaders.Set("User-Agent", c.s.userAgent())
  925. if c.ifNoneMatch_ != "" {
  926. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  927. }
  928. var body io.Reader = nil
  929. c.urlParams_.Set("alt", alt)
  930. c.urlParams_.Set("prettyPrint", "false")
  931. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  932. urls += "?" + c.urlParams_.Encode()
  933. req, err := http.NewRequest("GET", urls, body)
  934. if err != nil {
  935. return nil, err
  936. }
  937. req.Header = reqHeaders
  938. googleapi.Expand(req.URL, map[string]string{
  939. "name": c.name,
  940. })
  941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  942. }
  943. // Do executes the "cloudidentity.groups.get" call.
  944. // Exactly one of *Group or error will be non-nil. Any non-2xx status
  945. // code is an error. Response headers are in either
  946. // *Group.ServerResponse.Header or (if a response was returned at all)
  947. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  948. // check whether the returned error was because http.StatusNotModified
  949. // was returned.
  950. func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) {
  951. gensupport.SetOptions(c.urlParams_, opts...)
  952. res, err := c.doRequest("json")
  953. if res != nil && res.StatusCode == http.StatusNotModified {
  954. if res.Body != nil {
  955. res.Body.Close()
  956. }
  957. return nil, &googleapi.Error{
  958. Code: res.StatusCode,
  959. Header: res.Header,
  960. }
  961. }
  962. if err != nil {
  963. return nil, err
  964. }
  965. defer googleapi.CloseBody(res)
  966. if err := googleapi.CheckResponse(res); err != nil {
  967. return nil, err
  968. }
  969. ret := &Group{
  970. ServerResponse: googleapi.ServerResponse{
  971. Header: res.Header,
  972. HTTPStatusCode: res.StatusCode,
  973. },
  974. }
  975. target := &ret
  976. if err := gensupport.DecodeResponse(target, res); err != nil {
  977. return nil, err
  978. }
  979. return ret, nil
  980. // {
  981. // "description": "Retrieves a Group.",
  982. // "flatPath": "v1beta1/groups/{groupsId}",
  983. // "httpMethod": "GET",
  984. // "id": "cloudidentity.groups.get",
  985. // "parameterOrder": [
  986. // "name"
  987. // ],
  988. // "parameters": {
  989. // "name": {
  990. // "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.",
  991. // "location": "path",
  992. // "pattern": "^groups/[^/]+$",
  993. // "required": true,
  994. // "type": "string"
  995. // }
  996. // },
  997. // "path": "v1beta1/{+name}",
  998. // "response": {
  999. // "$ref": "Group"
  1000. // },
  1001. // "scopes": [
  1002. // "https://www.googleapis.com/auth/cloud-identity.groups",
  1003. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  1004. // ]
  1005. // }
  1006. }
  1007. // method id "cloudidentity.groups.lookup":
  1008. type GroupsLookupCall struct {
  1009. s *Service
  1010. urlParams_ gensupport.URLParams
  1011. ifNoneMatch_ string
  1012. ctx_ context.Context
  1013. header_ http.Header
  1014. }
  1015. // Lookup: Looks up
  1016. // [resource
  1017. // name](https://cloud.google.com/apis/design/resource_names) of a Group
  1018. // by
  1019. // its EntityKey.
  1020. func (r *GroupsService) Lookup() *GroupsLookupCall {
  1021. c := &GroupsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1022. return c
  1023. }
  1024. // GroupKeyId sets the optional parameter "groupKey.id": The id of the
  1025. // entity within the given namespace. The id must be unique
  1026. // within its namespace.
  1027. func (c *GroupsLookupCall) GroupKeyId(groupKeyId string) *GroupsLookupCall {
  1028. c.urlParams_.Set("groupKey.id", groupKeyId)
  1029. return c
  1030. }
  1031. // GroupKeyNamespace sets the optional parameter "groupKey.namespace":
  1032. // Namespaces provide isolation for ids, i.e an id only needs to be
  1033. // unique
  1034. // within its namespace.
  1035. //
  1036. // Namespaces are currently only created as part of IdentitySource
  1037. // creation
  1038. // from Admin Console. A namespace
  1039. // "identitysources/{identity_source_id}" is
  1040. // created corresponding to every Identity Source `identity_source_id`.
  1041. func (c *GroupsLookupCall) GroupKeyNamespace(groupKeyNamespace string) *GroupsLookupCall {
  1042. c.urlParams_.Set("groupKey.namespace", groupKeyNamespace)
  1043. return c
  1044. }
  1045. // Fields allows partial responses to be retrieved. See
  1046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1047. // for more information.
  1048. func (c *GroupsLookupCall) Fields(s ...googleapi.Field) *GroupsLookupCall {
  1049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1050. return c
  1051. }
  1052. // IfNoneMatch sets the optional parameter which makes the operation
  1053. // fail if the object's ETag matches the given value. This is useful for
  1054. // getting updates only after the object has changed since the last
  1055. // request. Use googleapi.IsNotModified to check whether the response
  1056. // error from Do is the result of In-None-Match.
  1057. func (c *GroupsLookupCall) IfNoneMatch(entityTag string) *GroupsLookupCall {
  1058. c.ifNoneMatch_ = entityTag
  1059. return c
  1060. }
  1061. // Context sets the context to be used in this call's Do method. Any
  1062. // pending HTTP request will be aborted if the provided context is
  1063. // canceled.
  1064. func (c *GroupsLookupCall) Context(ctx context.Context) *GroupsLookupCall {
  1065. c.ctx_ = ctx
  1066. return c
  1067. }
  1068. // Header returns an http.Header that can be modified by the caller to
  1069. // add HTTP headers to the request.
  1070. func (c *GroupsLookupCall) Header() http.Header {
  1071. if c.header_ == nil {
  1072. c.header_ = make(http.Header)
  1073. }
  1074. return c.header_
  1075. }
  1076. func (c *GroupsLookupCall) doRequest(alt string) (*http.Response, error) {
  1077. reqHeaders := make(http.Header)
  1078. for k, v := range c.header_ {
  1079. reqHeaders[k] = v
  1080. }
  1081. reqHeaders.Set("User-Agent", c.s.userAgent())
  1082. if c.ifNoneMatch_ != "" {
  1083. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1084. }
  1085. var body io.Reader = nil
  1086. c.urlParams_.Set("alt", alt)
  1087. c.urlParams_.Set("prettyPrint", "false")
  1088. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:lookup")
  1089. urls += "?" + c.urlParams_.Encode()
  1090. req, err := http.NewRequest("GET", urls, body)
  1091. if err != nil {
  1092. return nil, err
  1093. }
  1094. req.Header = reqHeaders
  1095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1096. }
  1097. // Do executes the "cloudidentity.groups.lookup" call.
  1098. // Exactly one of *LookupGroupNameResponse or error will be non-nil. Any
  1099. // non-2xx status code is an error. Response headers are in either
  1100. // *LookupGroupNameResponse.ServerResponse.Header or (if a response was
  1101. // returned at all) in error.(*googleapi.Error).Header. Use
  1102. // googleapi.IsNotModified to check whether the returned error was
  1103. // because http.StatusNotModified was returned.
  1104. func (c *GroupsLookupCall) Do(opts ...googleapi.CallOption) (*LookupGroupNameResponse, error) {
  1105. gensupport.SetOptions(c.urlParams_, opts...)
  1106. res, err := c.doRequest("json")
  1107. if res != nil && res.StatusCode == http.StatusNotModified {
  1108. if res.Body != nil {
  1109. res.Body.Close()
  1110. }
  1111. return nil, &googleapi.Error{
  1112. Code: res.StatusCode,
  1113. Header: res.Header,
  1114. }
  1115. }
  1116. if err != nil {
  1117. return nil, err
  1118. }
  1119. defer googleapi.CloseBody(res)
  1120. if err := googleapi.CheckResponse(res); err != nil {
  1121. return nil, err
  1122. }
  1123. ret := &LookupGroupNameResponse{
  1124. ServerResponse: googleapi.ServerResponse{
  1125. Header: res.Header,
  1126. HTTPStatusCode: res.StatusCode,
  1127. },
  1128. }
  1129. target := &ret
  1130. if err := gensupport.DecodeResponse(target, res); err != nil {
  1131. return nil, err
  1132. }
  1133. return ret, nil
  1134. // {
  1135. // "description": "Looks up [resource\nname](https://cloud.google.com/apis/design/resource_names) of a Group by\nits EntityKey.",
  1136. // "flatPath": "v1beta1/groups:lookup",
  1137. // "httpMethod": "GET",
  1138. // "id": "cloudidentity.groups.lookup",
  1139. // "parameterOrder": [],
  1140. // "parameters": {
  1141. // "groupKey.id": {
  1142. // "description": "The id of the entity within the given namespace. The id must be unique\nwithin its namespace.",
  1143. // "location": "query",
  1144. // "type": "string"
  1145. // },
  1146. // "groupKey.namespace": {
  1147. // "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`.",
  1148. // "location": "query",
  1149. // "type": "string"
  1150. // }
  1151. // },
  1152. // "path": "v1beta1/groups:lookup",
  1153. // "response": {
  1154. // "$ref": "LookupGroupNameResponse"
  1155. // },
  1156. // "scopes": [
  1157. // "https://www.googleapis.com/auth/cloud-identity.groups",
  1158. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  1159. // ]
  1160. // }
  1161. }
  1162. // method id "cloudidentity.groups.patch":
  1163. type GroupsPatchCall struct {
  1164. s *Service
  1165. name string
  1166. group *Group
  1167. urlParams_ gensupport.URLParams
  1168. ctx_ context.Context
  1169. header_ http.Header
  1170. }
  1171. // Patch: Updates a Group.
  1172. func (r *GroupsService) Patch(name string, group *Group) *GroupsPatchCall {
  1173. c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1174. c.name = name
  1175. c.group = group
  1176. return c
  1177. }
  1178. // UpdateMask sets the optional parameter "updateMask": Editable fields:
  1179. // `display_name`, `description`
  1180. func (c *GroupsPatchCall) UpdateMask(updateMask string) *GroupsPatchCall {
  1181. c.urlParams_.Set("updateMask", updateMask)
  1182. return c
  1183. }
  1184. // Fields allows partial responses to be retrieved. See
  1185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1186. // for more information.
  1187. func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall {
  1188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1189. return c
  1190. }
  1191. // Context sets the context to be used in this call's Do method. Any
  1192. // pending HTTP request will be aborted if the provided context is
  1193. // canceled.
  1194. func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall {
  1195. c.ctx_ = ctx
  1196. return c
  1197. }
  1198. // Header returns an http.Header that can be modified by the caller to
  1199. // add HTTP headers to the request.
  1200. func (c *GroupsPatchCall) Header() http.Header {
  1201. if c.header_ == nil {
  1202. c.header_ = make(http.Header)
  1203. }
  1204. return c.header_
  1205. }
  1206. func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  1207. reqHeaders := make(http.Header)
  1208. for k, v := range c.header_ {
  1209. reqHeaders[k] = v
  1210. }
  1211. reqHeaders.Set("User-Agent", c.s.userAgent())
  1212. var body io.Reader = nil
  1213. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  1214. if err != nil {
  1215. return nil, err
  1216. }
  1217. reqHeaders.Set("Content-Type", "application/json")
  1218. c.urlParams_.Set("alt", alt)
  1219. c.urlParams_.Set("prettyPrint", "false")
  1220. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1221. urls += "?" + c.urlParams_.Encode()
  1222. req, err := http.NewRequest("PATCH", urls, body)
  1223. if err != nil {
  1224. return nil, err
  1225. }
  1226. req.Header = reqHeaders
  1227. googleapi.Expand(req.URL, map[string]string{
  1228. "name": c.name,
  1229. })
  1230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1231. }
  1232. // Do executes the "cloudidentity.groups.patch" call.
  1233. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1234. // status code is an error. Response headers are in either
  1235. // *Operation.ServerResponse.Header or (if a response was returned at
  1236. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1237. // to check whether the returned error was because
  1238. // http.StatusNotModified was returned.
  1239. func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1240. gensupport.SetOptions(c.urlParams_, opts...)
  1241. res, err := c.doRequest("json")
  1242. if res != nil && res.StatusCode == http.StatusNotModified {
  1243. if res.Body != nil {
  1244. res.Body.Close()
  1245. }
  1246. return nil, &googleapi.Error{
  1247. Code: res.StatusCode,
  1248. Header: res.Header,
  1249. }
  1250. }
  1251. if err != nil {
  1252. return nil, err
  1253. }
  1254. defer googleapi.CloseBody(res)
  1255. if err := googleapi.CheckResponse(res); err != nil {
  1256. return nil, err
  1257. }
  1258. ret := &Operation{
  1259. ServerResponse: googleapi.ServerResponse{
  1260. Header: res.Header,
  1261. HTTPStatusCode: res.StatusCode,
  1262. },
  1263. }
  1264. target := &ret
  1265. if err := gensupport.DecodeResponse(target, res); err != nil {
  1266. return nil, err
  1267. }
  1268. return ret, nil
  1269. // {
  1270. // "description": "Updates a Group.",
  1271. // "flatPath": "v1beta1/groups/{groupsId}",
  1272. // "httpMethod": "PATCH",
  1273. // "id": "cloudidentity.groups.patch",
  1274. // "parameterOrder": [
  1275. // "name"
  1276. // ],
  1277. // "parameters": {
  1278. // "name": {
  1279. // "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",
  1280. // "location": "path",
  1281. // "pattern": "^groups/[^/]+$",
  1282. // "required": true,
  1283. // "type": "string"
  1284. // },
  1285. // "updateMask": {
  1286. // "description": "Editable fields: `display_name`, `description`",
  1287. // "format": "google-fieldmask",
  1288. // "location": "query",
  1289. // "type": "string"
  1290. // }
  1291. // },
  1292. // "path": "v1beta1/{+name}",
  1293. // "request": {
  1294. // "$ref": "Group"
  1295. // },
  1296. // "response": {
  1297. // "$ref": "Operation"
  1298. // },
  1299. // "scopes": [
  1300. // "https://www.googleapis.com/auth/cloud-identity.groups"
  1301. // ]
  1302. // }
  1303. }
  1304. // method id "cloudidentity.groups.search":
  1305. type GroupsSearchCall struct {
  1306. s *Service
  1307. urlParams_ gensupport.URLParams
  1308. ifNoneMatch_ string
  1309. ctx_ context.Context
  1310. header_ http.Header
  1311. }
  1312. // Search: Searches for Groups.
  1313. func (r *GroupsService) Search() *GroupsSearchCall {
  1314. c := &GroupsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1315. return c
  1316. }
  1317. // PageSize sets the optional parameter "pageSize": The default page
  1318. // size is 200 (max 1000) for the BASIC view, and 50
  1319. // (max 500) for the FULL view.
  1320. func (c *GroupsSearchCall) PageSize(pageSize int64) *GroupsSearchCall {
  1321. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1322. return c
  1323. }
  1324. // PageToken sets the optional parameter "pageToken": The
  1325. // next_page_token value returned from a previous search request, if
  1326. // any.
  1327. func (c *GroupsSearchCall) PageToken(pageToken string) *GroupsSearchCall {
  1328. c.urlParams_.Set("pageToken", pageToken)
  1329. return c
  1330. }
  1331. // Query sets the optional parameter "query": Query string for
  1332. // performing search on groups.
  1333. // Users can search on namespace and label attributes of groups.
  1334. // EXACT match ('=') is supported on namespace, and CONTAINS match (':')
  1335. // is
  1336. // supported on labels. This is a `required` field.
  1337. // Multiple queries can be combined using `AND` operator. The operator
  1338. // is case
  1339. // sensitive.
  1340. // An example query would be:
  1341. // "namespace=<namespace_value> AND labels:<labels_value>".
  1342. func (c *GroupsSearchCall) Query(query string) *GroupsSearchCall {
  1343. c.urlParams_.Set("query", query)
  1344. return c
  1345. }
  1346. // View sets the optional parameter "view": Group resource view to be
  1347. // returned. Defaults to [GroupView.BASIC]().
  1348. //
  1349. // Possible values:
  1350. // "BASIC"
  1351. // "FULL"
  1352. func (c *GroupsSearchCall) View(view string) *GroupsSearchCall {
  1353. c.urlParams_.Set("view", view)
  1354. return c
  1355. }
  1356. // Fields allows partial responses to be retrieved. See
  1357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1358. // for more information.
  1359. func (c *GroupsSearchCall) Fields(s ...googleapi.Field) *GroupsSearchCall {
  1360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1361. return c
  1362. }
  1363. // IfNoneMatch sets the optional parameter which makes the operation
  1364. // fail if the object's ETag matches the given value. This is useful for
  1365. // getting updates only after the object has changed since the last
  1366. // request. Use googleapi.IsNotModified to check whether the response
  1367. // error from Do is the result of In-None-Match.
  1368. func (c *GroupsSearchCall) IfNoneMatch(entityTag string) *GroupsSearchCall {
  1369. c.ifNoneMatch_ = entityTag
  1370. return c
  1371. }
  1372. // Context sets the context to be used in this call's Do method. Any
  1373. // pending HTTP request will be aborted if the provided context is
  1374. // canceled.
  1375. func (c *GroupsSearchCall) Context(ctx context.Context) *GroupsSearchCall {
  1376. c.ctx_ = ctx
  1377. return c
  1378. }
  1379. // Header returns an http.Header that can be modified by the caller to
  1380. // add HTTP headers to the request.
  1381. func (c *GroupsSearchCall) Header() http.Header {
  1382. if c.header_ == nil {
  1383. c.header_ = make(http.Header)
  1384. }
  1385. return c.header_
  1386. }
  1387. func (c *GroupsSearchCall) doRequest(alt string) (*http.Response, error) {
  1388. reqHeaders := make(http.Header)
  1389. for k, v := range c.header_ {
  1390. reqHeaders[k] = v
  1391. }
  1392. reqHeaders.Set("User-Agent", c.s.userAgent())
  1393. if c.ifNoneMatch_ != "" {
  1394. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1395. }
  1396. var body io.Reader = nil
  1397. c.urlParams_.Set("alt", alt)
  1398. c.urlParams_.Set("prettyPrint", "false")
  1399. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/groups:search")
  1400. urls += "?" + c.urlParams_.Encode()
  1401. req, err := http.NewRequest("GET", urls, body)
  1402. if err != nil {
  1403. return nil, err
  1404. }
  1405. req.Header = reqHeaders
  1406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1407. }
  1408. // Do executes the "cloudidentity.groups.search" call.
  1409. // Exactly one of *SearchGroupsResponse or error will be non-nil. Any
  1410. // non-2xx status code is an error. Response headers are in either
  1411. // *SearchGroupsResponse.ServerResponse.Header or (if a response was
  1412. // returned at all) in error.(*googleapi.Error).Header. Use
  1413. // googleapi.IsNotModified to check whether the returned error was
  1414. // because http.StatusNotModified was returned.
  1415. func (c *GroupsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGroupsResponse, error) {
  1416. gensupport.SetOptions(c.urlParams_, opts...)
  1417. res, err := c.doRequest("json")
  1418. if res != nil && res.StatusCode == http.StatusNotModified {
  1419. if res.Body != nil {
  1420. res.Body.Close()
  1421. }
  1422. return nil, &googleapi.Error{
  1423. Code: res.StatusCode,
  1424. Header: res.Header,
  1425. }
  1426. }
  1427. if err != nil {
  1428. return nil, err
  1429. }
  1430. defer googleapi.CloseBody(res)
  1431. if err := googleapi.CheckResponse(res); err != nil {
  1432. return nil, err
  1433. }
  1434. ret := &SearchGroupsResponse{
  1435. ServerResponse: googleapi.ServerResponse{
  1436. Header: res.Header,
  1437. HTTPStatusCode: res.StatusCode,
  1438. },
  1439. }
  1440. target := &ret
  1441. if err := gensupport.DecodeResponse(target, res); err != nil {
  1442. return nil, err
  1443. }
  1444. return ret, nil
  1445. // {
  1446. // "description": "Searches for Groups.",
  1447. // "flatPath": "v1beta1/groups:search",
  1448. // "httpMethod": "GET",
  1449. // "id": "cloudidentity.groups.search",
  1450. // "parameterOrder": [],
  1451. // "parameters": {
  1452. // "pageSize": {
  1453. // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.",
  1454. // "format": "int32",
  1455. // "location": "query",
  1456. // "type": "integer"
  1457. // },
  1458. // "pageToken": {
  1459. // "description": "The next_page_token value returned from a previous search request, if any.",
  1460. // "location": "query",
  1461. // "type": "string"
  1462. // },
  1463. // "query": {
  1464. // "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\".",
  1465. // "location": "query",
  1466. // "type": "string"
  1467. // },
  1468. // "view": {
  1469. // "description": "Group resource view to be returned. Defaults to [GroupView.BASIC]().",
  1470. // "enum": [
  1471. // "BASIC",
  1472. // "FULL"
  1473. // ],
  1474. // "location": "query",
  1475. // "type": "string"
  1476. // }
  1477. // },
  1478. // "path": "v1beta1/groups:search",
  1479. // "response": {
  1480. // "$ref": "SearchGroupsResponse"
  1481. // },
  1482. // "scopes": [
  1483. // "https://www.googleapis.com/auth/cloud-identity.groups",
  1484. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  1485. // ]
  1486. // }
  1487. }
  1488. // Pages invokes f for each page of results.
  1489. // A non-nil error returned from f will halt the iteration.
  1490. // The provided context supersedes any context provided to the Context method.
  1491. func (c *GroupsSearchCall) Pages(ctx context.Context, f func(*SearchGroupsResponse) error) error {
  1492. c.ctx_ = ctx
  1493. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1494. for {
  1495. x, err := c.Do()
  1496. if err != nil {
  1497. return err
  1498. }
  1499. if err := f(x); err != nil {
  1500. return err
  1501. }
  1502. if x.NextPageToken == "" {
  1503. return nil
  1504. }
  1505. c.PageToken(x.NextPageToken)
  1506. }
  1507. }
  1508. // method id "cloudidentity.groups.memberships.create":
  1509. type GroupsMembershipsCreateCall struct {
  1510. s *Service
  1511. parent string
  1512. membership *Membership
  1513. urlParams_ gensupport.URLParams
  1514. ctx_ context.Context
  1515. header_ http.Header
  1516. }
  1517. // Create: Creates a Membership.
  1518. func (r *GroupsMembershipsService) Create(parent string, membership *Membership) *GroupsMembershipsCreateCall {
  1519. c := &GroupsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1520. c.parent = parent
  1521. c.membership = membership
  1522. return c
  1523. }
  1524. // Fields allows partial responses to be retrieved. See
  1525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1526. // for more information.
  1527. func (c *GroupsMembershipsCreateCall) Fields(s ...googleapi.Field) *GroupsMembershipsCreateCall {
  1528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1529. return c
  1530. }
  1531. // Context sets the context to be used in this call's Do method. Any
  1532. // pending HTTP request will be aborted if the provided context is
  1533. // canceled.
  1534. func (c *GroupsMembershipsCreateCall) Context(ctx context.Context) *GroupsMembershipsCreateCall {
  1535. c.ctx_ = ctx
  1536. return c
  1537. }
  1538. // Header returns an http.Header that can be modified by the caller to
  1539. // add HTTP headers to the request.
  1540. func (c *GroupsMembershipsCreateCall) Header() http.Header {
  1541. if c.header_ == nil {
  1542. c.header_ = make(http.Header)
  1543. }
  1544. return c.header_
  1545. }
  1546. func (c *GroupsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) {
  1547. reqHeaders := make(http.Header)
  1548. for k, v := range c.header_ {
  1549. reqHeaders[k] = v
  1550. }
  1551. reqHeaders.Set("User-Agent", c.s.userAgent())
  1552. var body io.Reader = nil
  1553. body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership)
  1554. if err != nil {
  1555. return nil, err
  1556. }
  1557. reqHeaders.Set("Content-Type", "application/json")
  1558. c.urlParams_.Set("alt", alt)
  1559. c.urlParams_.Set("prettyPrint", "false")
  1560. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships")
  1561. urls += "?" + c.urlParams_.Encode()
  1562. req, err := http.NewRequest("POST", urls, body)
  1563. if err != nil {
  1564. return nil, err
  1565. }
  1566. req.Header = reqHeaders
  1567. googleapi.Expand(req.URL, map[string]string{
  1568. "parent": c.parent,
  1569. })
  1570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1571. }
  1572. // Do executes the "cloudidentity.groups.memberships.create" call.
  1573. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1574. // status code is an error. Response headers are in either
  1575. // *Operation.ServerResponse.Header or (if a response was returned at
  1576. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1577. // to check whether the returned error was because
  1578. // http.StatusNotModified was returned.
  1579. func (c *GroupsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1580. gensupport.SetOptions(c.urlParams_, opts...)
  1581. res, err := c.doRequest("json")
  1582. if res != nil && res.StatusCode == http.StatusNotModified {
  1583. if res.Body != nil {
  1584. res.Body.Close()
  1585. }
  1586. return nil, &googleapi.Error{
  1587. Code: res.StatusCode,
  1588. Header: res.Header,
  1589. }
  1590. }
  1591. if err != nil {
  1592. return nil, err
  1593. }
  1594. defer googleapi.CloseBody(res)
  1595. if err := googleapi.CheckResponse(res); err != nil {
  1596. return nil, err
  1597. }
  1598. ret := &Operation{
  1599. ServerResponse: googleapi.ServerResponse{
  1600. Header: res.Header,
  1601. HTTPStatusCode: res.StatusCode,
  1602. },
  1603. }
  1604. target := &ret
  1605. if err := gensupport.DecodeResponse(target, res); err != nil {
  1606. return nil, err
  1607. }
  1608. return ret, nil
  1609. // {
  1610. // "description": "Creates a Membership.",
  1611. // "flatPath": "v1beta1/groups/{groupsId}/memberships",
  1612. // "httpMethod": "POST",
  1613. // "id": "cloudidentity.groups.memberships.create",
  1614. // "parameterOrder": [
  1615. // "parent"
  1616. // ],
  1617. // "parameters": {
  1618. // "parent": {
  1619. // "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.",
  1620. // "location": "path",
  1621. // "pattern": "^groups/[^/]+$",
  1622. // "required": true,
  1623. // "type": "string"
  1624. // }
  1625. // },
  1626. // "path": "v1beta1/{+parent}/memberships",
  1627. // "request": {
  1628. // "$ref": "Membership"
  1629. // },
  1630. // "response": {
  1631. // "$ref": "Operation"
  1632. // },
  1633. // "scopes": [
  1634. // "https://www.googleapis.com/auth/cloud-identity.groups"
  1635. // ]
  1636. // }
  1637. }
  1638. // method id "cloudidentity.groups.memberships.delete":
  1639. type GroupsMembershipsDeleteCall struct {
  1640. s *Service
  1641. name string
  1642. urlParams_ gensupport.URLParams
  1643. ctx_ context.Context
  1644. header_ http.Header
  1645. }
  1646. // Delete: Deletes a Membership.
  1647. func (r *GroupsMembershipsService) Delete(name string) *GroupsMembershipsDeleteCall {
  1648. c := &GroupsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1649. c.name = name
  1650. return c
  1651. }
  1652. // Fields allows partial responses to be retrieved. See
  1653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1654. // for more information.
  1655. func (c *GroupsMembershipsDeleteCall) Fields(s ...googleapi.Field) *GroupsMembershipsDeleteCall {
  1656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1657. return c
  1658. }
  1659. // Context sets the context to be used in this call's Do method. Any
  1660. // pending HTTP request will be aborted if the provided context is
  1661. // canceled.
  1662. func (c *GroupsMembershipsDeleteCall) Context(ctx context.Context) *GroupsMembershipsDeleteCall {
  1663. c.ctx_ = ctx
  1664. return c
  1665. }
  1666. // Header returns an http.Header that can be modified by the caller to
  1667. // add HTTP headers to the request.
  1668. func (c *GroupsMembershipsDeleteCall) Header() http.Header {
  1669. if c.header_ == nil {
  1670. c.header_ = make(http.Header)
  1671. }
  1672. return c.header_
  1673. }
  1674. func (c *GroupsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1675. reqHeaders := make(http.Header)
  1676. for k, v := range c.header_ {
  1677. reqHeaders[k] = v
  1678. }
  1679. reqHeaders.Set("User-Agent", c.s.userAgent())
  1680. var body io.Reader = nil
  1681. c.urlParams_.Set("alt", alt)
  1682. c.urlParams_.Set("prettyPrint", "false")
  1683. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1684. urls += "?" + c.urlParams_.Encode()
  1685. req, err := http.NewRequest("DELETE", urls, body)
  1686. if err != nil {
  1687. return nil, err
  1688. }
  1689. req.Header = reqHeaders
  1690. googleapi.Expand(req.URL, map[string]string{
  1691. "name": c.name,
  1692. })
  1693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1694. }
  1695. // Do executes the "cloudidentity.groups.memberships.delete" call.
  1696. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1697. // status code is an error. Response headers are in either
  1698. // *Operation.ServerResponse.Header or (if a response was returned at
  1699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1700. // to check whether the returned error was because
  1701. // http.StatusNotModified was returned.
  1702. func (c *GroupsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1703. gensupport.SetOptions(c.urlParams_, opts...)
  1704. res, err := c.doRequest("json")
  1705. if res != nil && res.StatusCode == http.StatusNotModified {
  1706. if res.Body != nil {
  1707. res.Body.Close()
  1708. }
  1709. return nil, &googleapi.Error{
  1710. Code: res.StatusCode,
  1711. Header: res.Header,
  1712. }
  1713. }
  1714. if err != nil {
  1715. return nil, err
  1716. }
  1717. defer googleapi.CloseBody(res)
  1718. if err := googleapi.CheckResponse(res); err != nil {
  1719. return nil, err
  1720. }
  1721. ret := &Operation{
  1722. ServerResponse: googleapi.ServerResponse{
  1723. Header: res.Header,
  1724. HTTPStatusCode: res.StatusCode,
  1725. },
  1726. }
  1727. target := &ret
  1728. if err := gensupport.DecodeResponse(target, res); err != nil {
  1729. return nil, err
  1730. }
  1731. return ret, nil
  1732. // {
  1733. // "description": "Deletes a Membership.",
  1734. // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}",
  1735. // "httpMethod": "DELETE",
  1736. // "id": "cloudidentity.groups.memberships.delete",
  1737. // "parameterOrder": [
  1738. // "name"
  1739. // ],
  1740. // "parameters": {
  1741. // "name": {
  1742. // "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.",
  1743. // "location": "path",
  1744. // "pattern": "^groups/[^/]+/memberships/[^/]+$",
  1745. // "required": true,
  1746. // "type": "string"
  1747. // }
  1748. // },
  1749. // "path": "v1beta1/{+name}",
  1750. // "response": {
  1751. // "$ref": "Operation"
  1752. // },
  1753. // "scopes": [
  1754. // "https://www.googleapis.com/auth/cloud-identity.groups"
  1755. // ]
  1756. // }
  1757. }
  1758. // method id "cloudidentity.groups.memberships.get":
  1759. type GroupsMembershipsGetCall struct {
  1760. s *Service
  1761. name string
  1762. urlParams_ gensupport.URLParams
  1763. ifNoneMatch_ string
  1764. ctx_ context.Context
  1765. header_ http.Header
  1766. }
  1767. // Get: Retrieves a Membership.
  1768. func (r *GroupsMembershipsService) Get(name string) *GroupsMembershipsGetCall {
  1769. c := &GroupsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1770. c.name = name
  1771. return c
  1772. }
  1773. // Fields allows partial responses to be retrieved. See
  1774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1775. // for more information.
  1776. func (c *GroupsMembershipsGetCall) Fields(s ...googleapi.Field) *GroupsMembershipsGetCall {
  1777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1778. return c
  1779. }
  1780. // IfNoneMatch sets the optional parameter which makes the operation
  1781. // fail if the object's ETag matches the given value. This is useful for
  1782. // getting updates only after the object has changed since the last
  1783. // request. Use googleapi.IsNotModified to check whether the response
  1784. // error from Do is the result of In-None-Match.
  1785. func (c *GroupsMembershipsGetCall) IfNoneMatch(entityTag string) *GroupsMembershipsGetCall {
  1786. c.ifNoneMatch_ = entityTag
  1787. return c
  1788. }
  1789. // Context sets the context to be used in this call's Do method. Any
  1790. // pending HTTP request will be aborted if the provided context is
  1791. // canceled.
  1792. func (c *GroupsMembershipsGetCall) Context(ctx context.Context) *GroupsMembershipsGetCall {
  1793. c.ctx_ = ctx
  1794. return c
  1795. }
  1796. // Header returns an http.Header that can be modified by the caller to
  1797. // add HTTP headers to the request.
  1798. func (c *GroupsMembershipsGetCall) Header() http.Header {
  1799. if c.header_ == nil {
  1800. c.header_ = make(http.Header)
  1801. }
  1802. return c.header_
  1803. }
  1804. func (c *GroupsMembershipsGetCall) doRequest(alt string) (*http.Response, error) {
  1805. reqHeaders := make(http.Header)
  1806. for k, v := range c.header_ {
  1807. reqHeaders[k] = v
  1808. }
  1809. reqHeaders.Set("User-Agent", c.s.userAgent())
  1810. if c.ifNoneMatch_ != "" {
  1811. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1812. }
  1813. var body io.Reader = nil
  1814. c.urlParams_.Set("alt", alt)
  1815. c.urlParams_.Set("prettyPrint", "false")
  1816. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1817. urls += "?" + c.urlParams_.Encode()
  1818. req, err := http.NewRequest("GET", urls, body)
  1819. if err != nil {
  1820. return nil, err
  1821. }
  1822. req.Header = reqHeaders
  1823. googleapi.Expand(req.URL, map[string]string{
  1824. "name": c.name,
  1825. })
  1826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1827. }
  1828. // Do executes the "cloudidentity.groups.memberships.get" call.
  1829. // Exactly one of *Membership or error will be non-nil. Any non-2xx
  1830. // status code is an error. Response headers are in either
  1831. // *Membership.ServerResponse.Header or (if a response was returned at
  1832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1833. // to check whether the returned error was because
  1834. // http.StatusNotModified was returned.
  1835. func (c *GroupsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) {
  1836. gensupport.SetOptions(c.urlParams_, opts...)
  1837. res, err := c.doRequest("json")
  1838. if res != nil && res.StatusCode == http.StatusNotModified {
  1839. if res.Body != nil {
  1840. res.Body.Close()
  1841. }
  1842. return nil, &googleapi.Error{
  1843. Code: res.StatusCode,
  1844. Header: res.Header,
  1845. }
  1846. }
  1847. if err != nil {
  1848. return nil, err
  1849. }
  1850. defer googleapi.CloseBody(res)
  1851. if err := googleapi.CheckResponse(res); err != nil {
  1852. return nil, err
  1853. }
  1854. ret := &Membership{
  1855. ServerResponse: googleapi.ServerResponse{
  1856. Header: res.Header,
  1857. HTTPStatusCode: res.StatusCode,
  1858. },
  1859. }
  1860. target := &ret
  1861. if err := gensupport.DecodeResponse(target, res); err != nil {
  1862. return nil, err
  1863. }
  1864. return ret, nil
  1865. // {
  1866. // "description": "Retrieves a Membership.",
  1867. // "flatPath": "v1beta1/groups/{groupsId}/memberships/{membershipsId}",
  1868. // "httpMethod": "GET",
  1869. // "id": "cloudidentity.groups.memberships.get",
  1870. // "parameterOrder": [
  1871. // "name"
  1872. // ],
  1873. // "parameters": {
  1874. // "name": {
  1875. // "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.",
  1876. // "location": "path",
  1877. // "pattern": "^groups/[^/]+/memberships/[^/]+$",
  1878. // "required": true,
  1879. // "type": "string"
  1880. // }
  1881. // },
  1882. // "path": "v1beta1/{+name}",
  1883. // "response": {
  1884. // "$ref": "Membership"
  1885. // },
  1886. // "scopes": [
  1887. // "https://www.googleapis.com/auth/cloud-identity.groups",
  1888. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  1889. // ]
  1890. // }
  1891. }
  1892. // method id "cloudidentity.groups.memberships.list":
  1893. type GroupsMembershipsListCall struct {
  1894. s *Service
  1895. parent string
  1896. urlParams_ gensupport.URLParams
  1897. ifNoneMatch_ string
  1898. ctx_ context.Context
  1899. header_ http.Header
  1900. }
  1901. // List: List Memberships within a Group.
  1902. func (r *GroupsMembershipsService) List(parent string) *GroupsMembershipsListCall {
  1903. c := &GroupsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1904. c.parent = parent
  1905. return c
  1906. }
  1907. // PageSize sets the optional parameter "pageSize": The default page
  1908. // size is 200 (max 1000) for the BASIC view, and 50
  1909. // (max 500) for the FULL view.
  1910. func (c *GroupsMembershipsListCall) PageSize(pageSize int64) *GroupsMembershipsListCall {
  1911. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1912. return c
  1913. }
  1914. // PageToken sets the optional parameter "pageToken": The
  1915. // next_page_token value returned from a previous list request, if any
  1916. func (c *GroupsMembershipsListCall) PageToken(pageToken string) *GroupsMembershipsListCall {
  1917. c.urlParams_.Set("pageToken", pageToken)
  1918. return c
  1919. }
  1920. // View sets the optional parameter "view": Membership resource view to
  1921. // be returned. Defaults to MembershipView.BASIC.
  1922. //
  1923. // Possible values:
  1924. // "BASIC"
  1925. // "FULL"
  1926. func (c *GroupsMembershipsListCall) View(view string) *GroupsMembershipsListCall {
  1927. c.urlParams_.Set("view", view)
  1928. return c
  1929. }
  1930. // Fields allows partial responses to be retrieved. See
  1931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1932. // for more information.
  1933. func (c *GroupsMembershipsListCall) Fields(s ...googleapi.Field) *GroupsMembershipsListCall {
  1934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1935. return c
  1936. }
  1937. // IfNoneMatch sets the optional parameter which makes the operation
  1938. // fail if the object's ETag matches the given value. This is useful for
  1939. // getting updates only after the object has changed since the last
  1940. // request. Use googleapi.IsNotModified to check whether the response
  1941. // error from Do is the result of In-None-Match.
  1942. func (c *GroupsMembershipsListCall) IfNoneMatch(entityTag string) *GroupsMembershipsListCall {
  1943. c.ifNoneMatch_ = entityTag
  1944. return c
  1945. }
  1946. // Context sets the context to be used in this call's Do method. Any
  1947. // pending HTTP request will be aborted if the provided context is
  1948. // canceled.
  1949. func (c *GroupsMembershipsListCall) Context(ctx context.Context) *GroupsMembershipsListCall {
  1950. c.ctx_ = ctx
  1951. return c
  1952. }
  1953. // Header returns an http.Header that can be modified by the caller to
  1954. // add HTTP headers to the request.
  1955. func (c *GroupsMembershipsListCall) Header() http.Header {
  1956. if c.header_ == nil {
  1957. c.header_ = make(http.Header)
  1958. }
  1959. return c.header_
  1960. }
  1961. func (c *GroupsMembershipsListCall) doRequest(alt string) (*http.Response, error) {
  1962. reqHeaders := make(http.Header)
  1963. for k, v := range c.header_ {
  1964. reqHeaders[k] = v
  1965. }
  1966. reqHeaders.Set("User-Agent", c.s.userAgent())
  1967. if c.ifNoneMatch_ != "" {
  1968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1969. }
  1970. var body io.Reader = nil
  1971. c.urlParams_.Set("alt", alt)
  1972. c.urlParams_.Set("prettyPrint", "false")
  1973. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships")
  1974. urls += "?" + c.urlParams_.Encode()
  1975. req, err := http.NewRequest("GET", urls, body)
  1976. if err != nil {
  1977. return nil, err
  1978. }
  1979. req.Header = reqHeaders
  1980. googleapi.Expand(req.URL, map[string]string{
  1981. "parent": c.parent,
  1982. })
  1983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1984. }
  1985. // Do executes the "cloudidentity.groups.memberships.list" call.
  1986. // Exactly one of *ListMembershipsResponse or error will be non-nil. Any
  1987. // non-2xx status code is an error. Response headers are in either
  1988. // *ListMembershipsResponse.ServerResponse.Header or (if a response was
  1989. // returned at all) in error.(*googleapi.Error).Header. Use
  1990. // googleapi.IsNotModified to check whether the returned error was
  1991. // because http.StatusNotModified was returned.
  1992. func (c *GroupsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) {
  1993. gensupport.SetOptions(c.urlParams_, opts...)
  1994. res, err := c.doRequest("json")
  1995. if res != nil && res.StatusCode == http.StatusNotModified {
  1996. if res.Body != nil {
  1997. res.Body.Close()
  1998. }
  1999. return nil, &googleapi.Error{
  2000. Code: res.StatusCode,
  2001. Header: res.Header,
  2002. }
  2003. }
  2004. if err != nil {
  2005. return nil, err
  2006. }
  2007. defer googleapi.CloseBody(res)
  2008. if err := googleapi.CheckResponse(res); err != nil {
  2009. return nil, err
  2010. }
  2011. ret := &ListMembershipsResponse{
  2012. ServerResponse: googleapi.ServerResponse{
  2013. Header: res.Header,
  2014. HTTPStatusCode: res.StatusCode,
  2015. },
  2016. }
  2017. target := &ret
  2018. if err := gensupport.DecodeResponse(target, res); err != nil {
  2019. return nil, err
  2020. }
  2021. return ret, nil
  2022. // {
  2023. // "description": "List Memberships within a Group.",
  2024. // "flatPath": "v1beta1/groups/{groupsId}/memberships",
  2025. // "httpMethod": "GET",
  2026. // "id": "cloudidentity.groups.memberships.list",
  2027. // "parameterOrder": [
  2028. // "parent"
  2029. // ],
  2030. // "parameters": {
  2031. // "pageSize": {
  2032. // "description": "The default page size is 200 (max 1000) for the BASIC view, and 50\n(max 500) for the FULL view.",
  2033. // "format": "int32",
  2034. // "location": "query",
  2035. // "type": "integer"
  2036. // },
  2037. // "pageToken": {
  2038. // "description": "The next_page_token value returned from a previous list request, if any",
  2039. // "location": "query",
  2040. // "type": "string"
  2041. // },
  2042. // "parent": {
  2043. // "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.",
  2044. // "location": "path",
  2045. // "pattern": "^groups/[^/]+$",
  2046. // "required": true,
  2047. // "type": "string"
  2048. // },
  2049. // "view": {
  2050. // "description": "Membership resource view to be returned. Defaults to MembershipView.BASIC.",
  2051. // "enum": [
  2052. // "BASIC",
  2053. // "FULL"
  2054. // ],
  2055. // "location": "query",
  2056. // "type": "string"
  2057. // }
  2058. // },
  2059. // "path": "v1beta1/{+parent}/memberships",
  2060. // "response": {
  2061. // "$ref": "ListMembershipsResponse"
  2062. // },
  2063. // "scopes": [
  2064. // "https://www.googleapis.com/auth/cloud-identity.groups",
  2065. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  2066. // ]
  2067. // }
  2068. }
  2069. // Pages invokes f for each page of results.
  2070. // A non-nil error returned from f will halt the iteration.
  2071. // The provided context supersedes any context provided to the Context method.
  2072. func (c *GroupsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error {
  2073. c.ctx_ = ctx
  2074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2075. for {
  2076. x, err := c.Do()
  2077. if err != nil {
  2078. return err
  2079. }
  2080. if err := f(x); err != nil {
  2081. return err
  2082. }
  2083. if x.NextPageToken == "" {
  2084. return nil
  2085. }
  2086. c.PageToken(x.NextPageToken)
  2087. }
  2088. }
  2089. // method id "cloudidentity.groups.memberships.lookup":
  2090. type GroupsMembershipsLookupCall struct {
  2091. s *Service
  2092. parent string
  2093. urlParams_ gensupport.URLParams
  2094. ifNoneMatch_ string
  2095. ctx_ context.Context
  2096. header_ http.Header
  2097. }
  2098. // Lookup: Looks up
  2099. // [resource
  2100. // name](https://cloud.google.com/apis/design/resource_names) of a
  2101. // Membership
  2102. // within a Group by member's EntityKey.
  2103. func (r *GroupsMembershipsService) Lookup(parent string) *GroupsMembershipsLookupCall {
  2104. c := &GroupsMembershipsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2105. c.parent = parent
  2106. return c
  2107. }
  2108. // MemberKeyId sets the optional parameter "memberKey.id": The id of the
  2109. // entity within the given namespace. The id must be unique
  2110. // within its namespace.
  2111. func (c *GroupsMembershipsLookupCall) MemberKeyId(memberKeyId string) *GroupsMembershipsLookupCall {
  2112. c.urlParams_.Set("memberKey.id", memberKeyId)
  2113. return c
  2114. }
  2115. // MemberKeyNamespace sets the optional parameter "memberKey.namespace":
  2116. // Namespaces provide isolation for ids, i.e an id only needs to be
  2117. // unique
  2118. // within its namespace.
  2119. //
  2120. // Namespaces are currently only created as part of IdentitySource
  2121. // creation
  2122. // from Admin Console. A namespace
  2123. // "identitysources/{identity_source_id}" is
  2124. // created corresponding to every Identity Source `identity_source_id`.
  2125. func (c *GroupsMembershipsLookupCall) MemberKeyNamespace(memberKeyNamespace string) *GroupsMembershipsLookupCall {
  2126. c.urlParams_.Set("memberKey.namespace", memberKeyNamespace)
  2127. return c
  2128. }
  2129. // Fields allows partial responses to be retrieved. See
  2130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2131. // for more information.
  2132. func (c *GroupsMembershipsLookupCall) Fields(s ...googleapi.Field) *GroupsMembershipsLookupCall {
  2133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2134. return c
  2135. }
  2136. // IfNoneMatch sets the optional parameter which makes the operation
  2137. // fail if the object's ETag matches the given value. This is useful for
  2138. // getting updates only after the object has changed since the last
  2139. // request. Use googleapi.IsNotModified to check whether the response
  2140. // error from Do is the result of In-None-Match.
  2141. func (c *GroupsMembershipsLookupCall) IfNoneMatch(entityTag string) *GroupsMembershipsLookupCall {
  2142. c.ifNoneMatch_ = entityTag
  2143. return c
  2144. }
  2145. // Context sets the context to be used in this call's Do method. Any
  2146. // pending HTTP request will be aborted if the provided context is
  2147. // canceled.
  2148. func (c *GroupsMembershipsLookupCall) Context(ctx context.Context) *GroupsMembershipsLookupCall {
  2149. c.ctx_ = ctx
  2150. return c
  2151. }
  2152. // Header returns an http.Header that can be modified by the caller to
  2153. // add HTTP headers to the request.
  2154. func (c *GroupsMembershipsLookupCall) Header() http.Header {
  2155. if c.header_ == nil {
  2156. c.header_ = make(http.Header)
  2157. }
  2158. return c.header_
  2159. }
  2160. func (c *GroupsMembershipsLookupCall) doRequest(alt string) (*http.Response, error) {
  2161. reqHeaders := make(http.Header)
  2162. for k, v := range c.header_ {
  2163. reqHeaders[k] = v
  2164. }
  2165. reqHeaders.Set("User-Agent", c.s.userAgent())
  2166. if c.ifNoneMatch_ != "" {
  2167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2168. }
  2169. var body io.Reader = nil
  2170. c.urlParams_.Set("alt", alt)
  2171. c.urlParams_.Set("prettyPrint", "false")
  2172. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:lookup")
  2173. urls += "?" + c.urlParams_.Encode()
  2174. req, err := http.NewRequest("GET", urls, body)
  2175. if err != nil {
  2176. return nil, err
  2177. }
  2178. req.Header = reqHeaders
  2179. googleapi.Expand(req.URL, map[string]string{
  2180. "parent": c.parent,
  2181. })
  2182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2183. }
  2184. // Do executes the "cloudidentity.groups.memberships.lookup" call.
  2185. // Exactly one of *LookupMembershipNameResponse or error will be
  2186. // non-nil. Any non-2xx status code is an error. Response headers are in
  2187. // either *LookupMembershipNameResponse.ServerResponse.Header or (if a
  2188. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2189. // googleapi.IsNotModified to check whether the returned error was
  2190. // because http.StatusNotModified was returned.
  2191. func (c *GroupsMembershipsLookupCall) Do(opts ...googleapi.CallOption) (*LookupMembershipNameResponse, error) {
  2192. gensupport.SetOptions(c.urlParams_, opts...)
  2193. res, err := c.doRequest("json")
  2194. if res != nil && res.StatusCode == http.StatusNotModified {
  2195. if res.Body != nil {
  2196. res.Body.Close()
  2197. }
  2198. return nil, &googleapi.Error{
  2199. Code: res.StatusCode,
  2200. Header: res.Header,
  2201. }
  2202. }
  2203. if err != nil {
  2204. return nil, err
  2205. }
  2206. defer googleapi.CloseBody(res)
  2207. if err := googleapi.CheckResponse(res); err != nil {
  2208. return nil, err
  2209. }
  2210. ret := &LookupMembershipNameResponse{
  2211. ServerResponse: googleapi.ServerResponse{
  2212. Header: res.Header,
  2213. HTTPStatusCode: res.StatusCode,
  2214. },
  2215. }
  2216. target := &ret
  2217. if err := gensupport.DecodeResponse(target, res); err != nil {
  2218. return nil, err
  2219. }
  2220. return ret, nil
  2221. // {
  2222. // "description": "Looks up [resource\nname](https://cloud.google.com/apis/design/resource_names) of a Membership\nwithin a Group by member's EntityKey.",
  2223. // "flatPath": "v1beta1/groups/{groupsId}/memberships:lookup",
  2224. // "httpMethod": "GET",
  2225. // "id": "cloudidentity.groups.memberships.lookup",
  2226. // "parameterOrder": [
  2227. // "parent"
  2228. // ],
  2229. // "parameters": {
  2230. // "memberKey.id": {
  2231. // "description": "The id of the entity within the given namespace. The id must be unique\nwithin its namespace.",
  2232. // "location": "query",
  2233. // "type": "string"
  2234. // },
  2235. // "memberKey.namespace": {
  2236. // "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`.",
  2237. // "location": "query",
  2238. // "type": "string"
  2239. // },
  2240. // "parent": {
  2241. // "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.",
  2242. // "location": "path",
  2243. // "pattern": "^groups/[^/]+$",
  2244. // "required": true,
  2245. // "type": "string"
  2246. // }
  2247. // },
  2248. // "path": "v1beta1/{+parent}/memberships:lookup",
  2249. // "response": {
  2250. // "$ref": "LookupMembershipNameResponse"
  2251. // },
  2252. // "scopes": [
  2253. // "https://www.googleapis.com/auth/cloud-identity.groups",
  2254. // "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
  2255. // ]
  2256. // }
  2257. }