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.
 
 
 

5201 lines
187 KiB

  1. // Package clouduseraccounts provides access to the Cloud User Accounts API.
  2. //
  3. // See https://cloud.google.com/compute/docs/access/user-accounts/api/latest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/clouduseraccounts/vm_alpha"
  8. // ...
  9. // clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient)
  10. package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/vm_alpha"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "clouduseraccounts:vm_alpha"
  41. const apiName = "clouduseraccounts"
  42. const apiVersion = "vm_alpha"
  43. const basePath = "https://www.googleapis.com/clouduseraccounts/vm_alpha/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View your data across Google Cloud Platform services
  49. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  50. // Manage your Google Cloud User Accounts
  51. CloudUseraccountsScope = "https://www.googleapis.com/auth/cloud.useraccounts"
  52. // View your Google Cloud User Accounts
  53. CloudUseraccountsReadonlyScope = "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  54. )
  55. func New(client *http.Client) (*Service, error) {
  56. if client == nil {
  57. return nil, errors.New("client is nil")
  58. }
  59. s := &Service{client: client, BasePath: basePath}
  60. s.GlobalAccountsOperations = NewGlobalAccountsOperationsService(s)
  61. s.Groups = NewGroupsService(s)
  62. s.Linux = NewLinuxService(s)
  63. s.Users = NewUsersService(s)
  64. return s, nil
  65. }
  66. type Service struct {
  67. client *http.Client
  68. BasePath string // API endpoint base URL
  69. UserAgent string // optional additional User-Agent fragment
  70. GlobalAccountsOperations *GlobalAccountsOperationsService
  71. Groups *GroupsService
  72. Linux *LinuxService
  73. Users *UsersService
  74. }
  75. func (s *Service) userAgent() string {
  76. if s.UserAgent == "" {
  77. return googleapi.UserAgent
  78. }
  79. return googleapi.UserAgent + " " + s.UserAgent
  80. }
  81. func NewGlobalAccountsOperationsService(s *Service) *GlobalAccountsOperationsService {
  82. rs := &GlobalAccountsOperationsService{s: s}
  83. return rs
  84. }
  85. type GlobalAccountsOperationsService struct {
  86. s *Service
  87. }
  88. func NewGroupsService(s *Service) *GroupsService {
  89. rs := &GroupsService{s: s}
  90. return rs
  91. }
  92. type GroupsService struct {
  93. s *Service
  94. }
  95. func NewLinuxService(s *Service) *LinuxService {
  96. rs := &LinuxService{s: s}
  97. return rs
  98. }
  99. type LinuxService struct {
  100. s *Service
  101. }
  102. func NewUsersService(s *Service) *UsersService {
  103. rs := &UsersService{s: s}
  104. return rs
  105. }
  106. type UsersService struct {
  107. s *Service
  108. }
  109. // AuditConfig: Enables "data access" audit logging for a service and
  110. // specifies a list of members that are log-exempted.
  111. type AuditConfig struct {
  112. // ExemptedMembers: Specifies the identities that are exempted from
  113. // "data access" audit logging for the `service` specified above.
  114. // Follows the same format of Binding.members.
  115. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  116. // Service: Specifies a service that will be enabled for "data access"
  117. // audit logging. For example, `resourcemanager`, `storage`, `compute`.
  118. // `allServices` is a special value that covers all services.
  119. Service string `json:"service,omitempty"`
  120. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  121. // unconditionally include in API requests. By default, fields with
  122. // empty values are omitted from API requests. However, any non-pointer,
  123. // non-interface field appearing in ForceSendFields will be sent to the
  124. // server regardless of whether the field is empty or not. This may be
  125. // used to include empty fields in Patch requests.
  126. ForceSendFields []string `json:"-"`
  127. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  128. // include in API requests with the JSON null value. By default, fields
  129. // with empty values are omitted from API requests. However, any field
  130. // with an empty value appearing in NullFields will be sent to the
  131. // server as null. It is an error if a field in this list has a
  132. // non-empty value. This may be used to include null fields in Patch
  133. // requests.
  134. NullFields []string `json:"-"`
  135. }
  136. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  137. type NoMethod AuditConfig
  138. raw := NoMethod(*s)
  139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  140. }
  141. // AuthorizedKeysView: A list of authorized public keys for a user
  142. // account.
  143. type AuthorizedKeysView struct {
  144. // Keys: [Output Only] The list of authorized public keys in SSH format.
  145. Keys []string `json:"keys,omitempty"`
  146. // Sudoer: [Output Only] Whether the user has the ability to elevate on
  147. // the instance that requested the authorized keys.
  148. Sudoer bool `json:"sudoer,omitempty"`
  149. // ForceSendFields is a list of field names (e.g. "Keys") to
  150. // unconditionally include in API requests. By default, fields with
  151. // empty values are omitted from API requests. However, any non-pointer,
  152. // non-interface field appearing in ForceSendFields will be sent to the
  153. // server regardless of whether the field is empty or not. This may be
  154. // used to include empty fields in Patch requests.
  155. ForceSendFields []string `json:"-"`
  156. // NullFields is a list of field names (e.g. "Keys") to include in API
  157. // requests with the JSON null value. By default, fields with empty
  158. // values are omitted from API requests. However, any field with an
  159. // empty value appearing in NullFields will be sent to the server as
  160. // null. It is an error if a field in this list has a non-empty value.
  161. // This may be used to include null fields in Patch requests.
  162. NullFields []string `json:"-"`
  163. }
  164. func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) {
  165. type NoMethod AuthorizedKeysView
  166. raw := NoMethod(*s)
  167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  168. }
  169. // Binding: Associates `members` with a `role`.
  170. type Binding struct {
  171. // Members: Specifies the identities requesting access for a Cloud
  172. // Platform resource. `members` can have the following values:
  173. //
  174. // * `allUsers`: A special identifier that represents anyone who is on
  175. // the internet; with or without a Google account.
  176. //
  177. // * `allAuthenticatedUsers`: A special identifier that represents
  178. // anyone who is authenticated with a Google account or a service
  179. // account.
  180. //
  181. // * `user:{emailid}`: An email address that represents a specific
  182. // Google account. For example, `alice@gmail.com` or
  183. // `joe@example.com`.
  184. //
  185. // * `serviceAccount:{emailid}`: An email address that represents a
  186. // service account. For example,
  187. // `my-other-app@appspot.gserviceaccount.com`.
  188. //
  189. // * `group:{emailid}`: An email address that represents a Google group.
  190. // For example, `admins@example.com`.
  191. //
  192. // * `domain:{domain}`: A Google Apps domain name that represents all
  193. // the users of that domain. For example, `google.com` or `example.com`.
  194. Members []string `json:"members,omitempty"`
  195. // Role: Role that is assigned to `members`. For example,
  196. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  197. Role string `json:"role,omitempty"`
  198. // ForceSendFields is a list of field names (e.g. "Members") to
  199. // unconditionally include in API requests. By default, fields with
  200. // empty values are omitted from API requests. However, any non-pointer,
  201. // non-interface field appearing in ForceSendFields will be sent to the
  202. // server regardless of whether the field is empty or not. This may be
  203. // used to include empty fields in Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. // NullFields is a list of field names (e.g. "Members") to include in
  206. // API requests with the JSON null value. By default, fields with empty
  207. // values are omitted from API requests. However, any field with an
  208. // empty value appearing in NullFields will be sent to the server as
  209. // null. It is an error if a field in this list has a non-empty value.
  210. // This may be used to include null fields in Patch requests.
  211. NullFields []string `json:"-"`
  212. }
  213. func (s *Binding) MarshalJSON() ([]byte, error) {
  214. type NoMethod Binding
  215. raw := NoMethod(*s)
  216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  217. }
  218. // Condition: A condition to be met.
  219. type Condition struct {
  220. // Iam: Trusted attributes supplied by the IAM system.
  221. //
  222. // Possible values:
  223. // "ATTRIBUTION"
  224. // "AUTHORITY"
  225. // "NO_ATTR"
  226. Iam string `json:"iam,omitempty"`
  227. // Op: An operator to apply the subject with.
  228. //
  229. // Possible values:
  230. // "DISCHARGED"
  231. // "EQUALS"
  232. // "IN"
  233. // "NOT_EQUALS"
  234. // "NOT_IN"
  235. // "NO_OP"
  236. Op string `json:"op,omitempty"`
  237. // Svc: Trusted attributes discharged by the service.
  238. Svc string `json:"svc,omitempty"`
  239. // Sys: Trusted attributes supplied by any service that owns resources
  240. // and uses the IAM system for access control.
  241. //
  242. // Possible values:
  243. // "IP"
  244. // "NAME"
  245. // "NO_ATTR"
  246. // "REGION"
  247. // "SERVICE"
  248. Sys string `json:"sys,omitempty"`
  249. // Value: The object of the condition. Exactly one of these must be set.
  250. Value string `json:"value,omitempty"`
  251. // Values: The objects of the condition. This is mutually exclusive with
  252. // 'value'.
  253. Values []string `json:"values,omitempty"`
  254. // ForceSendFields is a list of field names (e.g. "Iam") to
  255. // unconditionally include in API requests. By default, fields with
  256. // empty values are omitted from API requests. However, any non-pointer,
  257. // non-interface field appearing in ForceSendFields will be sent to the
  258. // server regardless of whether the field is empty or not. This may be
  259. // used to include empty fields in Patch requests.
  260. ForceSendFields []string `json:"-"`
  261. // NullFields is a list of field names (e.g. "Iam") to include in API
  262. // requests with the JSON null value. By default, fields with empty
  263. // values are omitted from API requests. However, any field with an
  264. // empty value appearing in NullFields will be sent to the server as
  265. // null. It is an error if a field in this list has a non-empty value.
  266. // This may be used to include null fields in Patch requests.
  267. NullFields []string `json:"-"`
  268. }
  269. func (s *Condition) MarshalJSON() ([]byte, error) {
  270. type NoMethod Condition
  271. raw := NoMethod(*s)
  272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  273. }
  274. // Group: A Group resource.
  275. type Group struct {
  276. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  277. // format.
  278. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  279. // Description: An optional textual description of the resource;
  280. // provided by the client when the resource is created.
  281. Description string `json:"description,omitempty"`
  282. // Id: [Output Only] Unique identifier for the resource; defined by the
  283. // server.
  284. Id uint64 `json:"id,omitempty,string"`
  285. // Kind: [Output Only] Type of the resource. Always
  286. // clouduseraccounts#group for groups.
  287. Kind string `json:"kind,omitempty"`
  288. // Members: [Output Only] A list of URLs to User resources who belong to
  289. // the group. Users may only be members of groups in the same project.
  290. Members []string `json:"members,omitempty"`
  291. // Name: Name of the resource; provided by the client when the resource
  292. // is created.
  293. Name string `json:"name,omitempty"`
  294. // SelfLink: [Output Only] Server defined URL for the resource.
  295. SelfLink string `json:"selfLink,omitempty"`
  296. // ServerResponse contains the HTTP response code and headers from the
  297. // server.
  298. googleapi.ServerResponse `json:"-"`
  299. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  300. // to unconditionally include in API requests. By default, fields with
  301. // empty values are omitted from API requests. However, any non-pointer,
  302. // non-interface field appearing in ForceSendFields will be sent to the
  303. // server regardless of whether the field is empty or not. This may be
  304. // used to include empty fields in Patch requests.
  305. ForceSendFields []string `json:"-"`
  306. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  307. // include in API requests with the JSON null value. By default, fields
  308. // with empty values are omitted from API requests. However, any field
  309. // with an empty value appearing in NullFields will be sent to the
  310. // server as null. It is an error if a field in this list has a
  311. // non-empty value. This may be used to include null fields in Patch
  312. // requests.
  313. NullFields []string `json:"-"`
  314. }
  315. func (s *Group) MarshalJSON() ([]byte, error) {
  316. type NoMethod Group
  317. raw := NoMethod(*s)
  318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  319. }
  320. type GroupList struct {
  321. // Id: [Output Only] Unique identifier for the resource; defined by the
  322. // server.
  323. Id string `json:"id,omitempty"`
  324. // Items: [Output Only] A list of Group resources.
  325. Items []*Group `json:"items,omitempty"`
  326. // Kind: [Output Only] Type of resource. Always
  327. // clouduseraccounts#groupList for lists of groups.
  328. Kind string `json:"kind,omitempty"`
  329. // NextPageToken: [Output Only] A token used to continue a truncated
  330. // list request.
  331. NextPageToken string `json:"nextPageToken,omitempty"`
  332. // SelfLink: [Output Only] Server defined URL for this resource.
  333. SelfLink string `json:"selfLink,omitempty"`
  334. // ServerResponse contains the HTTP response code and headers from the
  335. // server.
  336. googleapi.ServerResponse `json:"-"`
  337. // ForceSendFields is a list of field names (e.g. "Id") to
  338. // unconditionally include in API requests. By default, fields with
  339. // empty values are omitted from API requests. However, any non-pointer,
  340. // non-interface field appearing in ForceSendFields will be sent to the
  341. // server regardless of whether the field is empty or not. This may be
  342. // used to include empty fields in Patch requests.
  343. ForceSendFields []string `json:"-"`
  344. // NullFields is a list of field names (e.g. "Id") to include in API
  345. // requests with the JSON null value. By default, fields with empty
  346. // values are omitted from API requests. However, any field with an
  347. // empty value appearing in NullFields will be sent to the server as
  348. // null. It is an error if a field in this list has a non-empty value.
  349. // This may be used to include null fields in Patch requests.
  350. NullFields []string `json:"-"`
  351. }
  352. func (s *GroupList) MarshalJSON() ([]byte, error) {
  353. type NoMethod GroupList
  354. raw := NoMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  356. }
  357. type GroupsAddMemberRequest struct {
  358. // Users: Fully-qualified URLs of the User resources to add.
  359. Users []string `json:"users,omitempty"`
  360. // ForceSendFields is a list of field names (e.g. "Users") to
  361. // unconditionally include in API requests. By default, fields with
  362. // empty values are omitted from API requests. However, any non-pointer,
  363. // non-interface field appearing in ForceSendFields will be sent to the
  364. // server regardless of whether the field is empty or not. This may be
  365. // used to include empty fields in Patch requests.
  366. ForceSendFields []string `json:"-"`
  367. // NullFields is a list of field names (e.g. "Users") to include in API
  368. // requests with the JSON null value. By default, fields with empty
  369. // values are omitted from API requests. However, any field with an
  370. // empty value appearing in NullFields will be sent to the server as
  371. // null. It is an error if a field in this list has a non-empty value.
  372. // This may be used to include null fields in Patch requests.
  373. NullFields []string `json:"-"`
  374. }
  375. func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) {
  376. type NoMethod GroupsAddMemberRequest
  377. raw := NoMethod(*s)
  378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  379. }
  380. type GroupsRemoveMemberRequest struct {
  381. // Users: Fully-qualified URLs of the User resources to remove.
  382. Users []string `json:"users,omitempty"`
  383. // ForceSendFields is a list of field names (e.g. "Users") 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. "Users") to include in API
  391. // 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 *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) {
  399. type NoMethod GroupsRemoveMemberRequest
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // LinuxAccountViews: A list of all Linux accounts for this project.
  404. // This API is only used by Compute Engine virtual machines to get
  405. // information about user accounts for a project or instance. Linux
  406. // resources are read-only views into users and groups managed by the
  407. // Compute Engine Accounts API.
  408. type LinuxAccountViews struct {
  409. // GroupViews: [Output Only] A list of all groups within a project.
  410. GroupViews []*LinuxGroupView `json:"groupViews,omitempty"`
  411. // Kind: [Output Only] Type of the resource. Always
  412. // clouduseraccounts#linuxAccountViews for Linux resources.
  413. Kind string `json:"kind,omitempty"`
  414. // UserViews: [Output Only] A list of all users within a project.
  415. UserViews []*LinuxUserView `json:"userViews,omitempty"`
  416. // ForceSendFields is a list of field names (e.g. "GroupViews") to
  417. // unconditionally include in API requests. By default, fields with
  418. // empty values are omitted from API requests. However, any non-pointer,
  419. // non-interface field appearing in ForceSendFields will be sent to the
  420. // server regardless of whether the field is empty or not. This may be
  421. // used to include empty fields in Patch requests.
  422. ForceSendFields []string `json:"-"`
  423. // NullFields is a list of field names (e.g. "GroupViews") to include in
  424. // API requests with the JSON null value. By default, fields with empty
  425. // values are omitted from API requests. However, any field with an
  426. // empty value appearing in NullFields will be sent to the server as
  427. // null. It is an error if a field in this list has a non-empty value.
  428. // This may be used to include null fields in Patch requests.
  429. NullFields []string `json:"-"`
  430. }
  431. func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) {
  432. type NoMethod LinuxAccountViews
  433. raw := NoMethod(*s)
  434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  435. }
  436. type LinuxGetAuthorizedKeysViewResponse struct {
  437. // Resource: [Output Only] A list of authorized public keys for a user.
  438. Resource *AuthorizedKeysView `json:"resource,omitempty"`
  439. // ServerResponse contains the HTTP response code and headers from the
  440. // server.
  441. googleapi.ServerResponse `json:"-"`
  442. // ForceSendFields is a list of field names (e.g. "Resource") to
  443. // unconditionally include in API requests. By default, fields with
  444. // empty values are omitted from API requests. However, any non-pointer,
  445. // non-interface field appearing in ForceSendFields will be sent to the
  446. // server regardless of whether the field is empty or not. This may be
  447. // used to include empty fields in Patch requests.
  448. ForceSendFields []string `json:"-"`
  449. // NullFields is a list of field names (e.g. "Resource") to include in
  450. // API requests with the JSON null value. By default, fields with empty
  451. // values are omitted from API requests. However, any field with an
  452. // empty value appearing in NullFields will be sent to the server as
  453. // null. It is an error if a field in this list has a non-empty value.
  454. // This may be used to include null fields in Patch requests.
  455. NullFields []string `json:"-"`
  456. }
  457. func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) {
  458. type NoMethod LinuxGetAuthorizedKeysViewResponse
  459. raw := NoMethod(*s)
  460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  461. }
  462. type LinuxGetLinuxAccountViewsResponse struct {
  463. // Resource: [Output Only] A list of authorized user accounts and
  464. // groups.
  465. Resource *LinuxAccountViews `json:"resource,omitempty"`
  466. // ServerResponse contains the HTTP response code and headers from the
  467. // server.
  468. googleapi.ServerResponse `json:"-"`
  469. // ForceSendFields is a list of field names (e.g. "Resource") to
  470. // unconditionally include in API requests. By default, fields with
  471. // empty values are omitted from API requests. However, any non-pointer,
  472. // non-interface field appearing in ForceSendFields will be sent to the
  473. // server regardless of whether the field is empty or not. This may be
  474. // used to include empty fields in Patch requests.
  475. ForceSendFields []string `json:"-"`
  476. // NullFields is a list of field names (e.g. "Resource") to include in
  477. // API requests with the JSON null value. By default, fields with empty
  478. // values are omitted from API requests. However, any field with an
  479. // empty value appearing in NullFields will be sent to the server as
  480. // null. It is an error if a field in this list has a non-empty value.
  481. // This may be used to include null fields in Patch requests.
  482. NullFields []string `json:"-"`
  483. }
  484. func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) {
  485. type NoMethod LinuxGetLinuxAccountViewsResponse
  486. raw := NoMethod(*s)
  487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  488. }
  489. // LinuxGroupView: A detailed view of a Linux group.
  490. type LinuxGroupView struct {
  491. // Gid: [Output Only] The Group ID.
  492. Gid int64 `json:"gid,omitempty"`
  493. // GroupName: [Output Only] Group name.
  494. GroupName string `json:"groupName,omitempty"`
  495. // Members: [Output Only] List of user accounts that belong to the
  496. // group.
  497. Members []string `json:"members,omitempty"`
  498. // ForceSendFields is a list of field names (e.g. "Gid") to
  499. // unconditionally include in API requests. By default, fields with
  500. // empty values are omitted from API requests. However, any non-pointer,
  501. // non-interface field appearing in ForceSendFields will be sent to the
  502. // server regardless of whether the field is empty or not. This may be
  503. // used to include empty fields in Patch requests.
  504. ForceSendFields []string `json:"-"`
  505. // NullFields is a list of field names (e.g. "Gid") to include in API
  506. // requests with the JSON null value. By default, fields with empty
  507. // values are omitted from API requests. However, any field with an
  508. // empty value appearing in NullFields will be sent to the server as
  509. // null. It is an error if a field in this list has a non-empty value.
  510. // This may be used to include null fields in Patch requests.
  511. NullFields []string `json:"-"`
  512. }
  513. func (s *LinuxGroupView) MarshalJSON() ([]byte, error) {
  514. type NoMethod LinuxGroupView
  515. raw := NoMethod(*s)
  516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  517. }
  518. // LinuxUserView: A detailed view of a Linux user account.
  519. type LinuxUserView struct {
  520. // Gecos: [Output Only] The GECOS (user information) entry for this
  521. // account.
  522. Gecos string `json:"gecos,omitempty"`
  523. // Gid: [Output Only] User's default group ID.
  524. Gid int64 `json:"gid,omitempty"`
  525. // HomeDirectory: [Output Only] The path to the home directory for this
  526. // account.
  527. HomeDirectory string `json:"homeDirectory,omitempty"`
  528. // Shell: [Output Only] The path to the login shell for this account.
  529. Shell string `json:"shell,omitempty"`
  530. // Uid: [Output Only] User ID.
  531. Uid int64 `json:"uid,omitempty"`
  532. // Username: [Output Only] The username of the account.
  533. Username string `json:"username,omitempty"`
  534. // ForceSendFields is a list of field names (e.g. "Gecos") to
  535. // unconditionally include in API requests. By default, fields with
  536. // empty values are omitted from API requests. However, any non-pointer,
  537. // non-interface field appearing in ForceSendFields will be sent to the
  538. // server regardless of whether the field is empty or not. This may be
  539. // used to include empty fields in Patch requests.
  540. ForceSendFields []string `json:"-"`
  541. // NullFields is a list of field names (e.g. "Gecos") to include in API
  542. // requests with the JSON null value. By default, fields with empty
  543. // values are omitted from API requests. However, any field with an
  544. // empty value appearing in NullFields will be sent to the server as
  545. // null. It is an error if a field in this list has a non-empty value.
  546. // This may be used to include null fields in Patch requests.
  547. NullFields []string `json:"-"`
  548. }
  549. func (s *LinuxUserView) MarshalJSON() ([]byte, error) {
  550. type NoMethod LinuxUserView
  551. raw := NoMethod(*s)
  552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  553. }
  554. // LogConfig: Specifies what kind of log the caller must write
  555. type LogConfig struct {
  556. // Counter: Counter options.
  557. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  558. // ForceSendFields is a list of field names (e.g. "Counter") to
  559. // unconditionally include in API requests. By default, fields with
  560. // empty values are omitted from API requests. However, any non-pointer,
  561. // non-interface field appearing in ForceSendFields will be sent to the
  562. // server regardless of whether the field is empty or not. This may be
  563. // used to include empty fields in Patch requests.
  564. ForceSendFields []string `json:"-"`
  565. // NullFields is a list of field names (e.g. "Counter") to include in
  566. // API requests with the JSON null value. By default, fields with empty
  567. // values are omitted from API requests. However, any field with an
  568. // empty value appearing in NullFields will be sent to the server as
  569. // null. It is an error if a field in this list has a non-empty value.
  570. // This may be used to include null fields in Patch requests.
  571. NullFields []string `json:"-"`
  572. }
  573. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  574. type NoMethod LogConfig
  575. raw := NoMethod(*s)
  576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  577. }
  578. // LogConfigCounterOptions: Options for counters
  579. type LogConfigCounterOptions struct {
  580. // Field: The field value to attribute.
  581. Field string `json:"field,omitempty"`
  582. // Metric: The metric to update.
  583. Metric string `json:"metric,omitempty"`
  584. // ForceSendFields is a list of field names (e.g. "Field") to
  585. // unconditionally include in API requests. By default, fields with
  586. // empty values are omitted from API requests. However, any non-pointer,
  587. // non-interface field appearing in ForceSendFields will be sent to the
  588. // server regardless of whether the field is empty or not. This may be
  589. // used to include empty fields in Patch requests.
  590. ForceSendFields []string `json:"-"`
  591. // NullFields is a list of field names (e.g. "Field") to include in API
  592. // requests with the JSON null value. By default, fields with empty
  593. // values are omitted from API requests. However, any field with an
  594. // empty value appearing in NullFields will be sent to the server as
  595. // null. It is an error if a field in this list has a non-empty value.
  596. // This may be used to include null fields in Patch requests.
  597. NullFields []string `json:"-"`
  598. }
  599. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  600. type NoMethod LogConfigCounterOptions
  601. raw := NoMethod(*s)
  602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  603. }
  604. // Operation: An Operation resource, used to manage asynchronous API
  605. // requests.
  606. type Operation struct {
  607. // ClientOperationId: [Output Only] Reserved for future use.
  608. ClientOperationId string `json:"clientOperationId,omitempty"`
  609. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  610. // format.
  611. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  612. // Description: [Output Only] A textual description of the operation,
  613. // which is set when the operation is created.
  614. Description string `json:"description,omitempty"`
  615. // EndTime: [Output Only] The time that this operation was completed.
  616. // This value is in RFC3339 text format.
  617. EndTime string `json:"endTime,omitempty"`
  618. // Error: [Output Only] If errors are generated during processing of the
  619. // operation, this field will be populated.
  620. Error *OperationError `json:"error,omitempty"`
  621. // HttpErrorMessage: [Output Only] If the operation fails, this field
  622. // contains the HTTP error message that was returned, such as NOT FOUND.
  623. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  624. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  625. // contains the HTTP error status code that was returned. For example, a
  626. // 404 means the resource was not found.
  627. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  628. // Id: [Output Only] The unique identifier for the resource. This
  629. // identifier is defined by the server.
  630. Id uint64 `json:"id,omitempty,string"`
  631. // InsertTime: [Output Only] The time that this operation was requested.
  632. // This value is in RFC3339 text format.
  633. InsertTime string `json:"insertTime,omitempty"`
  634. // Kind: [Output Only] Type of the resource. Always compute#operation
  635. // for Operation resources.
  636. Kind string `json:"kind,omitempty"`
  637. // Name: [Output Only] Name of the resource.
  638. Name string `json:"name,omitempty"`
  639. // OperationType: [Output Only] The type of operation, such as insert,
  640. // update, or delete, and so on.
  641. OperationType string `json:"operationType,omitempty"`
  642. // Progress: [Output Only] An optional progress indicator that ranges
  643. // from 0 to 100. There is no requirement that this be linear or support
  644. // any granularity of operations. This should not be used to guess when
  645. // the operation will be complete. This number should monotonically
  646. // increase as the operation progresses.
  647. Progress int64 `json:"progress,omitempty"`
  648. // Region: [Output Only] The URL of the region where the operation
  649. // resides. Only available when performing regional operations.
  650. Region string `json:"region,omitempty"`
  651. // SelfLink: [Output Only] Server-defined URL for the resource.
  652. SelfLink string `json:"selfLink,omitempty"`
  653. // StartTime: [Output Only] The time that this operation was started by
  654. // the server. This value is in RFC3339 text format.
  655. StartTime string `json:"startTime,omitempty"`
  656. // Status: [Output Only] The status of the operation, which can be one
  657. // of the following: PENDING, RUNNING, or DONE.
  658. //
  659. // Possible values:
  660. // "DONE"
  661. // "PENDING"
  662. // "RUNNING"
  663. Status string `json:"status,omitempty"`
  664. // StatusMessage: [Output Only] An optional textual description of the
  665. // current status of the operation.
  666. StatusMessage string `json:"statusMessage,omitempty"`
  667. // TargetId: [Output Only] The unique target ID, which identifies a
  668. // specific incarnation of the target resource.
  669. TargetId uint64 `json:"targetId,omitempty,string"`
  670. // TargetLink: [Output Only] The URL of the resource that the operation
  671. // modifies.
  672. TargetLink string `json:"targetLink,omitempty"`
  673. // User: [Output Only] User who requested the operation, for example:
  674. // user@example.com.
  675. User string `json:"user,omitempty"`
  676. // Warnings: [Output Only] If warning messages are generated during
  677. // processing of the operation, this field will be populated.
  678. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  679. // Zone: [Output Only] The URL of the zone where the operation resides.
  680. // Only available when performing per-zone operations.
  681. Zone string `json:"zone,omitempty"`
  682. // ServerResponse contains the HTTP response code and headers from the
  683. // server.
  684. googleapi.ServerResponse `json:"-"`
  685. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  686. // to unconditionally include in API requests. By default, fields with
  687. // empty values are omitted from API requests. However, any non-pointer,
  688. // non-interface field appearing in ForceSendFields will be sent to the
  689. // server regardless of whether the field is empty or not. This may be
  690. // used to include empty fields in Patch requests.
  691. ForceSendFields []string `json:"-"`
  692. // NullFields is a list of field names (e.g. "ClientOperationId") to
  693. // include in API requests with the JSON null value. By default, fields
  694. // with empty values are omitted from API requests. However, any field
  695. // with an empty value appearing in NullFields will be sent to the
  696. // server as null. It is an error if a field in this list has a
  697. // non-empty value. This may be used to include null fields in Patch
  698. // requests.
  699. NullFields []string `json:"-"`
  700. }
  701. func (s *Operation) MarshalJSON() ([]byte, error) {
  702. type NoMethod Operation
  703. raw := NoMethod(*s)
  704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  705. }
  706. // OperationError: [Output Only] If errors are generated during
  707. // processing of the operation, this field will be populated.
  708. type OperationError struct {
  709. // Errors: [Output Only] The array of errors encountered while
  710. // processing this operation.
  711. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  712. // ForceSendFields is a list of field names (e.g. "Errors") to
  713. // unconditionally include in API requests. By default, fields with
  714. // empty values are omitted from API requests. However, any non-pointer,
  715. // non-interface field appearing in ForceSendFields will be sent to the
  716. // server regardless of whether the field is empty or not. This may be
  717. // used to include empty fields in Patch requests.
  718. ForceSendFields []string `json:"-"`
  719. // NullFields is a list of field names (e.g. "Errors") to include in API
  720. // requests with the JSON null value. By default, fields with empty
  721. // values are omitted from API requests. However, any field with an
  722. // empty value appearing in NullFields will be sent to the server as
  723. // null. It is an error if a field in this list has a non-empty value.
  724. // This may be used to include null fields in Patch requests.
  725. NullFields []string `json:"-"`
  726. }
  727. func (s *OperationError) MarshalJSON() ([]byte, error) {
  728. type NoMethod OperationError
  729. raw := NoMethod(*s)
  730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  731. }
  732. type OperationErrorErrors struct {
  733. // Code: [Output Only] The error type identifier for this error.
  734. Code string `json:"code,omitempty"`
  735. // Location: [Output Only] Indicates the field in the request that
  736. // caused the error. This property is optional.
  737. Location string `json:"location,omitempty"`
  738. // Message: [Output Only] An optional, human-readable error message.
  739. Message string `json:"message,omitempty"`
  740. // ForceSendFields is a list of field names (e.g. "Code") to
  741. // unconditionally include in API requests. By default, fields with
  742. // empty values are omitted from API requests. However, any non-pointer,
  743. // non-interface field appearing in ForceSendFields will be sent to the
  744. // server regardless of whether the field is empty or not. This may be
  745. // used to include empty fields in Patch requests.
  746. ForceSendFields []string `json:"-"`
  747. // NullFields is a list of field names (e.g. "Code") to include in API
  748. // requests with the JSON null value. By default, fields with empty
  749. // values are omitted from API requests. However, any field with an
  750. // empty value appearing in NullFields will be sent to the server as
  751. // null. It is an error if a field in this list has a non-empty value.
  752. // This may be used to include null fields in Patch requests.
  753. NullFields []string `json:"-"`
  754. }
  755. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  756. type NoMethod OperationErrorErrors
  757. raw := NoMethod(*s)
  758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  759. }
  760. type OperationWarnings struct {
  761. // Code: [Output Only] A warning code, if applicable. For example,
  762. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  763. // the response.
  764. //
  765. // Possible values:
  766. // "CLEANUP_FAILED"
  767. // "DEPRECATED_RESOURCE_USED"
  768. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  769. // "INJECTED_KERNELS_DEPRECATED"
  770. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  771. // "NEXT_HOP_CANNOT_IP_FORWARD"
  772. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  773. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  774. // "NEXT_HOP_NOT_RUNNING"
  775. // "NOT_CRITICAL_ERROR"
  776. // "NO_RESULTS_ON_PAGE"
  777. // "REQUIRED_TOS_AGREEMENT"
  778. // "RESOURCE_NOT_DELETED"
  779. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  780. // "UNREACHABLE"
  781. Code string `json:"code,omitempty"`
  782. // Data: [Output Only] Metadata about this warning in key: value format.
  783. // For example:
  784. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  785. Data []*OperationWarningsData `json:"data,omitempty"`
  786. // Message: [Output Only] A human-readable description of the warning
  787. // code.
  788. Message string `json:"message,omitempty"`
  789. // ForceSendFields is a list of field names (e.g. "Code") to
  790. // unconditionally include in API requests. By default, fields with
  791. // empty values are omitted from API requests. However, any non-pointer,
  792. // non-interface field appearing in ForceSendFields will be sent to the
  793. // server regardless of whether the field is empty or not. This may be
  794. // used to include empty fields in Patch requests.
  795. ForceSendFields []string `json:"-"`
  796. // NullFields is a list of field names (e.g. "Code") to include in API
  797. // requests with the JSON null value. By default, fields with empty
  798. // values are omitted from API requests. However, any field with an
  799. // empty value appearing in NullFields will be sent to the server as
  800. // null. It is an error if a field in this list has a non-empty value.
  801. // This may be used to include null fields in Patch requests.
  802. NullFields []string `json:"-"`
  803. }
  804. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  805. type NoMethod OperationWarnings
  806. raw := NoMethod(*s)
  807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  808. }
  809. type OperationWarningsData struct {
  810. // Key: [Output Only] A key that provides more detail on the warning
  811. // being returned. For example, for warnings where there are no results
  812. // in a list request for a particular zone, this key might be scope and
  813. // the key value might be the zone name. Other examples might be a key
  814. // indicating a deprecated resource and a suggested replacement, or a
  815. // warning about invalid network settings (for example, if an instance
  816. // attempts to perform IP forwarding but is not enabled for IP
  817. // forwarding).
  818. Key string `json:"key,omitempty"`
  819. // Value: [Output Only] A warning data value corresponding to the key.
  820. Value string `json:"value,omitempty"`
  821. // ForceSendFields is a list of field names (e.g. "Key") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. // NullFields is a list of field names (e.g. "Key") to include in API
  829. // requests with the JSON null value. By default, fields with empty
  830. // values are omitted from API requests. However, any field with an
  831. // empty value appearing in NullFields will be sent to the server as
  832. // null. It is an error if a field in this list has a non-empty value.
  833. // This may be used to include null fields in Patch requests.
  834. NullFields []string `json:"-"`
  835. }
  836. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  837. type NoMethod OperationWarningsData
  838. raw := NoMethod(*s)
  839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  840. }
  841. // OperationList: Contains a list of Operation resources.
  842. type OperationList struct {
  843. // Id: [Output Only] The unique identifier for the resource. This
  844. // identifier is defined by the server.
  845. Id string `json:"id,omitempty"`
  846. // Items: [Output Only] A list of Operation resources.
  847. Items []*Operation `json:"items,omitempty"`
  848. // Kind: [Output Only] Type of resource. Always compute#operations for
  849. // Operations resource.
  850. Kind string `json:"kind,omitempty"`
  851. // NextPageToken: [Output Only] This token allows you to get the next
  852. // page of results for list requests. If the number of results is larger
  853. // than maxResults, use the nextPageToken as a value for the query
  854. // parameter pageToken in the next list request. Subsequent list
  855. // requests will have their own nextPageToken to continue paging through
  856. // the results.
  857. NextPageToken string `json:"nextPageToken,omitempty"`
  858. // SelfLink: [Output Only] Server-defined URL for this resource.
  859. SelfLink string `json:"selfLink,omitempty"`
  860. // ServerResponse contains the HTTP response code and headers from the
  861. // server.
  862. googleapi.ServerResponse `json:"-"`
  863. // ForceSendFields is a list of field names (e.g. "Id") to
  864. // unconditionally include in API requests. By default, fields with
  865. // empty values are omitted from API requests. However, any non-pointer,
  866. // non-interface field appearing in ForceSendFields will be sent to the
  867. // server regardless of whether the field is empty or not. This may be
  868. // used to include empty fields in Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. // NullFields is a list of field names (e.g. "Id") to include in API
  871. // requests with the JSON null value. By default, fields with empty
  872. // values are omitted from API requests. However, any field with an
  873. // empty value appearing in NullFields will be sent to the server as
  874. // null. It is an error if a field in this list has a non-empty value.
  875. // This may be used to include null fields in Patch requests.
  876. NullFields []string `json:"-"`
  877. }
  878. func (s *OperationList) MarshalJSON() ([]byte, error) {
  879. type NoMethod OperationList
  880. raw := NoMethod(*s)
  881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  882. }
  883. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  884. // used to specify access control policies for Cloud Platform
  885. // resources.
  886. //
  887. //
  888. //
  889. // A `Policy` consists of a list of `bindings`. A `Binding` binds a list
  890. // of `members` to a `role`, where the members can be user accounts,
  891. // Google groups, Google domains, and service accounts. A `role` is a
  892. // named list of permissions defined by IAM.
  893. //
  894. // **Example**
  895. //
  896. // { "bindings": [ { "role": "roles/owner", "members": [
  897. // "user:mike@example.com", "group:admins@example.com",
  898. // "domain:google.com",
  899. // "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, {
  900. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  901. // }
  902. //
  903. // For a description of IAM and its features, see the [IAM developer's
  904. // guide](https://cloud.google.com/iam).
  905. type Policy struct {
  906. // AuditConfigs: Specifies audit logging configs for "data access".
  907. // "data access": generally refers to data reads/writes and admin reads.
  908. // "admin activity": generally refers to admin writes.
  909. //
  910. // Note: `AuditConfig` doesn't apply to "admin activity", which always
  911. // enables audit logging.
  912. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  913. // Bindings: Associates a list of `members` to a `role`. Multiple
  914. // `bindings` must not be specified for the same `role`. `bindings` with
  915. // no members will result in an error.
  916. Bindings []*Binding `json:"bindings,omitempty"`
  917. // Etag: `etag` is used for optimistic concurrency control as a way to
  918. // help prevent simultaneous updates of a policy from overwriting each
  919. // other. It is strongly suggested that systems make use of the `etag`
  920. // in the read-modify-write cycle to perform policy updates in order to
  921. // avoid race conditions: An `etag` is returned in the response to
  922. // `getIamPolicy`, and systems are expected to put that etag in the
  923. // request to `setIamPolicy` to ensure that their change will be applied
  924. // to the same version of the policy.
  925. //
  926. // If no `etag` is provided in the call to `setIamPolicy`, then the
  927. // existing policy is overwritten blindly.
  928. Etag string `json:"etag,omitempty"`
  929. IamOwned bool `json:"iamOwned,omitempty"`
  930. // Rules: If more than one rule is specified, the rules are applied in
  931. // the following manner: - All matching LOG rules are always applied. -
  932. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  933. // will be applied if one or more matching rule requires logging. -
  934. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  935. // granted. Logging will be applied if one or more matching rule
  936. // requires logging. - Otherwise, if no rule applies, permission is
  937. // denied.
  938. Rules []*Rule `json:"rules,omitempty"`
  939. // Version: Version of the `Policy`. The default version is 0.
  940. Version int64 `json:"version,omitempty"`
  941. // ServerResponse contains the HTTP response code and headers from the
  942. // server.
  943. googleapi.ServerResponse `json:"-"`
  944. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  945. // unconditionally include in API requests. By default, fields with
  946. // empty values are omitted from API requests. However, any non-pointer,
  947. // non-interface field appearing in ForceSendFields will be sent to the
  948. // server regardless of whether the field is empty or not. This may be
  949. // used to include empty fields in Patch requests.
  950. ForceSendFields []string `json:"-"`
  951. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  952. // in API requests with the JSON null value. By default, fields with
  953. // empty values are omitted from API requests. However, any field with
  954. // an empty value appearing in NullFields will be sent to the server as
  955. // null. It is an error if a field in this list has a non-empty value.
  956. // This may be used to include null fields in Patch requests.
  957. NullFields []string `json:"-"`
  958. }
  959. func (s *Policy) MarshalJSON() ([]byte, error) {
  960. type NoMethod Policy
  961. raw := NoMethod(*s)
  962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  963. }
  964. // PublicKey: A public key for authenticating to guests.
  965. type PublicKey struct {
  966. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  967. // format.
  968. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  969. // Description: An optional textual description of the resource;
  970. // provided by the client when the resource is created.
  971. Description string `json:"description,omitempty"`
  972. // ExpirationTimestamp: Optional expiration timestamp. If provided, the
  973. // timestamp must be in RFC3339 text format. If not provided, the public
  974. // key never expires.
  975. ExpirationTimestamp string `json:"expirationTimestamp,omitempty"`
  976. // Fingerprint: [Output Only] The fingerprint of the key is defined by
  977. // RFC4716 to be the MD5 digest of the public key.
  978. Fingerprint string `json:"fingerprint,omitempty"`
  979. // Key: Public key text in SSH format, defined by RFC4253 section 6.6.
  980. Key string `json:"key,omitempty"`
  981. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  982. // to unconditionally include in API requests. By default, fields with
  983. // empty values are omitted from API requests. However, any non-pointer,
  984. // non-interface field appearing in ForceSendFields will be sent to the
  985. // server regardless of whether the field is empty or not. This may be
  986. // used to include empty fields in Patch requests.
  987. ForceSendFields []string `json:"-"`
  988. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  989. // include in API requests with the JSON null value. By default, fields
  990. // with empty values are omitted from API requests. However, any field
  991. // with an empty value appearing in NullFields will be sent to the
  992. // server as null. It is an error if a field in this list has a
  993. // non-empty value. This may be used to include null fields in Patch
  994. // requests.
  995. NullFields []string `json:"-"`
  996. }
  997. func (s *PublicKey) MarshalJSON() ([]byte, error) {
  998. type NoMethod PublicKey
  999. raw := NoMethod(*s)
  1000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1001. }
  1002. // Rule: A rule to be applied in a Policy.
  1003. type Rule struct {
  1004. // Action: Required
  1005. //
  1006. // Possible values:
  1007. // "ALLOW"
  1008. // "ALLOW_WITH_LOG"
  1009. // "DENY"
  1010. // "DENY_WITH_LOG"
  1011. // "LOG"
  1012. // "NO_ACTION"
  1013. Action string `json:"action,omitempty"`
  1014. // Conditions: Additional restrictions that must be met
  1015. Conditions []*Condition `json:"conditions,omitempty"`
  1016. // Description: Human-readable description of the rule.
  1017. Description string `json:"description,omitempty"`
  1018. // Ins: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this
  1019. // set of entries.
  1020. Ins []string `json:"ins,omitempty"`
  1021. // LogConfigs: The config returned to callers of
  1022. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  1023. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  1024. // NotIns: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not
  1025. // in this set of entries.
  1026. NotIns []string `json:"notIns,omitempty"`
  1027. // Permissions: A permission is a string of form '..' (e.g.,
  1028. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  1029. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  1030. Permissions []string `json:"permissions,omitempty"`
  1031. // ForceSendFields is a list of field names (e.g. "Action") to
  1032. // unconditionally include in API requests. By default, fields with
  1033. // empty values are omitted from API requests. However, any non-pointer,
  1034. // non-interface field appearing in ForceSendFields will be sent to the
  1035. // server regardless of whether the field is empty or not. This may be
  1036. // used to include empty fields in Patch requests.
  1037. ForceSendFields []string `json:"-"`
  1038. // NullFields is a list of field names (e.g. "Action") to include in API
  1039. // requests with the JSON null value. By default, fields with empty
  1040. // values are omitted from API requests. However, any field with an
  1041. // empty value appearing in NullFields will be sent to the server as
  1042. // null. It is an error if a field in this list has a non-empty value.
  1043. // This may be used to include null fields in Patch requests.
  1044. NullFields []string `json:"-"`
  1045. }
  1046. func (s *Rule) MarshalJSON() ([]byte, error) {
  1047. type NoMethod Rule
  1048. raw := NoMethod(*s)
  1049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1050. }
  1051. type TestPermissionsRequest struct {
  1052. // Permissions: The set of permissions to check for the 'resource'.
  1053. // Permissions with wildcards (such as '*' or 'storage.*') are not
  1054. // allowed.
  1055. Permissions []string `json:"permissions,omitempty"`
  1056. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1057. // unconditionally include in API requests. By default, fields with
  1058. // empty values are omitted from API requests. However, any non-pointer,
  1059. // non-interface field appearing in ForceSendFields will be sent to the
  1060. // server regardless of whether the field is empty or not. This may be
  1061. // used to include empty fields in Patch requests.
  1062. ForceSendFields []string `json:"-"`
  1063. // NullFields is a list of field names (e.g. "Permissions") to include
  1064. // in API requests with the JSON null value. By default, fields with
  1065. // empty values are omitted from API requests. However, any field with
  1066. // an empty value appearing in NullFields will be sent to the server as
  1067. // null. It is an error if a field in this list has a non-empty value.
  1068. // This may be used to include null fields in Patch requests.
  1069. NullFields []string `json:"-"`
  1070. }
  1071. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  1072. type NoMethod TestPermissionsRequest
  1073. raw := NoMethod(*s)
  1074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1075. }
  1076. type TestPermissionsResponse struct {
  1077. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  1078. // the caller is allowed.
  1079. Permissions []string `json:"permissions,omitempty"`
  1080. // ServerResponse contains the HTTP response code and headers from the
  1081. // server.
  1082. googleapi.ServerResponse `json:"-"`
  1083. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1084. // unconditionally include in API requests. By default, fields with
  1085. // empty values are omitted from API requests. However, any non-pointer,
  1086. // non-interface field appearing in ForceSendFields will be sent to the
  1087. // server regardless of whether the field is empty or not. This may be
  1088. // used to include empty fields in Patch requests.
  1089. ForceSendFields []string `json:"-"`
  1090. // NullFields is a list of field names (e.g. "Permissions") to include
  1091. // in API requests with the JSON null value. By default, fields with
  1092. // empty values are omitted from API requests. However, any field with
  1093. // an empty value appearing in NullFields will be sent to the server as
  1094. // null. It is an error if a field in this list has a non-empty value.
  1095. // This may be used to include null fields in Patch requests.
  1096. NullFields []string `json:"-"`
  1097. }
  1098. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  1099. type NoMethod TestPermissionsResponse
  1100. raw := NoMethod(*s)
  1101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1102. }
  1103. // User: A User resource.
  1104. type User struct {
  1105. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1106. // format.
  1107. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1108. // Description: An optional textual description of the resource;
  1109. // provided by the client when the resource is created.
  1110. Description string `json:"description,omitempty"`
  1111. // Groups: [Output Only] A list of URLs to Group resources who contain
  1112. // the user. Users are only members of groups in the same project.
  1113. Groups []string `json:"groups,omitempty"`
  1114. // Id: [Output Only] Unique identifier for the resource; defined by the
  1115. // server.
  1116. Id uint64 `json:"id,omitempty,string"`
  1117. // Kind: [Output Only] Type of the resource. Always
  1118. // clouduseraccounts#user for users.
  1119. Kind string `json:"kind,omitempty"`
  1120. // Name: Name of the resource; provided by the client when the resource
  1121. // is created.
  1122. Name string `json:"name,omitempty"`
  1123. // Owner: Email address of account's owner. This account will be
  1124. // validated to make sure it exists. The email can belong to any domain,
  1125. // but it must be tied to a Google account.
  1126. Owner string `json:"owner,omitempty"`
  1127. // PublicKeys: [Output Only] Public keys that this user may use to
  1128. // login.
  1129. PublicKeys []*PublicKey `json:"publicKeys,omitempty"`
  1130. // SelfLink: [Output Only] Server defined URL for the resource.
  1131. SelfLink string `json:"selfLink,omitempty"`
  1132. // ServerResponse contains the HTTP response code and headers from the
  1133. // server.
  1134. googleapi.ServerResponse `json:"-"`
  1135. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  1136. // to unconditionally include in API requests. By default, fields with
  1137. // empty values are omitted from API requests. However, any non-pointer,
  1138. // non-interface field appearing in ForceSendFields will be sent to the
  1139. // server regardless of whether the field is empty or not. This may be
  1140. // used to include empty fields in Patch requests.
  1141. ForceSendFields []string `json:"-"`
  1142. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  1143. // include in API requests with the JSON null value. By default, fields
  1144. // with empty values are omitted from API requests. However, any field
  1145. // with an empty value appearing in NullFields will be sent to the
  1146. // server as null. It is an error if a field in this list has a
  1147. // non-empty value. This may be used to include null fields in Patch
  1148. // requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *User) MarshalJSON() ([]byte, error) {
  1152. type NoMethod User
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. type UserList struct {
  1157. // Id: [Output Only] Unique identifier for the resource; defined by the
  1158. // server.
  1159. Id string `json:"id,omitempty"`
  1160. // Items: [Output Only] A list of User resources.
  1161. Items []*User `json:"items,omitempty"`
  1162. // Kind: [Output Only] Type of resource. Always
  1163. // clouduseraccounts#userList for lists of users.
  1164. Kind string `json:"kind,omitempty"`
  1165. // NextPageToken: [Output Only] A token used to continue a truncated
  1166. // list request.
  1167. NextPageToken string `json:"nextPageToken,omitempty"`
  1168. // SelfLink: [Output Only] Server defined URL for this resource.
  1169. SelfLink string `json:"selfLink,omitempty"`
  1170. // ServerResponse contains the HTTP response code and headers from the
  1171. // server.
  1172. googleapi.ServerResponse `json:"-"`
  1173. // ForceSendFields is a list of field names (e.g. "Id") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. // NullFields is a list of field names (e.g. "Id") to include in API
  1181. // requests with the JSON null value. By default, fields with empty
  1182. // values are omitted from API requests. However, any field with an
  1183. // empty value appearing in NullFields will be sent to the server as
  1184. // null. It is an error if a field in this list has a non-empty value.
  1185. // This may be used to include null fields in Patch requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *UserList) MarshalJSON() ([]byte, error) {
  1189. type NoMethod UserList
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // method id "clouduseraccounts.globalAccountsOperations.delete":
  1194. type GlobalAccountsOperationsDeleteCall struct {
  1195. s *Service
  1196. project string
  1197. operation string
  1198. urlParams_ gensupport.URLParams
  1199. ctx_ context.Context
  1200. header_ http.Header
  1201. }
  1202. // Delete: Deletes the specified operation resource.
  1203. func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall {
  1204. c := &GlobalAccountsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1205. c.project = project
  1206. c.operation = operation
  1207. return c
  1208. }
  1209. // Fields allows partial responses to be retrieved. See
  1210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1211. // for more information.
  1212. func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall {
  1213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1214. return c
  1215. }
  1216. // Context sets the context to be used in this call's Do method. Any
  1217. // pending HTTP request will be aborted if the provided context is
  1218. // canceled.
  1219. func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall {
  1220. c.ctx_ = ctx
  1221. return c
  1222. }
  1223. // Header returns an http.Header that can be modified by the caller to
  1224. // add HTTP headers to the request.
  1225. func (c *GlobalAccountsOperationsDeleteCall) Header() http.Header {
  1226. if c.header_ == nil {
  1227. c.header_ = make(http.Header)
  1228. }
  1229. return c.header_
  1230. }
  1231. func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1232. reqHeaders := make(http.Header)
  1233. for k, v := range c.header_ {
  1234. reqHeaders[k] = v
  1235. }
  1236. reqHeaders.Set("User-Agent", c.s.userAgent())
  1237. var body io.Reader = nil
  1238. c.urlParams_.Set("alt", alt)
  1239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  1240. urls += "?" + c.urlParams_.Encode()
  1241. req, _ := http.NewRequest("DELETE", urls, body)
  1242. req.Header = reqHeaders
  1243. googleapi.Expand(req.URL, map[string]string{
  1244. "project": c.project,
  1245. "operation": c.operation,
  1246. })
  1247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1248. }
  1249. // Do executes the "clouduseraccounts.globalAccountsOperations.delete" call.
  1250. func (c *GlobalAccountsOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1251. gensupport.SetOptions(c.urlParams_, opts...)
  1252. res, err := c.doRequest("json")
  1253. if err != nil {
  1254. return err
  1255. }
  1256. defer googleapi.CloseBody(res)
  1257. if err := googleapi.CheckResponse(res); err != nil {
  1258. return err
  1259. }
  1260. return nil
  1261. // {
  1262. // "description": "Deletes the specified operation resource.",
  1263. // "httpMethod": "DELETE",
  1264. // "id": "clouduseraccounts.globalAccountsOperations.delete",
  1265. // "parameterOrder": [
  1266. // "project",
  1267. // "operation"
  1268. // ],
  1269. // "parameters": {
  1270. // "operation": {
  1271. // "description": "Name of the Operations resource to delete.",
  1272. // "location": "path",
  1273. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  1274. // "required": true,
  1275. // "type": "string"
  1276. // },
  1277. // "project": {
  1278. // "description": "Project ID for this request.",
  1279. // "location": "path",
  1280. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1281. // "required": true,
  1282. // "type": "string"
  1283. // }
  1284. // },
  1285. // "path": "{project}/global/operations/{operation}",
  1286. // "scopes": [
  1287. // "https://www.googleapis.com/auth/cloud-platform",
  1288. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1289. // ]
  1290. // }
  1291. }
  1292. // method id "clouduseraccounts.globalAccountsOperations.get":
  1293. type GlobalAccountsOperationsGetCall struct {
  1294. s *Service
  1295. project string
  1296. operation string
  1297. urlParams_ gensupport.URLParams
  1298. ifNoneMatch_ string
  1299. ctx_ context.Context
  1300. header_ http.Header
  1301. }
  1302. // Get: Retrieves the specified operation resource.
  1303. func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall {
  1304. c := &GlobalAccountsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1305. c.project = project
  1306. c.operation = operation
  1307. return c
  1308. }
  1309. // Fields allows partial responses to be retrieved. See
  1310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1311. // for more information.
  1312. func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall {
  1313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1314. return c
  1315. }
  1316. // IfNoneMatch sets the optional parameter which makes the operation
  1317. // fail if the object's ETag matches the given value. This is useful for
  1318. // getting updates only after the object has changed since the last
  1319. // request. Use googleapi.IsNotModified to check whether the response
  1320. // error from Do is the result of In-None-Match.
  1321. func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall {
  1322. c.ifNoneMatch_ = entityTag
  1323. return c
  1324. }
  1325. // Context sets the context to be used in this call's Do method. Any
  1326. // pending HTTP request will be aborted if the provided context is
  1327. // canceled.
  1328. func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall {
  1329. c.ctx_ = ctx
  1330. return c
  1331. }
  1332. // Header returns an http.Header that can be modified by the caller to
  1333. // add HTTP headers to the request.
  1334. func (c *GlobalAccountsOperationsGetCall) Header() http.Header {
  1335. if c.header_ == nil {
  1336. c.header_ = make(http.Header)
  1337. }
  1338. return c.header_
  1339. }
  1340. func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1341. reqHeaders := make(http.Header)
  1342. for k, v := range c.header_ {
  1343. reqHeaders[k] = v
  1344. }
  1345. reqHeaders.Set("User-Agent", c.s.userAgent())
  1346. if c.ifNoneMatch_ != "" {
  1347. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1348. }
  1349. var body io.Reader = nil
  1350. c.urlParams_.Set("alt", alt)
  1351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  1352. urls += "?" + c.urlParams_.Encode()
  1353. req, _ := http.NewRequest("GET", urls, body)
  1354. req.Header = reqHeaders
  1355. googleapi.Expand(req.URL, map[string]string{
  1356. "project": c.project,
  1357. "operation": c.operation,
  1358. })
  1359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1360. }
  1361. // Do executes the "clouduseraccounts.globalAccountsOperations.get" call.
  1362. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1363. // status code is an error. Response headers are in either
  1364. // *Operation.ServerResponse.Header or (if a response was returned at
  1365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1366. // to check whether the returned error was because
  1367. // http.StatusNotModified was returned.
  1368. func (c *GlobalAccountsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1369. gensupport.SetOptions(c.urlParams_, opts...)
  1370. res, err := c.doRequest("json")
  1371. if res != nil && res.StatusCode == http.StatusNotModified {
  1372. if res.Body != nil {
  1373. res.Body.Close()
  1374. }
  1375. return nil, &googleapi.Error{
  1376. Code: res.StatusCode,
  1377. Header: res.Header,
  1378. }
  1379. }
  1380. if err != nil {
  1381. return nil, err
  1382. }
  1383. defer googleapi.CloseBody(res)
  1384. if err := googleapi.CheckResponse(res); err != nil {
  1385. return nil, err
  1386. }
  1387. ret := &Operation{
  1388. ServerResponse: googleapi.ServerResponse{
  1389. Header: res.Header,
  1390. HTTPStatusCode: res.StatusCode,
  1391. },
  1392. }
  1393. target := &ret
  1394. if err := gensupport.DecodeResponse(target, res); err != nil {
  1395. return nil, err
  1396. }
  1397. return ret, nil
  1398. // {
  1399. // "description": "Retrieves the specified operation resource.",
  1400. // "httpMethod": "GET",
  1401. // "id": "clouduseraccounts.globalAccountsOperations.get",
  1402. // "parameterOrder": [
  1403. // "project",
  1404. // "operation"
  1405. // ],
  1406. // "parameters": {
  1407. // "operation": {
  1408. // "description": "Name of the Operations resource to return.",
  1409. // "location": "path",
  1410. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  1411. // "required": true,
  1412. // "type": "string"
  1413. // },
  1414. // "project": {
  1415. // "description": "Project ID for this request.",
  1416. // "location": "path",
  1417. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1418. // "required": true,
  1419. // "type": "string"
  1420. // }
  1421. // },
  1422. // "path": "{project}/global/operations/{operation}",
  1423. // "response": {
  1424. // "$ref": "Operation"
  1425. // },
  1426. // "scopes": [
  1427. // "https://www.googleapis.com/auth/cloud-platform",
  1428. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1429. // "https://www.googleapis.com/auth/cloud.useraccounts",
  1430. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  1431. // ]
  1432. // }
  1433. }
  1434. // method id "clouduseraccounts.globalAccountsOperations.list":
  1435. type GlobalAccountsOperationsListCall struct {
  1436. s *Service
  1437. project string
  1438. urlParams_ gensupport.URLParams
  1439. ifNoneMatch_ string
  1440. ctx_ context.Context
  1441. header_ http.Header
  1442. }
  1443. // List: Retrieves the list of operation resources contained within the
  1444. // specified project.
  1445. func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall {
  1446. c := &GlobalAccountsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1447. c.project = project
  1448. return c
  1449. }
  1450. // Filter sets the optional parameter "filter": Sets a filter expression
  1451. // for filtering listed resources, in the form filter={expression}. Your
  1452. // {expression} must be in the format: field_name comparison_string
  1453. // literal_string.
  1454. //
  1455. // The field_name is the name of the field you want to compare. Only
  1456. // atomic field types are supported (string, number, boolean). The
  1457. // comparison_string must be either eq (equals) or ne (not equals). The
  1458. // literal_string is the string value to filter to. The literal value
  1459. // must be valid for the type of field you are filtering by (string,
  1460. // number, boolean). For string fields, the literal value is interpreted
  1461. // as a regular expression using RE2 syntax. The literal value must
  1462. // match the entire field.
  1463. //
  1464. // For example, to filter for instances that do not have a name of
  1465. // example-instance, you would use filter=name ne
  1466. // example-instance.
  1467. //
  1468. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  1469. // you can also filter on nested fields. For example, you could filter
  1470. // on instances that have set the scheduling.automaticRestart field to
  1471. // true. In particular, use filtering on nested fields to take advantage
  1472. // of instance labels to organize and filter results based on label
  1473. // values.
  1474. //
  1475. // The Beta API also supports filtering on multiple expressions by
  1476. // providing each separate expression within parentheses. For example,
  1477. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  1478. // Multiple expressions are treated as AND expressions, meaning that
  1479. // resources must match all expressions to pass the filters.
  1480. func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall {
  1481. c.urlParams_.Set("filter", filter)
  1482. return c
  1483. }
  1484. // MaxResults sets the optional parameter "maxResults": The maximum
  1485. // number of results per page that should be returned. If the number of
  1486. // available results is larger than maxResults, Compute Engine returns a
  1487. // nextPageToken that can be used to get the next page of results in
  1488. // subsequent list requests.
  1489. func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall {
  1490. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1491. return c
  1492. }
  1493. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  1494. // a certain order. By default, results are returned in alphanumerical
  1495. // order based on the resource name.
  1496. //
  1497. // You can also sort results in descending order based on the creation
  1498. // timestamp using orderBy="creationTimestamp desc". This sorts results
  1499. // based on the creationTimestamp field in reverse chronological order
  1500. // (newest result first). Use this to sort resources like operations so
  1501. // that the newest operation is returned first.
  1502. //
  1503. // Currently, only sorting by name or creationTimestamp desc is
  1504. // supported.
  1505. func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall {
  1506. c.urlParams_.Set("orderBy", orderBy)
  1507. return c
  1508. }
  1509. // PageToken sets the optional parameter "pageToken": Specifies a page
  1510. // token to use. Set pageToken to the nextPageToken returned by a
  1511. // previous list request to get the next page of results.
  1512. func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall {
  1513. c.urlParams_.Set("pageToken", pageToken)
  1514. return c
  1515. }
  1516. // Fields allows partial responses to be retrieved. See
  1517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1518. // for more information.
  1519. func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall {
  1520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1521. return c
  1522. }
  1523. // IfNoneMatch sets the optional parameter which makes the operation
  1524. // fail if the object's ETag matches the given value. This is useful for
  1525. // getting updates only after the object has changed since the last
  1526. // request. Use googleapi.IsNotModified to check whether the response
  1527. // error from Do is the result of In-None-Match.
  1528. func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall {
  1529. c.ifNoneMatch_ = entityTag
  1530. return c
  1531. }
  1532. // Context sets the context to be used in this call's Do method. Any
  1533. // pending HTTP request will be aborted if the provided context is
  1534. // canceled.
  1535. func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall {
  1536. c.ctx_ = ctx
  1537. return c
  1538. }
  1539. // Header returns an http.Header that can be modified by the caller to
  1540. // add HTTP headers to the request.
  1541. func (c *GlobalAccountsOperationsListCall) Header() http.Header {
  1542. if c.header_ == nil {
  1543. c.header_ = make(http.Header)
  1544. }
  1545. return c.header_
  1546. }
  1547. func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1548. reqHeaders := make(http.Header)
  1549. for k, v := range c.header_ {
  1550. reqHeaders[k] = v
  1551. }
  1552. reqHeaders.Set("User-Agent", c.s.userAgent())
  1553. if c.ifNoneMatch_ != "" {
  1554. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1555. }
  1556. var body io.Reader = nil
  1557. c.urlParams_.Set("alt", alt)
  1558. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  1559. urls += "?" + c.urlParams_.Encode()
  1560. req, _ := http.NewRequest("GET", urls, body)
  1561. req.Header = reqHeaders
  1562. googleapi.Expand(req.URL, map[string]string{
  1563. "project": c.project,
  1564. })
  1565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1566. }
  1567. // Do executes the "clouduseraccounts.globalAccountsOperations.list" call.
  1568. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  1569. // status code is an error. Response headers are in either
  1570. // *OperationList.ServerResponse.Header or (if a response was returned
  1571. // at all) in error.(*googleapi.Error).Header. Use
  1572. // googleapi.IsNotModified to check whether the returned error was
  1573. // because http.StatusNotModified was returned.
  1574. func (c *GlobalAccountsOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  1575. gensupport.SetOptions(c.urlParams_, opts...)
  1576. res, err := c.doRequest("json")
  1577. if res != nil && res.StatusCode == http.StatusNotModified {
  1578. if res.Body != nil {
  1579. res.Body.Close()
  1580. }
  1581. return nil, &googleapi.Error{
  1582. Code: res.StatusCode,
  1583. Header: res.Header,
  1584. }
  1585. }
  1586. if err != nil {
  1587. return nil, err
  1588. }
  1589. defer googleapi.CloseBody(res)
  1590. if err := googleapi.CheckResponse(res); err != nil {
  1591. return nil, err
  1592. }
  1593. ret := &OperationList{
  1594. ServerResponse: googleapi.ServerResponse{
  1595. Header: res.Header,
  1596. HTTPStatusCode: res.StatusCode,
  1597. },
  1598. }
  1599. target := &ret
  1600. if err := gensupport.DecodeResponse(target, res); err != nil {
  1601. return nil, err
  1602. }
  1603. return ret, nil
  1604. // {
  1605. // "description": "Retrieves the list of operation resources contained within the specified project.",
  1606. // "httpMethod": "GET",
  1607. // "id": "clouduseraccounts.globalAccountsOperations.list",
  1608. // "parameterOrder": [
  1609. // "project"
  1610. // ],
  1611. // "parameters": {
  1612. // "filter": {
  1613. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  1614. // "location": "query",
  1615. // "type": "string"
  1616. // },
  1617. // "maxResults": {
  1618. // "default": "500",
  1619. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.",
  1620. // "format": "uint32",
  1621. // "location": "query",
  1622. // "maximum": "500",
  1623. // "minimum": "0",
  1624. // "type": "integer"
  1625. // },
  1626. // "orderBy": {
  1627. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  1628. // "location": "query",
  1629. // "type": "string"
  1630. // },
  1631. // "pageToken": {
  1632. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  1633. // "location": "query",
  1634. // "type": "string"
  1635. // },
  1636. // "project": {
  1637. // "description": "Project ID for this request.",
  1638. // "location": "path",
  1639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1640. // "required": true,
  1641. // "type": "string"
  1642. // }
  1643. // },
  1644. // "path": "{project}/global/operations",
  1645. // "response": {
  1646. // "$ref": "OperationList"
  1647. // },
  1648. // "scopes": [
  1649. // "https://www.googleapis.com/auth/cloud-platform",
  1650. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1651. // "https://www.googleapis.com/auth/cloud.useraccounts",
  1652. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  1653. // ]
  1654. // }
  1655. }
  1656. // Pages invokes f for each page of results.
  1657. // A non-nil error returned from f will halt the iteration.
  1658. // The provided context supersedes any context provided to the Context method.
  1659. func (c *GlobalAccountsOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  1660. c.ctx_ = ctx
  1661. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1662. for {
  1663. x, err := c.Do()
  1664. if err != nil {
  1665. return err
  1666. }
  1667. if err := f(x); err != nil {
  1668. return err
  1669. }
  1670. if x.NextPageToken == "" {
  1671. return nil
  1672. }
  1673. c.PageToken(x.NextPageToken)
  1674. }
  1675. }
  1676. // method id "clouduseraccounts.groups.addMember":
  1677. type GroupsAddMemberCall struct {
  1678. s *Service
  1679. project string
  1680. groupName string
  1681. groupsaddmemberrequest *GroupsAddMemberRequest
  1682. urlParams_ gensupport.URLParams
  1683. ctx_ context.Context
  1684. header_ http.Header
  1685. }
  1686. // AddMember: Adds users to the specified group.
  1687. func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall {
  1688. c := &GroupsAddMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1689. c.project = project
  1690. c.groupName = groupName
  1691. c.groupsaddmemberrequest = groupsaddmemberrequest
  1692. return c
  1693. }
  1694. // Fields allows partial responses to be retrieved. See
  1695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1696. // for more information.
  1697. func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall {
  1698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1699. return c
  1700. }
  1701. // Context sets the context to be used in this call's Do method. Any
  1702. // pending HTTP request will be aborted if the provided context is
  1703. // canceled.
  1704. func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall {
  1705. c.ctx_ = ctx
  1706. return c
  1707. }
  1708. // Header returns an http.Header that can be modified by the caller to
  1709. // add HTTP headers to the request.
  1710. func (c *GroupsAddMemberCall) Header() http.Header {
  1711. if c.header_ == nil {
  1712. c.header_ = make(http.Header)
  1713. }
  1714. return c.header_
  1715. }
  1716. func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) {
  1717. reqHeaders := make(http.Header)
  1718. for k, v := range c.header_ {
  1719. reqHeaders[k] = v
  1720. }
  1721. reqHeaders.Set("User-Agent", c.s.userAgent())
  1722. var body io.Reader = nil
  1723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest)
  1724. if err != nil {
  1725. return nil, err
  1726. }
  1727. reqHeaders.Set("Content-Type", "application/json")
  1728. c.urlParams_.Set("alt", alt)
  1729. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember")
  1730. urls += "?" + c.urlParams_.Encode()
  1731. req, _ := http.NewRequest("POST", urls, body)
  1732. req.Header = reqHeaders
  1733. googleapi.Expand(req.URL, map[string]string{
  1734. "project": c.project,
  1735. "groupName": c.groupName,
  1736. })
  1737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1738. }
  1739. // Do executes the "clouduseraccounts.groups.addMember" call.
  1740. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1741. // status code is an error. Response headers are in either
  1742. // *Operation.ServerResponse.Header or (if a response was returned at
  1743. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1744. // to check whether the returned error was because
  1745. // http.StatusNotModified was returned.
  1746. func (c *GroupsAddMemberCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1747. gensupport.SetOptions(c.urlParams_, opts...)
  1748. res, err := c.doRequest("json")
  1749. if res != nil && res.StatusCode == http.StatusNotModified {
  1750. if res.Body != nil {
  1751. res.Body.Close()
  1752. }
  1753. return nil, &googleapi.Error{
  1754. Code: res.StatusCode,
  1755. Header: res.Header,
  1756. }
  1757. }
  1758. if err != nil {
  1759. return nil, err
  1760. }
  1761. defer googleapi.CloseBody(res)
  1762. if err := googleapi.CheckResponse(res); err != nil {
  1763. return nil, err
  1764. }
  1765. ret := &Operation{
  1766. ServerResponse: googleapi.ServerResponse{
  1767. Header: res.Header,
  1768. HTTPStatusCode: res.StatusCode,
  1769. },
  1770. }
  1771. target := &ret
  1772. if err := gensupport.DecodeResponse(target, res); err != nil {
  1773. return nil, err
  1774. }
  1775. return ret, nil
  1776. // {
  1777. // "description": "Adds users to the specified group.",
  1778. // "httpMethod": "POST",
  1779. // "id": "clouduseraccounts.groups.addMember",
  1780. // "parameterOrder": [
  1781. // "project",
  1782. // "groupName"
  1783. // ],
  1784. // "parameters": {
  1785. // "groupName": {
  1786. // "description": "Name of the group for this request.",
  1787. // "location": "path",
  1788. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  1789. // "required": true,
  1790. // "type": "string"
  1791. // },
  1792. // "project": {
  1793. // "description": "Project ID for this request.",
  1794. // "location": "path",
  1795. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1796. // "required": true,
  1797. // "type": "string"
  1798. // }
  1799. // },
  1800. // "path": "{project}/global/groups/{groupName}/addMember",
  1801. // "request": {
  1802. // "$ref": "GroupsAddMemberRequest"
  1803. // },
  1804. // "response": {
  1805. // "$ref": "Operation"
  1806. // },
  1807. // "scopes": [
  1808. // "https://www.googleapis.com/auth/cloud-platform",
  1809. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1810. // ]
  1811. // }
  1812. }
  1813. // method id "clouduseraccounts.groups.delete":
  1814. type GroupsDeleteCall struct {
  1815. s *Service
  1816. project string
  1817. groupName string
  1818. urlParams_ gensupport.URLParams
  1819. ctx_ context.Context
  1820. header_ http.Header
  1821. }
  1822. // Delete: Deletes the specified Group resource.
  1823. func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall {
  1824. c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1825. c.project = project
  1826. c.groupName = groupName
  1827. return c
  1828. }
  1829. // Fields allows partial responses to be retrieved. See
  1830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1831. // for more information.
  1832. func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall {
  1833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1834. return c
  1835. }
  1836. // Context sets the context to be used in this call's Do method. Any
  1837. // pending HTTP request will be aborted if the provided context is
  1838. // canceled.
  1839. func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall {
  1840. c.ctx_ = ctx
  1841. return c
  1842. }
  1843. // Header returns an http.Header that can be modified by the caller to
  1844. // add HTTP headers to the request.
  1845. func (c *GroupsDeleteCall) Header() http.Header {
  1846. if c.header_ == nil {
  1847. c.header_ = make(http.Header)
  1848. }
  1849. return c.header_
  1850. }
  1851. func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1852. reqHeaders := make(http.Header)
  1853. for k, v := range c.header_ {
  1854. reqHeaders[k] = v
  1855. }
  1856. reqHeaders.Set("User-Agent", c.s.userAgent())
  1857. var body io.Reader = nil
  1858. c.urlParams_.Set("alt", alt)
  1859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}")
  1860. urls += "?" + c.urlParams_.Encode()
  1861. req, _ := http.NewRequest("DELETE", urls, body)
  1862. req.Header = reqHeaders
  1863. googleapi.Expand(req.URL, map[string]string{
  1864. "project": c.project,
  1865. "groupName": c.groupName,
  1866. })
  1867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1868. }
  1869. // Do executes the "clouduseraccounts.groups.delete" call.
  1870. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1871. // status code is an error. Response headers are in either
  1872. // *Operation.ServerResponse.Header or (if a response was returned at
  1873. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1874. // to check whether the returned error was because
  1875. // http.StatusNotModified was returned.
  1876. func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1877. gensupport.SetOptions(c.urlParams_, opts...)
  1878. res, err := c.doRequest("json")
  1879. if res != nil && res.StatusCode == http.StatusNotModified {
  1880. if res.Body != nil {
  1881. res.Body.Close()
  1882. }
  1883. return nil, &googleapi.Error{
  1884. Code: res.StatusCode,
  1885. Header: res.Header,
  1886. }
  1887. }
  1888. if err != nil {
  1889. return nil, err
  1890. }
  1891. defer googleapi.CloseBody(res)
  1892. if err := googleapi.CheckResponse(res); err != nil {
  1893. return nil, err
  1894. }
  1895. ret := &Operation{
  1896. ServerResponse: googleapi.ServerResponse{
  1897. Header: res.Header,
  1898. HTTPStatusCode: res.StatusCode,
  1899. },
  1900. }
  1901. target := &ret
  1902. if err := gensupport.DecodeResponse(target, res); err != nil {
  1903. return nil, err
  1904. }
  1905. return ret, nil
  1906. // {
  1907. // "description": "Deletes the specified Group resource.",
  1908. // "httpMethod": "DELETE",
  1909. // "id": "clouduseraccounts.groups.delete",
  1910. // "parameterOrder": [
  1911. // "project",
  1912. // "groupName"
  1913. // ],
  1914. // "parameters": {
  1915. // "groupName": {
  1916. // "description": "Name of the Group resource to delete.",
  1917. // "location": "path",
  1918. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  1919. // "required": true,
  1920. // "type": "string"
  1921. // },
  1922. // "project": {
  1923. // "description": "Project ID for this request.",
  1924. // "location": "path",
  1925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1926. // "required": true,
  1927. // "type": "string"
  1928. // }
  1929. // },
  1930. // "path": "{project}/global/groups/{groupName}",
  1931. // "response": {
  1932. // "$ref": "Operation"
  1933. // },
  1934. // "scopes": [
  1935. // "https://www.googleapis.com/auth/cloud-platform",
  1936. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1937. // ]
  1938. // }
  1939. }
  1940. // method id "clouduseraccounts.groups.get":
  1941. type GroupsGetCall struct {
  1942. s *Service
  1943. project string
  1944. groupName string
  1945. urlParams_ gensupport.URLParams
  1946. ifNoneMatch_ string
  1947. ctx_ context.Context
  1948. header_ http.Header
  1949. }
  1950. // Get: Returns the specified Group resource.
  1951. func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall {
  1952. c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1953. c.project = project
  1954. c.groupName = groupName
  1955. return c
  1956. }
  1957. // Fields allows partial responses to be retrieved. See
  1958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1959. // for more information.
  1960. func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall {
  1961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1962. return c
  1963. }
  1964. // IfNoneMatch sets the optional parameter which makes the operation
  1965. // fail if the object's ETag matches the given value. This is useful for
  1966. // getting updates only after the object has changed since the last
  1967. // request. Use googleapi.IsNotModified to check whether the response
  1968. // error from Do is the result of In-None-Match.
  1969. func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall {
  1970. c.ifNoneMatch_ = entityTag
  1971. return c
  1972. }
  1973. // Context sets the context to be used in this call's Do method. Any
  1974. // pending HTTP request will be aborted if the provided context is
  1975. // canceled.
  1976. func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall {
  1977. c.ctx_ = ctx
  1978. return c
  1979. }
  1980. // Header returns an http.Header that can be modified by the caller to
  1981. // add HTTP headers to the request.
  1982. func (c *GroupsGetCall) Header() http.Header {
  1983. if c.header_ == nil {
  1984. c.header_ = make(http.Header)
  1985. }
  1986. return c.header_
  1987. }
  1988. func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) {
  1989. reqHeaders := make(http.Header)
  1990. for k, v := range c.header_ {
  1991. reqHeaders[k] = v
  1992. }
  1993. reqHeaders.Set("User-Agent", c.s.userAgent())
  1994. if c.ifNoneMatch_ != "" {
  1995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1996. }
  1997. var body io.Reader = nil
  1998. c.urlParams_.Set("alt", alt)
  1999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}")
  2000. urls += "?" + c.urlParams_.Encode()
  2001. req, _ := http.NewRequest("GET", urls, body)
  2002. req.Header = reqHeaders
  2003. googleapi.Expand(req.URL, map[string]string{
  2004. "project": c.project,
  2005. "groupName": c.groupName,
  2006. })
  2007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2008. }
  2009. // Do executes the "clouduseraccounts.groups.get" call.
  2010. // Exactly one of *Group or error will be non-nil. Any non-2xx status
  2011. // code is an error. Response headers are in either
  2012. // *Group.ServerResponse.Header or (if a response was returned at all)
  2013. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2014. // check whether the returned error was because http.StatusNotModified
  2015. // was returned.
  2016. func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) {
  2017. gensupport.SetOptions(c.urlParams_, opts...)
  2018. res, err := c.doRequest("json")
  2019. if res != nil && res.StatusCode == http.StatusNotModified {
  2020. if res.Body != nil {
  2021. res.Body.Close()
  2022. }
  2023. return nil, &googleapi.Error{
  2024. Code: res.StatusCode,
  2025. Header: res.Header,
  2026. }
  2027. }
  2028. if err != nil {
  2029. return nil, err
  2030. }
  2031. defer googleapi.CloseBody(res)
  2032. if err := googleapi.CheckResponse(res); err != nil {
  2033. return nil, err
  2034. }
  2035. ret := &Group{
  2036. ServerResponse: googleapi.ServerResponse{
  2037. Header: res.Header,
  2038. HTTPStatusCode: res.StatusCode,
  2039. },
  2040. }
  2041. target := &ret
  2042. if err := gensupport.DecodeResponse(target, res); err != nil {
  2043. return nil, err
  2044. }
  2045. return ret, nil
  2046. // {
  2047. // "description": "Returns the specified Group resource.",
  2048. // "httpMethod": "GET",
  2049. // "id": "clouduseraccounts.groups.get",
  2050. // "parameterOrder": [
  2051. // "project",
  2052. // "groupName"
  2053. // ],
  2054. // "parameters": {
  2055. // "groupName": {
  2056. // "description": "Name of the Group resource to return.",
  2057. // "location": "path",
  2058. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2059. // "required": true,
  2060. // "type": "string"
  2061. // },
  2062. // "project": {
  2063. // "description": "Project ID for this request.",
  2064. // "location": "path",
  2065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2066. // "required": true,
  2067. // "type": "string"
  2068. // }
  2069. // },
  2070. // "path": "{project}/global/groups/{groupName}",
  2071. // "response": {
  2072. // "$ref": "Group"
  2073. // },
  2074. // "scopes": [
  2075. // "https://www.googleapis.com/auth/cloud-platform",
  2076. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2077. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2078. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2079. // ]
  2080. // }
  2081. }
  2082. // method id "clouduseraccounts.groups.getIamPolicy":
  2083. type GroupsGetIamPolicyCall struct {
  2084. s *Service
  2085. project string
  2086. resource string
  2087. urlParams_ gensupport.URLParams
  2088. ifNoneMatch_ string
  2089. ctx_ context.Context
  2090. header_ http.Header
  2091. }
  2092. // GetIamPolicy: Gets the access control policy for a resource. May be
  2093. // empty if no such policy or resource exists.
  2094. func (r *GroupsService) GetIamPolicy(project string, resource string) *GroupsGetIamPolicyCall {
  2095. c := &GroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2096. c.project = project
  2097. c.resource = resource
  2098. return c
  2099. }
  2100. // Fields allows partial responses to be retrieved. See
  2101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2102. // for more information.
  2103. func (c *GroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsGetIamPolicyCall {
  2104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2105. return c
  2106. }
  2107. // IfNoneMatch sets the optional parameter which makes the operation
  2108. // fail if the object's ETag matches the given value. This is useful for
  2109. // getting updates only after the object has changed since the last
  2110. // request. Use googleapi.IsNotModified to check whether the response
  2111. // error from Do is the result of In-None-Match.
  2112. func (c *GroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *GroupsGetIamPolicyCall {
  2113. c.ifNoneMatch_ = entityTag
  2114. return c
  2115. }
  2116. // Context sets the context to be used in this call's Do method. Any
  2117. // pending HTTP request will be aborted if the provided context is
  2118. // canceled.
  2119. func (c *GroupsGetIamPolicyCall) Context(ctx context.Context) *GroupsGetIamPolicyCall {
  2120. c.ctx_ = ctx
  2121. return c
  2122. }
  2123. // Header returns an http.Header that can be modified by the caller to
  2124. // add HTTP headers to the request.
  2125. func (c *GroupsGetIamPolicyCall) Header() http.Header {
  2126. if c.header_ == nil {
  2127. c.header_ = make(http.Header)
  2128. }
  2129. return c.header_
  2130. }
  2131. func (c *GroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2132. reqHeaders := make(http.Header)
  2133. for k, v := range c.header_ {
  2134. reqHeaders[k] = v
  2135. }
  2136. reqHeaders.Set("User-Agent", c.s.userAgent())
  2137. if c.ifNoneMatch_ != "" {
  2138. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2139. }
  2140. var body io.Reader = nil
  2141. c.urlParams_.Set("alt", alt)
  2142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/getIamPolicy")
  2143. urls += "?" + c.urlParams_.Encode()
  2144. req, _ := http.NewRequest("GET", urls, body)
  2145. req.Header = reqHeaders
  2146. googleapi.Expand(req.URL, map[string]string{
  2147. "project": c.project,
  2148. "resource": c.resource,
  2149. })
  2150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2151. }
  2152. // Do executes the "clouduseraccounts.groups.getIamPolicy" call.
  2153. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  2154. // code is an error. Response headers are in either
  2155. // *Policy.ServerResponse.Header or (if a response was returned at all)
  2156. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2157. // check whether the returned error was because http.StatusNotModified
  2158. // was returned.
  2159. func (c *GroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2160. gensupport.SetOptions(c.urlParams_, opts...)
  2161. res, err := c.doRequest("json")
  2162. if res != nil && res.StatusCode == http.StatusNotModified {
  2163. if res.Body != nil {
  2164. res.Body.Close()
  2165. }
  2166. return nil, &googleapi.Error{
  2167. Code: res.StatusCode,
  2168. Header: res.Header,
  2169. }
  2170. }
  2171. if err != nil {
  2172. return nil, err
  2173. }
  2174. defer googleapi.CloseBody(res)
  2175. if err := googleapi.CheckResponse(res); err != nil {
  2176. return nil, err
  2177. }
  2178. ret := &Policy{
  2179. ServerResponse: googleapi.ServerResponse{
  2180. Header: res.Header,
  2181. HTTPStatusCode: res.StatusCode,
  2182. },
  2183. }
  2184. target := &ret
  2185. if err := gensupport.DecodeResponse(target, res); err != nil {
  2186. return nil, err
  2187. }
  2188. return ret, nil
  2189. // {
  2190. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  2191. // "httpMethod": "GET",
  2192. // "id": "clouduseraccounts.groups.getIamPolicy",
  2193. // "parameterOrder": [
  2194. // "project",
  2195. // "resource"
  2196. // ],
  2197. // "parameters": {
  2198. // "project": {
  2199. // "description": "Project ID for this request.",
  2200. // "location": "path",
  2201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2202. // "required": true,
  2203. // "type": "string"
  2204. // },
  2205. // "resource": {
  2206. // "description": "Name of the resource for this request.",
  2207. // "location": "path",
  2208. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  2209. // "required": true,
  2210. // "type": "string"
  2211. // }
  2212. // },
  2213. // "path": "{project}/global/groups/{resource}/getIamPolicy",
  2214. // "response": {
  2215. // "$ref": "Policy"
  2216. // },
  2217. // "scopes": [
  2218. // "https://www.googleapis.com/auth/cloud-platform",
  2219. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2220. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2221. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2222. // ]
  2223. // }
  2224. }
  2225. // method id "clouduseraccounts.groups.insert":
  2226. type GroupsInsertCall struct {
  2227. s *Service
  2228. project string
  2229. group *Group
  2230. urlParams_ gensupport.URLParams
  2231. ctx_ context.Context
  2232. header_ http.Header
  2233. }
  2234. // Insert: Creates a Group resource in the specified project using the
  2235. // data included in the request.
  2236. func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall {
  2237. c := &GroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2238. c.project = project
  2239. c.group = group
  2240. return c
  2241. }
  2242. // Fields allows partial responses to be retrieved. See
  2243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2244. // for more information.
  2245. func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall {
  2246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2247. return c
  2248. }
  2249. // Context sets the context to be used in this call's Do method. Any
  2250. // pending HTTP request will be aborted if the provided context is
  2251. // canceled.
  2252. func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall {
  2253. c.ctx_ = ctx
  2254. return c
  2255. }
  2256. // Header returns an http.Header that can be modified by the caller to
  2257. // add HTTP headers to the request.
  2258. func (c *GroupsInsertCall) Header() http.Header {
  2259. if c.header_ == nil {
  2260. c.header_ = make(http.Header)
  2261. }
  2262. return c.header_
  2263. }
  2264. func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  2265. reqHeaders := make(http.Header)
  2266. for k, v := range c.header_ {
  2267. reqHeaders[k] = v
  2268. }
  2269. reqHeaders.Set("User-Agent", c.s.userAgent())
  2270. var body io.Reader = nil
  2271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  2272. if err != nil {
  2273. return nil, err
  2274. }
  2275. reqHeaders.Set("Content-Type", "application/json")
  2276. c.urlParams_.Set("alt", alt)
  2277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups")
  2278. urls += "?" + c.urlParams_.Encode()
  2279. req, _ := http.NewRequest("POST", urls, body)
  2280. req.Header = reqHeaders
  2281. googleapi.Expand(req.URL, map[string]string{
  2282. "project": c.project,
  2283. })
  2284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2285. }
  2286. // Do executes the "clouduseraccounts.groups.insert" call.
  2287. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2288. // status code is an error. Response headers are in either
  2289. // *Operation.ServerResponse.Header or (if a response was returned at
  2290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2291. // to check whether the returned error was because
  2292. // http.StatusNotModified was returned.
  2293. func (c *GroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2294. gensupport.SetOptions(c.urlParams_, opts...)
  2295. res, err := c.doRequest("json")
  2296. if res != nil && res.StatusCode == http.StatusNotModified {
  2297. if res.Body != nil {
  2298. res.Body.Close()
  2299. }
  2300. return nil, &googleapi.Error{
  2301. Code: res.StatusCode,
  2302. Header: res.Header,
  2303. }
  2304. }
  2305. if err != nil {
  2306. return nil, err
  2307. }
  2308. defer googleapi.CloseBody(res)
  2309. if err := googleapi.CheckResponse(res); err != nil {
  2310. return nil, err
  2311. }
  2312. ret := &Operation{
  2313. ServerResponse: googleapi.ServerResponse{
  2314. Header: res.Header,
  2315. HTTPStatusCode: res.StatusCode,
  2316. },
  2317. }
  2318. target := &ret
  2319. if err := gensupport.DecodeResponse(target, res); err != nil {
  2320. return nil, err
  2321. }
  2322. return ret, nil
  2323. // {
  2324. // "description": "Creates a Group resource in the specified project using the data included in the request.",
  2325. // "httpMethod": "POST",
  2326. // "id": "clouduseraccounts.groups.insert",
  2327. // "parameterOrder": [
  2328. // "project"
  2329. // ],
  2330. // "parameters": {
  2331. // "project": {
  2332. // "description": "Project ID for this request.",
  2333. // "location": "path",
  2334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2335. // "required": true,
  2336. // "type": "string"
  2337. // }
  2338. // },
  2339. // "path": "{project}/global/groups",
  2340. // "request": {
  2341. // "$ref": "Group"
  2342. // },
  2343. // "response": {
  2344. // "$ref": "Operation"
  2345. // },
  2346. // "scopes": [
  2347. // "https://www.googleapis.com/auth/cloud-platform",
  2348. // "https://www.googleapis.com/auth/cloud.useraccounts"
  2349. // ]
  2350. // }
  2351. }
  2352. // method id "clouduseraccounts.groups.list":
  2353. type GroupsListCall struct {
  2354. s *Service
  2355. project string
  2356. urlParams_ gensupport.URLParams
  2357. ifNoneMatch_ string
  2358. ctx_ context.Context
  2359. header_ http.Header
  2360. }
  2361. // List: Retrieves the list of groups contained within the specified
  2362. // project.
  2363. func (r *GroupsService) List(project string) *GroupsListCall {
  2364. c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2365. c.project = project
  2366. return c
  2367. }
  2368. // Filter sets the optional parameter "filter": Sets a filter expression
  2369. // for filtering listed resources, in the form filter={expression}. Your
  2370. // {expression} must be in the format: field_name comparison_string
  2371. // literal_string.
  2372. //
  2373. // The field_name is the name of the field you want to compare. Only
  2374. // atomic field types are supported (string, number, boolean). The
  2375. // comparison_string must be either eq (equals) or ne (not equals). The
  2376. // literal_string is the string value to filter to. The literal value
  2377. // must be valid for the type of field you are filtering by (string,
  2378. // number, boolean). For string fields, the literal value is interpreted
  2379. // as a regular expression using RE2 syntax. The literal value must
  2380. // match the entire field.
  2381. //
  2382. // For example, to filter for instances that do not have a name of
  2383. // example-instance, you would use filter=name ne
  2384. // example-instance.
  2385. //
  2386. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  2387. // you can also filter on nested fields. For example, you could filter
  2388. // on instances that have set the scheduling.automaticRestart field to
  2389. // true. In particular, use filtering on nested fields to take advantage
  2390. // of instance labels to organize and filter results based on label
  2391. // values.
  2392. //
  2393. // The Beta API also supports filtering on multiple expressions by
  2394. // providing each separate expression within parentheses. For example,
  2395. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  2396. // Multiple expressions are treated as AND expressions, meaning that
  2397. // resources must match all expressions to pass the filters.
  2398. func (c *GroupsListCall) Filter(filter string) *GroupsListCall {
  2399. c.urlParams_.Set("filter", filter)
  2400. return c
  2401. }
  2402. // MaxResults sets the optional parameter "maxResults": The maximum
  2403. // number of results per page that should be returned. If the number of
  2404. // available results is larger than maxResults, Compute Engine returns a
  2405. // nextPageToken that can be used to get the next page of results in
  2406. // subsequent list requests.
  2407. func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall {
  2408. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2409. return c
  2410. }
  2411. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  2412. // a certain order. By default, results are returned in alphanumerical
  2413. // order based on the resource name.
  2414. //
  2415. // You can also sort results in descending order based on the creation
  2416. // timestamp using orderBy="creationTimestamp desc". This sorts results
  2417. // based on the creationTimestamp field in reverse chronological order
  2418. // (newest result first). Use this to sort resources like operations so
  2419. // that the newest operation is returned first.
  2420. //
  2421. // Currently, only sorting by name or creationTimestamp desc is
  2422. // supported.
  2423. func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall {
  2424. c.urlParams_.Set("orderBy", orderBy)
  2425. return c
  2426. }
  2427. // PageToken sets the optional parameter "pageToken": Specifies a page
  2428. // token to use. Set pageToken to the nextPageToken returned by a
  2429. // previous list request to get the next page of results.
  2430. func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall {
  2431. c.urlParams_.Set("pageToken", pageToken)
  2432. return c
  2433. }
  2434. // Fields allows partial responses to be retrieved. See
  2435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2436. // for more information.
  2437. func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall {
  2438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2439. return c
  2440. }
  2441. // IfNoneMatch sets the optional parameter which makes the operation
  2442. // fail if the object's ETag matches the given value. This is useful for
  2443. // getting updates only after the object has changed since the last
  2444. // request. Use googleapi.IsNotModified to check whether the response
  2445. // error from Do is the result of In-None-Match.
  2446. func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall {
  2447. c.ifNoneMatch_ = entityTag
  2448. return c
  2449. }
  2450. // Context sets the context to be used in this call's Do method. Any
  2451. // pending HTTP request will be aborted if the provided context is
  2452. // canceled.
  2453. func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall {
  2454. c.ctx_ = ctx
  2455. return c
  2456. }
  2457. // Header returns an http.Header that can be modified by the caller to
  2458. // add HTTP headers to the request.
  2459. func (c *GroupsListCall) Header() http.Header {
  2460. if c.header_ == nil {
  2461. c.header_ = make(http.Header)
  2462. }
  2463. return c.header_
  2464. }
  2465. func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) {
  2466. reqHeaders := make(http.Header)
  2467. for k, v := range c.header_ {
  2468. reqHeaders[k] = v
  2469. }
  2470. reqHeaders.Set("User-Agent", c.s.userAgent())
  2471. if c.ifNoneMatch_ != "" {
  2472. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2473. }
  2474. var body io.Reader = nil
  2475. c.urlParams_.Set("alt", alt)
  2476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups")
  2477. urls += "?" + c.urlParams_.Encode()
  2478. req, _ := http.NewRequest("GET", urls, body)
  2479. req.Header = reqHeaders
  2480. googleapi.Expand(req.URL, map[string]string{
  2481. "project": c.project,
  2482. })
  2483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2484. }
  2485. // Do executes the "clouduseraccounts.groups.list" call.
  2486. // Exactly one of *GroupList or error will be non-nil. Any non-2xx
  2487. // status code is an error. Response headers are in either
  2488. // *GroupList.ServerResponse.Header or (if a response was returned at
  2489. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2490. // to check whether the returned error was because
  2491. // http.StatusNotModified was returned.
  2492. func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*GroupList, error) {
  2493. gensupport.SetOptions(c.urlParams_, opts...)
  2494. res, err := c.doRequest("json")
  2495. if res != nil && res.StatusCode == http.StatusNotModified {
  2496. if res.Body != nil {
  2497. res.Body.Close()
  2498. }
  2499. return nil, &googleapi.Error{
  2500. Code: res.StatusCode,
  2501. Header: res.Header,
  2502. }
  2503. }
  2504. if err != nil {
  2505. return nil, err
  2506. }
  2507. defer googleapi.CloseBody(res)
  2508. if err := googleapi.CheckResponse(res); err != nil {
  2509. return nil, err
  2510. }
  2511. ret := &GroupList{
  2512. ServerResponse: googleapi.ServerResponse{
  2513. Header: res.Header,
  2514. HTTPStatusCode: res.StatusCode,
  2515. },
  2516. }
  2517. target := &ret
  2518. if err := gensupport.DecodeResponse(target, res); err != nil {
  2519. return nil, err
  2520. }
  2521. return ret, nil
  2522. // {
  2523. // "description": "Retrieves the list of groups contained within the specified project.",
  2524. // "httpMethod": "GET",
  2525. // "id": "clouduseraccounts.groups.list",
  2526. // "parameterOrder": [
  2527. // "project"
  2528. // ],
  2529. // "parameters": {
  2530. // "filter": {
  2531. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  2532. // "location": "query",
  2533. // "type": "string"
  2534. // },
  2535. // "maxResults": {
  2536. // "default": "500",
  2537. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.",
  2538. // "format": "uint32",
  2539. // "location": "query",
  2540. // "maximum": "500",
  2541. // "minimum": "0",
  2542. // "type": "integer"
  2543. // },
  2544. // "orderBy": {
  2545. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  2546. // "location": "query",
  2547. // "type": "string"
  2548. // },
  2549. // "pageToken": {
  2550. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  2551. // "location": "query",
  2552. // "type": "string"
  2553. // },
  2554. // "project": {
  2555. // "description": "Project ID for this request.",
  2556. // "location": "path",
  2557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2558. // "required": true,
  2559. // "type": "string"
  2560. // }
  2561. // },
  2562. // "path": "{project}/global/groups",
  2563. // "response": {
  2564. // "$ref": "GroupList"
  2565. // },
  2566. // "scopes": [
  2567. // "https://www.googleapis.com/auth/cloud-platform",
  2568. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2569. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2570. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2571. // ]
  2572. // }
  2573. }
  2574. // Pages invokes f for each page of results.
  2575. // A non-nil error returned from f will halt the iteration.
  2576. // The provided context supersedes any context provided to the Context method.
  2577. func (c *GroupsListCall) Pages(ctx context.Context, f func(*GroupList) error) error {
  2578. c.ctx_ = ctx
  2579. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2580. for {
  2581. x, err := c.Do()
  2582. if err != nil {
  2583. return err
  2584. }
  2585. if err := f(x); err != nil {
  2586. return err
  2587. }
  2588. if x.NextPageToken == "" {
  2589. return nil
  2590. }
  2591. c.PageToken(x.NextPageToken)
  2592. }
  2593. }
  2594. // method id "clouduseraccounts.groups.removeMember":
  2595. type GroupsRemoveMemberCall struct {
  2596. s *Service
  2597. project string
  2598. groupName string
  2599. groupsremovememberrequest *GroupsRemoveMemberRequest
  2600. urlParams_ gensupport.URLParams
  2601. ctx_ context.Context
  2602. header_ http.Header
  2603. }
  2604. // RemoveMember: Removes users from the specified group.
  2605. func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall {
  2606. c := &GroupsRemoveMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2607. c.project = project
  2608. c.groupName = groupName
  2609. c.groupsremovememberrequest = groupsremovememberrequest
  2610. return c
  2611. }
  2612. // Fields allows partial responses to be retrieved. See
  2613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2614. // for more information.
  2615. func (c *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall {
  2616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2617. return c
  2618. }
  2619. // Context sets the context to be used in this call's Do method. Any
  2620. // pending HTTP request will be aborted if the provided context is
  2621. // canceled.
  2622. func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall {
  2623. c.ctx_ = ctx
  2624. return c
  2625. }
  2626. // Header returns an http.Header that can be modified by the caller to
  2627. // add HTTP headers to the request.
  2628. func (c *GroupsRemoveMemberCall) Header() http.Header {
  2629. if c.header_ == nil {
  2630. c.header_ = make(http.Header)
  2631. }
  2632. return c.header_
  2633. }
  2634. func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) {
  2635. reqHeaders := make(http.Header)
  2636. for k, v := range c.header_ {
  2637. reqHeaders[k] = v
  2638. }
  2639. reqHeaders.Set("User-Agent", c.s.userAgent())
  2640. var body io.Reader = nil
  2641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest)
  2642. if err != nil {
  2643. return nil, err
  2644. }
  2645. reqHeaders.Set("Content-Type", "application/json")
  2646. c.urlParams_.Set("alt", alt)
  2647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember")
  2648. urls += "?" + c.urlParams_.Encode()
  2649. req, _ := http.NewRequest("POST", urls, body)
  2650. req.Header = reqHeaders
  2651. googleapi.Expand(req.URL, map[string]string{
  2652. "project": c.project,
  2653. "groupName": c.groupName,
  2654. })
  2655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2656. }
  2657. // Do executes the "clouduseraccounts.groups.removeMember" call.
  2658. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2659. // status code is an error. Response headers are in either
  2660. // *Operation.ServerResponse.Header or (if a response was returned at
  2661. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2662. // to check whether the returned error was because
  2663. // http.StatusNotModified was returned.
  2664. func (c *GroupsRemoveMemberCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2665. gensupport.SetOptions(c.urlParams_, opts...)
  2666. res, err := c.doRequest("json")
  2667. if res != nil && res.StatusCode == http.StatusNotModified {
  2668. if res.Body != nil {
  2669. res.Body.Close()
  2670. }
  2671. return nil, &googleapi.Error{
  2672. Code: res.StatusCode,
  2673. Header: res.Header,
  2674. }
  2675. }
  2676. if err != nil {
  2677. return nil, err
  2678. }
  2679. defer googleapi.CloseBody(res)
  2680. if err := googleapi.CheckResponse(res); err != nil {
  2681. return nil, err
  2682. }
  2683. ret := &Operation{
  2684. ServerResponse: googleapi.ServerResponse{
  2685. Header: res.Header,
  2686. HTTPStatusCode: res.StatusCode,
  2687. },
  2688. }
  2689. target := &ret
  2690. if err := gensupport.DecodeResponse(target, res); err != nil {
  2691. return nil, err
  2692. }
  2693. return ret, nil
  2694. // {
  2695. // "description": "Removes users from the specified group.",
  2696. // "httpMethod": "POST",
  2697. // "id": "clouduseraccounts.groups.removeMember",
  2698. // "parameterOrder": [
  2699. // "project",
  2700. // "groupName"
  2701. // ],
  2702. // "parameters": {
  2703. // "groupName": {
  2704. // "description": "Name of the group for this request.",
  2705. // "location": "path",
  2706. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2707. // "required": true,
  2708. // "type": "string"
  2709. // },
  2710. // "project": {
  2711. // "description": "Project ID for this request.",
  2712. // "location": "path",
  2713. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2714. // "required": true,
  2715. // "type": "string"
  2716. // }
  2717. // },
  2718. // "path": "{project}/global/groups/{groupName}/removeMember",
  2719. // "request": {
  2720. // "$ref": "GroupsRemoveMemberRequest"
  2721. // },
  2722. // "response": {
  2723. // "$ref": "Operation"
  2724. // },
  2725. // "scopes": [
  2726. // "https://www.googleapis.com/auth/cloud-platform",
  2727. // "https://www.googleapis.com/auth/cloud.useraccounts"
  2728. // ]
  2729. // }
  2730. }
  2731. // method id "clouduseraccounts.groups.setIamPolicy":
  2732. type GroupsSetIamPolicyCall struct {
  2733. s *Service
  2734. project string
  2735. resource string
  2736. policy *Policy
  2737. urlParams_ gensupport.URLParams
  2738. ctx_ context.Context
  2739. header_ http.Header
  2740. }
  2741. // SetIamPolicy: Sets the access control policy on the specified
  2742. // resource. Replaces any existing policy.
  2743. func (r *GroupsService) SetIamPolicy(project string, resource string, policy *Policy) *GroupsSetIamPolicyCall {
  2744. c := &GroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2745. c.project = project
  2746. c.resource = resource
  2747. c.policy = policy
  2748. return c
  2749. }
  2750. // Fields allows partial responses to be retrieved. See
  2751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2752. // for more information.
  2753. func (c *GroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsSetIamPolicyCall {
  2754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2755. return c
  2756. }
  2757. // Context sets the context to be used in this call's Do method. Any
  2758. // pending HTTP request will be aborted if the provided context is
  2759. // canceled.
  2760. func (c *GroupsSetIamPolicyCall) Context(ctx context.Context) *GroupsSetIamPolicyCall {
  2761. c.ctx_ = ctx
  2762. return c
  2763. }
  2764. // Header returns an http.Header that can be modified by the caller to
  2765. // add HTTP headers to the request.
  2766. func (c *GroupsSetIamPolicyCall) Header() http.Header {
  2767. if c.header_ == nil {
  2768. c.header_ = make(http.Header)
  2769. }
  2770. return c.header_
  2771. }
  2772. func (c *GroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2773. reqHeaders := make(http.Header)
  2774. for k, v := range c.header_ {
  2775. reqHeaders[k] = v
  2776. }
  2777. reqHeaders.Set("User-Agent", c.s.userAgent())
  2778. var body io.Reader = nil
  2779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  2780. if err != nil {
  2781. return nil, err
  2782. }
  2783. reqHeaders.Set("Content-Type", "application/json")
  2784. c.urlParams_.Set("alt", alt)
  2785. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/setIamPolicy")
  2786. urls += "?" + c.urlParams_.Encode()
  2787. req, _ := http.NewRequest("POST", urls, body)
  2788. req.Header = reqHeaders
  2789. googleapi.Expand(req.URL, map[string]string{
  2790. "project": c.project,
  2791. "resource": c.resource,
  2792. })
  2793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2794. }
  2795. // Do executes the "clouduseraccounts.groups.setIamPolicy" call.
  2796. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  2797. // code is an error. Response headers are in either
  2798. // *Policy.ServerResponse.Header or (if a response was returned at all)
  2799. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2800. // check whether the returned error was because http.StatusNotModified
  2801. // was returned.
  2802. func (c *GroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2803. gensupport.SetOptions(c.urlParams_, opts...)
  2804. res, err := c.doRequest("json")
  2805. if res != nil && res.StatusCode == http.StatusNotModified {
  2806. if res.Body != nil {
  2807. res.Body.Close()
  2808. }
  2809. return nil, &googleapi.Error{
  2810. Code: res.StatusCode,
  2811. Header: res.Header,
  2812. }
  2813. }
  2814. if err != nil {
  2815. return nil, err
  2816. }
  2817. defer googleapi.CloseBody(res)
  2818. if err := googleapi.CheckResponse(res); err != nil {
  2819. return nil, err
  2820. }
  2821. ret := &Policy{
  2822. ServerResponse: googleapi.ServerResponse{
  2823. Header: res.Header,
  2824. HTTPStatusCode: res.StatusCode,
  2825. },
  2826. }
  2827. target := &ret
  2828. if err := gensupport.DecodeResponse(target, res); err != nil {
  2829. return nil, err
  2830. }
  2831. return ret, nil
  2832. // {
  2833. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  2834. // "httpMethod": "POST",
  2835. // "id": "clouduseraccounts.groups.setIamPolicy",
  2836. // "parameterOrder": [
  2837. // "project",
  2838. // "resource"
  2839. // ],
  2840. // "parameters": {
  2841. // "project": {
  2842. // "description": "Project ID for this request.",
  2843. // "location": "path",
  2844. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2845. // "required": true,
  2846. // "type": "string"
  2847. // },
  2848. // "resource": {
  2849. // "description": "Name of the resource for this request.",
  2850. // "location": "path",
  2851. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  2852. // "required": true,
  2853. // "type": "string"
  2854. // }
  2855. // },
  2856. // "path": "{project}/global/groups/{resource}/setIamPolicy",
  2857. // "request": {
  2858. // "$ref": "Policy"
  2859. // },
  2860. // "response": {
  2861. // "$ref": "Policy"
  2862. // },
  2863. // "scopes": [
  2864. // "https://www.googleapis.com/auth/cloud-platform",
  2865. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2866. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2867. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2868. // ]
  2869. // }
  2870. }
  2871. // method id "clouduseraccounts.groups.testIamPermissions":
  2872. type GroupsTestIamPermissionsCall struct {
  2873. s *Service
  2874. project string
  2875. resource string
  2876. testpermissionsrequest *TestPermissionsRequest
  2877. urlParams_ gensupport.URLParams
  2878. ctx_ context.Context
  2879. header_ http.Header
  2880. }
  2881. // TestIamPermissions: Returns permissions that a caller has on the
  2882. // specified resource.
  2883. func (r *GroupsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GroupsTestIamPermissionsCall {
  2884. c := &GroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2885. c.project = project
  2886. c.resource = resource
  2887. c.testpermissionsrequest = testpermissionsrequest
  2888. return c
  2889. }
  2890. // Fields allows partial responses to be retrieved. See
  2891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2892. // for more information.
  2893. func (c *GroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *GroupsTestIamPermissionsCall {
  2894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2895. return c
  2896. }
  2897. // Context sets the context to be used in this call's Do method. Any
  2898. // pending HTTP request will be aborted if the provided context is
  2899. // canceled.
  2900. func (c *GroupsTestIamPermissionsCall) Context(ctx context.Context) *GroupsTestIamPermissionsCall {
  2901. c.ctx_ = ctx
  2902. return c
  2903. }
  2904. // Header returns an http.Header that can be modified by the caller to
  2905. // add HTTP headers to the request.
  2906. func (c *GroupsTestIamPermissionsCall) Header() http.Header {
  2907. if c.header_ == nil {
  2908. c.header_ = make(http.Header)
  2909. }
  2910. return c.header_
  2911. }
  2912. func (c *GroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2913. reqHeaders := make(http.Header)
  2914. for k, v := range c.header_ {
  2915. reqHeaders[k] = v
  2916. }
  2917. reqHeaders.Set("User-Agent", c.s.userAgent())
  2918. var body io.Reader = nil
  2919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  2920. if err != nil {
  2921. return nil, err
  2922. }
  2923. reqHeaders.Set("Content-Type", "application/json")
  2924. c.urlParams_.Set("alt", alt)
  2925. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/testIamPermissions")
  2926. urls += "?" + c.urlParams_.Encode()
  2927. req, _ := http.NewRequest("POST", urls, body)
  2928. req.Header = reqHeaders
  2929. googleapi.Expand(req.URL, map[string]string{
  2930. "project": c.project,
  2931. "resource": c.resource,
  2932. })
  2933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2934. }
  2935. // Do executes the "clouduseraccounts.groups.testIamPermissions" call.
  2936. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  2937. // non-2xx status code is an error. Response headers are in either
  2938. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  2939. // returned at all) in error.(*googleapi.Error).Header. Use
  2940. // googleapi.IsNotModified to check whether the returned error was
  2941. // because http.StatusNotModified was returned.
  2942. func (c *GroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  2943. gensupport.SetOptions(c.urlParams_, opts...)
  2944. res, err := c.doRequest("json")
  2945. if res != nil && res.StatusCode == http.StatusNotModified {
  2946. if res.Body != nil {
  2947. res.Body.Close()
  2948. }
  2949. return nil, &googleapi.Error{
  2950. Code: res.StatusCode,
  2951. Header: res.Header,
  2952. }
  2953. }
  2954. if err != nil {
  2955. return nil, err
  2956. }
  2957. defer googleapi.CloseBody(res)
  2958. if err := googleapi.CheckResponse(res); err != nil {
  2959. return nil, err
  2960. }
  2961. ret := &TestPermissionsResponse{
  2962. ServerResponse: googleapi.ServerResponse{
  2963. Header: res.Header,
  2964. HTTPStatusCode: res.StatusCode,
  2965. },
  2966. }
  2967. target := &ret
  2968. if err := gensupport.DecodeResponse(target, res); err != nil {
  2969. return nil, err
  2970. }
  2971. return ret, nil
  2972. // {
  2973. // "description": "Returns permissions that a caller has on the specified resource.",
  2974. // "httpMethod": "POST",
  2975. // "id": "clouduseraccounts.groups.testIamPermissions",
  2976. // "parameterOrder": [
  2977. // "project",
  2978. // "resource"
  2979. // ],
  2980. // "parameters": {
  2981. // "project": {
  2982. // "description": "Project ID for this request.",
  2983. // "location": "path",
  2984. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2985. // "required": true,
  2986. // "type": "string"
  2987. // },
  2988. // "resource": {
  2989. // "description": "Name of the resource for this request.",
  2990. // "location": "path",
  2991. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  2992. // "required": true,
  2993. // "type": "string"
  2994. // }
  2995. // },
  2996. // "path": "{project}/global/groups/{resource}/testIamPermissions",
  2997. // "request": {
  2998. // "$ref": "TestPermissionsRequest"
  2999. // },
  3000. // "response": {
  3001. // "$ref": "TestPermissionsResponse"
  3002. // },
  3003. // "scopes": [
  3004. // "https://www.googleapis.com/auth/cloud-platform",
  3005. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3006. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3007. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3008. // ]
  3009. // }
  3010. }
  3011. // method id "clouduseraccounts.linux.getAuthorizedKeysView":
  3012. type LinuxGetAuthorizedKeysViewCall struct {
  3013. s *Service
  3014. project string
  3015. zone string
  3016. user string
  3017. urlParams_ gensupport.URLParams
  3018. ctx_ context.Context
  3019. header_ http.Header
  3020. }
  3021. // GetAuthorizedKeysView: Returns a list of authorized public keys for a
  3022. // specific user account.
  3023. func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall {
  3024. c := &LinuxGetAuthorizedKeysViewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3025. c.project = project
  3026. c.zone = zone
  3027. c.user = user
  3028. c.urlParams_.Set("instance", instance)
  3029. return c
  3030. }
  3031. // Login sets the optional parameter "login": Whether the view was
  3032. // requested as part of a user-initiated login.
  3033. func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall {
  3034. c.urlParams_.Set("login", fmt.Sprint(login))
  3035. return c
  3036. }
  3037. // Fields allows partial responses to be retrieved. See
  3038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3039. // for more information.
  3040. func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall {
  3041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3042. return c
  3043. }
  3044. // Context sets the context to be used in this call's Do method. Any
  3045. // pending HTTP request will be aborted if the provided context is
  3046. // canceled.
  3047. func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall {
  3048. c.ctx_ = ctx
  3049. return c
  3050. }
  3051. // Header returns an http.Header that can be modified by the caller to
  3052. // add HTTP headers to the request.
  3053. func (c *LinuxGetAuthorizedKeysViewCall) Header() http.Header {
  3054. if c.header_ == nil {
  3055. c.header_ = make(http.Header)
  3056. }
  3057. return c.header_
  3058. }
  3059. func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) {
  3060. reqHeaders := make(http.Header)
  3061. for k, v := range c.header_ {
  3062. reqHeaders[k] = v
  3063. }
  3064. reqHeaders.Set("User-Agent", c.s.userAgent())
  3065. var body io.Reader = nil
  3066. c.urlParams_.Set("alt", alt)
  3067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}")
  3068. urls += "?" + c.urlParams_.Encode()
  3069. req, _ := http.NewRequest("POST", urls, body)
  3070. req.Header = reqHeaders
  3071. googleapi.Expand(req.URL, map[string]string{
  3072. "project": c.project,
  3073. "zone": c.zone,
  3074. "user": c.user,
  3075. })
  3076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3077. }
  3078. // Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call.
  3079. // Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be
  3080. // non-nil. Any non-2xx status code is an error. Response headers are in
  3081. // either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or
  3082. // (if a response was returned at all) in
  3083. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3084. // whether the returned error was because http.StatusNotModified was
  3085. // returned.
  3086. func (c *LinuxGetAuthorizedKeysViewCall) Do(opts ...googleapi.CallOption) (*LinuxGetAuthorizedKeysViewResponse, error) {
  3087. gensupport.SetOptions(c.urlParams_, opts...)
  3088. res, err := c.doRequest("json")
  3089. if res != nil && res.StatusCode == http.StatusNotModified {
  3090. if res.Body != nil {
  3091. res.Body.Close()
  3092. }
  3093. return nil, &googleapi.Error{
  3094. Code: res.StatusCode,
  3095. Header: res.Header,
  3096. }
  3097. }
  3098. if err != nil {
  3099. return nil, err
  3100. }
  3101. defer googleapi.CloseBody(res)
  3102. if err := googleapi.CheckResponse(res); err != nil {
  3103. return nil, err
  3104. }
  3105. ret := &LinuxGetAuthorizedKeysViewResponse{
  3106. ServerResponse: googleapi.ServerResponse{
  3107. Header: res.Header,
  3108. HTTPStatusCode: res.StatusCode,
  3109. },
  3110. }
  3111. target := &ret
  3112. if err := gensupport.DecodeResponse(target, res); err != nil {
  3113. return nil, err
  3114. }
  3115. return ret, nil
  3116. // {
  3117. // "description": "Returns a list of authorized public keys for a specific user account.",
  3118. // "httpMethod": "POST",
  3119. // "id": "clouduseraccounts.linux.getAuthorizedKeysView",
  3120. // "parameterOrder": [
  3121. // "project",
  3122. // "zone",
  3123. // "user",
  3124. // "instance"
  3125. // ],
  3126. // "parameters": {
  3127. // "instance": {
  3128. // "description": "The fully-qualified URL of the virtual machine requesting the view.",
  3129. // "location": "query",
  3130. // "required": true,
  3131. // "type": "string"
  3132. // },
  3133. // "login": {
  3134. // "description": "Whether the view was requested as part of a user-initiated login.",
  3135. // "location": "query",
  3136. // "type": "boolean"
  3137. // },
  3138. // "project": {
  3139. // "description": "Project ID for this request.",
  3140. // "location": "path",
  3141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3142. // "required": true,
  3143. // "type": "string"
  3144. // },
  3145. // "user": {
  3146. // "description": "The user account for which you want to get a list of authorized public keys.",
  3147. // "location": "path",
  3148. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3149. // "required": true,
  3150. // "type": "string"
  3151. // },
  3152. // "zone": {
  3153. // "description": "Name of the zone for this request.",
  3154. // "location": "path",
  3155. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3156. // "required": true,
  3157. // "type": "string"
  3158. // }
  3159. // },
  3160. // "path": "{project}/zones/{zone}/authorizedKeysView/{user}",
  3161. // "response": {
  3162. // "$ref": "LinuxGetAuthorizedKeysViewResponse"
  3163. // },
  3164. // "scopes": [
  3165. // "https://www.googleapis.com/auth/cloud-platform",
  3166. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3167. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3168. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3169. // ]
  3170. // }
  3171. }
  3172. // method id "clouduseraccounts.linux.getLinuxAccountViews":
  3173. type LinuxGetLinuxAccountViewsCall struct {
  3174. s *Service
  3175. project string
  3176. zone string
  3177. urlParams_ gensupport.URLParams
  3178. ctx_ context.Context
  3179. header_ http.Header
  3180. }
  3181. // GetLinuxAccountViews: Retrieves a list of user accounts for an
  3182. // instance within a specific project.
  3183. func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall {
  3184. c := &LinuxGetLinuxAccountViewsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3185. c.project = project
  3186. c.zone = zone
  3187. c.urlParams_.Set("instance", instance)
  3188. return c
  3189. }
  3190. // Filter sets the optional parameter "filter": Sets a filter expression
  3191. // for filtering listed resources, in the form filter={expression}. Your
  3192. // {expression} must be in the format: field_name comparison_string
  3193. // literal_string.
  3194. //
  3195. // The field_name is the name of the field you want to compare. Only
  3196. // atomic field types are supported (string, number, boolean). The
  3197. // comparison_string must be either eq (equals) or ne (not equals). The
  3198. // literal_string is the string value to filter to. The literal value
  3199. // must be valid for the type of field you are filtering by (string,
  3200. // number, boolean). For string fields, the literal value is interpreted
  3201. // as a regular expression using RE2 syntax. The literal value must
  3202. // match the entire field.
  3203. //
  3204. // For example, to filter for instances that do not have a name of
  3205. // example-instance, you would use filter=name ne
  3206. // example-instance.
  3207. //
  3208. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  3209. // you can also filter on nested fields. For example, you could filter
  3210. // on instances that have set the scheduling.automaticRestart field to
  3211. // true. In particular, use filtering on nested fields to take advantage
  3212. // of instance labels to organize and filter results based on label
  3213. // values.
  3214. //
  3215. // The Beta API also supports filtering on multiple expressions by
  3216. // providing each separate expression within parentheses. For example,
  3217. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  3218. // Multiple expressions are treated as AND expressions, meaning that
  3219. // resources must match all expressions to pass the filters.
  3220. func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall {
  3221. c.urlParams_.Set("filter", filter)
  3222. return c
  3223. }
  3224. // MaxResults sets the optional parameter "maxResults": The maximum
  3225. // number of results per page that should be returned. If the number of
  3226. // available results is larger than maxResults, Compute Engine returns a
  3227. // nextPageToken that can be used to get the next page of results in
  3228. // subsequent list requests.
  3229. func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall {
  3230. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3231. return c
  3232. }
  3233. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  3234. // a certain order. By default, results are returned in alphanumerical
  3235. // order based on the resource name.
  3236. //
  3237. // You can also sort results in descending order based on the creation
  3238. // timestamp using orderBy="creationTimestamp desc". This sorts results
  3239. // based on the creationTimestamp field in reverse chronological order
  3240. // (newest result first). Use this to sort resources like operations so
  3241. // that the newest operation is returned first.
  3242. //
  3243. // Currently, only sorting by name or creationTimestamp desc is
  3244. // supported.
  3245. func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall {
  3246. c.urlParams_.Set("orderBy", orderBy)
  3247. return c
  3248. }
  3249. // PageToken sets the optional parameter "pageToken": Specifies a page
  3250. // token to use. Set pageToken to the nextPageToken returned by a
  3251. // previous list request to get the next page of results.
  3252. func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall {
  3253. c.urlParams_.Set("pageToken", pageToken)
  3254. return c
  3255. }
  3256. // Fields allows partial responses to be retrieved. See
  3257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3258. // for more information.
  3259. func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall {
  3260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3261. return c
  3262. }
  3263. // Context sets the context to be used in this call's Do method. Any
  3264. // pending HTTP request will be aborted if the provided context is
  3265. // canceled.
  3266. func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall {
  3267. c.ctx_ = ctx
  3268. return c
  3269. }
  3270. // Header returns an http.Header that can be modified by the caller to
  3271. // add HTTP headers to the request.
  3272. func (c *LinuxGetLinuxAccountViewsCall) Header() http.Header {
  3273. if c.header_ == nil {
  3274. c.header_ = make(http.Header)
  3275. }
  3276. return c.header_
  3277. }
  3278. func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) {
  3279. reqHeaders := make(http.Header)
  3280. for k, v := range c.header_ {
  3281. reqHeaders[k] = v
  3282. }
  3283. reqHeaders.Set("User-Agent", c.s.userAgent())
  3284. var body io.Reader = nil
  3285. c.urlParams_.Set("alt", alt)
  3286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews")
  3287. urls += "?" + c.urlParams_.Encode()
  3288. req, _ := http.NewRequest("POST", urls, body)
  3289. req.Header = reqHeaders
  3290. googleapi.Expand(req.URL, map[string]string{
  3291. "project": c.project,
  3292. "zone": c.zone,
  3293. })
  3294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3295. }
  3296. // Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call.
  3297. // Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be
  3298. // non-nil. Any non-2xx status code is an error. Response headers are in
  3299. // either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or
  3300. // (if a response was returned at all) in
  3301. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3302. // whether the returned error was because http.StatusNotModified was
  3303. // returned.
  3304. func (c *LinuxGetLinuxAccountViewsCall) Do(opts ...googleapi.CallOption) (*LinuxGetLinuxAccountViewsResponse, error) {
  3305. gensupport.SetOptions(c.urlParams_, opts...)
  3306. res, err := c.doRequest("json")
  3307. if res != nil && res.StatusCode == http.StatusNotModified {
  3308. if res.Body != nil {
  3309. res.Body.Close()
  3310. }
  3311. return nil, &googleapi.Error{
  3312. Code: res.StatusCode,
  3313. Header: res.Header,
  3314. }
  3315. }
  3316. if err != nil {
  3317. return nil, err
  3318. }
  3319. defer googleapi.CloseBody(res)
  3320. if err := googleapi.CheckResponse(res); err != nil {
  3321. return nil, err
  3322. }
  3323. ret := &LinuxGetLinuxAccountViewsResponse{
  3324. ServerResponse: googleapi.ServerResponse{
  3325. Header: res.Header,
  3326. HTTPStatusCode: res.StatusCode,
  3327. },
  3328. }
  3329. target := &ret
  3330. if err := gensupport.DecodeResponse(target, res); err != nil {
  3331. return nil, err
  3332. }
  3333. return ret, nil
  3334. // {
  3335. // "description": "Retrieves a list of user accounts for an instance within a specific project.",
  3336. // "httpMethod": "POST",
  3337. // "id": "clouduseraccounts.linux.getLinuxAccountViews",
  3338. // "parameterOrder": [
  3339. // "project",
  3340. // "zone",
  3341. // "instance"
  3342. // ],
  3343. // "parameters": {
  3344. // "filter": {
  3345. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  3346. // "location": "query",
  3347. // "type": "string"
  3348. // },
  3349. // "instance": {
  3350. // "description": "The fully-qualified URL of the virtual machine requesting the views.",
  3351. // "location": "query",
  3352. // "required": true,
  3353. // "type": "string"
  3354. // },
  3355. // "maxResults": {
  3356. // "default": "500",
  3357. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.",
  3358. // "format": "uint32",
  3359. // "location": "query",
  3360. // "maximum": "500",
  3361. // "minimum": "0",
  3362. // "type": "integer"
  3363. // },
  3364. // "orderBy": {
  3365. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  3366. // "location": "query",
  3367. // "type": "string"
  3368. // },
  3369. // "pageToken": {
  3370. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  3371. // "location": "query",
  3372. // "type": "string"
  3373. // },
  3374. // "project": {
  3375. // "description": "Project ID for this request.",
  3376. // "location": "path",
  3377. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3378. // "required": true,
  3379. // "type": "string"
  3380. // },
  3381. // "zone": {
  3382. // "description": "Name of the zone for this request.",
  3383. // "location": "path",
  3384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3385. // "required": true,
  3386. // "type": "string"
  3387. // }
  3388. // },
  3389. // "path": "{project}/zones/{zone}/linuxAccountViews",
  3390. // "response": {
  3391. // "$ref": "LinuxGetLinuxAccountViewsResponse"
  3392. // },
  3393. // "scopes": [
  3394. // "https://www.googleapis.com/auth/cloud-platform",
  3395. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3396. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3397. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3398. // ]
  3399. // }
  3400. }
  3401. // method id "clouduseraccounts.users.addPublicKey":
  3402. type UsersAddPublicKeyCall struct {
  3403. s *Service
  3404. project string
  3405. user string
  3406. publickey *PublicKey
  3407. urlParams_ gensupport.URLParams
  3408. ctx_ context.Context
  3409. header_ http.Header
  3410. }
  3411. // AddPublicKey: Adds a public key to the specified User resource with
  3412. // the data included in the request.
  3413. func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall {
  3414. c := &UsersAddPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3415. c.project = project
  3416. c.user = user
  3417. c.publickey = publickey
  3418. return c
  3419. }
  3420. // Fields allows partial responses to be retrieved. See
  3421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3422. // for more information.
  3423. func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall {
  3424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3425. return c
  3426. }
  3427. // Context sets the context to be used in this call's Do method. Any
  3428. // pending HTTP request will be aborted if the provided context is
  3429. // canceled.
  3430. func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall {
  3431. c.ctx_ = ctx
  3432. return c
  3433. }
  3434. // Header returns an http.Header that can be modified by the caller to
  3435. // add HTTP headers to the request.
  3436. func (c *UsersAddPublicKeyCall) Header() http.Header {
  3437. if c.header_ == nil {
  3438. c.header_ = make(http.Header)
  3439. }
  3440. return c.header_
  3441. }
  3442. func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) {
  3443. reqHeaders := make(http.Header)
  3444. for k, v := range c.header_ {
  3445. reqHeaders[k] = v
  3446. }
  3447. reqHeaders.Set("User-Agent", c.s.userAgent())
  3448. var body io.Reader = nil
  3449. body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey)
  3450. if err != nil {
  3451. return nil, err
  3452. }
  3453. reqHeaders.Set("Content-Type", "application/json")
  3454. c.urlParams_.Set("alt", alt)
  3455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey")
  3456. urls += "?" + c.urlParams_.Encode()
  3457. req, _ := http.NewRequest("POST", urls, body)
  3458. req.Header = reqHeaders
  3459. googleapi.Expand(req.URL, map[string]string{
  3460. "project": c.project,
  3461. "user": c.user,
  3462. })
  3463. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3464. }
  3465. // Do executes the "clouduseraccounts.users.addPublicKey" call.
  3466. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3467. // status code is an error. Response headers are in either
  3468. // *Operation.ServerResponse.Header or (if a response was returned at
  3469. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3470. // to check whether the returned error was because
  3471. // http.StatusNotModified was returned.
  3472. func (c *UsersAddPublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3473. gensupport.SetOptions(c.urlParams_, opts...)
  3474. res, err := c.doRequest("json")
  3475. if res != nil && res.StatusCode == http.StatusNotModified {
  3476. if res.Body != nil {
  3477. res.Body.Close()
  3478. }
  3479. return nil, &googleapi.Error{
  3480. Code: res.StatusCode,
  3481. Header: res.Header,
  3482. }
  3483. }
  3484. if err != nil {
  3485. return nil, err
  3486. }
  3487. defer googleapi.CloseBody(res)
  3488. if err := googleapi.CheckResponse(res); err != nil {
  3489. return nil, err
  3490. }
  3491. ret := &Operation{
  3492. ServerResponse: googleapi.ServerResponse{
  3493. Header: res.Header,
  3494. HTTPStatusCode: res.StatusCode,
  3495. },
  3496. }
  3497. target := &ret
  3498. if err := gensupport.DecodeResponse(target, res); err != nil {
  3499. return nil, err
  3500. }
  3501. return ret, nil
  3502. // {
  3503. // "description": "Adds a public key to the specified User resource with the data included in the request.",
  3504. // "httpMethod": "POST",
  3505. // "id": "clouduseraccounts.users.addPublicKey",
  3506. // "parameterOrder": [
  3507. // "project",
  3508. // "user"
  3509. // ],
  3510. // "parameters": {
  3511. // "project": {
  3512. // "description": "Project ID for this request.",
  3513. // "location": "path",
  3514. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3515. // "required": true,
  3516. // "type": "string"
  3517. // },
  3518. // "user": {
  3519. // "description": "Name of the user for this request.",
  3520. // "location": "path",
  3521. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3522. // "required": true,
  3523. // "type": "string"
  3524. // }
  3525. // },
  3526. // "path": "{project}/global/users/{user}/addPublicKey",
  3527. // "request": {
  3528. // "$ref": "PublicKey"
  3529. // },
  3530. // "response": {
  3531. // "$ref": "Operation"
  3532. // },
  3533. // "scopes": [
  3534. // "https://www.googleapis.com/auth/cloud-platform",
  3535. // "https://www.googleapis.com/auth/cloud.useraccounts"
  3536. // ]
  3537. // }
  3538. }
  3539. // method id "clouduseraccounts.users.delete":
  3540. type UsersDeleteCall struct {
  3541. s *Service
  3542. project string
  3543. user string
  3544. urlParams_ gensupport.URLParams
  3545. ctx_ context.Context
  3546. header_ http.Header
  3547. }
  3548. // Delete: Deletes the specified User resource.
  3549. func (r *UsersService) Delete(project string, user string) *UsersDeleteCall {
  3550. c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3551. c.project = project
  3552. c.user = user
  3553. return c
  3554. }
  3555. // Fields allows partial responses to be retrieved. See
  3556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3557. // for more information.
  3558. func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
  3559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3560. return c
  3561. }
  3562. // Context sets the context to be used in this call's Do method. Any
  3563. // pending HTTP request will be aborted if the provided context is
  3564. // canceled.
  3565. func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
  3566. c.ctx_ = ctx
  3567. return c
  3568. }
  3569. // Header returns an http.Header that can be modified by the caller to
  3570. // add HTTP headers to the request.
  3571. func (c *UsersDeleteCall) Header() http.Header {
  3572. if c.header_ == nil {
  3573. c.header_ = make(http.Header)
  3574. }
  3575. return c.header_
  3576. }
  3577. func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3578. reqHeaders := make(http.Header)
  3579. for k, v := range c.header_ {
  3580. reqHeaders[k] = v
  3581. }
  3582. reqHeaders.Set("User-Agent", c.s.userAgent())
  3583. var body io.Reader = nil
  3584. c.urlParams_.Set("alt", alt)
  3585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}")
  3586. urls += "?" + c.urlParams_.Encode()
  3587. req, _ := http.NewRequest("DELETE", urls, body)
  3588. req.Header = reqHeaders
  3589. googleapi.Expand(req.URL, map[string]string{
  3590. "project": c.project,
  3591. "user": c.user,
  3592. })
  3593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3594. }
  3595. // Do executes the "clouduseraccounts.users.delete" call.
  3596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3597. // status code is an error. Response headers are in either
  3598. // *Operation.ServerResponse.Header or (if a response was returned at
  3599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3600. // to check whether the returned error was because
  3601. // http.StatusNotModified was returned.
  3602. func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3603. gensupport.SetOptions(c.urlParams_, opts...)
  3604. res, err := c.doRequest("json")
  3605. if res != nil && res.StatusCode == http.StatusNotModified {
  3606. if res.Body != nil {
  3607. res.Body.Close()
  3608. }
  3609. return nil, &googleapi.Error{
  3610. Code: res.StatusCode,
  3611. Header: res.Header,
  3612. }
  3613. }
  3614. if err != nil {
  3615. return nil, err
  3616. }
  3617. defer googleapi.CloseBody(res)
  3618. if err := googleapi.CheckResponse(res); err != nil {
  3619. return nil, err
  3620. }
  3621. ret := &Operation{
  3622. ServerResponse: googleapi.ServerResponse{
  3623. Header: res.Header,
  3624. HTTPStatusCode: res.StatusCode,
  3625. },
  3626. }
  3627. target := &ret
  3628. if err := gensupport.DecodeResponse(target, res); err != nil {
  3629. return nil, err
  3630. }
  3631. return ret, nil
  3632. // {
  3633. // "description": "Deletes the specified User resource.",
  3634. // "httpMethod": "DELETE",
  3635. // "id": "clouduseraccounts.users.delete",
  3636. // "parameterOrder": [
  3637. // "project",
  3638. // "user"
  3639. // ],
  3640. // "parameters": {
  3641. // "project": {
  3642. // "description": "Project ID for this request.",
  3643. // "location": "path",
  3644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3645. // "required": true,
  3646. // "type": "string"
  3647. // },
  3648. // "user": {
  3649. // "description": "Name of the user resource to delete.",
  3650. // "location": "path",
  3651. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3652. // "required": true,
  3653. // "type": "string"
  3654. // }
  3655. // },
  3656. // "path": "{project}/global/users/{user}",
  3657. // "response": {
  3658. // "$ref": "Operation"
  3659. // },
  3660. // "scopes": [
  3661. // "https://www.googleapis.com/auth/cloud-platform",
  3662. // "https://www.googleapis.com/auth/cloud.useraccounts"
  3663. // ]
  3664. // }
  3665. }
  3666. // method id "clouduseraccounts.users.get":
  3667. type UsersGetCall struct {
  3668. s *Service
  3669. project string
  3670. user string
  3671. urlParams_ gensupport.URLParams
  3672. ifNoneMatch_ string
  3673. ctx_ context.Context
  3674. header_ http.Header
  3675. }
  3676. // Get: Returns the specified User resource.
  3677. func (r *UsersService) Get(project string, user string) *UsersGetCall {
  3678. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3679. c.project = project
  3680. c.user = user
  3681. return c
  3682. }
  3683. // Fields allows partial responses to be retrieved. See
  3684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3685. // for more information.
  3686. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  3687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3688. return c
  3689. }
  3690. // IfNoneMatch sets the optional parameter which makes the operation
  3691. // fail if the object's ETag matches the given value. This is useful for
  3692. // getting updates only after the object has changed since the last
  3693. // request. Use googleapi.IsNotModified to check whether the response
  3694. // error from Do is the result of In-None-Match.
  3695. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  3696. c.ifNoneMatch_ = entityTag
  3697. return c
  3698. }
  3699. // Context sets the context to be used in this call's Do method. Any
  3700. // pending HTTP request will be aborted if the provided context is
  3701. // canceled.
  3702. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  3703. c.ctx_ = ctx
  3704. return c
  3705. }
  3706. // Header returns an http.Header that can be modified by the caller to
  3707. // add HTTP headers to the request.
  3708. func (c *UsersGetCall) Header() http.Header {
  3709. if c.header_ == nil {
  3710. c.header_ = make(http.Header)
  3711. }
  3712. return c.header_
  3713. }
  3714. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  3715. reqHeaders := make(http.Header)
  3716. for k, v := range c.header_ {
  3717. reqHeaders[k] = v
  3718. }
  3719. reqHeaders.Set("User-Agent", c.s.userAgent())
  3720. if c.ifNoneMatch_ != "" {
  3721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3722. }
  3723. var body io.Reader = nil
  3724. c.urlParams_.Set("alt", alt)
  3725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}")
  3726. urls += "?" + c.urlParams_.Encode()
  3727. req, _ := http.NewRequest("GET", urls, body)
  3728. req.Header = reqHeaders
  3729. googleapi.Expand(req.URL, map[string]string{
  3730. "project": c.project,
  3731. "user": c.user,
  3732. })
  3733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3734. }
  3735. // Do executes the "clouduseraccounts.users.get" call.
  3736. // Exactly one of *User or error will be non-nil. Any non-2xx status
  3737. // code is an error. Response headers are in either
  3738. // *User.ServerResponse.Header or (if a response was returned at all) in
  3739. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3740. // whether the returned error was because http.StatusNotModified was
  3741. // returned.
  3742. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  3743. gensupport.SetOptions(c.urlParams_, opts...)
  3744. res, err := c.doRequest("json")
  3745. if res != nil && res.StatusCode == http.StatusNotModified {
  3746. if res.Body != nil {
  3747. res.Body.Close()
  3748. }
  3749. return nil, &googleapi.Error{
  3750. Code: res.StatusCode,
  3751. Header: res.Header,
  3752. }
  3753. }
  3754. if err != nil {
  3755. return nil, err
  3756. }
  3757. defer googleapi.CloseBody(res)
  3758. if err := googleapi.CheckResponse(res); err != nil {
  3759. return nil, err
  3760. }
  3761. ret := &User{
  3762. ServerResponse: googleapi.ServerResponse{
  3763. Header: res.Header,
  3764. HTTPStatusCode: res.StatusCode,
  3765. },
  3766. }
  3767. target := &ret
  3768. if err := gensupport.DecodeResponse(target, res); err != nil {
  3769. return nil, err
  3770. }
  3771. return ret, nil
  3772. // {
  3773. // "description": "Returns the specified User resource.",
  3774. // "httpMethod": "GET",
  3775. // "id": "clouduseraccounts.users.get",
  3776. // "parameterOrder": [
  3777. // "project",
  3778. // "user"
  3779. // ],
  3780. // "parameters": {
  3781. // "project": {
  3782. // "description": "Project ID for this request.",
  3783. // "location": "path",
  3784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3785. // "required": true,
  3786. // "type": "string"
  3787. // },
  3788. // "user": {
  3789. // "description": "Name of the user resource to return.",
  3790. // "location": "path",
  3791. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3792. // "required": true,
  3793. // "type": "string"
  3794. // }
  3795. // },
  3796. // "path": "{project}/global/users/{user}",
  3797. // "response": {
  3798. // "$ref": "User"
  3799. // },
  3800. // "scopes": [
  3801. // "https://www.googleapis.com/auth/cloud-platform",
  3802. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3803. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3804. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3805. // ]
  3806. // }
  3807. }
  3808. // method id "clouduseraccounts.users.getIamPolicy":
  3809. type UsersGetIamPolicyCall struct {
  3810. s *Service
  3811. project string
  3812. resource string
  3813. urlParams_ gensupport.URLParams
  3814. ifNoneMatch_ string
  3815. ctx_ context.Context
  3816. header_ http.Header
  3817. }
  3818. // GetIamPolicy: Gets the access control policy for a resource. May be
  3819. // empty if no such policy or resource exists.
  3820. func (r *UsersService) GetIamPolicy(project string, resource string) *UsersGetIamPolicyCall {
  3821. c := &UsersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3822. c.project = project
  3823. c.resource = resource
  3824. return c
  3825. }
  3826. // Fields allows partial responses to be retrieved. See
  3827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3828. // for more information.
  3829. func (c *UsersGetIamPolicyCall) Fields(s ...googleapi.Field) *UsersGetIamPolicyCall {
  3830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3831. return c
  3832. }
  3833. // IfNoneMatch sets the optional parameter which makes the operation
  3834. // fail if the object's ETag matches the given value. This is useful for
  3835. // getting updates only after the object has changed since the last
  3836. // request. Use googleapi.IsNotModified to check whether the response
  3837. // error from Do is the result of In-None-Match.
  3838. func (c *UsersGetIamPolicyCall) IfNoneMatch(entityTag string) *UsersGetIamPolicyCall {
  3839. c.ifNoneMatch_ = entityTag
  3840. return c
  3841. }
  3842. // Context sets the context to be used in this call's Do method. Any
  3843. // pending HTTP request will be aborted if the provided context is
  3844. // canceled.
  3845. func (c *UsersGetIamPolicyCall) Context(ctx context.Context) *UsersGetIamPolicyCall {
  3846. c.ctx_ = ctx
  3847. return c
  3848. }
  3849. // Header returns an http.Header that can be modified by the caller to
  3850. // add HTTP headers to the request.
  3851. func (c *UsersGetIamPolicyCall) Header() http.Header {
  3852. if c.header_ == nil {
  3853. c.header_ = make(http.Header)
  3854. }
  3855. return c.header_
  3856. }
  3857. func (c *UsersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3858. reqHeaders := make(http.Header)
  3859. for k, v := range c.header_ {
  3860. reqHeaders[k] = v
  3861. }
  3862. reqHeaders.Set("User-Agent", c.s.userAgent())
  3863. if c.ifNoneMatch_ != "" {
  3864. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3865. }
  3866. var body io.Reader = nil
  3867. c.urlParams_.Set("alt", alt)
  3868. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/getIamPolicy")
  3869. urls += "?" + c.urlParams_.Encode()
  3870. req, _ := http.NewRequest("GET", urls, body)
  3871. req.Header = reqHeaders
  3872. googleapi.Expand(req.URL, map[string]string{
  3873. "project": c.project,
  3874. "resource": c.resource,
  3875. })
  3876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3877. }
  3878. // Do executes the "clouduseraccounts.users.getIamPolicy" call.
  3879. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3880. // code is an error. Response headers are in either
  3881. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3882. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3883. // check whether the returned error was because http.StatusNotModified
  3884. // was returned.
  3885. func (c *UsersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3886. gensupport.SetOptions(c.urlParams_, opts...)
  3887. res, err := c.doRequest("json")
  3888. if res != nil && res.StatusCode == http.StatusNotModified {
  3889. if res.Body != nil {
  3890. res.Body.Close()
  3891. }
  3892. return nil, &googleapi.Error{
  3893. Code: res.StatusCode,
  3894. Header: res.Header,
  3895. }
  3896. }
  3897. if err != nil {
  3898. return nil, err
  3899. }
  3900. defer googleapi.CloseBody(res)
  3901. if err := googleapi.CheckResponse(res); err != nil {
  3902. return nil, err
  3903. }
  3904. ret := &Policy{
  3905. ServerResponse: googleapi.ServerResponse{
  3906. Header: res.Header,
  3907. HTTPStatusCode: res.StatusCode,
  3908. },
  3909. }
  3910. target := &ret
  3911. if err := gensupport.DecodeResponse(target, res); err != nil {
  3912. return nil, err
  3913. }
  3914. return ret, nil
  3915. // {
  3916. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  3917. // "httpMethod": "GET",
  3918. // "id": "clouduseraccounts.users.getIamPolicy",
  3919. // "parameterOrder": [
  3920. // "project",
  3921. // "resource"
  3922. // ],
  3923. // "parameters": {
  3924. // "project": {
  3925. // "description": "Project ID for this request.",
  3926. // "location": "path",
  3927. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3928. // "required": true,
  3929. // "type": "string"
  3930. // },
  3931. // "resource": {
  3932. // "description": "Name of the resource for this request.",
  3933. // "location": "path",
  3934. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  3935. // "required": true,
  3936. // "type": "string"
  3937. // }
  3938. // },
  3939. // "path": "{project}/global/users/{resource}/getIamPolicy",
  3940. // "response": {
  3941. // "$ref": "Policy"
  3942. // },
  3943. // "scopes": [
  3944. // "https://www.googleapis.com/auth/cloud-platform",
  3945. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3946. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3947. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3948. // ]
  3949. // }
  3950. }
  3951. // method id "clouduseraccounts.users.insert":
  3952. type UsersInsertCall struct {
  3953. s *Service
  3954. project string
  3955. user *User
  3956. urlParams_ gensupport.URLParams
  3957. ctx_ context.Context
  3958. header_ http.Header
  3959. }
  3960. // Insert: Creates a User resource in the specified project using the
  3961. // data included in the request.
  3962. func (r *UsersService) Insert(project string, user *User) *UsersInsertCall {
  3963. c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3964. c.project = project
  3965. c.user = user
  3966. return c
  3967. }
  3968. // Fields allows partial responses to be retrieved. See
  3969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3970. // for more information.
  3971. func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
  3972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3973. return c
  3974. }
  3975. // Context sets the context to be used in this call's Do method. Any
  3976. // pending HTTP request will be aborted if the provided context is
  3977. // canceled.
  3978. func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
  3979. c.ctx_ = ctx
  3980. return c
  3981. }
  3982. // Header returns an http.Header that can be modified by the caller to
  3983. // add HTTP headers to the request.
  3984. func (c *UsersInsertCall) Header() http.Header {
  3985. if c.header_ == nil {
  3986. c.header_ = make(http.Header)
  3987. }
  3988. return c.header_
  3989. }
  3990. func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
  3991. reqHeaders := make(http.Header)
  3992. for k, v := range c.header_ {
  3993. reqHeaders[k] = v
  3994. }
  3995. reqHeaders.Set("User-Agent", c.s.userAgent())
  3996. var body io.Reader = nil
  3997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  3998. if err != nil {
  3999. return nil, err
  4000. }
  4001. reqHeaders.Set("Content-Type", "application/json")
  4002. c.urlParams_.Set("alt", alt)
  4003. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users")
  4004. urls += "?" + c.urlParams_.Encode()
  4005. req, _ := http.NewRequest("POST", urls, body)
  4006. req.Header = reqHeaders
  4007. googleapi.Expand(req.URL, map[string]string{
  4008. "project": c.project,
  4009. })
  4010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4011. }
  4012. // Do executes the "clouduseraccounts.users.insert" call.
  4013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4014. // status code is an error. Response headers are in either
  4015. // *Operation.ServerResponse.Header or (if a response was returned at
  4016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4017. // to check whether the returned error was because
  4018. // http.StatusNotModified was returned.
  4019. func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4020. gensupport.SetOptions(c.urlParams_, opts...)
  4021. res, err := c.doRequest("json")
  4022. if res != nil && res.StatusCode == http.StatusNotModified {
  4023. if res.Body != nil {
  4024. res.Body.Close()
  4025. }
  4026. return nil, &googleapi.Error{
  4027. Code: res.StatusCode,
  4028. Header: res.Header,
  4029. }
  4030. }
  4031. if err != nil {
  4032. return nil, err
  4033. }
  4034. defer googleapi.CloseBody(res)
  4035. if err := googleapi.CheckResponse(res); err != nil {
  4036. return nil, err
  4037. }
  4038. ret := &Operation{
  4039. ServerResponse: googleapi.ServerResponse{
  4040. Header: res.Header,
  4041. HTTPStatusCode: res.StatusCode,
  4042. },
  4043. }
  4044. target := &ret
  4045. if err := gensupport.DecodeResponse(target, res); err != nil {
  4046. return nil, err
  4047. }
  4048. return ret, nil
  4049. // {
  4050. // "description": "Creates a User resource in the specified project using the data included in the request.",
  4051. // "httpMethod": "POST",
  4052. // "id": "clouduseraccounts.users.insert",
  4053. // "parameterOrder": [
  4054. // "project"
  4055. // ],
  4056. // "parameters": {
  4057. // "project": {
  4058. // "description": "Project ID for this request.",
  4059. // "location": "path",
  4060. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4061. // "required": true,
  4062. // "type": "string"
  4063. // }
  4064. // },
  4065. // "path": "{project}/global/users",
  4066. // "request": {
  4067. // "$ref": "User"
  4068. // },
  4069. // "response": {
  4070. // "$ref": "Operation"
  4071. // },
  4072. // "scopes": [
  4073. // "https://www.googleapis.com/auth/cloud-platform",
  4074. // "https://www.googleapis.com/auth/cloud.useraccounts"
  4075. // ]
  4076. // }
  4077. }
  4078. // method id "clouduseraccounts.users.list":
  4079. type UsersListCall struct {
  4080. s *Service
  4081. project string
  4082. urlParams_ gensupport.URLParams
  4083. ifNoneMatch_ string
  4084. ctx_ context.Context
  4085. header_ http.Header
  4086. }
  4087. // List: Retrieves a list of users contained within the specified
  4088. // project.
  4089. func (r *UsersService) List(project string) *UsersListCall {
  4090. c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4091. c.project = project
  4092. return c
  4093. }
  4094. // Filter sets the optional parameter "filter": Sets a filter expression
  4095. // for filtering listed resources, in the form filter={expression}. Your
  4096. // {expression} must be in the format: field_name comparison_string
  4097. // literal_string.
  4098. //
  4099. // The field_name is the name of the field you want to compare. Only
  4100. // atomic field types are supported (string, number, boolean). The
  4101. // comparison_string must be either eq (equals) or ne (not equals). The
  4102. // literal_string is the string value to filter to. The literal value
  4103. // must be valid for the type of field you are filtering by (string,
  4104. // number, boolean). For string fields, the literal value is interpreted
  4105. // as a regular expression using RE2 syntax. The literal value must
  4106. // match the entire field.
  4107. //
  4108. // For example, to filter for instances that do not have a name of
  4109. // example-instance, you would use filter=name ne
  4110. // example-instance.
  4111. //
  4112. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  4113. // you can also filter on nested fields. For example, you could filter
  4114. // on instances that have set the scheduling.automaticRestart field to
  4115. // true. In particular, use filtering on nested fields to take advantage
  4116. // of instance labels to organize and filter results based on label
  4117. // values.
  4118. //
  4119. // The Beta API also supports filtering on multiple expressions by
  4120. // providing each separate expression within parentheses. For example,
  4121. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  4122. // Multiple expressions are treated as AND expressions, meaning that
  4123. // resources must match all expressions to pass the filters.
  4124. func (c *UsersListCall) Filter(filter string) *UsersListCall {
  4125. c.urlParams_.Set("filter", filter)
  4126. return c
  4127. }
  4128. // MaxResults sets the optional parameter "maxResults": The maximum
  4129. // number of results per page that should be returned. If the number of
  4130. // available results is larger than maxResults, Compute Engine returns a
  4131. // nextPageToken that can be used to get the next page of results in
  4132. // subsequent list requests.
  4133. func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall {
  4134. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4135. return c
  4136. }
  4137. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  4138. // a certain order. By default, results are returned in alphanumerical
  4139. // order based on the resource name.
  4140. //
  4141. // You can also sort results in descending order based on the creation
  4142. // timestamp using orderBy="creationTimestamp desc". This sorts results
  4143. // based on the creationTimestamp field in reverse chronological order
  4144. // (newest result first). Use this to sort resources like operations so
  4145. // that the newest operation is returned first.
  4146. //
  4147. // Currently, only sorting by name or creationTimestamp desc is
  4148. // supported.
  4149. func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall {
  4150. c.urlParams_.Set("orderBy", orderBy)
  4151. return c
  4152. }
  4153. // PageToken sets the optional parameter "pageToken": Specifies a page
  4154. // token to use. Set pageToken to the nextPageToken returned by a
  4155. // previous list request to get the next page of results.
  4156. func (c *UsersListCall) PageToken(pageToken string) *UsersListCall {
  4157. c.urlParams_.Set("pageToken", pageToken)
  4158. return c
  4159. }
  4160. // Fields allows partial responses to be retrieved. See
  4161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4162. // for more information.
  4163. func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
  4164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4165. return c
  4166. }
  4167. // IfNoneMatch sets the optional parameter which makes the operation
  4168. // fail if the object's ETag matches the given value. This is useful for
  4169. // getting updates only after the object has changed since the last
  4170. // request. Use googleapi.IsNotModified to check whether the response
  4171. // error from Do is the result of In-None-Match.
  4172. func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
  4173. c.ifNoneMatch_ = entityTag
  4174. return c
  4175. }
  4176. // Context sets the context to be used in this call's Do method. Any
  4177. // pending HTTP request will be aborted if the provided context is
  4178. // canceled.
  4179. func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
  4180. c.ctx_ = ctx
  4181. return c
  4182. }
  4183. // Header returns an http.Header that can be modified by the caller to
  4184. // add HTTP headers to the request.
  4185. func (c *UsersListCall) Header() http.Header {
  4186. if c.header_ == nil {
  4187. c.header_ = make(http.Header)
  4188. }
  4189. return c.header_
  4190. }
  4191. func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
  4192. reqHeaders := make(http.Header)
  4193. for k, v := range c.header_ {
  4194. reqHeaders[k] = v
  4195. }
  4196. reqHeaders.Set("User-Agent", c.s.userAgent())
  4197. if c.ifNoneMatch_ != "" {
  4198. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4199. }
  4200. var body io.Reader = nil
  4201. c.urlParams_.Set("alt", alt)
  4202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users")
  4203. urls += "?" + c.urlParams_.Encode()
  4204. req, _ := http.NewRequest("GET", urls, body)
  4205. req.Header = reqHeaders
  4206. googleapi.Expand(req.URL, map[string]string{
  4207. "project": c.project,
  4208. })
  4209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4210. }
  4211. // Do executes the "clouduseraccounts.users.list" call.
  4212. // Exactly one of *UserList or error will be non-nil. Any non-2xx status
  4213. // code is an error. Response headers are in either
  4214. // *UserList.ServerResponse.Header or (if a response was returned at
  4215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4216. // to check whether the returned error was because
  4217. // http.StatusNotModified was returned.
  4218. func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UserList, error) {
  4219. gensupport.SetOptions(c.urlParams_, opts...)
  4220. res, err := c.doRequest("json")
  4221. if res != nil && res.StatusCode == http.StatusNotModified {
  4222. if res.Body != nil {
  4223. res.Body.Close()
  4224. }
  4225. return nil, &googleapi.Error{
  4226. Code: res.StatusCode,
  4227. Header: res.Header,
  4228. }
  4229. }
  4230. if err != nil {
  4231. return nil, err
  4232. }
  4233. defer googleapi.CloseBody(res)
  4234. if err := googleapi.CheckResponse(res); err != nil {
  4235. return nil, err
  4236. }
  4237. ret := &UserList{
  4238. ServerResponse: googleapi.ServerResponse{
  4239. Header: res.Header,
  4240. HTTPStatusCode: res.StatusCode,
  4241. },
  4242. }
  4243. target := &ret
  4244. if err := gensupport.DecodeResponse(target, res); err != nil {
  4245. return nil, err
  4246. }
  4247. return ret, nil
  4248. // {
  4249. // "description": "Retrieves a list of users contained within the specified project.",
  4250. // "httpMethod": "GET",
  4251. // "id": "clouduseraccounts.users.list",
  4252. // "parameterOrder": [
  4253. // "project"
  4254. // ],
  4255. // "parameters": {
  4256. // "filter": {
  4257. // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.\n\nThe field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.\n\nCompute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.\n\nThe Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.",
  4258. // "location": "query",
  4259. // "type": "string"
  4260. // },
  4261. // "maxResults": {
  4262. // "default": "500",
  4263. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests.",
  4264. // "format": "uint32",
  4265. // "location": "query",
  4266. // "maximum": "500",
  4267. // "minimum": "0",
  4268. // "type": "integer"
  4269. // },
  4270. // "orderBy": {
  4271. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  4272. // "location": "query",
  4273. // "type": "string"
  4274. // },
  4275. // "pageToken": {
  4276. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  4277. // "location": "query",
  4278. // "type": "string"
  4279. // },
  4280. // "project": {
  4281. // "description": "Project ID for this request.",
  4282. // "location": "path",
  4283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4284. // "required": true,
  4285. // "type": "string"
  4286. // }
  4287. // },
  4288. // "path": "{project}/global/users",
  4289. // "response": {
  4290. // "$ref": "UserList"
  4291. // },
  4292. // "scopes": [
  4293. // "https://www.googleapis.com/auth/cloud-platform",
  4294. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4295. // "https://www.googleapis.com/auth/cloud.useraccounts",
  4296. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  4297. // ]
  4298. // }
  4299. }
  4300. // Pages invokes f for each page of results.
  4301. // A non-nil error returned from f will halt the iteration.
  4302. // The provided context supersedes any context provided to the Context method.
  4303. func (c *UsersListCall) Pages(ctx context.Context, f func(*UserList) error) error {
  4304. c.ctx_ = ctx
  4305. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4306. for {
  4307. x, err := c.Do()
  4308. if err != nil {
  4309. return err
  4310. }
  4311. if err := f(x); err != nil {
  4312. return err
  4313. }
  4314. if x.NextPageToken == "" {
  4315. return nil
  4316. }
  4317. c.PageToken(x.NextPageToken)
  4318. }
  4319. }
  4320. // method id "clouduseraccounts.users.removePublicKey":
  4321. type UsersRemovePublicKeyCall struct {
  4322. s *Service
  4323. project string
  4324. user string
  4325. urlParams_ gensupport.URLParams
  4326. ctx_ context.Context
  4327. header_ http.Header
  4328. }
  4329. // RemovePublicKey: Removes the specified public key from the user.
  4330. func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall {
  4331. c := &UsersRemovePublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4332. c.project = project
  4333. c.user = user
  4334. c.urlParams_.Set("fingerprint", fingerprint)
  4335. return c
  4336. }
  4337. // Fields allows partial responses to be retrieved. See
  4338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4339. // for more information.
  4340. func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall {
  4341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4342. return c
  4343. }
  4344. // Context sets the context to be used in this call's Do method. Any
  4345. // pending HTTP request will be aborted if the provided context is
  4346. // canceled.
  4347. func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall {
  4348. c.ctx_ = ctx
  4349. return c
  4350. }
  4351. // Header returns an http.Header that can be modified by the caller to
  4352. // add HTTP headers to the request.
  4353. func (c *UsersRemovePublicKeyCall) Header() http.Header {
  4354. if c.header_ == nil {
  4355. c.header_ = make(http.Header)
  4356. }
  4357. return c.header_
  4358. }
  4359. func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) {
  4360. reqHeaders := make(http.Header)
  4361. for k, v := range c.header_ {
  4362. reqHeaders[k] = v
  4363. }
  4364. reqHeaders.Set("User-Agent", c.s.userAgent())
  4365. var body io.Reader = nil
  4366. c.urlParams_.Set("alt", alt)
  4367. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey")
  4368. urls += "?" + c.urlParams_.Encode()
  4369. req, _ := http.NewRequest("POST", urls, body)
  4370. req.Header = reqHeaders
  4371. googleapi.Expand(req.URL, map[string]string{
  4372. "project": c.project,
  4373. "user": c.user,
  4374. })
  4375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4376. }
  4377. // Do executes the "clouduseraccounts.users.removePublicKey" call.
  4378. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4379. // status code is an error. Response headers are in either
  4380. // *Operation.ServerResponse.Header or (if a response was returned at
  4381. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4382. // to check whether the returned error was because
  4383. // http.StatusNotModified was returned.
  4384. func (c *UsersRemovePublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4385. gensupport.SetOptions(c.urlParams_, opts...)
  4386. res, err := c.doRequest("json")
  4387. if res != nil && res.StatusCode == http.StatusNotModified {
  4388. if res.Body != nil {
  4389. res.Body.Close()
  4390. }
  4391. return nil, &googleapi.Error{
  4392. Code: res.StatusCode,
  4393. Header: res.Header,
  4394. }
  4395. }
  4396. if err != nil {
  4397. return nil, err
  4398. }
  4399. defer googleapi.CloseBody(res)
  4400. if err := googleapi.CheckResponse(res); err != nil {
  4401. return nil, err
  4402. }
  4403. ret := &Operation{
  4404. ServerResponse: googleapi.ServerResponse{
  4405. Header: res.Header,
  4406. HTTPStatusCode: res.StatusCode,
  4407. },
  4408. }
  4409. target := &ret
  4410. if err := gensupport.DecodeResponse(target, res); err != nil {
  4411. return nil, err
  4412. }
  4413. return ret, nil
  4414. // {
  4415. // "description": "Removes the specified public key from the user.",
  4416. // "httpMethod": "POST",
  4417. // "id": "clouduseraccounts.users.removePublicKey",
  4418. // "parameterOrder": [
  4419. // "project",
  4420. // "user",
  4421. // "fingerprint"
  4422. // ],
  4423. // "parameters": {
  4424. // "fingerprint": {
  4425. // "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.",
  4426. // "location": "query",
  4427. // "pattern": "[a-f0-9]{32}",
  4428. // "required": true,
  4429. // "type": "string"
  4430. // },
  4431. // "project": {
  4432. // "description": "Project ID for this request.",
  4433. // "location": "path",
  4434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4435. // "required": true,
  4436. // "type": "string"
  4437. // },
  4438. // "user": {
  4439. // "description": "Name of the user for this request.",
  4440. // "location": "path",
  4441. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  4442. // "required": true,
  4443. // "type": "string"
  4444. // }
  4445. // },
  4446. // "path": "{project}/global/users/{user}/removePublicKey",
  4447. // "response": {
  4448. // "$ref": "Operation"
  4449. // },
  4450. // "scopes": [
  4451. // "https://www.googleapis.com/auth/cloud-platform",
  4452. // "https://www.googleapis.com/auth/cloud.useraccounts"
  4453. // ]
  4454. // }
  4455. }
  4456. // method id "clouduseraccounts.users.setIamPolicy":
  4457. type UsersSetIamPolicyCall struct {
  4458. s *Service
  4459. project string
  4460. resource string
  4461. policy *Policy
  4462. urlParams_ gensupport.URLParams
  4463. ctx_ context.Context
  4464. header_ http.Header
  4465. }
  4466. // SetIamPolicy: Sets the access control policy on the specified
  4467. // resource. Replaces any existing policy.
  4468. func (r *UsersService) SetIamPolicy(project string, resource string, policy *Policy) *UsersSetIamPolicyCall {
  4469. c := &UsersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4470. c.project = project
  4471. c.resource = resource
  4472. c.policy = policy
  4473. return c
  4474. }
  4475. // Fields allows partial responses to be retrieved. See
  4476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4477. // for more information.
  4478. func (c *UsersSetIamPolicyCall) Fields(s ...googleapi.Field) *UsersSetIamPolicyCall {
  4479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4480. return c
  4481. }
  4482. // Context sets the context to be used in this call's Do method. Any
  4483. // pending HTTP request will be aborted if the provided context is
  4484. // canceled.
  4485. func (c *UsersSetIamPolicyCall) Context(ctx context.Context) *UsersSetIamPolicyCall {
  4486. c.ctx_ = ctx
  4487. return c
  4488. }
  4489. // Header returns an http.Header that can be modified by the caller to
  4490. // add HTTP headers to the request.
  4491. func (c *UsersSetIamPolicyCall) Header() http.Header {
  4492. if c.header_ == nil {
  4493. c.header_ = make(http.Header)
  4494. }
  4495. return c.header_
  4496. }
  4497. func (c *UsersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4498. reqHeaders := make(http.Header)
  4499. for k, v := range c.header_ {
  4500. reqHeaders[k] = v
  4501. }
  4502. reqHeaders.Set("User-Agent", c.s.userAgent())
  4503. var body io.Reader = nil
  4504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  4505. if err != nil {
  4506. return nil, err
  4507. }
  4508. reqHeaders.Set("Content-Type", "application/json")
  4509. c.urlParams_.Set("alt", alt)
  4510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/setIamPolicy")
  4511. urls += "?" + c.urlParams_.Encode()
  4512. req, _ := http.NewRequest("POST", urls, body)
  4513. req.Header = reqHeaders
  4514. googleapi.Expand(req.URL, map[string]string{
  4515. "project": c.project,
  4516. "resource": c.resource,
  4517. })
  4518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4519. }
  4520. // Do executes the "clouduseraccounts.users.setIamPolicy" call.
  4521. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4522. // code is an error. Response headers are in either
  4523. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4524. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4525. // check whether the returned error was because http.StatusNotModified
  4526. // was returned.
  4527. func (c *UsersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4528. gensupport.SetOptions(c.urlParams_, opts...)
  4529. res, err := c.doRequest("json")
  4530. if res != nil && res.StatusCode == http.StatusNotModified {
  4531. if res.Body != nil {
  4532. res.Body.Close()
  4533. }
  4534. return nil, &googleapi.Error{
  4535. Code: res.StatusCode,
  4536. Header: res.Header,
  4537. }
  4538. }
  4539. if err != nil {
  4540. return nil, err
  4541. }
  4542. defer googleapi.CloseBody(res)
  4543. if err := googleapi.CheckResponse(res); err != nil {
  4544. return nil, err
  4545. }
  4546. ret := &Policy{
  4547. ServerResponse: googleapi.ServerResponse{
  4548. Header: res.Header,
  4549. HTTPStatusCode: res.StatusCode,
  4550. },
  4551. }
  4552. target := &ret
  4553. if err := gensupport.DecodeResponse(target, res); err != nil {
  4554. return nil, err
  4555. }
  4556. return ret, nil
  4557. // {
  4558. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  4559. // "httpMethod": "POST",
  4560. // "id": "clouduseraccounts.users.setIamPolicy",
  4561. // "parameterOrder": [
  4562. // "project",
  4563. // "resource"
  4564. // ],
  4565. // "parameters": {
  4566. // "project": {
  4567. // "description": "Project ID for this request.",
  4568. // "location": "path",
  4569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4570. // "required": true,
  4571. // "type": "string"
  4572. // },
  4573. // "resource": {
  4574. // "description": "Name of the resource for this request.",
  4575. // "location": "path",
  4576. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  4577. // "required": true,
  4578. // "type": "string"
  4579. // }
  4580. // },
  4581. // "path": "{project}/global/users/{resource}/setIamPolicy",
  4582. // "request": {
  4583. // "$ref": "Policy"
  4584. // },
  4585. // "response": {
  4586. // "$ref": "Policy"
  4587. // },
  4588. // "scopes": [
  4589. // "https://www.googleapis.com/auth/cloud-platform",
  4590. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4591. // "https://www.googleapis.com/auth/cloud.useraccounts",
  4592. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  4593. // ]
  4594. // }
  4595. }
  4596. // method id "clouduseraccounts.users.testIamPermissions":
  4597. type UsersTestIamPermissionsCall struct {
  4598. s *Service
  4599. project string
  4600. resource string
  4601. testpermissionsrequest *TestPermissionsRequest
  4602. urlParams_ gensupport.URLParams
  4603. ctx_ context.Context
  4604. header_ http.Header
  4605. }
  4606. // TestIamPermissions: Returns permissions that a caller has on the
  4607. // specified resource.
  4608. func (r *UsersService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UsersTestIamPermissionsCall {
  4609. c := &UsersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4610. c.project = project
  4611. c.resource = resource
  4612. c.testpermissionsrequest = testpermissionsrequest
  4613. return c
  4614. }
  4615. // Fields allows partial responses to be retrieved. See
  4616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4617. // for more information.
  4618. func (c *UsersTestIamPermissionsCall) Fields(s ...googleapi.Field) *UsersTestIamPermissionsCall {
  4619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4620. return c
  4621. }
  4622. // Context sets the context to be used in this call's Do method. Any
  4623. // pending HTTP request will be aborted if the provided context is
  4624. // canceled.
  4625. func (c *UsersTestIamPermissionsCall) Context(ctx context.Context) *UsersTestIamPermissionsCall {
  4626. c.ctx_ = ctx
  4627. return c
  4628. }
  4629. // Header returns an http.Header that can be modified by the caller to
  4630. // add HTTP headers to the request.
  4631. func (c *UsersTestIamPermissionsCall) Header() http.Header {
  4632. if c.header_ == nil {
  4633. c.header_ = make(http.Header)
  4634. }
  4635. return c.header_
  4636. }
  4637. func (c *UsersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4638. reqHeaders := make(http.Header)
  4639. for k, v := range c.header_ {
  4640. reqHeaders[k] = v
  4641. }
  4642. reqHeaders.Set("User-Agent", c.s.userAgent())
  4643. var body io.Reader = nil
  4644. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  4645. if err != nil {
  4646. return nil, err
  4647. }
  4648. reqHeaders.Set("Content-Type", "application/json")
  4649. c.urlParams_.Set("alt", alt)
  4650. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/testIamPermissions")
  4651. urls += "?" + c.urlParams_.Encode()
  4652. req, _ := http.NewRequest("POST", urls, body)
  4653. req.Header = reqHeaders
  4654. googleapi.Expand(req.URL, map[string]string{
  4655. "project": c.project,
  4656. "resource": c.resource,
  4657. })
  4658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4659. }
  4660. // Do executes the "clouduseraccounts.users.testIamPermissions" call.
  4661. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  4662. // non-2xx status code is an error. Response headers are in either
  4663. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  4664. // returned at all) in error.(*googleapi.Error).Header. Use
  4665. // googleapi.IsNotModified to check whether the returned error was
  4666. // because http.StatusNotModified was returned.
  4667. func (c *UsersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  4668. gensupport.SetOptions(c.urlParams_, opts...)
  4669. res, err := c.doRequest("json")
  4670. if res != nil && res.StatusCode == http.StatusNotModified {
  4671. if res.Body != nil {
  4672. res.Body.Close()
  4673. }
  4674. return nil, &googleapi.Error{
  4675. Code: res.StatusCode,
  4676. Header: res.Header,
  4677. }
  4678. }
  4679. if err != nil {
  4680. return nil, err
  4681. }
  4682. defer googleapi.CloseBody(res)
  4683. if err := googleapi.CheckResponse(res); err != nil {
  4684. return nil, err
  4685. }
  4686. ret := &TestPermissionsResponse{
  4687. ServerResponse: googleapi.ServerResponse{
  4688. Header: res.Header,
  4689. HTTPStatusCode: res.StatusCode,
  4690. },
  4691. }
  4692. target := &ret
  4693. if err := gensupport.DecodeResponse(target, res); err != nil {
  4694. return nil, err
  4695. }
  4696. return ret, nil
  4697. // {
  4698. // "description": "Returns permissions that a caller has on the specified resource.",
  4699. // "httpMethod": "POST",
  4700. // "id": "clouduseraccounts.users.testIamPermissions",
  4701. // "parameterOrder": [
  4702. // "project",
  4703. // "resource"
  4704. // ],
  4705. // "parameters": {
  4706. // "project": {
  4707. // "description": "Project ID for this request.",
  4708. // "location": "path",
  4709. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4710. // "required": true,
  4711. // "type": "string"
  4712. // },
  4713. // "resource": {
  4714. // "description": "Name of the resource for this request.",
  4715. // "location": "path",
  4716. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  4717. // "required": true,
  4718. // "type": "string"
  4719. // }
  4720. // },
  4721. // "path": "{project}/global/users/{resource}/testIamPermissions",
  4722. // "request": {
  4723. // "$ref": "TestPermissionsRequest"
  4724. // },
  4725. // "response": {
  4726. // "$ref": "TestPermissionsResponse"
  4727. // },
  4728. // "scopes": [
  4729. // "https://www.googleapis.com/auth/cloud-platform",
  4730. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4731. // "https://www.googleapis.com/auth/cloud.useraccounts",
  4732. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  4733. // ]
  4734. // }
  4735. }