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.
 
 
 

3873 lines
141 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_beta"
  8. // ...
  9. // clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient)
  10. package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/vm_beta"
  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_beta"
  41. const apiName = "clouduseraccounts"
  42. const apiVersion = "vm_beta"
  43. const basePath = "https://www.googleapis.com/clouduseraccounts/vm_beta/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. // AuthorizedKeysView: A list of authorized public keys for a user
  110. // account.
  111. type AuthorizedKeysView struct {
  112. // Keys: [Output Only] The list of authorized public keys in SSH format.
  113. Keys []string `json:"keys,omitempty"`
  114. // Sudoer: [Output Only] Whether the user has the ability to elevate on
  115. // the instance that requested the authorized keys.
  116. Sudoer bool `json:"sudoer,omitempty"`
  117. // ForceSendFields is a list of field names (e.g. "Keys") to
  118. // unconditionally include in API requests. By default, fields with
  119. // empty values are omitted from API requests. However, any non-pointer,
  120. // non-interface field appearing in ForceSendFields will be sent to the
  121. // server regardless of whether the field is empty or not. This may be
  122. // used to include empty fields in Patch requests.
  123. ForceSendFields []string `json:"-"`
  124. // NullFields is a list of field names (e.g. "Keys") to include in API
  125. // requests with the JSON null value. By default, fields with empty
  126. // values are omitted from API requests. However, any field with an
  127. // empty value appearing in NullFields will be sent to the server as
  128. // null. It is an error if a field in this list has a non-empty value.
  129. // This may be used to include null fields in Patch requests.
  130. NullFields []string `json:"-"`
  131. }
  132. func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) {
  133. type NoMethod AuthorizedKeysView
  134. raw := NoMethod(*s)
  135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  136. }
  137. // Group: A Group resource.
  138. type Group struct {
  139. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  140. // format.
  141. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  142. // Description: An optional textual description of the resource;
  143. // provided by the client when the resource is created.
  144. Description string `json:"description,omitempty"`
  145. // Id: [Output Only] Unique identifier for the resource; defined by the
  146. // server.
  147. Id uint64 `json:"id,omitempty,string"`
  148. // Kind: [Output Only] Type of the resource. Always
  149. // clouduseraccounts#group for groups.
  150. Kind string `json:"kind,omitempty"`
  151. // Members: [Output Only] A list of URLs to User resources who belong to
  152. // the group. Users may only be members of groups in the same project.
  153. Members []string `json:"members,omitempty"`
  154. // Name: Name of the resource; provided by the client when the resource
  155. // is created.
  156. Name string `json:"name,omitempty"`
  157. // SelfLink: [Output Only] Server defined URL for the resource.
  158. SelfLink string `json:"selfLink,omitempty"`
  159. // ServerResponse contains the HTTP response code and headers from the
  160. // server.
  161. googleapi.ServerResponse `json:"-"`
  162. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  163. // to unconditionally include in API requests. By default, fields with
  164. // empty values are omitted from API requests. However, any non-pointer,
  165. // non-interface field appearing in ForceSendFields will be sent to the
  166. // server regardless of whether the field is empty or not. This may be
  167. // used to include empty fields in Patch requests.
  168. ForceSendFields []string `json:"-"`
  169. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  170. // include in API requests with the JSON null value. By default, fields
  171. // with empty values are omitted from API requests. However, any field
  172. // with an empty value appearing in NullFields will be sent to the
  173. // server as null. It is an error if a field in this list has a
  174. // non-empty value. This may be used to include null fields in Patch
  175. // requests.
  176. NullFields []string `json:"-"`
  177. }
  178. func (s *Group) MarshalJSON() ([]byte, error) {
  179. type NoMethod Group
  180. raw := NoMethod(*s)
  181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  182. }
  183. type GroupList struct {
  184. // Id: [Output Only] Unique identifier for the resource; defined by the
  185. // server.
  186. Id string `json:"id,omitempty"`
  187. // Items: [Output Only] A list of Group resources.
  188. Items []*Group `json:"items,omitempty"`
  189. // Kind: [Output Only] Type of resource. Always
  190. // clouduseraccounts#groupList for lists of groups.
  191. Kind string `json:"kind,omitempty"`
  192. // NextPageToken: [Output Only] A token used to continue a truncated
  193. // list request.
  194. NextPageToken string `json:"nextPageToken,omitempty"`
  195. // SelfLink: [Output Only] Server defined URL for this resource.
  196. SelfLink string `json:"selfLink,omitempty"`
  197. // ServerResponse contains the HTTP response code and headers from the
  198. // server.
  199. googleapi.ServerResponse `json:"-"`
  200. // ForceSendFields is a list of field names (e.g. "Id") to
  201. // unconditionally include in API requests. By default, fields with
  202. // empty values are omitted from API requests. However, any non-pointer,
  203. // non-interface field appearing in ForceSendFields will be sent to the
  204. // server regardless of whether the field is empty or not. This may be
  205. // used to include empty fields in Patch requests.
  206. ForceSendFields []string `json:"-"`
  207. // NullFields is a list of field names (e.g. "Id") to include in API
  208. // requests with the JSON null value. By default, fields with empty
  209. // values are omitted from API requests. However, any field with an
  210. // empty value appearing in NullFields will be sent to the server as
  211. // null. It is an error if a field in this list has a non-empty value.
  212. // This may be used to include null fields in Patch requests.
  213. NullFields []string `json:"-"`
  214. }
  215. func (s *GroupList) MarshalJSON() ([]byte, error) {
  216. type NoMethod GroupList
  217. raw := NoMethod(*s)
  218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  219. }
  220. type GroupsAddMemberRequest struct {
  221. // Users: Fully-qualified URLs of the User resources to add.
  222. Users []string `json:"users,omitempty"`
  223. // ForceSendFields is a list of field names (e.g. "Users") to
  224. // unconditionally include in API requests. By default, fields with
  225. // empty values are omitted from API requests. However, any non-pointer,
  226. // non-interface field appearing in ForceSendFields will be sent to the
  227. // server regardless of whether the field is empty or not. This may be
  228. // used to include empty fields in Patch requests.
  229. ForceSendFields []string `json:"-"`
  230. // NullFields is a list of field names (e.g. "Users") to include in API
  231. // requests with the JSON null value. By default, fields with empty
  232. // values are omitted from API requests. However, any field with an
  233. // empty value appearing in NullFields will be sent to the server as
  234. // null. It is an error if a field in this list has a non-empty value.
  235. // This may be used to include null fields in Patch requests.
  236. NullFields []string `json:"-"`
  237. }
  238. func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) {
  239. type NoMethod GroupsAddMemberRequest
  240. raw := NoMethod(*s)
  241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  242. }
  243. type GroupsRemoveMemberRequest struct {
  244. // Users: Fully-qualified URLs of the User resources to remove.
  245. Users []string `json:"users,omitempty"`
  246. // ForceSendFields is a list of field names (e.g. "Users") to
  247. // unconditionally include in API requests. By default, fields with
  248. // empty values are omitted from API requests. However, any non-pointer,
  249. // non-interface field appearing in ForceSendFields will be sent to the
  250. // server regardless of whether the field is empty or not. This may be
  251. // used to include empty fields in Patch requests.
  252. ForceSendFields []string `json:"-"`
  253. // NullFields is a list of field names (e.g. "Users") to include in API
  254. // requests with the JSON null value. By default, fields with empty
  255. // values are omitted from API requests. However, any field with an
  256. // empty value appearing in NullFields will be sent to the server as
  257. // null. It is an error if a field in this list has a non-empty value.
  258. // This may be used to include null fields in Patch requests.
  259. NullFields []string `json:"-"`
  260. }
  261. func (s *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) {
  262. type NoMethod GroupsRemoveMemberRequest
  263. raw := NoMethod(*s)
  264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  265. }
  266. // LinuxAccountViews: A list of all Linux accounts for this project.
  267. // This API is only used by Compute Engine virtual machines to get
  268. // information about user accounts for a project or instance. Linux
  269. // resources are read-only views into users and groups managed by the
  270. // Compute Engine Accounts API.
  271. type LinuxAccountViews struct {
  272. // GroupViews: [Output Only] A list of all groups within a project.
  273. GroupViews []*LinuxGroupView `json:"groupViews,omitempty"`
  274. // Kind: [Output Only] Type of the resource. Always
  275. // clouduseraccounts#linuxAccountViews for Linux resources.
  276. Kind string `json:"kind,omitempty"`
  277. // UserViews: [Output Only] A list of all users within a project.
  278. UserViews []*LinuxUserView `json:"userViews,omitempty"`
  279. // ForceSendFields is a list of field names (e.g. "GroupViews") to
  280. // unconditionally include in API requests. By default, fields with
  281. // empty values are omitted from API requests. However, any non-pointer,
  282. // non-interface field appearing in ForceSendFields will be sent to the
  283. // server regardless of whether the field is empty or not. This may be
  284. // used to include empty fields in Patch requests.
  285. ForceSendFields []string `json:"-"`
  286. // NullFields is a list of field names (e.g. "GroupViews") to include in
  287. // API requests with the JSON null value. By default, fields with empty
  288. // values are omitted from API requests. However, any field with an
  289. // empty value appearing in NullFields will be sent to the server as
  290. // null. It is an error if a field in this list has a non-empty value.
  291. // This may be used to include null fields in Patch requests.
  292. NullFields []string `json:"-"`
  293. }
  294. func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) {
  295. type NoMethod LinuxAccountViews
  296. raw := NoMethod(*s)
  297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  298. }
  299. type LinuxGetAuthorizedKeysViewResponse struct {
  300. // Resource: [Output Only] A list of authorized public keys for a user.
  301. Resource *AuthorizedKeysView `json:"resource,omitempty"`
  302. // ServerResponse contains the HTTP response code and headers from the
  303. // server.
  304. googleapi.ServerResponse `json:"-"`
  305. // ForceSendFields is a list of field names (e.g. "Resource") to
  306. // unconditionally include in API requests. By default, fields with
  307. // empty values are omitted from API requests. However, any non-pointer,
  308. // non-interface field appearing in ForceSendFields will be sent to the
  309. // server regardless of whether the field is empty or not. This may be
  310. // used to include empty fields in Patch requests.
  311. ForceSendFields []string `json:"-"`
  312. // NullFields is a list of field names (e.g. "Resource") to include in
  313. // API requests with the JSON null value. By default, fields with empty
  314. // values are omitted from API requests. However, any field with an
  315. // empty value appearing in NullFields will be sent to the server as
  316. // null. It is an error if a field in this list has a non-empty value.
  317. // This may be used to include null fields in Patch requests.
  318. NullFields []string `json:"-"`
  319. }
  320. func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) {
  321. type NoMethod LinuxGetAuthorizedKeysViewResponse
  322. raw := NoMethod(*s)
  323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  324. }
  325. type LinuxGetLinuxAccountViewsResponse struct {
  326. // Resource: [Output Only] A list of authorized user accounts and
  327. // groups.
  328. Resource *LinuxAccountViews `json:"resource,omitempty"`
  329. // ServerResponse contains the HTTP response code and headers from the
  330. // server.
  331. googleapi.ServerResponse `json:"-"`
  332. // ForceSendFields is a list of field names (e.g. "Resource") to
  333. // unconditionally include in API requests. By default, fields with
  334. // empty values are omitted from API requests. However, any non-pointer,
  335. // non-interface field appearing in ForceSendFields will be sent to the
  336. // server regardless of whether the field is empty or not. This may be
  337. // used to include empty fields in Patch requests.
  338. ForceSendFields []string `json:"-"`
  339. // NullFields is a list of field names (e.g. "Resource") to include in
  340. // API requests with the JSON null value. By default, fields with empty
  341. // values are omitted from API requests. However, any field with an
  342. // empty value appearing in NullFields will be sent to the server as
  343. // null. It is an error if a field in this list has a non-empty value.
  344. // This may be used to include null fields in Patch requests.
  345. NullFields []string `json:"-"`
  346. }
  347. func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) {
  348. type NoMethod LinuxGetLinuxAccountViewsResponse
  349. raw := NoMethod(*s)
  350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  351. }
  352. // LinuxGroupView: A detailed view of a Linux group.
  353. type LinuxGroupView struct {
  354. // Gid: [Output Only] The Group ID.
  355. Gid int64 `json:"gid,omitempty"`
  356. // GroupName: [Output Only] Group name.
  357. GroupName string `json:"groupName,omitempty"`
  358. // Members: [Output Only] List of user accounts that belong to the
  359. // group.
  360. Members []string `json:"members,omitempty"`
  361. // ForceSendFields is a list of field names (e.g. "Gid") to
  362. // unconditionally include in API requests. By default, fields with
  363. // empty values are omitted from API requests. However, any non-pointer,
  364. // non-interface field appearing in ForceSendFields will be sent to the
  365. // server regardless of whether the field is empty or not. This may be
  366. // used to include empty fields in Patch requests.
  367. ForceSendFields []string `json:"-"`
  368. // NullFields is a list of field names (e.g. "Gid") to include in API
  369. // requests with the JSON null value. By default, fields with empty
  370. // values are omitted from API requests. However, any field with an
  371. // empty value appearing in NullFields will be sent to the server as
  372. // null. It is an error if a field in this list has a non-empty value.
  373. // This may be used to include null fields in Patch requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *LinuxGroupView) MarshalJSON() ([]byte, error) {
  377. type NoMethod LinuxGroupView
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. // LinuxUserView: A detailed view of a Linux user account.
  382. type LinuxUserView struct {
  383. // Gecos: [Output Only] The GECOS (user information) entry for this
  384. // account.
  385. Gecos string `json:"gecos,omitempty"`
  386. // Gid: [Output Only] User's default group ID.
  387. Gid int64 `json:"gid,omitempty"`
  388. // HomeDirectory: [Output Only] The path to the home directory for this
  389. // account.
  390. HomeDirectory string `json:"homeDirectory,omitempty"`
  391. // Shell: [Output Only] The path to the login shell for this account.
  392. Shell string `json:"shell,omitempty"`
  393. // Uid: [Output Only] User ID.
  394. Uid int64 `json:"uid,omitempty"`
  395. // Username: [Output Only] The username of the account.
  396. Username string `json:"username,omitempty"`
  397. // ForceSendFields is a list of field names (e.g. "Gecos") to
  398. // unconditionally include in API requests. By default, fields with
  399. // empty values are omitted from API requests. However, any non-pointer,
  400. // non-interface field appearing in ForceSendFields will be sent to the
  401. // server regardless of whether the field is empty or not. This may be
  402. // used to include empty fields in Patch requests.
  403. ForceSendFields []string `json:"-"`
  404. // NullFields is a list of field names (e.g. "Gecos") to include in API
  405. // requests with the JSON null value. By default, fields with empty
  406. // values are omitted from API requests. However, any field with an
  407. // empty value appearing in NullFields will be sent to the server as
  408. // null. It is an error if a field in this list has a non-empty value.
  409. // This may be used to include null fields in Patch requests.
  410. NullFields []string `json:"-"`
  411. }
  412. func (s *LinuxUserView) MarshalJSON() ([]byte, error) {
  413. type NoMethod LinuxUserView
  414. raw := NoMethod(*s)
  415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  416. }
  417. // Operation: An Operation resource, used to manage asynchronous API
  418. // requests.
  419. type Operation struct {
  420. // ClientOperationId: [Output Only] Reserved for future use.
  421. ClientOperationId string `json:"clientOperationId,omitempty"`
  422. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  423. // format.
  424. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  425. // Description: [Output Only] A textual description of the operation,
  426. // which is set when the operation is created.
  427. Description string `json:"description,omitempty"`
  428. // EndTime: [Output Only] The time that this operation was completed.
  429. // This value is in RFC3339 text format.
  430. EndTime string `json:"endTime,omitempty"`
  431. // Error: [Output Only] If errors are generated during processing of the
  432. // operation, this field will be populated.
  433. Error *OperationError `json:"error,omitempty"`
  434. // HttpErrorMessage: [Output Only] If the operation fails, this field
  435. // contains the HTTP error message that was returned, such as NOT FOUND.
  436. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  437. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  438. // contains the HTTP error status code that was returned. For example, a
  439. // 404 means the resource was not found.
  440. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  441. // Id: [Output Only] The unique identifier for the resource. This
  442. // identifier is defined by the server.
  443. Id uint64 `json:"id,omitempty,string"`
  444. // InsertTime: [Output Only] The time that this operation was requested.
  445. // This value is in RFC3339 text format.
  446. InsertTime string `json:"insertTime,omitempty"`
  447. // Kind: [Output Only] Type of the resource. Always compute#operation
  448. // for Operation resources.
  449. Kind string `json:"kind,omitempty"`
  450. // Name: [Output Only] Name of the resource.
  451. Name string `json:"name,omitempty"`
  452. // OperationType: [Output Only] The type of operation, such as insert,
  453. // update, or delete, and so on.
  454. OperationType string `json:"operationType,omitempty"`
  455. // Progress: [Output Only] An optional progress indicator that ranges
  456. // from 0 to 100. There is no requirement that this be linear or support
  457. // any granularity of operations. This should not be used to guess when
  458. // the operation will be complete. This number should monotonically
  459. // increase as the operation progresses.
  460. Progress int64 `json:"progress,omitempty"`
  461. // Region: [Output Only] The URL of the region where the operation
  462. // resides. Only available when performing regional operations.
  463. Region string `json:"region,omitempty"`
  464. // SelfLink: [Output Only] Server-defined URL for the resource.
  465. SelfLink string `json:"selfLink,omitempty"`
  466. // StartTime: [Output Only] The time that this operation was started by
  467. // the server. This value is in RFC3339 text format.
  468. StartTime string `json:"startTime,omitempty"`
  469. // Status: [Output Only] The status of the operation, which can be one
  470. // of the following: PENDING, RUNNING, or DONE.
  471. //
  472. // Possible values:
  473. // "DONE"
  474. // "PENDING"
  475. // "RUNNING"
  476. Status string `json:"status,omitempty"`
  477. // StatusMessage: [Output Only] An optional textual description of the
  478. // current status of the operation.
  479. StatusMessage string `json:"statusMessage,omitempty"`
  480. // TargetId: [Output Only] The unique target ID, which identifies a
  481. // specific incarnation of the target resource.
  482. TargetId uint64 `json:"targetId,omitempty,string"`
  483. // TargetLink: [Output Only] The URL of the resource that the operation
  484. // modifies.
  485. TargetLink string `json:"targetLink,omitempty"`
  486. // User: [Output Only] User who requested the operation, for example:
  487. // user@example.com.
  488. User string `json:"user,omitempty"`
  489. // Warnings: [Output Only] If warning messages are generated during
  490. // processing of the operation, this field will be populated.
  491. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  492. // Zone: [Output Only] The URL of the zone where the operation resides.
  493. // Only available when performing per-zone operations.
  494. Zone string `json:"zone,omitempty"`
  495. // ServerResponse contains the HTTP response code and headers from the
  496. // server.
  497. googleapi.ServerResponse `json:"-"`
  498. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  499. // to 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. "ClientOperationId") to
  506. // include in API requests with the JSON null value. By default, fields
  507. // with empty values are omitted from API requests. However, any field
  508. // with an empty value appearing in NullFields will be sent to the
  509. // server as null. It is an error if a field in this list has a
  510. // non-empty value. This may be used to include null fields in Patch
  511. // requests.
  512. NullFields []string `json:"-"`
  513. }
  514. func (s *Operation) MarshalJSON() ([]byte, error) {
  515. type NoMethod Operation
  516. raw := NoMethod(*s)
  517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  518. }
  519. // OperationError: [Output Only] If errors are generated during
  520. // processing of the operation, this field will be populated.
  521. type OperationError struct {
  522. // Errors: [Output Only] The array of errors encountered while
  523. // processing this operation.
  524. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  525. // ForceSendFields is a list of field names (e.g. "Errors") to
  526. // unconditionally include in API requests. By default, fields with
  527. // empty values are omitted from API requests. However, any non-pointer,
  528. // non-interface field appearing in ForceSendFields will be sent to the
  529. // server regardless of whether the field is empty or not. This may be
  530. // used to include empty fields in Patch requests.
  531. ForceSendFields []string `json:"-"`
  532. // NullFields is a list of field names (e.g. "Errors") to include in API
  533. // requests with the JSON null value. By default, fields with empty
  534. // values are omitted from API requests. However, any field with an
  535. // empty value appearing in NullFields will be sent to the server as
  536. // null. It is an error if a field in this list has a non-empty value.
  537. // This may be used to include null fields in Patch requests.
  538. NullFields []string `json:"-"`
  539. }
  540. func (s *OperationError) MarshalJSON() ([]byte, error) {
  541. type NoMethod OperationError
  542. raw := NoMethod(*s)
  543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  544. }
  545. type OperationErrorErrors struct {
  546. // Code: [Output Only] The error type identifier for this error.
  547. Code string `json:"code,omitempty"`
  548. // Location: [Output Only] Indicates the field in the request that
  549. // caused the error. This property is optional.
  550. Location string `json:"location,omitempty"`
  551. // Message: [Output Only] An optional, human-readable error message.
  552. Message string `json:"message,omitempty"`
  553. // ForceSendFields is a list of field names (e.g. "Code") to
  554. // unconditionally include in API requests. By default, fields with
  555. // empty values are omitted from API requests. However, any non-pointer,
  556. // non-interface field appearing in ForceSendFields will be sent to the
  557. // server regardless of whether the field is empty or not. This may be
  558. // used to include empty fields in Patch requests.
  559. ForceSendFields []string `json:"-"`
  560. // NullFields is a list of field names (e.g. "Code") to include in API
  561. // requests with the JSON null value. By default, fields with empty
  562. // values are omitted from API requests. However, any field with an
  563. // empty value appearing in NullFields will be sent to the server as
  564. // null. It is an error if a field in this list has a non-empty value.
  565. // This may be used to include null fields in Patch requests.
  566. NullFields []string `json:"-"`
  567. }
  568. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  569. type NoMethod OperationErrorErrors
  570. raw := NoMethod(*s)
  571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  572. }
  573. type OperationWarnings struct {
  574. // Code: [Output Only] A warning code, if applicable. For example,
  575. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  576. // the response.
  577. //
  578. // Possible values:
  579. // "CLEANUP_FAILED"
  580. // "DEPRECATED_RESOURCE_USED"
  581. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  582. // "INJECTED_KERNELS_DEPRECATED"
  583. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  584. // "NEXT_HOP_CANNOT_IP_FORWARD"
  585. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  586. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  587. // "NEXT_HOP_NOT_RUNNING"
  588. // "NOT_CRITICAL_ERROR"
  589. // "NO_RESULTS_ON_PAGE"
  590. // "REQUIRED_TOS_AGREEMENT"
  591. // "RESOURCE_NOT_DELETED"
  592. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  593. // "UNREACHABLE"
  594. Code string `json:"code,omitempty"`
  595. // Data: [Output Only] Metadata about this warning in key: value format.
  596. // For example:
  597. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  598. Data []*OperationWarningsData `json:"data,omitempty"`
  599. // Message: [Output Only] A human-readable description of the warning
  600. // code.
  601. Message string `json:"message,omitempty"`
  602. // ForceSendFields is a list of field names (e.g. "Code") to
  603. // unconditionally include in API requests. By default, fields with
  604. // empty values are omitted from API requests. However, any non-pointer,
  605. // non-interface field appearing in ForceSendFields will be sent to the
  606. // server regardless of whether the field is empty or not. This may be
  607. // used to include empty fields in Patch requests.
  608. ForceSendFields []string `json:"-"`
  609. // NullFields is a list of field names (e.g. "Code") to include in API
  610. // requests with the JSON null value. By default, fields with empty
  611. // values are omitted from API requests. However, any field with an
  612. // empty value appearing in NullFields will be sent to the server as
  613. // null. It is an error if a field in this list has a non-empty value.
  614. // This may be used to include null fields in Patch requests.
  615. NullFields []string `json:"-"`
  616. }
  617. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  618. type NoMethod OperationWarnings
  619. raw := NoMethod(*s)
  620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  621. }
  622. type OperationWarningsData struct {
  623. // Key: [Output Only] A key that provides more detail on the warning
  624. // being returned. For example, for warnings where there are no results
  625. // in a list request for a particular zone, this key might be scope and
  626. // the key value might be the zone name. Other examples might be a key
  627. // indicating a deprecated resource and a suggested replacement, or a
  628. // warning about invalid network settings (for example, if an instance
  629. // attempts to perform IP forwarding but is not enabled for IP
  630. // forwarding).
  631. Key string `json:"key,omitempty"`
  632. // Value: [Output Only] A warning data value corresponding to the key.
  633. Value string `json:"value,omitempty"`
  634. // ForceSendFields is a list of field names (e.g. "Key") to
  635. // unconditionally include in API requests. By default, fields with
  636. // empty values are omitted from API requests. However, any non-pointer,
  637. // non-interface field appearing in ForceSendFields will be sent to the
  638. // server regardless of whether the field is empty or not. This may be
  639. // used to include empty fields in Patch requests.
  640. ForceSendFields []string `json:"-"`
  641. // NullFields is a list of field names (e.g. "Key") to include in API
  642. // requests with the JSON null value. By default, fields with empty
  643. // values are omitted from API requests. However, any field with an
  644. // empty value appearing in NullFields will be sent to the server as
  645. // null. It is an error if a field in this list has a non-empty value.
  646. // This may be used to include null fields in Patch requests.
  647. NullFields []string `json:"-"`
  648. }
  649. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  650. type NoMethod OperationWarningsData
  651. raw := NoMethod(*s)
  652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  653. }
  654. // OperationList: Contains a list of Operation resources.
  655. type OperationList struct {
  656. // Id: [Output Only] The unique identifier for the resource. This
  657. // identifier is defined by the server.
  658. Id string `json:"id,omitempty"`
  659. // Items: [Output Only] A list of Operation resources.
  660. Items []*Operation `json:"items,omitempty"`
  661. // Kind: [Output Only] Type of resource. Always compute#operations for
  662. // Operations resource.
  663. Kind string `json:"kind,omitempty"`
  664. // NextPageToken: [Output Only] This token allows you to get the next
  665. // page of results for list requests. If the number of results is larger
  666. // than maxResults, use the nextPageToken as a value for the query
  667. // parameter pageToken in the next list request. Subsequent list
  668. // requests will have their own nextPageToken to continue paging through
  669. // the results.
  670. NextPageToken string `json:"nextPageToken,omitempty"`
  671. // SelfLink: [Output Only] Server-defined URL for this resource.
  672. SelfLink string `json:"selfLink,omitempty"`
  673. // ServerResponse contains the HTTP response code and headers from the
  674. // server.
  675. googleapi.ServerResponse `json:"-"`
  676. // ForceSendFields is a list of field names (e.g. "Id") to
  677. // unconditionally include in API requests. By default, fields with
  678. // empty values are omitted from API requests. However, any non-pointer,
  679. // non-interface field appearing in ForceSendFields will be sent to the
  680. // server regardless of whether the field is empty or not. This may be
  681. // used to include empty fields in Patch requests.
  682. ForceSendFields []string `json:"-"`
  683. // NullFields is a list of field names (e.g. "Id") to include in API
  684. // requests with the JSON null value. By default, fields with empty
  685. // values are omitted from API requests. However, any field with an
  686. // empty value appearing in NullFields will be sent to the server as
  687. // null. It is an error if a field in this list has a non-empty value.
  688. // This may be used to include null fields in Patch requests.
  689. NullFields []string `json:"-"`
  690. }
  691. func (s *OperationList) MarshalJSON() ([]byte, error) {
  692. type NoMethod OperationList
  693. raw := NoMethod(*s)
  694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  695. }
  696. // PublicKey: A public key for authenticating to guests.
  697. type PublicKey struct {
  698. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  699. // format.
  700. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  701. // Description: An optional textual description of the resource;
  702. // provided by the client when the resource is created.
  703. Description string `json:"description,omitempty"`
  704. // ExpirationTimestamp: Optional expiration timestamp. If provided, the
  705. // timestamp must be in RFC3339 text format. If not provided, the public
  706. // key never expires.
  707. ExpirationTimestamp string `json:"expirationTimestamp,omitempty"`
  708. // Fingerprint: [Output Only] The fingerprint of the key is defined by
  709. // RFC4716 to be the MD5 digest of the public key.
  710. Fingerprint string `json:"fingerprint,omitempty"`
  711. // Key: Public key text in SSH format, defined by RFC4253 section 6.6.
  712. Key string `json:"key,omitempty"`
  713. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  714. // to unconditionally include in API requests. By default, fields with
  715. // empty values are omitted from API requests. However, any non-pointer,
  716. // non-interface field appearing in ForceSendFields will be sent to the
  717. // server regardless of whether the field is empty or not. This may be
  718. // used to include empty fields in Patch requests.
  719. ForceSendFields []string `json:"-"`
  720. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  721. // include in API requests with the JSON null value. By default, fields
  722. // with empty values are omitted from API requests. However, any field
  723. // with an empty value appearing in NullFields will be sent to the
  724. // server as null. It is an error if a field in this list has a
  725. // non-empty value. This may be used to include null fields in Patch
  726. // requests.
  727. NullFields []string `json:"-"`
  728. }
  729. func (s *PublicKey) MarshalJSON() ([]byte, error) {
  730. type NoMethod PublicKey
  731. raw := NoMethod(*s)
  732. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  733. }
  734. // User: A User resource.
  735. type User struct {
  736. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  737. // format.
  738. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  739. // Description: An optional textual description of the resource;
  740. // provided by the client when the resource is created.
  741. Description string `json:"description,omitempty"`
  742. // Groups: [Output Only] A list of URLs to Group resources who contain
  743. // the user. Users are only members of groups in the same project.
  744. Groups []string `json:"groups,omitempty"`
  745. // Id: [Output Only] Unique identifier for the resource; defined by the
  746. // server.
  747. Id uint64 `json:"id,omitempty,string"`
  748. // Kind: [Output Only] Type of the resource. Always
  749. // clouduseraccounts#user for users.
  750. Kind string `json:"kind,omitempty"`
  751. // Name: Name of the resource; provided by the client when the resource
  752. // is created.
  753. Name string `json:"name,omitempty"`
  754. // Owner: Email address of account's owner. This account will be
  755. // validated to make sure it exists. The email can belong to any domain,
  756. // but it must be tied to a Google account.
  757. Owner string `json:"owner,omitempty"`
  758. // PublicKeys: [Output Only] Public keys that this user may use to
  759. // login.
  760. PublicKeys []*PublicKey `json:"publicKeys,omitempty"`
  761. // SelfLink: [Output Only] Server defined URL for the resource.
  762. SelfLink string `json:"selfLink,omitempty"`
  763. // ServerResponse contains the HTTP response code and headers from the
  764. // server.
  765. googleapi.ServerResponse `json:"-"`
  766. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  767. // to unconditionally include in API requests. By default, fields with
  768. // empty values are omitted from API requests. However, any non-pointer,
  769. // non-interface field appearing in ForceSendFields will be sent to the
  770. // server regardless of whether the field is empty or not. This may be
  771. // used to include empty fields in Patch requests.
  772. ForceSendFields []string `json:"-"`
  773. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  774. // include in API requests with the JSON null value. By default, fields
  775. // with empty values are omitted from API requests. However, any field
  776. // with an empty value appearing in NullFields will be sent to the
  777. // server as null. It is an error if a field in this list has a
  778. // non-empty value. This may be used to include null fields in Patch
  779. // requests.
  780. NullFields []string `json:"-"`
  781. }
  782. func (s *User) MarshalJSON() ([]byte, error) {
  783. type NoMethod User
  784. raw := NoMethod(*s)
  785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  786. }
  787. type UserList struct {
  788. // Id: [Output Only] Unique identifier for the resource; defined by the
  789. // server.
  790. Id string `json:"id,omitempty"`
  791. // Items: [Output Only] A list of User resources.
  792. Items []*User `json:"items,omitempty"`
  793. // Kind: [Output Only] Type of resource. Always
  794. // clouduseraccounts#userList for lists of users.
  795. Kind string `json:"kind,omitempty"`
  796. // NextPageToken: [Output Only] A token used to continue a truncated
  797. // list request.
  798. NextPageToken string `json:"nextPageToken,omitempty"`
  799. // SelfLink: [Output Only] Server defined URL for this resource.
  800. SelfLink string `json:"selfLink,omitempty"`
  801. // ServerResponse contains the HTTP response code and headers from the
  802. // server.
  803. googleapi.ServerResponse `json:"-"`
  804. // ForceSendFields is a list of field names (e.g. "Id") to
  805. // unconditionally include in API requests. By default, fields with
  806. // empty values are omitted from API requests. However, any non-pointer,
  807. // non-interface field appearing in ForceSendFields will be sent to the
  808. // server regardless of whether the field is empty or not. This may be
  809. // used to include empty fields in Patch requests.
  810. ForceSendFields []string `json:"-"`
  811. // NullFields is a list of field names (e.g. "Id") to include in API
  812. // requests with the JSON null value. By default, fields with empty
  813. // values are omitted from API requests. However, any field with an
  814. // empty value appearing in NullFields will be sent to the server as
  815. // null. It is an error if a field in this list has a non-empty value.
  816. // This may be used to include null fields in Patch requests.
  817. NullFields []string `json:"-"`
  818. }
  819. func (s *UserList) MarshalJSON() ([]byte, error) {
  820. type NoMethod UserList
  821. raw := NoMethod(*s)
  822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  823. }
  824. // method id "clouduseraccounts.globalAccountsOperations.delete":
  825. type GlobalAccountsOperationsDeleteCall struct {
  826. s *Service
  827. project string
  828. operation string
  829. urlParams_ gensupport.URLParams
  830. ctx_ context.Context
  831. header_ http.Header
  832. }
  833. // Delete: Deletes the specified operation resource.
  834. func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall {
  835. c := &GlobalAccountsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  836. c.project = project
  837. c.operation = operation
  838. return c
  839. }
  840. // Fields allows partial responses to be retrieved. See
  841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  842. // for more information.
  843. func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall {
  844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  845. return c
  846. }
  847. // Context sets the context to be used in this call's Do method. Any
  848. // pending HTTP request will be aborted if the provided context is
  849. // canceled.
  850. func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall {
  851. c.ctx_ = ctx
  852. return c
  853. }
  854. // Header returns an http.Header that can be modified by the caller to
  855. // add HTTP headers to the request.
  856. func (c *GlobalAccountsOperationsDeleteCall) Header() http.Header {
  857. if c.header_ == nil {
  858. c.header_ = make(http.Header)
  859. }
  860. return c.header_
  861. }
  862. func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  863. reqHeaders := make(http.Header)
  864. for k, v := range c.header_ {
  865. reqHeaders[k] = v
  866. }
  867. reqHeaders.Set("User-Agent", c.s.userAgent())
  868. var body io.Reader = nil
  869. c.urlParams_.Set("alt", alt)
  870. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  871. urls += "?" + c.urlParams_.Encode()
  872. req, _ := http.NewRequest("DELETE", urls, body)
  873. req.Header = reqHeaders
  874. googleapi.Expand(req.URL, map[string]string{
  875. "project": c.project,
  876. "operation": c.operation,
  877. })
  878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  879. }
  880. // Do executes the "clouduseraccounts.globalAccountsOperations.delete" call.
  881. func (c *GlobalAccountsOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  882. gensupport.SetOptions(c.urlParams_, opts...)
  883. res, err := c.doRequest("json")
  884. if err != nil {
  885. return err
  886. }
  887. defer googleapi.CloseBody(res)
  888. if err := googleapi.CheckResponse(res); err != nil {
  889. return err
  890. }
  891. return nil
  892. // {
  893. // "description": "Deletes the specified operation resource.",
  894. // "httpMethod": "DELETE",
  895. // "id": "clouduseraccounts.globalAccountsOperations.delete",
  896. // "parameterOrder": [
  897. // "project",
  898. // "operation"
  899. // ],
  900. // "parameters": {
  901. // "operation": {
  902. // "description": "Name of the Operations resource to delete.",
  903. // "location": "path",
  904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  905. // "required": true,
  906. // "type": "string"
  907. // },
  908. // "project": {
  909. // "description": "Project ID for this request.",
  910. // "location": "path",
  911. // "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])?))",
  912. // "required": true,
  913. // "type": "string"
  914. // }
  915. // },
  916. // "path": "{project}/global/operations/{operation}",
  917. // "scopes": [
  918. // "https://www.googleapis.com/auth/cloud-platform",
  919. // "https://www.googleapis.com/auth/cloud.useraccounts"
  920. // ]
  921. // }
  922. }
  923. // method id "clouduseraccounts.globalAccountsOperations.get":
  924. type GlobalAccountsOperationsGetCall struct {
  925. s *Service
  926. project string
  927. operation string
  928. urlParams_ gensupport.URLParams
  929. ifNoneMatch_ string
  930. ctx_ context.Context
  931. header_ http.Header
  932. }
  933. // Get: Retrieves the specified operation resource.
  934. func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall {
  935. c := &GlobalAccountsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  936. c.project = project
  937. c.operation = operation
  938. return c
  939. }
  940. // Fields allows partial responses to be retrieved. See
  941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  942. // for more information.
  943. func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall {
  944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  945. return c
  946. }
  947. // IfNoneMatch sets the optional parameter which makes the operation
  948. // fail if the object's ETag matches the given value. This is useful for
  949. // getting updates only after the object has changed since the last
  950. // request. Use googleapi.IsNotModified to check whether the response
  951. // error from Do is the result of In-None-Match.
  952. func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall {
  953. c.ifNoneMatch_ = entityTag
  954. return c
  955. }
  956. // Context sets the context to be used in this call's Do method. Any
  957. // pending HTTP request will be aborted if the provided context is
  958. // canceled.
  959. func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall {
  960. c.ctx_ = ctx
  961. return c
  962. }
  963. // Header returns an http.Header that can be modified by the caller to
  964. // add HTTP headers to the request.
  965. func (c *GlobalAccountsOperationsGetCall) Header() http.Header {
  966. if c.header_ == nil {
  967. c.header_ = make(http.Header)
  968. }
  969. return c.header_
  970. }
  971. func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  972. reqHeaders := make(http.Header)
  973. for k, v := range c.header_ {
  974. reqHeaders[k] = v
  975. }
  976. reqHeaders.Set("User-Agent", c.s.userAgent())
  977. if c.ifNoneMatch_ != "" {
  978. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  979. }
  980. var body io.Reader = nil
  981. c.urlParams_.Set("alt", alt)
  982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  983. urls += "?" + c.urlParams_.Encode()
  984. req, _ := http.NewRequest("GET", urls, body)
  985. req.Header = reqHeaders
  986. googleapi.Expand(req.URL, map[string]string{
  987. "project": c.project,
  988. "operation": c.operation,
  989. })
  990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  991. }
  992. // Do executes the "clouduseraccounts.globalAccountsOperations.get" call.
  993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  994. // status code is an error. Response headers are in either
  995. // *Operation.ServerResponse.Header or (if a response was returned at
  996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  997. // to check whether the returned error was because
  998. // http.StatusNotModified was returned.
  999. func (c *GlobalAccountsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1000. gensupport.SetOptions(c.urlParams_, opts...)
  1001. res, err := c.doRequest("json")
  1002. if res != nil && res.StatusCode == http.StatusNotModified {
  1003. if res.Body != nil {
  1004. res.Body.Close()
  1005. }
  1006. return nil, &googleapi.Error{
  1007. Code: res.StatusCode,
  1008. Header: res.Header,
  1009. }
  1010. }
  1011. if err != nil {
  1012. return nil, err
  1013. }
  1014. defer googleapi.CloseBody(res)
  1015. if err := googleapi.CheckResponse(res); err != nil {
  1016. return nil, err
  1017. }
  1018. ret := &Operation{
  1019. ServerResponse: googleapi.ServerResponse{
  1020. Header: res.Header,
  1021. HTTPStatusCode: res.StatusCode,
  1022. },
  1023. }
  1024. target := &ret
  1025. if err := gensupport.DecodeResponse(target, res); err != nil {
  1026. return nil, err
  1027. }
  1028. return ret, nil
  1029. // {
  1030. // "description": "Retrieves the specified operation resource.",
  1031. // "httpMethod": "GET",
  1032. // "id": "clouduseraccounts.globalAccountsOperations.get",
  1033. // "parameterOrder": [
  1034. // "project",
  1035. // "operation"
  1036. // ],
  1037. // "parameters": {
  1038. // "operation": {
  1039. // "description": "Name of the Operations resource to return.",
  1040. // "location": "path",
  1041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  1042. // "required": true,
  1043. // "type": "string"
  1044. // },
  1045. // "project": {
  1046. // "description": "Project ID for this request.",
  1047. // "location": "path",
  1048. // "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])?))",
  1049. // "required": true,
  1050. // "type": "string"
  1051. // }
  1052. // },
  1053. // "path": "{project}/global/operations/{operation}",
  1054. // "response": {
  1055. // "$ref": "Operation"
  1056. // },
  1057. // "scopes": [
  1058. // "https://www.googleapis.com/auth/cloud-platform",
  1059. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1060. // "https://www.googleapis.com/auth/cloud.useraccounts",
  1061. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  1062. // ]
  1063. // }
  1064. }
  1065. // method id "clouduseraccounts.globalAccountsOperations.list":
  1066. type GlobalAccountsOperationsListCall struct {
  1067. s *Service
  1068. project string
  1069. urlParams_ gensupport.URLParams
  1070. ifNoneMatch_ string
  1071. ctx_ context.Context
  1072. header_ http.Header
  1073. }
  1074. // List: Retrieves the list of operation resources contained within the
  1075. // specified project.
  1076. func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall {
  1077. c := &GlobalAccountsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1078. c.project = project
  1079. return c
  1080. }
  1081. // Filter sets the optional parameter "filter": Sets a filter expression
  1082. // for filtering listed resources, in the form filter={expression}. Your
  1083. // {expression} must be in the format: field_name comparison_string
  1084. // literal_string.
  1085. //
  1086. // The field_name is the name of the field you want to compare. Only
  1087. // atomic field types are supported (string, number, boolean). The
  1088. // comparison_string must be either eq (equals) or ne (not equals). The
  1089. // literal_string is the string value to filter to. The literal value
  1090. // must be valid for the type of field you are filtering by (string,
  1091. // number, boolean). For string fields, the literal value is interpreted
  1092. // as a regular expression using RE2 syntax. The literal value must
  1093. // match the entire field.
  1094. //
  1095. // For example, to filter for instances that do not have a name of
  1096. // example-instance, you would use filter=name ne
  1097. // example-instance.
  1098. //
  1099. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  1100. // you can also filter on nested fields. For example, you could filter
  1101. // on instances that have set the scheduling.automaticRestart field to
  1102. // true. In particular, use filtering on nested fields to take advantage
  1103. // of instance labels to organize and filter results based on label
  1104. // values.
  1105. //
  1106. // The Beta API also supports filtering on multiple expressions by
  1107. // providing each separate expression within parentheses. For example,
  1108. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  1109. // Multiple expressions are treated as AND expressions, meaning that
  1110. // resources must match all expressions to pass the filters.
  1111. func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall {
  1112. c.urlParams_.Set("filter", filter)
  1113. return c
  1114. }
  1115. // MaxResults sets the optional parameter "maxResults": The maximum
  1116. // number of results per page that should be returned. If the number of
  1117. // available results is larger than maxResults, Compute Engine returns a
  1118. // nextPageToken that can be used to get the next page of results in
  1119. // subsequent list requests.
  1120. func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall {
  1121. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1122. return c
  1123. }
  1124. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  1125. // a certain order. By default, results are returned in alphanumerical
  1126. // order based on the resource name.
  1127. //
  1128. // You can also sort results in descending order based on the creation
  1129. // timestamp using orderBy="creationTimestamp desc". This sorts results
  1130. // based on the creationTimestamp field in reverse chronological order
  1131. // (newest result first). Use this to sort resources like operations so
  1132. // that the newest operation is returned first.
  1133. //
  1134. // Currently, only sorting by name or creationTimestamp desc is
  1135. // supported.
  1136. func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall {
  1137. c.urlParams_.Set("orderBy", orderBy)
  1138. return c
  1139. }
  1140. // PageToken sets the optional parameter "pageToken": Specifies a page
  1141. // token to use. Set pageToken to the nextPageToken returned by a
  1142. // previous list request to get the next page of results.
  1143. func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall {
  1144. c.urlParams_.Set("pageToken", pageToken)
  1145. return c
  1146. }
  1147. // Fields allows partial responses to be retrieved. See
  1148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1149. // for more information.
  1150. func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall {
  1151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1152. return c
  1153. }
  1154. // IfNoneMatch sets the optional parameter which makes the operation
  1155. // fail if the object's ETag matches the given value. This is useful for
  1156. // getting updates only after the object has changed since the last
  1157. // request. Use googleapi.IsNotModified to check whether the response
  1158. // error from Do is the result of In-None-Match.
  1159. func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall {
  1160. c.ifNoneMatch_ = entityTag
  1161. return c
  1162. }
  1163. // Context sets the context to be used in this call's Do method. Any
  1164. // pending HTTP request will be aborted if the provided context is
  1165. // canceled.
  1166. func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall {
  1167. c.ctx_ = ctx
  1168. return c
  1169. }
  1170. // Header returns an http.Header that can be modified by the caller to
  1171. // add HTTP headers to the request.
  1172. func (c *GlobalAccountsOperationsListCall) Header() http.Header {
  1173. if c.header_ == nil {
  1174. c.header_ = make(http.Header)
  1175. }
  1176. return c.header_
  1177. }
  1178. func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1179. reqHeaders := make(http.Header)
  1180. for k, v := range c.header_ {
  1181. reqHeaders[k] = v
  1182. }
  1183. reqHeaders.Set("User-Agent", c.s.userAgent())
  1184. if c.ifNoneMatch_ != "" {
  1185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1186. }
  1187. var body io.Reader = nil
  1188. c.urlParams_.Set("alt", alt)
  1189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  1190. urls += "?" + c.urlParams_.Encode()
  1191. req, _ := http.NewRequest("GET", urls, body)
  1192. req.Header = reqHeaders
  1193. googleapi.Expand(req.URL, map[string]string{
  1194. "project": c.project,
  1195. })
  1196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1197. }
  1198. // Do executes the "clouduseraccounts.globalAccountsOperations.list" call.
  1199. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  1200. // status code is an error. Response headers are in either
  1201. // *OperationList.ServerResponse.Header or (if a response was returned
  1202. // at all) in error.(*googleapi.Error).Header. Use
  1203. // googleapi.IsNotModified to check whether the returned error was
  1204. // because http.StatusNotModified was returned.
  1205. func (c *GlobalAccountsOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  1206. gensupport.SetOptions(c.urlParams_, opts...)
  1207. res, err := c.doRequest("json")
  1208. if res != nil && res.StatusCode == http.StatusNotModified {
  1209. if res.Body != nil {
  1210. res.Body.Close()
  1211. }
  1212. return nil, &googleapi.Error{
  1213. Code: res.StatusCode,
  1214. Header: res.Header,
  1215. }
  1216. }
  1217. if err != nil {
  1218. return nil, err
  1219. }
  1220. defer googleapi.CloseBody(res)
  1221. if err := googleapi.CheckResponse(res); err != nil {
  1222. return nil, err
  1223. }
  1224. ret := &OperationList{
  1225. ServerResponse: googleapi.ServerResponse{
  1226. Header: res.Header,
  1227. HTTPStatusCode: res.StatusCode,
  1228. },
  1229. }
  1230. target := &ret
  1231. if err := gensupport.DecodeResponse(target, res); err != nil {
  1232. return nil, err
  1233. }
  1234. return ret, nil
  1235. // {
  1236. // "description": "Retrieves the list of operation resources contained within the specified project.",
  1237. // "httpMethod": "GET",
  1238. // "id": "clouduseraccounts.globalAccountsOperations.list",
  1239. // "parameterOrder": [
  1240. // "project"
  1241. // ],
  1242. // "parameters": {
  1243. // "filter": {
  1244. // "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.",
  1245. // "location": "query",
  1246. // "type": "string"
  1247. // },
  1248. // "maxResults": {
  1249. // "default": "500",
  1250. // "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.",
  1251. // "format": "uint32",
  1252. // "location": "query",
  1253. // "maximum": "500",
  1254. // "minimum": "0",
  1255. // "type": "integer"
  1256. // },
  1257. // "orderBy": {
  1258. // "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.",
  1259. // "location": "query",
  1260. // "type": "string"
  1261. // },
  1262. // "pageToken": {
  1263. // "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.",
  1264. // "location": "query",
  1265. // "type": "string"
  1266. // },
  1267. // "project": {
  1268. // "description": "Project ID for this request.",
  1269. // "location": "path",
  1270. // "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])?))",
  1271. // "required": true,
  1272. // "type": "string"
  1273. // }
  1274. // },
  1275. // "path": "{project}/global/operations",
  1276. // "response": {
  1277. // "$ref": "OperationList"
  1278. // },
  1279. // "scopes": [
  1280. // "https://www.googleapis.com/auth/cloud-platform",
  1281. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1282. // "https://www.googleapis.com/auth/cloud.useraccounts",
  1283. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  1284. // ]
  1285. // }
  1286. }
  1287. // Pages invokes f for each page of results.
  1288. // A non-nil error returned from f will halt the iteration.
  1289. // The provided context supersedes any context provided to the Context method.
  1290. func (c *GlobalAccountsOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  1291. c.ctx_ = ctx
  1292. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1293. for {
  1294. x, err := c.Do()
  1295. if err != nil {
  1296. return err
  1297. }
  1298. if err := f(x); err != nil {
  1299. return err
  1300. }
  1301. if x.NextPageToken == "" {
  1302. return nil
  1303. }
  1304. c.PageToken(x.NextPageToken)
  1305. }
  1306. }
  1307. // method id "clouduseraccounts.groups.addMember":
  1308. type GroupsAddMemberCall struct {
  1309. s *Service
  1310. project string
  1311. groupName string
  1312. groupsaddmemberrequest *GroupsAddMemberRequest
  1313. urlParams_ gensupport.URLParams
  1314. ctx_ context.Context
  1315. header_ http.Header
  1316. }
  1317. // AddMember: Adds users to the specified group.
  1318. func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall {
  1319. c := &GroupsAddMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1320. c.project = project
  1321. c.groupName = groupName
  1322. c.groupsaddmemberrequest = groupsaddmemberrequest
  1323. return c
  1324. }
  1325. // Fields allows partial responses to be retrieved. See
  1326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1327. // for more information.
  1328. func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall {
  1329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1330. return c
  1331. }
  1332. // Context sets the context to be used in this call's Do method. Any
  1333. // pending HTTP request will be aborted if the provided context is
  1334. // canceled.
  1335. func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall {
  1336. c.ctx_ = ctx
  1337. return c
  1338. }
  1339. // Header returns an http.Header that can be modified by the caller to
  1340. // add HTTP headers to the request.
  1341. func (c *GroupsAddMemberCall) Header() http.Header {
  1342. if c.header_ == nil {
  1343. c.header_ = make(http.Header)
  1344. }
  1345. return c.header_
  1346. }
  1347. func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) {
  1348. reqHeaders := make(http.Header)
  1349. for k, v := range c.header_ {
  1350. reqHeaders[k] = v
  1351. }
  1352. reqHeaders.Set("User-Agent", c.s.userAgent())
  1353. var body io.Reader = nil
  1354. body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest)
  1355. if err != nil {
  1356. return nil, err
  1357. }
  1358. reqHeaders.Set("Content-Type", "application/json")
  1359. c.urlParams_.Set("alt", alt)
  1360. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember")
  1361. urls += "?" + c.urlParams_.Encode()
  1362. req, _ := http.NewRequest("POST", urls, body)
  1363. req.Header = reqHeaders
  1364. googleapi.Expand(req.URL, map[string]string{
  1365. "project": c.project,
  1366. "groupName": c.groupName,
  1367. })
  1368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1369. }
  1370. // Do executes the "clouduseraccounts.groups.addMember" call.
  1371. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1372. // status code is an error. Response headers are in either
  1373. // *Operation.ServerResponse.Header or (if a response was returned at
  1374. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1375. // to check whether the returned error was because
  1376. // http.StatusNotModified was returned.
  1377. func (c *GroupsAddMemberCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1378. gensupport.SetOptions(c.urlParams_, opts...)
  1379. res, err := c.doRequest("json")
  1380. if res != nil && res.StatusCode == http.StatusNotModified {
  1381. if res.Body != nil {
  1382. res.Body.Close()
  1383. }
  1384. return nil, &googleapi.Error{
  1385. Code: res.StatusCode,
  1386. Header: res.Header,
  1387. }
  1388. }
  1389. if err != nil {
  1390. return nil, err
  1391. }
  1392. defer googleapi.CloseBody(res)
  1393. if err := googleapi.CheckResponse(res); err != nil {
  1394. return nil, err
  1395. }
  1396. ret := &Operation{
  1397. ServerResponse: googleapi.ServerResponse{
  1398. Header: res.Header,
  1399. HTTPStatusCode: res.StatusCode,
  1400. },
  1401. }
  1402. target := &ret
  1403. if err := gensupport.DecodeResponse(target, res); err != nil {
  1404. return nil, err
  1405. }
  1406. return ret, nil
  1407. // {
  1408. // "description": "Adds users to the specified group.",
  1409. // "httpMethod": "POST",
  1410. // "id": "clouduseraccounts.groups.addMember",
  1411. // "parameterOrder": [
  1412. // "project",
  1413. // "groupName"
  1414. // ],
  1415. // "parameters": {
  1416. // "groupName": {
  1417. // "description": "Name of the group for this request.",
  1418. // "location": "path",
  1419. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  1420. // "required": true,
  1421. // "type": "string"
  1422. // },
  1423. // "project": {
  1424. // "description": "Project ID for this request.",
  1425. // "location": "path",
  1426. // "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])?))",
  1427. // "required": true,
  1428. // "type": "string"
  1429. // }
  1430. // },
  1431. // "path": "{project}/global/groups/{groupName}/addMember",
  1432. // "request": {
  1433. // "$ref": "GroupsAddMemberRequest"
  1434. // },
  1435. // "response": {
  1436. // "$ref": "Operation"
  1437. // },
  1438. // "scopes": [
  1439. // "https://www.googleapis.com/auth/cloud-platform",
  1440. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1441. // ]
  1442. // }
  1443. }
  1444. // method id "clouduseraccounts.groups.delete":
  1445. type GroupsDeleteCall struct {
  1446. s *Service
  1447. project string
  1448. groupName string
  1449. urlParams_ gensupport.URLParams
  1450. ctx_ context.Context
  1451. header_ http.Header
  1452. }
  1453. // Delete: Deletes the specified Group resource.
  1454. func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall {
  1455. c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1456. c.project = project
  1457. c.groupName = groupName
  1458. return c
  1459. }
  1460. // Fields allows partial responses to be retrieved. See
  1461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1462. // for more information.
  1463. func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall {
  1464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1465. return c
  1466. }
  1467. // Context sets the context to be used in this call's Do method. Any
  1468. // pending HTTP request will be aborted if the provided context is
  1469. // canceled.
  1470. func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall {
  1471. c.ctx_ = ctx
  1472. return c
  1473. }
  1474. // Header returns an http.Header that can be modified by the caller to
  1475. // add HTTP headers to the request.
  1476. func (c *GroupsDeleteCall) Header() http.Header {
  1477. if c.header_ == nil {
  1478. c.header_ = make(http.Header)
  1479. }
  1480. return c.header_
  1481. }
  1482. func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1483. reqHeaders := make(http.Header)
  1484. for k, v := range c.header_ {
  1485. reqHeaders[k] = v
  1486. }
  1487. reqHeaders.Set("User-Agent", c.s.userAgent())
  1488. var body io.Reader = nil
  1489. c.urlParams_.Set("alt", alt)
  1490. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}")
  1491. urls += "?" + c.urlParams_.Encode()
  1492. req, _ := http.NewRequest("DELETE", urls, body)
  1493. req.Header = reqHeaders
  1494. googleapi.Expand(req.URL, map[string]string{
  1495. "project": c.project,
  1496. "groupName": c.groupName,
  1497. })
  1498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1499. }
  1500. // Do executes the "clouduseraccounts.groups.delete" call.
  1501. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1502. // status code is an error. Response headers are in either
  1503. // *Operation.ServerResponse.Header or (if a response was returned at
  1504. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1505. // to check whether the returned error was because
  1506. // http.StatusNotModified was returned.
  1507. func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1508. gensupport.SetOptions(c.urlParams_, opts...)
  1509. res, err := c.doRequest("json")
  1510. if res != nil && res.StatusCode == http.StatusNotModified {
  1511. if res.Body != nil {
  1512. res.Body.Close()
  1513. }
  1514. return nil, &googleapi.Error{
  1515. Code: res.StatusCode,
  1516. Header: res.Header,
  1517. }
  1518. }
  1519. if err != nil {
  1520. return nil, err
  1521. }
  1522. defer googleapi.CloseBody(res)
  1523. if err := googleapi.CheckResponse(res); err != nil {
  1524. return nil, err
  1525. }
  1526. ret := &Operation{
  1527. ServerResponse: googleapi.ServerResponse{
  1528. Header: res.Header,
  1529. HTTPStatusCode: res.StatusCode,
  1530. },
  1531. }
  1532. target := &ret
  1533. if err := gensupport.DecodeResponse(target, res); err != nil {
  1534. return nil, err
  1535. }
  1536. return ret, nil
  1537. // {
  1538. // "description": "Deletes the specified Group resource.",
  1539. // "httpMethod": "DELETE",
  1540. // "id": "clouduseraccounts.groups.delete",
  1541. // "parameterOrder": [
  1542. // "project",
  1543. // "groupName"
  1544. // ],
  1545. // "parameters": {
  1546. // "groupName": {
  1547. // "description": "Name of the Group resource to delete.",
  1548. // "location": "path",
  1549. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  1550. // "required": true,
  1551. // "type": "string"
  1552. // },
  1553. // "project": {
  1554. // "description": "Project ID for this request.",
  1555. // "location": "path",
  1556. // "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])?))",
  1557. // "required": true,
  1558. // "type": "string"
  1559. // }
  1560. // },
  1561. // "path": "{project}/global/groups/{groupName}",
  1562. // "response": {
  1563. // "$ref": "Operation"
  1564. // },
  1565. // "scopes": [
  1566. // "https://www.googleapis.com/auth/cloud-platform",
  1567. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1568. // ]
  1569. // }
  1570. }
  1571. // method id "clouduseraccounts.groups.get":
  1572. type GroupsGetCall struct {
  1573. s *Service
  1574. project string
  1575. groupName string
  1576. urlParams_ gensupport.URLParams
  1577. ifNoneMatch_ string
  1578. ctx_ context.Context
  1579. header_ http.Header
  1580. }
  1581. // Get: Returns the specified Group resource.
  1582. func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall {
  1583. c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1584. c.project = project
  1585. c.groupName = groupName
  1586. return c
  1587. }
  1588. // Fields allows partial responses to be retrieved. See
  1589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1590. // for more information.
  1591. func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall {
  1592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1593. return c
  1594. }
  1595. // IfNoneMatch sets the optional parameter which makes the operation
  1596. // fail if the object's ETag matches the given value. This is useful for
  1597. // getting updates only after the object has changed since the last
  1598. // request. Use googleapi.IsNotModified to check whether the response
  1599. // error from Do is the result of In-None-Match.
  1600. func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall {
  1601. c.ifNoneMatch_ = entityTag
  1602. return c
  1603. }
  1604. // Context sets the context to be used in this call's Do method. Any
  1605. // pending HTTP request will be aborted if the provided context is
  1606. // canceled.
  1607. func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall {
  1608. c.ctx_ = ctx
  1609. return c
  1610. }
  1611. // Header returns an http.Header that can be modified by the caller to
  1612. // add HTTP headers to the request.
  1613. func (c *GroupsGetCall) Header() http.Header {
  1614. if c.header_ == nil {
  1615. c.header_ = make(http.Header)
  1616. }
  1617. return c.header_
  1618. }
  1619. func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) {
  1620. reqHeaders := make(http.Header)
  1621. for k, v := range c.header_ {
  1622. reqHeaders[k] = v
  1623. }
  1624. reqHeaders.Set("User-Agent", c.s.userAgent())
  1625. if c.ifNoneMatch_ != "" {
  1626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1627. }
  1628. var body io.Reader = nil
  1629. c.urlParams_.Set("alt", alt)
  1630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}")
  1631. urls += "?" + c.urlParams_.Encode()
  1632. req, _ := http.NewRequest("GET", urls, body)
  1633. req.Header = reqHeaders
  1634. googleapi.Expand(req.URL, map[string]string{
  1635. "project": c.project,
  1636. "groupName": c.groupName,
  1637. })
  1638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1639. }
  1640. // Do executes the "clouduseraccounts.groups.get" call.
  1641. // Exactly one of *Group or error will be non-nil. Any non-2xx status
  1642. // code is an error. Response headers are in either
  1643. // *Group.ServerResponse.Header or (if a response was returned at all)
  1644. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1645. // check whether the returned error was because http.StatusNotModified
  1646. // was returned.
  1647. func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) {
  1648. gensupport.SetOptions(c.urlParams_, opts...)
  1649. res, err := c.doRequest("json")
  1650. if res != nil && res.StatusCode == http.StatusNotModified {
  1651. if res.Body != nil {
  1652. res.Body.Close()
  1653. }
  1654. return nil, &googleapi.Error{
  1655. Code: res.StatusCode,
  1656. Header: res.Header,
  1657. }
  1658. }
  1659. if err != nil {
  1660. return nil, err
  1661. }
  1662. defer googleapi.CloseBody(res)
  1663. if err := googleapi.CheckResponse(res); err != nil {
  1664. return nil, err
  1665. }
  1666. ret := &Group{
  1667. ServerResponse: googleapi.ServerResponse{
  1668. Header: res.Header,
  1669. HTTPStatusCode: res.StatusCode,
  1670. },
  1671. }
  1672. target := &ret
  1673. if err := gensupport.DecodeResponse(target, res); err != nil {
  1674. return nil, err
  1675. }
  1676. return ret, nil
  1677. // {
  1678. // "description": "Returns the specified Group resource.",
  1679. // "httpMethod": "GET",
  1680. // "id": "clouduseraccounts.groups.get",
  1681. // "parameterOrder": [
  1682. // "project",
  1683. // "groupName"
  1684. // ],
  1685. // "parameters": {
  1686. // "groupName": {
  1687. // "description": "Name of the Group resource to return.",
  1688. // "location": "path",
  1689. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  1690. // "required": true,
  1691. // "type": "string"
  1692. // },
  1693. // "project": {
  1694. // "description": "Project ID for this request.",
  1695. // "location": "path",
  1696. // "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])?))",
  1697. // "required": true,
  1698. // "type": "string"
  1699. // }
  1700. // },
  1701. // "path": "{project}/global/groups/{groupName}",
  1702. // "response": {
  1703. // "$ref": "Group"
  1704. // },
  1705. // "scopes": [
  1706. // "https://www.googleapis.com/auth/cloud-platform",
  1707. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1708. // "https://www.googleapis.com/auth/cloud.useraccounts",
  1709. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  1710. // ]
  1711. // }
  1712. }
  1713. // method id "clouduseraccounts.groups.insert":
  1714. type GroupsInsertCall struct {
  1715. s *Service
  1716. project string
  1717. group *Group
  1718. urlParams_ gensupport.URLParams
  1719. ctx_ context.Context
  1720. header_ http.Header
  1721. }
  1722. // Insert: Creates a Group resource in the specified project using the
  1723. // data included in the request.
  1724. func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall {
  1725. c := &GroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1726. c.project = project
  1727. c.group = group
  1728. return c
  1729. }
  1730. // Fields allows partial responses to be retrieved. See
  1731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1732. // for more information.
  1733. func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall {
  1734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1735. return c
  1736. }
  1737. // Context sets the context to be used in this call's Do method. Any
  1738. // pending HTTP request will be aborted if the provided context is
  1739. // canceled.
  1740. func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall {
  1741. c.ctx_ = ctx
  1742. return c
  1743. }
  1744. // Header returns an http.Header that can be modified by the caller to
  1745. // add HTTP headers to the request.
  1746. func (c *GroupsInsertCall) Header() http.Header {
  1747. if c.header_ == nil {
  1748. c.header_ = make(http.Header)
  1749. }
  1750. return c.header_
  1751. }
  1752. func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  1753. reqHeaders := make(http.Header)
  1754. for k, v := range c.header_ {
  1755. reqHeaders[k] = v
  1756. }
  1757. reqHeaders.Set("User-Agent", c.s.userAgent())
  1758. var body io.Reader = nil
  1759. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  1760. if err != nil {
  1761. return nil, err
  1762. }
  1763. reqHeaders.Set("Content-Type", "application/json")
  1764. c.urlParams_.Set("alt", alt)
  1765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups")
  1766. urls += "?" + c.urlParams_.Encode()
  1767. req, _ := http.NewRequest("POST", urls, body)
  1768. req.Header = reqHeaders
  1769. googleapi.Expand(req.URL, map[string]string{
  1770. "project": c.project,
  1771. })
  1772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1773. }
  1774. // Do executes the "clouduseraccounts.groups.insert" call.
  1775. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1776. // status code is an error. Response headers are in either
  1777. // *Operation.ServerResponse.Header or (if a response was returned at
  1778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1779. // to check whether the returned error was because
  1780. // http.StatusNotModified was returned.
  1781. func (c *GroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1782. gensupport.SetOptions(c.urlParams_, opts...)
  1783. res, err := c.doRequest("json")
  1784. if res != nil && res.StatusCode == http.StatusNotModified {
  1785. if res.Body != nil {
  1786. res.Body.Close()
  1787. }
  1788. return nil, &googleapi.Error{
  1789. Code: res.StatusCode,
  1790. Header: res.Header,
  1791. }
  1792. }
  1793. if err != nil {
  1794. return nil, err
  1795. }
  1796. defer googleapi.CloseBody(res)
  1797. if err := googleapi.CheckResponse(res); err != nil {
  1798. return nil, err
  1799. }
  1800. ret := &Operation{
  1801. ServerResponse: googleapi.ServerResponse{
  1802. Header: res.Header,
  1803. HTTPStatusCode: res.StatusCode,
  1804. },
  1805. }
  1806. target := &ret
  1807. if err := gensupport.DecodeResponse(target, res); err != nil {
  1808. return nil, err
  1809. }
  1810. return ret, nil
  1811. // {
  1812. // "description": "Creates a Group resource in the specified project using the data included in the request.",
  1813. // "httpMethod": "POST",
  1814. // "id": "clouduseraccounts.groups.insert",
  1815. // "parameterOrder": [
  1816. // "project"
  1817. // ],
  1818. // "parameters": {
  1819. // "project": {
  1820. // "description": "Project ID for this request.",
  1821. // "location": "path",
  1822. // "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])?))",
  1823. // "required": true,
  1824. // "type": "string"
  1825. // }
  1826. // },
  1827. // "path": "{project}/global/groups",
  1828. // "request": {
  1829. // "$ref": "Group"
  1830. // },
  1831. // "response": {
  1832. // "$ref": "Operation"
  1833. // },
  1834. // "scopes": [
  1835. // "https://www.googleapis.com/auth/cloud-platform",
  1836. // "https://www.googleapis.com/auth/cloud.useraccounts"
  1837. // ]
  1838. // }
  1839. }
  1840. // method id "clouduseraccounts.groups.list":
  1841. type GroupsListCall struct {
  1842. s *Service
  1843. project string
  1844. urlParams_ gensupport.URLParams
  1845. ifNoneMatch_ string
  1846. ctx_ context.Context
  1847. header_ http.Header
  1848. }
  1849. // List: Retrieves the list of groups contained within the specified
  1850. // project.
  1851. func (r *GroupsService) List(project string) *GroupsListCall {
  1852. c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1853. c.project = project
  1854. return c
  1855. }
  1856. // Filter sets the optional parameter "filter": Sets a filter expression
  1857. // for filtering listed resources, in the form filter={expression}. Your
  1858. // {expression} must be in the format: field_name comparison_string
  1859. // literal_string.
  1860. //
  1861. // The field_name is the name of the field you want to compare. Only
  1862. // atomic field types are supported (string, number, boolean). The
  1863. // comparison_string must be either eq (equals) or ne (not equals). The
  1864. // literal_string is the string value to filter to. The literal value
  1865. // must be valid for the type of field you are filtering by (string,
  1866. // number, boolean). For string fields, the literal value is interpreted
  1867. // as a regular expression using RE2 syntax. The literal value must
  1868. // match the entire field.
  1869. //
  1870. // For example, to filter for instances that do not have a name of
  1871. // example-instance, you would use filter=name ne
  1872. // example-instance.
  1873. //
  1874. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  1875. // you can also filter on nested fields. For example, you could filter
  1876. // on instances that have set the scheduling.automaticRestart field to
  1877. // true. In particular, use filtering on nested fields to take advantage
  1878. // of instance labels to organize and filter results based on label
  1879. // values.
  1880. //
  1881. // The Beta API also supports filtering on multiple expressions by
  1882. // providing each separate expression within parentheses. For example,
  1883. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  1884. // Multiple expressions are treated as AND expressions, meaning that
  1885. // resources must match all expressions to pass the filters.
  1886. func (c *GroupsListCall) Filter(filter string) *GroupsListCall {
  1887. c.urlParams_.Set("filter", filter)
  1888. return c
  1889. }
  1890. // MaxResults sets the optional parameter "maxResults": The maximum
  1891. // number of results per page that should be returned. If the number of
  1892. // available results is larger than maxResults, Compute Engine returns a
  1893. // nextPageToken that can be used to get the next page of results in
  1894. // subsequent list requests.
  1895. func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall {
  1896. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1897. return c
  1898. }
  1899. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  1900. // a certain order. By default, results are returned in alphanumerical
  1901. // order based on the resource name.
  1902. //
  1903. // You can also sort results in descending order based on the creation
  1904. // timestamp using orderBy="creationTimestamp desc". This sorts results
  1905. // based on the creationTimestamp field in reverse chronological order
  1906. // (newest result first). Use this to sort resources like operations so
  1907. // that the newest operation is returned first.
  1908. //
  1909. // Currently, only sorting by name or creationTimestamp desc is
  1910. // supported.
  1911. func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall {
  1912. c.urlParams_.Set("orderBy", orderBy)
  1913. return c
  1914. }
  1915. // PageToken sets the optional parameter "pageToken": Specifies a page
  1916. // token to use. Set pageToken to the nextPageToken returned by a
  1917. // previous list request to get the next page of results.
  1918. func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall {
  1919. c.urlParams_.Set("pageToken", pageToken)
  1920. return c
  1921. }
  1922. // Fields allows partial responses to be retrieved. See
  1923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1924. // for more information.
  1925. func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall {
  1926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1927. return c
  1928. }
  1929. // IfNoneMatch sets the optional parameter which makes the operation
  1930. // fail if the object's ETag matches the given value. This is useful for
  1931. // getting updates only after the object has changed since the last
  1932. // request. Use googleapi.IsNotModified to check whether the response
  1933. // error from Do is the result of In-None-Match.
  1934. func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall {
  1935. c.ifNoneMatch_ = entityTag
  1936. return c
  1937. }
  1938. // Context sets the context to be used in this call's Do method. Any
  1939. // pending HTTP request will be aborted if the provided context is
  1940. // canceled.
  1941. func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall {
  1942. c.ctx_ = ctx
  1943. return c
  1944. }
  1945. // Header returns an http.Header that can be modified by the caller to
  1946. // add HTTP headers to the request.
  1947. func (c *GroupsListCall) Header() http.Header {
  1948. if c.header_ == nil {
  1949. c.header_ = make(http.Header)
  1950. }
  1951. return c.header_
  1952. }
  1953. func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) {
  1954. reqHeaders := make(http.Header)
  1955. for k, v := range c.header_ {
  1956. reqHeaders[k] = v
  1957. }
  1958. reqHeaders.Set("User-Agent", c.s.userAgent())
  1959. if c.ifNoneMatch_ != "" {
  1960. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1961. }
  1962. var body io.Reader = nil
  1963. c.urlParams_.Set("alt", alt)
  1964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups")
  1965. urls += "?" + c.urlParams_.Encode()
  1966. req, _ := http.NewRequest("GET", urls, body)
  1967. req.Header = reqHeaders
  1968. googleapi.Expand(req.URL, map[string]string{
  1969. "project": c.project,
  1970. })
  1971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1972. }
  1973. // Do executes the "clouduseraccounts.groups.list" call.
  1974. // Exactly one of *GroupList or error will be non-nil. Any non-2xx
  1975. // status code is an error. Response headers are in either
  1976. // *GroupList.ServerResponse.Header or (if a response was returned at
  1977. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1978. // to check whether the returned error was because
  1979. // http.StatusNotModified was returned.
  1980. func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*GroupList, error) {
  1981. gensupport.SetOptions(c.urlParams_, opts...)
  1982. res, err := c.doRequest("json")
  1983. if res != nil && res.StatusCode == http.StatusNotModified {
  1984. if res.Body != nil {
  1985. res.Body.Close()
  1986. }
  1987. return nil, &googleapi.Error{
  1988. Code: res.StatusCode,
  1989. Header: res.Header,
  1990. }
  1991. }
  1992. if err != nil {
  1993. return nil, err
  1994. }
  1995. defer googleapi.CloseBody(res)
  1996. if err := googleapi.CheckResponse(res); err != nil {
  1997. return nil, err
  1998. }
  1999. ret := &GroupList{
  2000. ServerResponse: googleapi.ServerResponse{
  2001. Header: res.Header,
  2002. HTTPStatusCode: res.StatusCode,
  2003. },
  2004. }
  2005. target := &ret
  2006. if err := gensupport.DecodeResponse(target, res); err != nil {
  2007. return nil, err
  2008. }
  2009. return ret, nil
  2010. // {
  2011. // "description": "Retrieves the list of groups contained within the specified project.",
  2012. // "httpMethod": "GET",
  2013. // "id": "clouduseraccounts.groups.list",
  2014. // "parameterOrder": [
  2015. // "project"
  2016. // ],
  2017. // "parameters": {
  2018. // "filter": {
  2019. // "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.",
  2020. // "location": "query",
  2021. // "type": "string"
  2022. // },
  2023. // "maxResults": {
  2024. // "default": "500",
  2025. // "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.",
  2026. // "format": "uint32",
  2027. // "location": "query",
  2028. // "maximum": "500",
  2029. // "minimum": "0",
  2030. // "type": "integer"
  2031. // },
  2032. // "orderBy": {
  2033. // "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.",
  2034. // "location": "query",
  2035. // "type": "string"
  2036. // },
  2037. // "pageToken": {
  2038. // "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.",
  2039. // "location": "query",
  2040. // "type": "string"
  2041. // },
  2042. // "project": {
  2043. // "description": "Project ID for this request.",
  2044. // "location": "path",
  2045. // "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])?))",
  2046. // "required": true,
  2047. // "type": "string"
  2048. // }
  2049. // },
  2050. // "path": "{project}/global/groups",
  2051. // "response": {
  2052. // "$ref": "GroupList"
  2053. // },
  2054. // "scopes": [
  2055. // "https://www.googleapis.com/auth/cloud-platform",
  2056. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2057. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2058. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2059. // ]
  2060. // }
  2061. }
  2062. // Pages invokes f for each page of results.
  2063. // A non-nil error returned from f will halt the iteration.
  2064. // The provided context supersedes any context provided to the Context method.
  2065. func (c *GroupsListCall) Pages(ctx context.Context, f func(*GroupList) error) error {
  2066. c.ctx_ = ctx
  2067. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2068. for {
  2069. x, err := c.Do()
  2070. if err != nil {
  2071. return err
  2072. }
  2073. if err := f(x); err != nil {
  2074. return err
  2075. }
  2076. if x.NextPageToken == "" {
  2077. return nil
  2078. }
  2079. c.PageToken(x.NextPageToken)
  2080. }
  2081. }
  2082. // method id "clouduseraccounts.groups.removeMember":
  2083. type GroupsRemoveMemberCall struct {
  2084. s *Service
  2085. project string
  2086. groupName string
  2087. groupsremovememberrequest *GroupsRemoveMemberRequest
  2088. urlParams_ gensupport.URLParams
  2089. ctx_ context.Context
  2090. header_ http.Header
  2091. }
  2092. // RemoveMember: Removes users from the specified group.
  2093. func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall {
  2094. c := &GroupsRemoveMemberCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2095. c.project = project
  2096. c.groupName = groupName
  2097. c.groupsremovememberrequest = groupsremovememberrequest
  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 *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall {
  2104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2105. return c
  2106. }
  2107. // Context sets the context to be used in this call's Do method. Any
  2108. // pending HTTP request will be aborted if the provided context is
  2109. // canceled.
  2110. func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall {
  2111. c.ctx_ = ctx
  2112. return c
  2113. }
  2114. // Header returns an http.Header that can be modified by the caller to
  2115. // add HTTP headers to the request.
  2116. func (c *GroupsRemoveMemberCall) Header() http.Header {
  2117. if c.header_ == nil {
  2118. c.header_ = make(http.Header)
  2119. }
  2120. return c.header_
  2121. }
  2122. func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) {
  2123. reqHeaders := make(http.Header)
  2124. for k, v := range c.header_ {
  2125. reqHeaders[k] = v
  2126. }
  2127. reqHeaders.Set("User-Agent", c.s.userAgent())
  2128. var body io.Reader = nil
  2129. body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest)
  2130. if err != nil {
  2131. return nil, err
  2132. }
  2133. reqHeaders.Set("Content-Type", "application/json")
  2134. c.urlParams_.Set("alt", alt)
  2135. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember")
  2136. urls += "?" + c.urlParams_.Encode()
  2137. req, _ := http.NewRequest("POST", urls, body)
  2138. req.Header = reqHeaders
  2139. googleapi.Expand(req.URL, map[string]string{
  2140. "project": c.project,
  2141. "groupName": c.groupName,
  2142. })
  2143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2144. }
  2145. // Do executes the "clouduseraccounts.groups.removeMember" call.
  2146. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2147. // status code is an error. Response headers are in either
  2148. // *Operation.ServerResponse.Header or (if a response was returned at
  2149. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2150. // to check whether the returned error was because
  2151. // http.StatusNotModified was returned.
  2152. func (c *GroupsRemoveMemberCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2153. gensupport.SetOptions(c.urlParams_, opts...)
  2154. res, err := c.doRequest("json")
  2155. if res != nil && res.StatusCode == http.StatusNotModified {
  2156. if res.Body != nil {
  2157. res.Body.Close()
  2158. }
  2159. return nil, &googleapi.Error{
  2160. Code: res.StatusCode,
  2161. Header: res.Header,
  2162. }
  2163. }
  2164. if err != nil {
  2165. return nil, err
  2166. }
  2167. defer googleapi.CloseBody(res)
  2168. if err := googleapi.CheckResponse(res); err != nil {
  2169. return nil, err
  2170. }
  2171. ret := &Operation{
  2172. ServerResponse: googleapi.ServerResponse{
  2173. Header: res.Header,
  2174. HTTPStatusCode: res.StatusCode,
  2175. },
  2176. }
  2177. target := &ret
  2178. if err := gensupport.DecodeResponse(target, res); err != nil {
  2179. return nil, err
  2180. }
  2181. return ret, nil
  2182. // {
  2183. // "description": "Removes users from the specified group.",
  2184. // "httpMethod": "POST",
  2185. // "id": "clouduseraccounts.groups.removeMember",
  2186. // "parameterOrder": [
  2187. // "project",
  2188. // "groupName"
  2189. // ],
  2190. // "parameters": {
  2191. // "groupName": {
  2192. // "description": "Name of the group for this request.",
  2193. // "location": "path",
  2194. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2195. // "required": true,
  2196. // "type": "string"
  2197. // },
  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. // },
  2206. // "path": "{project}/global/groups/{groupName}/removeMember",
  2207. // "request": {
  2208. // "$ref": "GroupsRemoveMemberRequest"
  2209. // },
  2210. // "response": {
  2211. // "$ref": "Operation"
  2212. // },
  2213. // "scopes": [
  2214. // "https://www.googleapis.com/auth/cloud-platform",
  2215. // "https://www.googleapis.com/auth/cloud.useraccounts"
  2216. // ]
  2217. // }
  2218. }
  2219. // method id "clouduseraccounts.linux.getAuthorizedKeysView":
  2220. type LinuxGetAuthorizedKeysViewCall struct {
  2221. s *Service
  2222. project string
  2223. zone string
  2224. user string
  2225. urlParams_ gensupport.URLParams
  2226. ctx_ context.Context
  2227. header_ http.Header
  2228. }
  2229. // GetAuthorizedKeysView: Returns a list of authorized public keys for a
  2230. // specific user account.
  2231. func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall {
  2232. c := &LinuxGetAuthorizedKeysViewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2233. c.project = project
  2234. c.zone = zone
  2235. c.user = user
  2236. c.urlParams_.Set("instance", instance)
  2237. return c
  2238. }
  2239. // Login sets the optional parameter "login": Whether the view was
  2240. // requested as part of a user-initiated login.
  2241. func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall {
  2242. c.urlParams_.Set("login", fmt.Sprint(login))
  2243. return c
  2244. }
  2245. // Fields allows partial responses to be retrieved. See
  2246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2247. // for more information.
  2248. func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall {
  2249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2250. return c
  2251. }
  2252. // Context sets the context to be used in this call's Do method. Any
  2253. // pending HTTP request will be aborted if the provided context is
  2254. // canceled.
  2255. func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall {
  2256. c.ctx_ = ctx
  2257. return c
  2258. }
  2259. // Header returns an http.Header that can be modified by the caller to
  2260. // add HTTP headers to the request.
  2261. func (c *LinuxGetAuthorizedKeysViewCall) Header() http.Header {
  2262. if c.header_ == nil {
  2263. c.header_ = make(http.Header)
  2264. }
  2265. return c.header_
  2266. }
  2267. func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) {
  2268. reqHeaders := make(http.Header)
  2269. for k, v := range c.header_ {
  2270. reqHeaders[k] = v
  2271. }
  2272. reqHeaders.Set("User-Agent", c.s.userAgent())
  2273. var body io.Reader = nil
  2274. c.urlParams_.Set("alt", alt)
  2275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}")
  2276. urls += "?" + c.urlParams_.Encode()
  2277. req, _ := http.NewRequest("POST", urls, body)
  2278. req.Header = reqHeaders
  2279. googleapi.Expand(req.URL, map[string]string{
  2280. "project": c.project,
  2281. "zone": c.zone,
  2282. "user": c.user,
  2283. })
  2284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2285. }
  2286. // Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call.
  2287. // Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be
  2288. // non-nil. Any non-2xx status code is an error. Response headers are in
  2289. // either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or
  2290. // (if a response was returned at all) in
  2291. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2292. // whether the returned error was because http.StatusNotModified was
  2293. // returned.
  2294. func (c *LinuxGetAuthorizedKeysViewCall) Do(opts ...googleapi.CallOption) (*LinuxGetAuthorizedKeysViewResponse, error) {
  2295. gensupport.SetOptions(c.urlParams_, opts...)
  2296. res, err := c.doRequest("json")
  2297. if res != nil && res.StatusCode == http.StatusNotModified {
  2298. if res.Body != nil {
  2299. res.Body.Close()
  2300. }
  2301. return nil, &googleapi.Error{
  2302. Code: res.StatusCode,
  2303. Header: res.Header,
  2304. }
  2305. }
  2306. if err != nil {
  2307. return nil, err
  2308. }
  2309. defer googleapi.CloseBody(res)
  2310. if err := googleapi.CheckResponse(res); err != nil {
  2311. return nil, err
  2312. }
  2313. ret := &LinuxGetAuthorizedKeysViewResponse{
  2314. ServerResponse: googleapi.ServerResponse{
  2315. Header: res.Header,
  2316. HTTPStatusCode: res.StatusCode,
  2317. },
  2318. }
  2319. target := &ret
  2320. if err := gensupport.DecodeResponse(target, res); err != nil {
  2321. return nil, err
  2322. }
  2323. return ret, nil
  2324. // {
  2325. // "description": "Returns a list of authorized public keys for a specific user account.",
  2326. // "httpMethod": "POST",
  2327. // "id": "clouduseraccounts.linux.getAuthorizedKeysView",
  2328. // "parameterOrder": [
  2329. // "project",
  2330. // "zone",
  2331. // "user",
  2332. // "instance"
  2333. // ],
  2334. // "parameters": {
  2335. // "instance": {
  2336. // "description": "The fully-qualified URL of the virtual machine requesting the view.",
  2337. // "location": "query",
  2338. // "required": true,
  2339. // "type": "string"
  2340. // },
  2341. // "login": {
  2342. // "description": "Whether the view was requested as part of a user-initiated login.",
  2343. // "location": "query",
  2344. // "type": "boolean"
  2345. // },
  2346. // "project": {
  2347. // "description": "Project ID for this request.",
  2348. // "location": "path",
  2349. // "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])?))",
  2350. // "required": true,
  2351. // "type": "string"
  2352. // },
  2353. // "user": {
  2354. // "description": "The user account for which you want to get a list of authorized public keys.",
  2355. // "location": "path",
  2356. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2357. // "required": true,
  2358. // "type": "string"
  2359. // },
  2360. // "zone": {
  2361. // "description": "Name of the zone for this request.",
  2362. // "location": "path",
  2363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  2364. // "required": true,
  2365. // "type": "string"
  2366. // }
  2367. // },
  2368. // "path": "{project}/zones/{zone}/authorizedKeysView/{user}",
  2369. // "response": {
  2370. // "$ref": "LinuxGetAuthorizedKeysViewResponse"
  2371. // },
  2372. // "scopes": [
  2373. // "https://www.googleapis.com/auth/cloud-platform",
  2374. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2375. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2376. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2377. // ]
  2378. // }
  2379. }
  2380. // method id "clouduseraccounts.linux.getLinuxAccountViews":
  2381. type LinuxGetLinuxAccountViewsCall struct {
  2382. s *Service
  2383. project string
  2384. zone string
  2385. urlParams_ gensupport.URLParams
  2386. ctx_ context.Context
  2387. header_ http.Header
  2388. }
  2389. // GetLinuxAccountViews: Retrieves a list of user accounts for an
  2390. // instance within a specific project.
  2391. func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall {
  2392. c := &LinuxGetLinuxAccountViewsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2393. c.project = project
  2394. c.zone = zone
  2395. c.urlParams_.Set("instance", instance)
  2396. return c
  2397. }
  2398. // Filter sets the optional parameter "filter": Sets a filter expression
  2399. // for filtering listed resources, in the form filter={expression}. Your
  2400. // {expression} must be in the format: field_name comparison_string
  2401. // literal_string.
  2402. //
  2403. // The field_name is the name of the field you want to compare. Only
  2404. // atomic field types are supported (string, number, boolean). The
  2405. // comparison_string must be either eq (equals) or ne (not equals). The
  2406. // literal_string is the string value to filter to. The literal value
  2407. // must be valid for the type of field you are filtering by (string,
  2408. // number, boolean). For string fields, the literal value is interpreted
  2409. // as a regular expression using RE2 syntax. The literal value must
  2410. // match the entire field.
  2411. //
  2412. // For example, to filter for instances that do not have a name of
  2413. // example-instance, you would use filter=name ne
  2414. // example-instance.
  2415. //
  2416. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  2417. // you can also filter on nested fields. For example, you could filter
  2418. // on instances that have set the scheduling.automaticRestart field to
  2419. // true. In particular, use filtering on nested fields to take advantage
  2420. // of instance labels to organize and filter results based on label
  2421. // values.
  2422. //
  2423. // The Beta API also supports filtering on multiple expressions by
  2424. // providing each separate expression within parentheses. For example,
  2425. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  2426. // Multiple expressions are treated as AND expressions, meaning that
  2427. // resources must match all expressions to pass the filters.
  2428. func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall {
  2429. c.urlParams_.Set("filter", filter)
  2430. return c
  2431. }
  2432. // MaxResults sets the optional parameter "maxResults": The maximum
  2433. // number of results per page that should be returned. If the number of
  2434. // available results is larger than maxResults, Compute Engine returns a
  2435. // nextPageToken that can be used to get the next page of results in
  2436. // subsequent list requests.
  2437. func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall {
  2438. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2439. return c
  2440. }
  2441. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  2442. // a certain order. By default, results are returned in alphanumerical
  2443. // order based on the resource name.
  2444. //
  2445. // You can also sort results in descending order based on the creation
  2446. // timestamp using orderBy="creationTimestamp desc". This sorts results
  2447. // based on the creationTimestamp field in reverse chronological order
  2448. // (newest result first). Use this to sort resources like operations so
  2449. // that the newest operation is returned first.
  2450. //
  2451. // Currently, only sorting by name or creationTimestamp desc is
  2452. // supported.
  2453. func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall {
  2454. c.urlParams_.Set("orderBy", orderBy)
  2455. return c
  2456. }
  2457. // PageToken sets the optional parameter "pageToken": Specifies a page
  2458. // token to use. Set pageToken to the nextPageToken returned by a
  2459. // previous list request to get the next page of results.
  2460. func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall {
  2461. c.urlParams_.Set("pageToken", pageToken)
  2462. return c
  2463. }
  2464. // Fields allows partial responses to be retrieved. See
  2465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2466. // for more information.
  2467. func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall {
  2468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2469. return c
  2470. }
  2471. // Context sets the context to be used in this call's Do method. Any
  2472. // pending HTTP request will be aborted if the provided context is
  2473. // canceled.
  2474. func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall {
  2475. c.ctx_ = ctx
  2476. return c
  2477. }
  2478. // Header returns an http.Header that can be modified by the caller to
  2479. // add HTTP headers to the request.
  2480. func (c *LinuxGetLinuxAccountViewsCall) Header() http.Header {
  2481. if c.header_ == nil {
  2482. c.header_ = make(http.Header)
  2483. }
  2484. return c.header_
  2485. }
  2486. func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) {
  2487. reqHeaders := make(http.Header)
  2488. for k, v := range c.header_ {
  2489. reqHeaders[k] = v
  2490. }
  2491. reqHeaders.Set("User-Agent", c.s.userAgent())
  2492. var body io.Reader = nil
  2493. c.urlParams_.Set("alt", alt)
  2494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews")
  2495. urls += "?" + c.urlParams_.Encode()
  2496. req, _ := http.NewRequest("POST", urls, body)
  2497. req.Header = reqHeaders
  2498. googleapi.Expand(req.URL, map[string]string{
  2499. "project": c.project,
  2500. "zone": c.zone,
  2501. })
  2502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2503. }
  2504. // Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call.
  2505. // Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be
  2506. // non-nil. Any non-2xx status code is an error. Response headers are in
  2507. // either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or
  2508. // (if a response was returned at all) in
  2509. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2510. // whether the returned error was because http.StatusNotModified was
  2511. // returned.
  2512. func (c *LinuxGetLinuxAccountViewsCall) Do(opts ...googleapi.CallOption) (*LinuxGetLinuxAccountViewsResponse, error) {
  2513. gensupport.SetOptions(c.urlParams_, opts...)
  2514. res, err := c.doRequest("json")
  2515. if res != nil && res.StatusCode == http.StatusNotModified {
  2516. if res.Body != nil {
  2517. res.Body.Close()
  2518. }
  2519. return nil, &googleapi.Error{
  2520. Code: res.StatusCode,
  2521. Header: res.Header,
  2522. }
  2523. }
  2524. if err != nil {
  2525. return nil, err
  2526. }
  2527. defer googleapi.CloseBody(res)
  2528. if err := googleapi.CheckResponse(res); err != nil {
  2529. return nil, err
  2530. }
  2531. ret := &LinuxGetLinuxAccountViewsResponse{
  2532. ServerResponse: googleapi.ServerResponse{
  2533. Header: res.Header,
  2534. HTTPStatusCode: res.StatusCode,
  2535. },
  2536. }
  2537. target := &ret
  2538. if err := gensupport.DecodeResponse(target, res); err != nil {
  2539. return nil, err
  2540. }
  2541. return ret, nil
  2542. // {
  2543. // "description": "Retrieves a list of user accounts for an instance within a specific project.",
  2544. // "httpMethod": "POST",
  2545. // "id": "clouduseraccounts.linux.getLinuxAccountViews",
  2546. // "parameterOrder": [
  2547. // "project",
  2548. // "zone",
  2549. // "instance"
  2550. // ],
  2551. // "parameters": {
  2552. // "filter": {
  2553. // "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.",
  2554. // "location": "query",
  2555. // "type": "string"
  2556. // },
  2557. // "instance": {
  2558. // "description": "The fully-qualified URL of the virtual machine requesting the views.",
  2559. // "location": "query",
  2560. // "required": true,
  2561. // "type": "string"
  2562. // },
  2563. // "maxResults": {
  2564. // "default": "500",
  2565. // "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.",
  2566. // "format": "uint32",
  2567. // "location": "query",
  2568. // "maximum": "500",
  2569. // "minimum": "0",
  2570. // "type": "integer"
  2571. // },
  2572. // "orderBy": {
  2573. // "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.",
  2574. // "location": "query",
  2575. // "type": "string"
  2576. // },
  2577. // "pageToken": {
  2578. // "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.",
  2579. // "location": "query",
  2580. // "type": "string"
  2581. // },
  2582. // "project": {
  2583. // "description": "Project ID for this request.",
  2584. // "location": "path",
  2585. // "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])?))",
  2586. // "required": true,
  2587. // "type": "string"
  2588. // },
  2589. // "zone": {
  2590. // "description": "Name of the zone for this request.",
  2591. // "location": "path",
  2592. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  2593. // "required": true,
  2594. // "type": "string"
  2595. // }
  2596. // },
  2597. // "path": "{project}/zones/{zone}/linuxAccountViews",
  2598. // "response": {
  2599. // "$ref": "LinuxGetLinuxAccountViewsResponse"
  2600. // },
  2601. // "scopes": [
  2602. // "https://www.googleapis.com/auth/cloud-platform",
  2603. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2604. // "https://www.googleapis.com/auth/cloud.useraccounts",
  2605. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  2606. // ]
  2607. // }
  2608. }
  2609. // method id "clouduseraccounts.users.addPublicKey":
  2610. type UsersAddPublicKeyCall struct {
  2611. s *Service
  2612. project string
  2613. user string
  2614. publickey *PublicKey
  2615. urlParams_ gensupport.URLParams
  2616. ctx_ context.Context
  2617. header_ http.Header
  2618. }
  2619. // AddPublicKey: Adds a public key to the specified User resource with
  2620. // the data included in the request.
  2621. func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall {
  2622. c := &UsersAddPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2623. c.project = project
  2624. c.user = user
  2625. c.publickey = publickey
  2626. return c
  2627. }
  2628. // Fields allows partial responses to be retrieved. See
  2629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2630. // for more information.
  2631. func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall {
  2632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2633. return c
  2634. }
  2635. // Context sets the context to be used in this call's Do method. Any
  2636. // pending HTTP request will be aborted if the provided context is
  2637. // canceled.
  2638. func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall {
  2639. c.ctx_ = ctx
  2640. return c
  2641. }
  2642. // Header returns an http.Header that can be modified by the caller to
  2643. // add HTTP headers to the request.
  2644. func (c *UsersAddPublicKeyCall) Header() http.Header {
  2645. if c.header_ == nil {
  2646. c.header_ = make(http.Header)
  2647. }
  2648. return c.header_
  2649. }
  2650. func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) {
  2651. reqHeaders := make(http.Header)
  2652. for k, v := range c.header_ {
  2653. reqHeaders[k] = v
  2654. }
  2655. reqHeaders.Set("User-Agent", c.s.userAgent())
  2656. var body io.Reader = nil
  2657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey)
  2658. if err != nil {
  2659. return nil, err
  2660. }
  2661. reqHeaders.Set("Content-Type", "application/json")
  2662. c.urlParams_.Set("alt", alt)
  2663. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey")
  2664. urls += "?" + c.urlParams_.Encode()
  2665. req, _ := http.NewRequest("POST", urls, body)
  2666. req.Header = reqHeaders
  2667. googleapi.Expand(req.URL, map[string]string{
  2668. "project": c.project,
  2669. "user": c.user,
  2670. })
  2671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2672. }
  2673. // Do executes the "clouduseraccounts.users.addPublicKey" call.
  2674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2675. // status code is an error. Response headers are in either
  2676. // *Operation.ServerResponse.Header or (if a response was returned at
  2677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2678. // to check whether the returned error was because
  2679. // http.StatusNotModified was returned.
  2680. func (c *UsersAddPublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2681. gensupport.SetOptions(c.urlParams_, opts...)
  2682. res, err := c.doRequest("json")
  2683. if res != nil && res.StatusCode == http.StatusNotModified {
  2684. if res.Body != nil {
  2685. res.Body.Close()
  2686. }
  2687. return nil, &googleapi.Error{
  2688. Code: res.StatusCode,
  2689. Header: res.Header,
  2690. }
  2691. }
  2692. if err != nil {
  2693. return nil, err
  2694. }
  2695. defer googleapi.CloseBody(res)
  2696. if err := googleapi.CheckResponse(res); err != nil {
  2697. return nil, err
  2698. }
  2699. ret := &Operation{
  2700. ServerResponse: googleapi.ServerResponse{
  2701. Header: res.Header,
  2702. HTTPStatusCode: res.StatusCode,
  2703. },
  2704. }
  2705. target := &ret
  2706. if err := gensupport.DecodeResponse(target, res); err != nil {
  2707. return nil, err
  2708. }
  2709. return ret, nil
  2710. // {
  2711. // "description": "Adds a public key to the specified User resource with the data included in the request.",
  2712. // "httpMethod": "POST",
  2713. // "id": "clouduseraccounts.users.addPublicKey",
  2714. // "parameterOrder": [
  2715. // "project",
  2716. // "user"
  2717. // ],
  2718. // "parameters": {
  2719. // "project": {
  2720. // "description": "Project ID for this request.",
  2721. // "location": "path",
  2722. // "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])?))",
  2723. // "required": true,
  2724. // "type": "string"
  2725. // },
  2726. // "user": {
  2727. // "description": "Name of the user for this request.",
  2728. // "location": "path",
  2729. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2730. // "required": true,
  2731. // "type": "string"
  2732. // }
  2733. // },
  2734. // "path": "{project}/global/users/{user}/addPublicKey",
  2735. // "request": {
  2736. // "$ref": "PublicKey"
  2737. // },
  2738. // "response": {
  2739. // "$ref": "Operation"
  2740. // },
  2741. // "scopes": [
  2742. // "https://www.googleapis.com/auth/cloud-platform",
  2743. // "https://www.googleapis.com/auth/cloud.useraccounts"
  2744. // ]
  2745. // }
  2746. }
  2747. // method id "clouduseraccounts.users.delete":
  2748. type UsersDeleteCall struct {
  2749. s *Service
  2750. project string
  2751. user string
  2752. urlParams_ gensupport.URLParams
  2753. ctx_ context.Context
  2754. header_ http.Header
  2755. }
  2756. // Delete: Deletes the specified User resource.
  2757. func (r *UsersService) Delete(project string, user string) *UsersDeleteCall {
  2758. c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2759. c.project = project
  2760. c.user = user
  2761. return c
  2762. }
  2763. // Fields allows partial responses to be retrieved. See
  2764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2765. // for more information.
  2766. func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
  2767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2768. return c
  2769. }
  2770. // Context sets the context to be used in this call's Do method. Any
  2771. // pending HTTP request will be aborted if the provided context is
  2772. // canceled.
  2773. func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
  2774. c.ctx_ = ctx
  2775. return c
  2776. }
  2777. // Header returns an http.Header that can be modified by the caller to
  2778. // add HTTP headers to the request.
  2779. func (c *UsersDeleteCall) Header() http.Header {
  2780. if c.header_ == nil {
  2781. c.header_ = make(http.Header)
  2782. }
  2783. return c.header_
  2784. }
  2785. func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
  2786. reqHeaders := make(http.Header)
  2787. for k, v := range c.header_ {
  2788. reqHeaders[k] = v
  2789. }
  2790. reqHeaders.Set("User-Agent", c.s.userAgent())
  2791. var body io.Reader = nil
  2792. c.urlParams_.Set("alt", alt)
  2793. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}")
  2794. urls += "?" + c.urlParams_.Encode()
  2795. req, _ := http.NewRequest("DELETE", urls, body)
  2796. req.Header = reqHeaders
  2797. googleapi.Expand(req.URL, map[string]string{
  2798. "project": c.project,
  2799. "user": c.user,
  2800. })
  2801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2802. }
  2803. // Do executes the "clouduseraccounts.users.delete" call.
  2804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2805. // status code is an error. Response headers are in either
  2806. // *Operation.ServerResponse.Header or (if a response was returned at
  2807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2808. // to check whether the returned error was because
  2809. // http.StatusNotModified was returned.
  2810. func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2811. gensupport.SetOptions(c.urlParams_, opts...)
  2812. res, err := c.doRequest("json")
  2813. if res != nil && res.StatusCode == http.StatusNotModified {
  2814. if res.Body != nil {
  2815. res.Body.Close()
  2816. }
  2817. return nil, &googleapi.Error{
  2818. Code: res.StatusCode,
  2819. Header: res.Header,
  2820. }
  2821. }
  2822. if err != nil {
  2823. return nil, err
  2824. }
  2825. defer googleapi.CloseBody(res)
  2826. if err := googleapi.CheckResponse(res); err != nil {
  2827. return nil, err
  2828. }
  2829. ret := &Operation{
  2830. ServerResponse: googleapi.ServerResponse{
  2831. Header: res.Header,
  2832. HTTPStatusCode: res.StatusCode,
  2833. },
  2834. }
  2835. target := &ret
  2836. if err := gensupport.DecodeResponse(target, res); err != nil {
  2837. return nil, err
  2838. }
  2839. return ret, nil
  2840. // {
  2841. // "description": "Deletes the specified User resource.",
  2842. // "httpMethod": "DELETE",
  2843. // "id": "clouduseraccounts.users.delete",
  2844. // "parameterOrder": [
  2845. // "project",
  2846. // "user"
  2847. // ],
  2848. // "parameters": {
  2849. // "project": {
  2850. // "description": "Project ID for this request.",
  2851. // "location": "path",
  2852. // "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])?))",
  2853. // "required": true,
  2854. // "type": "string"
  2855. // },
  2856. // "user": {
  2857. // "description": "Name of the user resource to delete.",
  2858. // "location": "path",
  2859. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  2860. // "required": true,
  2861. // "type": "string"
  2862. // }
  2863. // },
  2864. // "path": "{project}/global/users/{user}",
  2865. // "response": {
  2866. // "$ref": "Operation"
  2867. // },
  2868. // "scopes": [
  2869. // "https://www.googleapis.com/auth/cloud-platform",
  2870. // "https://www.googleapis.com/auth/cloud.useraccounts"
  2871. // ]
  2872. // }
  2873. }
  2874. // method id "clouduseraccounts.users.get":
  2875. type UsersGetCall struct {
  2876. s *Service
  2877. project string
  2878. user string
  2879. urlParams_ gensupport.URLParams
  2880. ifNoneMatch_ string
  2881. ctx_ context.Context
  2882. header_ http.Header
  2883. }
  2884. // Get: Returns the specified User resource.
  2885. func (r *UsersService) Get(project string, user string) *UsersGetCall {
  2886. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2887. c.project = project
  2888. c.user = user
  2889. return c
  2890. }
  2891. // Fields allows partial responses to be retrieved. See
  2892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2893. // for more information.
  2894. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  2895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2896. return c
  2897. }
  2898. // IfNoneMatch sets the optional parameter which makes the operation
  2899. // fail if the object's ETag matches the given value. This is useful for
  2900. // getting updates only after the object has changed since the last
  2901. // request. Use googleapi.IsNotModified to check whether the response
  2902. // error from Do is the result of In-None-Match.
  2903. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  2904. c.ifNoneMatch_ = entityTag
  2905. return c
  2906. }
  2907. // Context sets the context to be used in this call's Do method. Any
  2908. // pending HTTP request will be aborted if the provided context is
  2909. // canceled.
  2910. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  2911. c.ctx_ = ctx
  2912. return c
  2913. }
  2914. // Header returns an http.Header that can be modified by the caller to
  2915. // add HTTP headers to the request.
  2916. func (c *UsersGetCall) Header() http.Header {
  2917. if c.header_ == nil {
  2918. c.header_ = make(http.Header)
  2919. }
  2920. return c.header_
  2921. }
  2922. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  2923. reqHeaders := make(http.Header)
  2924. for k, v := range c.header_ {
  2925. reqHeaders[k] = v
  2926. }
  2927. reqHeaders.Set("User-Agent", c.s.userAgent())
  2928. if c.ifNoneMatch_ != "" {
  2929. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2930. }
  2931. var body io.Reader = nil
  2932. c.urlParams_.Set("alt", alt)
  2933. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}")
  2934. urls += "?" + c.urlParams_.Encode()
  2935. req, _ := http.NewRequest("GET", urls, body)
  2936. req.Header = reqHeaders
  2937. googleapi.Expand(req.URL, map[string]string{
  2938. "project": c.project,
  2939. "user": c.user,
  2940. })
  2941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2942. }
  2943. // Do executes the "clouduseraccounts.users.get" call.
  2944. // Exactly one of *User or error will be non-nil. Any non-2xx status
  2945. // code is an error. Response headers are in either
  2946. // *User.ServerResponse.Header or (if a response was returned at all) in
  2947. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2948. // whether the returned error was because http.StatusNotModified was
  2949. // returned.
  2950. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  2951. gensupport.SetOptions(c.urlParams_, opts...)
  2952. res, err := c.doRequest("json")
  2953. if res != nil && res.StatusCode == http.StatusNotModified {
  2954. if res.Body != nil {
  2955. res.Body.Close()
  2956. }
  2957. return nil, &googleapi.Error{
  2958. Code: res.StatusCode,
  2959. Header: res.Header,
  2960. }
  2961. }
  2962. if err != nil {
  2963. return nil, err
  2964. }
  2965. defer googleapi.CloseBody(res)
  2966. if err := googleapi.CheckResponse(res); err != nil {
  2967. return nil, err
  2968. }
  2969. ret := &User{
  2970. ServerResponse: googleapi.ServerResponse{
  2971. Header: res.Header,
  2972. HTTPStatusCode: res.StatusCode,
  2973. },
  2974. }
  2975. target := &ret
  2976. if err := gensupport.DecodeResponse(target, res); err != nil {
  2977. return nil, err
  2978. }
  2979. return ret, nil
  2980. // {
  2981. // "description": "Returns the specified User resource.",
  2982. // "httpMethod": "GET",
  2983. // "id": "clouduseraccounts.users.get",
  2984. // "parameterOrder": [
  2985. // "project",
  2986. // "user"
  2987. // ],
  2988. // "parameters": {
  2989. // "project": {
  2990. // "description": "Project ID for this request.",
  2991. // "location": "path",
  2992. // "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])?))",
  2993. // "required": true,
  2994. // "type": "string"
  2995. // },
  2996. // "user": {
  2997. // "description": "Name of the user resource to return.",
  2998. // "location": "path",
  2999. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3000. // "required": true,
  3001. // "type": "string"
  3002. // }
  3003. // },
  3004. // "path": "{project}/global/users/{user}",
  3005. // "response": {
  3006. // "$ref": "User"
  3007. // },
  3008. // "scopes": [
  3009. // "https://www.googleapis.com/auth/cloud-platform",
  3010. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3011. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3012. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3013. // ]
  3014. // }
  3015. }
  3016. // method id "clouduseraccounts.users.insert":
  3017. type UsersInsertCall struct {
  3018. s *Service
  3019. project string
  3020. user *User
  3021. urlParams_ gensupport.URLParams
  3022. ctx_ context.Context
  3023. header_ http.Header
  3024. }
  3025. // Insert: Creates a User resource in the specified project using the
  3026. // data included in the request.
  3027. func (r *UsersService) Insert(project string, user *User) *UsersInsertCall {
  3028. c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3029. c.project = project
  3030. c.user = user
  3031. return c
  3032. }
  3033. // Fields allows partial responses to be retrieved. See
  3034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3035. // for more information.
  3036. func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
  3037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3038. return c
  3039. }
  3040. // Context sets the context to be used in this call's Do method. Any
  3041. // pending HTTP request will be aborted if the provided context is
  3042. // canceled.
  3043. func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
  3044. c.ctx_ = ctx
  3045. return c
  3046. }
  3047. // Header returns an http.Header that can be modified by the caller to
  3048. // add HTTP headers to the request.
  3049. func (c *UsersInsertCall) Header() http.Header {
  3050. if c.header_ == nil {
  3051. c.header_ = make(http.Header)
  3052. }
  3053. return c.header_
  3054. }
  3055. func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
  3056. reqHeaders := make(http.Header)
  3057. for k, v := range c.header_ {
  3058. reqHeaders[k] = v
  3059. }
  3060. reqHeaders.Set("User-Agent", c.s.userAgent())
  3061. var body io.Reader = nil
  3062. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  3063. if err != nil {
  3064. return nil, err
  3065. }
  3066. reqHeaders.Set("Content-Type", "application/json")
  3067. c.urlParams_.Set("alt", alt)
  3068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users")
  3069. urls += "?" + c.urlParams_.Encode()
  3070. req, _ := http.NewRequest("POST", urls, body)
  3071. req.Header = reqHeaders
  3072. googleapi.Expand(req.URL, map[string]string{
  3073. "project": c.project,
  3074. })
  3075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3076. }
  3077. // Do executes the "clouduseraccounts.users.insert" call.
  3078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3079. // status code is an error. Response headers are in either
  3080. // *Operation.ServerResponse.Header or (if a response was returned at
  3081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3082. // to check whether the returned error was because
  3083. // http.StatusNotModified was returned.
  3084. func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3085. gensupport.SetOptions(c.urlParams_, opts...)
  3086. res, err := c.doRequest("json")
  3087. if res != nil && res.StatusCode == http.StatusNotModified {
  3088. if res.Body != nil {
  3089. res.Body.Close()
  3090. }
  3091. return nil, &googleapi.Error{
  3092. Code: res.StatusCode,
  3093. Header: res.Header,
  3094. }
  3095. }
  3096. if err != nil {
  3097. return nil, err
  3098. }
  3099. defer googleapi.CloseBody(res)
  3100. if err := googleapi.CheckResponse(res); err != nil {
  3101. return nil, err
  3102. }
  3103. ret := &Operation{
  3104. ServerResponse: googleapi.ServerResponse{
  3105. Header: res.Header,
  3106. HTTPStatusCode: res.StatusCode,
  3107. },
  3108. }
  3109. target := &ret
  3110. if err := gensupport.DecodeResponse(target, res); err != nil {
  3111. return nil, err
  3112. }
  3113. return ret, nil
  3114. // {
  3115. // "description": "Creates a User resource in the specified project using the data included in the request.",
  3116. // "httpMethod": "POST",
  3117. // "id": "clouduseraccounts.users.insert",
  3118. // "parameterOrder": [
  3119. // "project"
  3120. // ],
  3121. // "parameters": {
  3122. // "project": {
  3123. // "description": "Project ID for this request.",
  3124. // "location": "path",
  3125. // "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])?))",
  3126. // "required": true,
  3127. // "type": "string"
  3128. // }
  3129. // },
  3130. // "path": "{project}/global/users",
  3131. // "request": {
  3132. // "$ref": "User"
  3133. // },
  3134. // "response": {
  3135. // "$ref": "Operation"
  3136. // },
  3137. // "scopes": [
  3138. // "https://www.googleapis.com/auth/cloud-platform",
  3139. // "https://www.googleapis.com/auth/cloud.useraccounts"
  3140. // ]
  3141. // }
  3142. }
  3143. // method id "clouduseraccounts.users.list":
  3144. type UsersListCall struct {
  3145. s *Service
  3146. project string
  3147. urlParams_ gensupport.URLParams
  3148. ifNoneMatch_ string
  3149. ctx_ context.Context
  3150. header_ http.Header
  3151. }
  3152. // List: Retrieves a list of users contained within the specified
  3153. // project.
  3154. func (r *UsersService) List(project string) *UsersListCall {
  3155. c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3156. c.project = project
  3157. return c
  3158. }
  3159. // Filter sets the optional parameter "filter": Sets a filter expression
  3160. // for filtering listed resources, in the form filter={expression}. Your
  3161. // {expression} must be in the format: field_name comparison_string
  3162. // literal_string.
  3163. //
  3164. // The field_name is the name of the field you want to compare. Only
  3165. // atomic field types are supported (string, number, boolean). The
  3166. // comparison_string must be either eq (equals) or ne (not equals). The
  3167. // literal_string is the string value to filter to. The literal value
  3168. // must be valid for the type of field you are filtering by (string,
  3169. // number, boolean). For string fields, the literal value is interpreted
  3170. // as a regular expression using RE2 syntax. The literal value must
  3171. // match the entire field.
  3172. //
  3173. // For example, to filter for instances that do not have a name of
  3174. // example-instance, you would use filter=name ne
  3175. // example-instance.
  3176. //
  3177. // Compute Engine Beta API Only: If you use filtering in the Beta API,
  3178. // you can also filter on nested fields. For example, you could filter
  3179. // on instances that have set the scheduling.automaticRestart field to
  3180. // true. In particular, use filtering on nested fields to take advantage
  3181. // of instance labels to organize and filter results based on label
  3182. // values.
  3183. //
  3184. // The Beta API also supports filtering on multiple expressions by
  3185. // providing each separate expression within parentheses. For example,
  3186. // (scheduling.automaticRestart eq true) (zone eq us-central1-f).
  3187. // Multiple expressions are treated as AND expressions, meaning that
  3188. // resources must match all expressions to pass the filters.
  3189. func (c *UsersListCall) Filter(filter string) *UsersListCall {
  3190. c.urlParams_.Set("filter", filter)
  3191. return c
  3192. }
  3193. // MaxResults sets the optional parameter "maxResults": The maximum
  3194. // number of results per page that should be returned. If the number of
  3195. // available results is larger than maxResults, Compute Engine returns a
  3196. // nextPageToken that can be used to get the next page of results in
  3197. // subsequent list requests.
  3198. func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall {
  3199. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3200. return c
  3201. }
  3202. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  3203. // a certain order. By default, results are returned in alphanumerical
  3204. // order based on the resource name.
  3205. //
  3206. // You can also sort results in descending order based on the creation
  3207. // timestamp using orderBy="creationTimestamp desc". This sorts results
  3208. // based on the creationTimestamp field in reverse chronological order
  3209. // (newest result first). Use this to sort resources like operations so
  3210. // that the newest operation is returned first.
  3211. //
  3212. // Currently, only sorting by name or creationTimestamp desc is
  3213. // supported.
  3214. func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall {
  3215. c.urlParams_.Set("orderBy", orderBy)
  3216. return c
  3217. }
  3218. // PageToken sets the optional parameter "pageToken": Specifies a page
  3219. // token to use. Set pageToken to the nextPageToken returned by a
  3220. // previous list request to get the next page of results.
  3221. func (c *UsersListCall) PageToken(pageToken string) *UsersListCall {
  3222. c.urlParams_.Set("pageToken", pageToken)
  3223. return c
  3224. }
  3225. // Fields allows partial responses to be retrieved. See
  3226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3227. // for more information.
  3228. func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
  3229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3230. return c
  3231. }
  3232. // IfNoneMatch sets the optional parameter which makes the operation
  3233. // fail if the object's ETag matches the given value. This is useful for
  3234. // getting updates only after the object has changed since the last
  3235. // request. Use googleapi.IsNotModified to check whether the response
  3236. // error from Do is the result of In-None-Match.
  3237. func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
  3238. c.ifNoneMatch_ = entityTag
  3239. return c
  3240. }
  3241. // Context sets the context to be used in this call's Do method. Any
  3242. // pending HTTP request will be aborted if the provided context is
  3243. // canceled.
  3244. func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
  3245. c.ctx_ = ctx
  3246. return c
  3247. }
  3248. // Header returns an http.Header that can be modified by the caller to
  3249. // add HTTP headers to the request.
  3250. func (c *UsersListCall) Header() http.Header {
  3251. if c.header_ == nil {
  3252. c.header_ = make(http.Header)
  3253. }
  3254. return c.header_
  3255. }
  3256. func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
  3257. reqHeaders := make(http.Header)
  3258. for k, v := range c.header_ {
  3259. reqHeaders[k] = v
  3260. }
  3261. reqHeaders.Set("User-Agent", c.s.userAgent())
  3262. if c.ifNoneMatch_ != "" {
  3263. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3264. }
  3265. var body io.Reader = nil
  3266. c.urlParams_.Set("alt", alt)
  3267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users")
  3268. urls += "?" + c.urlParams_.Encode()
  3269. req, _ := http.NewRequest("GET", urls, body)
  3270. req.Header = reqHeaders
  3271. googleapi.Expand(req.URL, map[string]string{
  3272. "project": c.project,
  3273. })
  3274. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3275. }
  3276. // Do executes the "clouduseraccounts.users.list" call.
  3277. // Exactly one of *UserList or error will be non-nil. Any non-2xx status
  3278. // code is an error. Response headers are in either
  3279. // *UserList.ServerResponse.Header or (if a response was returned at
  3280. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3281. // to check whether the returned error was because
  3282. // http.StatusNotModified was returned.
  3283. func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UserList, error) {
  3284. gensupport.SetOptions(c.urlParams_, opts...)
  3285. res, err := c.doRequest("json")
  3286. if res != nil && res.StatusCode == http.StatusNotModified {
  3287. if res.Body != nil {
  3288. res.Body.Close()
  3289. }
  3290. return nil, &googleapi.Error{
  3291. Code: res.StatusCode,
  3292. Header: res.Header,
  3293. }
  3294. }
  3295. if err != nil {
  3296. return nil, err
  3297. }
  3298. defer googleapi.CloseBody(res)
  3299. if err := googleapi.CheckResponse(res); err != nil {
  3300. return nil, err
  3301. }
  3302. ret := &UserList{
  3303. ServerResponse: googleapi.ServerResponse{
  3304. Header: res.Header,
  3305. HTTPStatusCode: res.StatusCode,
  3306. },
  3307. }
  3308. target := &ret
  3309. if err := gensupport.DecodeResponse(target, res); err != nil {
  3310. return nil, err
  3311. }
  3312. return ret, nil
  3313. // {
  3314. // "description": "Retrieves a list of users contained within the specified project.",
  3315. // "httpMethod": "GET",
  3316. // "id": "clouduseraccounts.users.list",
  3317. // "parameterOrder": [
  3318. // "project"
  3319. // ],
  3320. // "parameters": {
  3321. // "filter": {
  3322. // "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.",
  3323. // "location": "query",
  3324. // "type": "string"
  3325. // },
  3326. // "maxResults": {
  3327. // "default": "500",
  3328. // "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.",
  3329. // "format": "uint32",
  3330. // "location": "query",
  3331. // "maximum": "500",
  3332. // "minimum": "0",
  3333. // "type": "integer"
  3334. // },
  3335. // "orderBy": {
  3336. // "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.",
  3337. // "location": "query",
  3338. // "type": "string"
  3339. // },
  3340. // "pageToken": {
  3341. // "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.",
  3342. // "location": "query",
  3343. // "type": "string"
  3344. // },
  3345. // "project": {
  3346. // "description": "Project ID for this request.",
  3347. // "location": "path",
  3348. // "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])?))",
  3349. // "required": true,
  3350. // "type": "string"
  3351. // }
  3352. // },
  3353. // "path": "{project}/global/users",
  3354. // "response": {
  3355. // "$ref": "UserList"
  3356. // },
  3357. // "scopes": [
  3358. // "https://www.googleapis.com/auth/cloud-platform",
  3359. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3360. // "https://www.googleapis.com/auth/cloud.useraccounts",
  3361. // "https://www.googleapis.com/auth/cloud.useraccounts.readonly"
  3362. // ]
  3363. // }
  3364. }
  3365. // Pages invokes f for each page of results.
  3366. // A non-nil error returned from f will halt the iteration.
  3367. // The provided context supersedes any context provided to the Context method.
  3368. func (c *UsersListCall) Pages(ctx context.Context, f func(*UserList) error) error {
  3369. c.ctx_ = ctx
  3370. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3371. for {
  3372. x, err := c.Do()
  3373. if err != nil {
  3374. return err
  3375. }
  3376. if err := f(x); err != nil {
  3377. return err
  3378. }
  3379. if x.NextPageToken == "" {
  3380. return nil
  3381. }
  3382. c.PageToken(x.NextPageToken)
  3383. }
  3384. }
  3385. // method id "clouduseraccounts.users.removePublicKey":
  3386. type UsersRemovePublicKeyCall struct {
  3387. s *Service
  3388. project string
  3389. user string
  3390. urlParams_ gensupport.URLParams
  3391. ctx_ context.Context
  3392. header_ http.Header
  3393. }
  3394. // RemovePublicKey: Removes the specified public key from the user.
  3395. func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall {
  3396. c := &UsersRemovePublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3397. c.project = project
  3398. c.user = user
  3399. c.urlParams_.Set("fingerprint", fingerprint)
  3400. return c
  3401. }
  3402. // Fields allows partial responses to be retrieved. See
  3403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3404. // for more information.
  3405. func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall {
  3406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3407. return c
  3408. }
  3409. // Context sets the context to be used in this call's Do method. Any
  3410. // pending HTTP request will be aborted if the provided context is
  3411. // canceled.
  3412. func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall {
  3413. c.ctx_ = ctx
  3414. return c
  3415. }
  3416. // Header returns an http.Header that can be modified by the caller to
  3417. // add HTTP headers to the request.
  3418. func (c *UsersRemovePublicKeyCall) Header() http.Header {
  3419. if c.header_ == nil {
  3420. c.header_ = make(http.Header)
  3421. }
  3422. return c.header_
  3423. }
  3424. func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) {
  3425. reqHeaders := make(http.Header)
  3426. for k, v := range c.header_ {
  3427. reqHeaders[k] = v
  3428. }
  3429. reqHeaders.Set("User-Agent", c.s.userAgent())
  3430. var body io.Reader = nil
  3431. c.urlParams_.Set("alt", alt)
  3432. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey")
  3433. urls += "?" + c.urlParams_.Encode()
  3434. req, _ := http.NewRequest("POST", urls, body)
  3435. req.Header = reqHeaders
  3436. googleapi.Expand(req.URL, map[string]string{
  3437. "project": c.project,
  3438. "user": c.user,
  3439. })
  3440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3441. }
  3442. // Do executes the "clouduseraccounts.users.removePublicKey" call.
  3443. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3444. // status code is an error. Response headers are in either
  3445. // *Operation.ServerResponse.Header or (if a response was returned at
  3446. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3447. // to check whether the returned error was because
  3448. // http.StatusNotModified was returned.
  3449. func (c *UsersRemovePublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3450. gensupport.SetOptions(c.urlParams_, opts...)
  3451. res, err := c.doRequest("json")
  3452. if res != nil && res.StatusCode == http.StatusNotModified {
  3453. if res.Body != nil {
  3454. res.Body.Close()
  3455. }
  3456. return nil, &googleapi.Error{
  3457. Code: res.StatusCode,
  3458. Header: res.Header,
  3459. }
  3460. }
  3461. if err != nil {
  3462. return nil, err
  3463. }
  3464. defer googleapi.CloseBody(res)
  3465. if err := googleapi.CheckResponse(res); err != nil {
  3466. return nil, err
  3467. }
  3468. ret := &Operation{
  3469. ServerResponse: googleapi.ServerResponse{
  3470. Header: res.Header,
  3471. HTTPStatusCode: res.StatusCode,
  3472. },
  3473. }
  3474. target := &ret
  3475. if err := gensupport.DecodeResponse(target, res); err != nil {
  3476. return nil, err
  3477. }
  3478. return ret, nil
  3479. // {
  3480. // "description": "Removes the specified public key from the user.",
  3481. // "httpMethod": "POST",
  3482. // "id": "clouduseraccounts.users.removePublicKey",
  3483. // "parameterOrder": [
  3484. // "project",
  3485. // "user",
  3486. // "fingerprint"
  3487. // ],
  3488. // "parameters": {
  3489. // "fingerprint": {
  3490. // "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.",
  3491. // "location": "query",
  3492. // "pattern": "[a-f0-9]{32}",
  3493. // "required": true,
  3494. // "type": "string"
  3495. // },
  3496. // "project": {
  3497. // "description": "Project ID for this request.",
  3498. // "location": "path",
  3499. // "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])?))",
  3500. // "required": true,
  3501. // "type": "string"
  3502. // },
  3503. // "user": {
  3504. // "description": "Name of the user for this request.",
  3505. // "location": "path",
  3506. // "pattern": "[a-z][-a-z0-9_]{0,31}",
  3507. // "required": true,
  3508. // "type": "string"
  3509. // }
  3510. // },
  3511. // "path": "{project}/global/users/{user}/removePublicKey",
  3512. // "response": {
  3513. // "$ref": "Operation"
  3514. // },
  3515. // "scopes": [
  3516. // "https://www.googleapis.com/auth/cloud-platform",
  3517. // "https://www.googleapis.com/auth/cloud.useraccounts"
  3518. // ]
  3519. // }
  3520. }