Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

3288 рядки
114 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package storagetransfer provides access to the Storage Transfer API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/storage-transfer/docs
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/storagetransfer/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // storagetransferService, err := storagetransfer.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // storagetransferService, err := storagetransfer.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // storagetransferService, err := storagetransfer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package storagetransfer // import "google.golang.org/api/storagetransfer/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "storagetransfer:v1"
  67. const apiName = "storagetransfer"
  68. const apiVersion = "v1"
  69. const basePath = "https://storagetransfer.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.GoogleServiceAccounts = NewGoogleServiceAccountsService(s)
  106. s.TransferJobs = NewTransferJobsService(s)
  107. s.TransferOperations = NewTransferOperationsService(s)
  108. return s, nil
  109. }
  110. type Service struct {
  111. client *http.Client
  112. BasePath string // API endpoint base URL
  113. UserAgent string // optional additional User-Agent fragment
  114. GoogleServiceAccounts *GoogleServiceAccountsService
  115. TransferJobs *TransferJobsService
  116. TransferOperations *TransferOperationsService
  117. }
  118. func (s *Service) userAgent() string {
  119. if s.UserAgent == "" {
  120. return googleapi.UserAgent
  121. }
  122. return googleapi.UserAgent + " " + s.UserAgent
  123. }
  124. func NewGoogleServiceAccountsService(s *Service) *GoogleServiceAccountsService {
  125. rs := &GoogleServiceAccountsService{s: s}
  126. return rs
  127. }
  128. type GoogleServiceAccountsService struct {
  129. s *Service
  130. }
  131. func NewTransferJobsService(s *Service) *TransferJobsService {
  132. rs := &TransferJobsService{s: s}
  133. return rs
  134. }
  135. type TransferJobsService struct {
  136. s *Service
  137. }
  138. func NewTransferOperationsService(s *Service) *TransferOperationsService {
  139. rs := &TransferOperationsService{s: s}
  140. return rs
  141. }
  142. type TransferOperationsService struct {
  143. s *Service
  144. }
  145. // AwsAccessKey: AWS access key (see
  146. // [AWS
  147. // Security
  148. // Credentials](http://docs.aws.amazon.com/general/latest/gr/aws
  149. // -security-credentials.html)).
  150. type AwsAccessKey struct {
  151. // AccessKeyId: AWS access key ID.
  152. // Required.
  153. AccessKeyId string `json:"accessKeyId,omitempty"`
  154. // SecretAccessKey: AWS secret access key. This field is not returned in
  155. // RPC responses.
  156. // Required.
  157. SecretAccessKey string `json:"secretAccessKey,omitempty"`
  158. // ForceSendFields is a list of field names (e.g. "AccessKeyId") to
  159. // unconditionally include in API requests. By default, fields with
  160. // empty values are omitted from API requests. However, any non-pointer,
  161. // non-interface field appearing in ForceSendFields will be sent to the
  162. // server regardless of whether the field is empty or not. This may be
  163. // used to include empty fields in Patch requests.
  164. ForceSendFields []string `json:"-"`
  165. // NullFields is a list of field names (e.g. "AccessKeyId") to include
  166. // in API requests with the JSON null value. By default, fields with
  167. // empty values are omitted from API requests. However, any field with
  168. // an empty value appearing in NullFields will be sent to the server as
  169. // null. It is an error if a field in this list has a non-empty value.
  170. // This may be used to include null fields in Patch requests.
  171. NullFields []string `json:"-"`
  172. }
  173. func (s *AwsAccessKey) MarshalJSON() ([]byte, error) {
  174. type NoMethod AwsAccessKey
  175. raw := NoMethod(*s)
  176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  177. }
  178. // AwsS3Data: An AwsS3Data resource can be a data source, but not a data
  179. // sink.
  180. // In an AwsS3Data resource, an object's name is the S3 object's key
  181. // name.
  182. type AwsS3Data struct {
  183. // AwsAccessKey: AWS access key used to sign the API requests to the AWS
  184. // S3 bucket.
  185. // Permissions on the bucket must be granted to the access ID of the
  186. // AWS access key.
  187. // Required.
  188. AwsAccessKey *AwsAccessKey `json:"awsAccessKey,omitempty"`
  189. // BucketName: S3 Bucket name (see
  190. // [Creating
  191. // a
  192. // bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket
  193. // -get-location-example.html)).
  194. // Required.
  195. BucketName string `json:"bucketName,omitempty"`
  196. // ForceSendFields is a list of field names (e.g. "AwsAccessKey") to
  197. // unconditionally include in API requests. By default, fields with
  198. // empty values are omitted from API requests. However, any non-pointer,
  199. // non-interface field appearing in ForceSendFields will be sent to the
  200. // server regardless of whether the field is empty or not. This may be
  201. // used to include empty fields in Patch requests.
  202. ForceSendFields []string `json:"-"`
  203. // NullFields is a list of field names (e.g. "AwsAccessKey") to include
  204. // in API requests with the JSON null value. By default, fields with
  205. // empty values are omitted from API requests. However, any field with
  206. // an empty value appearing in NullFields will be sent to the server as
  207. // null. It is an error if a field in this list has a non-empty value.
  208. // This may be used to include null fields in Patch requests.
  209. NullFields []string `json:"-"`
  210. }
  211. func (s *AwsS3Data) MarshalJSON() ([]byte, error) {
  212. type NoMethod AwsS3Data
  213. raw := NoMethod(*s)
  214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  215. }
  216. // Date: Represents a whole or partial calendar date, e.g. a birthday.
  217. // The time of day
  218. // and time zone are either specified elsewhere or are not significant.
  219. // The date
  220. // is relative to the Proleptic Gregorian Calendar. This can
  221. // represent:
  222. //
  223. // * A full date, with non-zero year, month and day values
  224. // * A month and day value, with a zero year, e.g. an anniversary
  225. // * A year on its own, with zero month and day values
  226. // * A year and month value, with a zero day, e.g. a credit card
  227. // expiration date
  228. //
  229. // Related types are google.type.TimeOfDay and
  230. // `google.protobuf.Timestamp`.
  231. type Date struct {
  232. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  233. // month, or 0
  234. // if specifying a year by itself or a year and month where the day is
  235. // not
  236. // significant.
  237. Day int64 `json:"day,omitempty"`
  238. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year
  239. // without a
  240. // month and day.
  241. Month int64 `json:"month,omitempty"`
  242. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  243. // without
  244. // a year.
  245. Year int64 `json:"year,omitempty"`
  246. // ForceSendFields is a list of field names (e.g. "Day") 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. "Day") 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 *Date) MarshalJSON() ([]byte, error) {
  262. type NoMethod Date
  263. raw := NoMethod(*s)
  264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  265. }
  266. // Empty: A generic empty message that you can re-use to avoid defining
  267. // duplicated
  268. // empty messages in your APIs. A typical example is to use it as the
  269. // request
  270. // or the response type of an API method. For instance:
  271. //
  272. // service Foo {
  273. // rpc Bar(google.protobuf.Empty) returns
  274. // (google.protobuf.Empty);
  275. // }
  276. //
  277. // The JSON representation for `Empty` is empty JSON object `{}`.
  278. type Empty struct {
  279. // ServerResponse contains the HTTP response code and headers from the
  280. // server.
  281. googleapi.ServerResponse `json:"-"`
  282. }
  283. // ErrorLogEntry: An entry describing an error that has occurred.
  284. type ErrorLogEntry struct {
  285. // ErrorDetails: A list of messages that carry the error details.
  286. ErrorDetails []string `json:"errorDetails,omitempty"`
  287. // Url: A URL that refers to the target (a data source, a data sink,
  288. // or an object) with which the error is associated.
  289. // Required.
  290. Url string `json:"url,omitempty"`
  291. // ForceSendFields is a list of field names (e.g. "ErrorDetails") to
  292. // unconditionally include in API requests. By default, fields with
  293. // empty values are omitted from API requests. However, any non-pointer,
  294. // non-interface field appearing in ForceSendFields will be sent to the
  295. // server regardless of whether the field is empty or not. This may be
  296. // used to include empty fields in Patch requests.
  297. ForceSendFields []string `json:"-"`
  298. // NullFields is a list of field names (e.g. "ErrorDetails") to include
  299. // in API requests with the JSON null value. By default, fields with
  300. // empty values are omitted from API requests. However, any field with
  301. // an empty value appearing in NullFields will be sent to the server as
  302. // null. It is an error if a field in this list has a non-empty value.
  303. // This may be used to include null fields in Patch requests.
  304. NullFields []string `json:"-"`
  305. }
  306. func (s *ErrorLogEntry) MarshalJSON() ([]byte, error) {
  307. type NoMethod ErrorLogEntry
  308. raw := NoMethod(*s)
  309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  310. }
  311. // ErrorSummary: A summary of errors by error code, plus a count and
  312. // sample error log
  313. // entries.
  314. type ErrorSummary struct {
  315. // ErrorCode: Required.
  316. //
  317. // Possible values:
  318. // "OK" - Not an error; returned on success
  319. //
  320. // HTTP Mapping: 200 OK
  321. // "CANCELLED" - The operation was cancelled, typically by the
  322. // caller.
  323. //
  324. // HTTP Mapping: 499 Client Closed Request
  325. // "UNKNOWN" - Unknown error. For example, this error may be returned
  326. // when
  327. // a `Status` value received from another address space belongs to
  328. // an error space that is not known in this address space. Also
  329. // errors raised by APIs that do not return enough error information
  330. // may be converted to this error.
  331. //
  332. // HTTP Mapping: 500 Internal Server Error
  333. // "INVALID_ARGUMENT" - The client specified an invalid argument.
  334. // Note that this differs
  335. // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates
  336. // arguments
  337. // that are problematic regardless of the state of the system
  338. // (e.g., a malformed file name).
  339. //
  340. // HTTP Mapping: 400 Bad Request
  341. // "DEADLINE_EXCEEDED" - The deadline expired before the operation
  342. // could complete. For operations
  343. // that change the state of the system, this error may be returned
  344. // even if the operation has completed successfully. For example,
  345. // a
  346. // successful response from a server could have been delayed long
  347. // enough for the deadline to expire.
  348. //
  349. // HTTP Mapping: 504 Gateway Timeout
  350. // "NOT_FOUND" - Some requested entity (e.g., file or directory) was
  351. // not found.
  352. //
  353. // Note to server developers: if a request is denied for an entire
  354. // class
  355. // of users, such as gradual feature rollout or undocumented
  356. // whitelist,
  357. // `NOT_FOUND` may be used. If a request is denied for some users
  358. // within
  359. // a class of users, such as user-based access control,
  360. // `PERMISSION_DENIED`
  361. // must be used.
  362. //
  363. // HTTP Mapping: 404 Not Found
  364. // "ALREADY_EXISTS" - The entity that a client attempted to create
  365. // (e.g., file or directory)
  366. // already exists.
  367. //
  368. // HTTP Mapping: 409 Conflict
  369. // "PERMISSION_DENIED" - The caller does not have permission to
  370. // execute the specified
  371. // operation. `PERMISSION_DENIED` must not be used for rejections
  372. // caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
  373. // instead for those errors). `PERMISSION_DENIED` must not be
  374. // used if the caller can not be identified (use
  375. // `UNAUTHENTICATED`
  376. // instead for those errors). This error code does not imply the
  377. // request is valid or the requested entity exists or satisfies
  378. // other pre-conditions.
  379. //
  380. // HTTP Mapping: 403 Forbidden
  381. // "UNAUTHENTICATED" - The request does not have valid authentication
  382. // credentials for the
  383. // operation.
  384. //
  385. // HTTP Mapping: 401 Unauthorized
  386. // "RESOURCE_EXHAUSTED" - Some resource has been exhausted, perhaps a
  387. // per-user quota, or
  388. // perhaps the entire file system is out of space.
  389. //
  390. // HTTP Mapping: 429 Too Many Requests
  391. // "FAILED_PRECONDITION" - The operation was rejected because the
  392. // system is not in a state
  393. // required for the operation's execution. For example, the
  394. // directory
  395. // to be deleted is non-empty, an rmdir operation is applied to
  396. // a non-directory, etc.
  397. //
  398. // Service implementors can use the following guidelines to
  399. // decide
  400. // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
  401. // (a) Use `UNAVAILABLE` if the client can retry just the failing
  402. // call.
  403. // (b) Use `ABORTED` if the client should retry at a higher level
  404. // (e.g., when a client-specified test-and-set fails, indicating
  405. // the
  406. // client should restart a read-modify-write sequence).
  407. // (c) Use `FAILED_PRECONDITION` if the client should not retry until
  408. // the system state has been explicitly fixed. E.g., if an
  409. // "rmdir"
  410. // fails because the directory is non-empty, `FAILED_PRECONDITION`
  411. // should be returned since the client should not retry unless
  412. // the files are deleted from the directory.
  413. //
  414. // HTTP Mapping: 400 Bad Request
  415. // "ABORTED" - The operation was aborted, typically due to a
  416. // concurrency issue such as
  417. // a sequencer check failure or transaction abort.
  418. //
  419. // See the guidelines above for deciding between
  420. // `FAILED_PRECONDITION`,
  421. // `ABORTED`, and `UNAVAILABLE`.
  422. //
  423. // HTTP Mapping: 409 Conflict
  424. // "OUT_OF_RANGE" - The operation was attempted past the valid range.
  425. // E.g., seeking or
  426. // reading past end-of-file.
  427. //
  428. // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
  429. // be fixed if the system state changes. For example, a 32-bit
  430. // file
  431. // system will generate `INVALID_ARGUMENT` if asked to read at an
  432. // offset that is not in the range [0,2^32-1], but it will
  433. // generate
  434. // `OUT_OF_RANGE` if asked to read from an offset past the current
  435. // file size.
  436. //
  437. // There is a fair bit of overlap between `FAILED_PRECONDITION`
  438. // and
  439. // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more
  440. // specific
  441. // error) when it applies so that callers who are iterating through
  442. // a space can easily look for an `OUT_OF_RANGE` error to detect
  443. // when
  444. // they are done.
  445. //
  446. // HTTP Mapping: 400 Bad Request
  447. // "UNIMPLEMENTED" - The operation is not implemented or is not
  448. // supported/enabled in this
  449. // service.
  450. //
  451. // HTTP Mapping: 501 Not Implemented
  452. // "INTERNAL" - Internal errors. This means that some invariants
  453. // expected by the
  454. // underlying system have been broken. This error code is reserved
  455. // for serious errors.
  456. //
  457. // HTTP Mapping: 500 Internal Server Error
  458. // "UNAVAILABLE" - The service is currently unavailable. This is most
  459. // likely a
  460. // transient condition, which can be corrected by retrying with
  461. // a backoff.
  462. //
  463. // See the guidelines above for deciding between
  464. // `FAILED_PRECONDITION`,
  465. // `ABORTED`, and `UNAVAILABLE`.
  466. //
  467. // HTTP Mapping: 503 Service Unavailable
  468. // "DATA_LOSS" - Unrecoverable data loss or corruption.
  469. //
  470. // HTTP Mapping: 500 Internal Server Error
  471. ErrorCode string `json:"errorCode,omitempty"`
  472. // ErrorCount: Count of this type of error.
  473. // Required.
  474. ErrorCount int64 `json:"errorCount,omitempty,string"`
  475. // ErrorLogEntries: Error samples.
  476. //
  477. // No more than 100 error log entries may be recorded for a given
  478. // error code for a single task.
  479. ErrorLogEntries []*ErrorLogEntry `json:"errorLogEntries,omitempty"`
  480. // ForceSendFields is a list of field names (e.g. "ErrorCode") to
  481. // unconditionally include in API requests. By default, fields with
  482. // empty values are omitted from API requests. However, any non-pointer,
  483. // non-interface field appearing in ForceSendFields will be sent to the
  484. // server regardless of whether the field is empty or not. This may be
  485. // used to include empty fields in Patch requests.
  486. ForceSendFields []string `json:"-"`
  487. // NullFields is a list of field names (e.g. "ErrorCode") to include in
  488. // API requests with the JSON null value. By default, fields with empty
  489. // values are omitted from API requests. However, any field with an
  490. // empty value appearing in NullFields will be sent to the server as
  491. // null. It is an error if a field in this list has a non-empty value.
  492. // This may be used to include null fields in Patch requests.
  493. NullFields []string `json:"-"`
  494. }
  495. func (s *ErrorSummary) MarshalJSON() ([]byte, error) {
  496. type NoMethod ErrorSummary
  497. raw := NoMethod(*s)
  498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  499. }
  500. // GcsData: In a GcsData resource, an object's name is the Google Cloud
  501. // Storage object's
  502. // name and its `lastModificationTime` refers to the object's updated
  503. // time,
  504. // which changes when the content or the metadata of the object is
  505. // updated.
  506. type GcsData struct {
  507. // BucketName: Google Cloud Storage bucket name (see
  508. // [Bucket
  509. // Name
  510. // Requirements](https://cloud.google.com/storage/docs/naming#requir
  511. // ements)).
  512. // Required.
  513. BucketName string `json:"bucketName,omitempty"`
  514. // ForceSendFields is a list of field names (e.g. "BucketName") to
  515. // unconditionally include in API requests. By default, fields with
  516. // empty values are omitted from API requests. However, any non-pointer,
  517. // non-interface field appearing in ForceSendFields will be sent to the
  518. // server regardless of whether the field is empty or not. This may be
  519. // used to include empty fields in Patch requests.
  520. ForceSendFields []string `json:"-"`
  521. // NullFields is a list of field names (e.g. "BucketName") to include in
  522. // API requests with the JSON null value. By default, fields with empty
  523. // values are omitted from API requests. However, any field with an
  524. // empty value appearing in NullFields will be sent to the server as
  525. // null. It is an error if a field in this list has a non-empty value.
  526. // This may be used to include null fields in Patch requests.
  527. NullFields []string `json:"-"`
  528. }
  529. func (s *GcsData) MarshalJSON() ([]byte, error) {
  530. type NoMethod GcsData
  531. raw := NoMethod(*s)
  532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  533. }
  534. // GoogleServiceAccount: Google service account
  535. type GoogleServiceAccount struct {
  536. // AccountEmail: Required.
  537. AccountEmail string `json:"accountEmail,omitempty"`
  538. // ServerResponse contains the HTTP response code and headers from the
  539. // server.
  540. googleapi.ServerResponse `json:"-"`
  541. // ForceSendFields is a list of field names (e.g. "AccountEmail") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "AccountEmail") to include
  549. // in API requests with the JSON null value. By default, fields with
  550. // empty values are omitted from API requests. However, any field with
  551. // an empty value appearing in NullFields will be sent to the server as
  552. // null. It is an error if a field in this list has a non-empty value.
  553. // This may be used to include null fields in Patch requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *GoogleServiceAccount) MarshalJSON() ([]byte, error) {
  557. type NoMethod GoogleServiceAccount
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. // HttpData: An HttpData resource specifies a list of objects on the web
  562. // to be transferred
  563. // over HTTP. The information of the objects to be transferred is
  564. // contained in
  565. // a file referenced by a URL. The first line in the file must
  566. // be
  567. // "TsvHttpData-1.0", which specifies the format of the file.
  568. // Subsequent lines
  569. // specify the information of the list of objects, one object per list
  570. // entry.
  571. // Each entry has the following tab-delimited fields:
  572. //
  573. // * HTTP URL - The location of the object.
  574. //
  575. // * Length - The size of the object in bytes.
  576. //
  577. // * MD5 - The base64-encoded MD5 hash of the object.
  578. //
  579. // For an example of a valid TSV file, see
  580. // [Transferring data
  581. // from
  582. // URLs](https://cloud.google.com/storage/transfer/create-url-list).
  583. //
  584. //
  585. // When transferring data based on a URL list, keep the following in
  586. // mind:
  587. //
  588. // * When an object located at `http(s)://hostname:port/<URL-path>`
  589. // is
  590. // transferred to a data sink, the name of the object at the data sink
  591. // is
  592. // `<hostname>/<URL-path>`.
  593. //
  594. // * If the specified size of an object does not match the actual size
  595. // of the
  596. // object fetched, the object will not be transferred.
  597. //
  598. // * If the specified MD5 does not match the MD5 computed from the
  599. // transferred
  600. // bytes, the object transfer will fail. For more information,
  601. // see
  602. // [Generating MD5
  603. // hashes](https://cloud.google.com/storage/transfer/#md5)
  604. //
  605. // * Ensure that each URL you specify is publicly accessible.
  606. // For
  607. // example, in Google Cloud Storage you can
  608. // [share an object
  609. // publicly]
  610. // (https://cloud.google.com/storage/docs/cloud-console#_sharin
  611. // gdata) and get
  612. // a link to it.
  613. //
  614. // * Storage Transfer Service obeys `robots.txt` rules and requires the
  615. // source
  616. // HTTP server to support `Range` requests and to return a
  617. // `Content-Length`
  618. // header in each response.
  619. //
  620. // * [ObjectConditions](#ObjectConditions) have no effect when filtering
  621. // objects
  622. // to transfer.
  623. type HttpData struct {
  624. // ListUrl: The URL that points to the file that stores the object list
  625. // entries.
  626. // This file must allow public access. Currently, only URLs with HTTP
  627. // and
  628. // HTTPS schemes are supported.
  629. // Required.
  630. ListUrl string `json:"listUrl,omitempty"`
  631. // ForceSendFields is a list of field names (e.g. "ListUrl") to
  632. // unconditionally include in API requests. By default, fields with
  633. // empty values are omitted from API requests. However, any non-pointer,
  634. // non-interface field appearing in ForceSendFields will be sent to the
  635. // server regardless of whether the field is empty or not. This may be
  636. // used to include empty fields in Patch requests.
  637. ForceSendFields []string `json:"-"`
  638. // NullFields is a list of field names (e.g. "ListUrl") to include in
  639. // API requests with the JSON null value. By default, fields with empty
  640. // values are omitted from API requests. However, any field with an
  641. // empty value appearing in NullFields will be sent to the server as
  642. // null. It is an error if a field in this list has a non-empty value.
  643. // This may be used to include null fields in Patch requests.
  644. NullFields []string `json:"-"`
  645. }
  646. func (s *HttpData) MarshalJSON() ([]byte, error) {
  647. type NoMethod HttpData
  648. raw := NoMethod(*s)
  649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  650. }
  651. // ListOperationsResponse: The response message for
  652. // Operations.ListOperations.
  653. type ListOperationsResponse struct {
  654. // NextPageToken: The standard List next-page token.
  655. NextPageToken string `json:"nextPageToken,omitempty"`
  656. // Operations: A list of operations that matches the specified filter in
  657. // the request.
  658. Operations []*Operation `json:"operations,omitempty"`
  659. // ServerResponse contains the HTTP response code and headers from the
  660. // server.
  661. googleapi.ServerResponse `json:"-"`
  662. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  663. // unconditionally include in API requests. By default, fields with
  664. // empty values are omitted from API requests. However, any non-pointer,
  665. // non-interface field appearing in ForceSendFields will be sent to the
  666. // server regardless of whether the field is empty or not. This may be
  667. // used to include empty fields in Patch requests.
  668. ForceSendFields []string `json:"-"`
  669. // NullFields is a list of field names (e.g. "NextPageToken") to include
  670. // in API requests with the JSON null value. By default, fields with
  671. // empty values are omitted from API requests. However, any field with
  672. // an empty value appearing in NullFields will be sent to the server as
  673. // null. It is an error if a field in this list has a non-empty value.
  674. // This may be used to include null fields in Patch requests.
  675. NullFields []string `json:"-"`
  676. }
  677. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  678. type NoMethod ListOperationsResponse
  679. raw := NoMethod(*s)
  680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  681. }
  682. // ListTransferJobsResponse: Response from ListTransferJobs.
  683. type ListTransferJobsResponse struct {
  684. // NextPageToken: The list next page token.
  685. NextPageToken string `json:"nextPageToken,omitempty"`
  686. // TransferJobs: A list of transfer jobs.
  687. TransferJobs []*TransferJob `json:"transferJobs,omitempty"`
  688. // ServerResponse contains the HTTP response code and headers from the
  689. // server.
  690. googleapi.ServerResponse `json:"-"`
  691. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  692. // unconditionally include in API requests. By default, fields with
  693. // empty values are omitted from API requests. However, any non-pointer,
  694. // non-interface field appearing in ForceSendFields will be sent to the
  695. // server regardless of whether the field is empty or not. This may be
  696. // used to include empty fields in Patch requests.
  697. ForceSendFields []string `json:"-"`
  698. // NullFields is a list of field names (e.g. "NextPageToken") to include
  699. // in API requests with the JSON null value. By default, fields with
  700. // empty values are omitted from API requests. However, any field with
  701. // an empty value appearing in NullFields will be sent to the server as
  702. // null. It is an error if a field in this list has a non-empty value.
  703. // This may be used to include null fields in Patch requests.
  704. NullFields []string `json:"-"`
  705. }
  706. func (s *ListTransferJobsResponse) MarshalJSON() ([]byte, error) {
  707. type NoMethod ListTransferJobsResponse
  708. raw := NoMethod(*s)
  709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  710. }
  711. // ObjectConditions: Conditions that determine which objects will be
  712. // transferred. Applies only
  713. // to S3 and GCS objects.
  714. type ObjectConditions struct {
  715. // ExcludePrefixes: `excludePrefixes` must follow the requirements
  716. // described for
  717. // `includePrefixes`.
  718. //
  719. // The max size of `excludePrefixes` is 1000.
  720. ExcludePrefixes []string `json:"excludePrefixes,omitempty"`
  721. // IncludePrefixes: If `includePrefixes` is specified, objects that
  722. // satisfy the object
  723. // conditions must have names that start with one of the
  724. // `includePrefixes`
  725. // and that do not start with any of the `excludePrefixes`.
  726. // If
  727. // `includePrefixes` is not specified, all objects except those that
  728. // have
  729. // names starting with one of the `excludePrefixes` must satisfy the
  730. // object
  731. // conditions.
  732. //
  733. // Requirements:
  734. //
  735. // * Each include-prefix and exclude-prefix can contain any sequence
  736. // of
  737. // Unicode characters, of max length 1024 bytes when UTF8-encoded,
  738. // and
  739. // must not contain Carriage Return or Line Feed characters.
  740. // Wildcard
  741. // matching and regular expression matching are not supported.
  742. //
  743. // * Each include-prefix and exclude-prefix must omit the leading
  744. // slash.
  745. // For example, to include the `requests.gz` object in a transfer
  746. // from
  747. // `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the
  748. // include
  749. // prefix as `logs/y=2015/requests.gz`.
  750. //
  751. // * None of the include-prefix or the exclude-prefix values can be
  752. // empty,
  753. // if specified.
  754. //
  755. // * Each include-prefix must include a distinct portion of the
  756. // object
  757. // namespace, i.e., no include-prefix may be a prefix of another
  758. // include-prefix.
  759. //
  760. // * Each exclude-prefix must exclude a distinct portion of the
  761. // object
  762. // namespace, i.e., no exclude-prefix may be a prefix of another
  763. // exclude-prefix.
  764. //
  765. // * If `includePrefixes` is specified, then each exclude-prefix must
  766. // start
  767. // with the value of a path explicitly included by
  768. // `includePrefixes`.
  769. //
  770. // The max size of `includePrefixes` is 1000.
  771. IncludePrefixes []string `json:"includePrefixes,omitempty"`
  772. // MaxTimeElapsedSinceLastModification: If specified, only objects with
  773. // a `lastModificationTime` on or after
  774. // `NOW` - `maxTimeElapsedSinceLastModification` and objects that don't
  775. // have
  776. // a `lastModificationTime` are transferred.
  777. //
  778. // Note that `NOW` refers to the creation time of the transfer job,
  779. // and
  780. // `lastModificationTime` refers to the time of the last change to
  781. // the
  782. // object's content or metadata. Specifically, this would be the
  783. // `updated`
  784. // property of GCS objects and the `LastModified` field of S3 objects.
  785. MaxTimeElapsedSinceLastModification string `json:"maxTimeElapsedSinceLastModification,omitempty"`
  786. // MinTimeElapsedSinceLastModification: If specified, only objects with
  787. // a `lastModificationTime` before
  788. // `NOW` - `minTimeElapsedSinceLastModification` and objects that don't
  789. // have a
  790. // `lastModificationTime` are transferred.
  791. //
  792. // Note that `NOW` refers to the creation time of the transfer job,
  793. // and
  794. // `lastModificationTime` refers to the time of the last change to
  795. // the
  796. // object's content or metadata. Specifically, this would be the
  797. // `updated`
  798. // property of GCS objects and the `LastModified` field of S3 objects.
  799. MinTimeElapsedSinceLastModification string `json:"minTimeElapsedSinceLastModification,omitempty"`
  800. // ForceSendFields is a list of field names (e.g. "ExcludePrefixes") to
  801. // unconditionally include in API requests. By default, fields with
  802. // empty values are omitted from API requests. However, any non-pointer,
  803. // non-interface field appearing in ForceSendFields will be sent to the
  804. // server regardless of whether the field is empty or not. This may be
  805. // used to include empty fields in Patch requests.
  806. ForceSendFields []string `json:"-"`
  807. // NullFields is a list of field names (e.g. "ExcludePrefixes") to
  808. // include in API requests with the JSON null value. By default, fields
  809. // with empty values are omitted from API requests. However, any field
  810. // with an empty value appearing in NullFields will be sent to the
  811. // server as null. It is an error if a field in this list has a
  812. // non-empty value. This may be used to include null fields in Patch
  813. // requests.
  814. NullFields []string `json:"-"`
  815. }
  816. func (s *ObjectConditions) MarshalJSON() ([]byte, error) {
  817. type NoMethod ObjectConditions
  818. raw := NoMethod(*s)
  819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  820. }
  821. // Operation: This resource represents a long-running operation that is
  822. // the result of a
  823. // network API call.
  824. type Operation struct {
  825. // Done: If the value is `false`, it means the operation is still in
  826. // progress.
  827. // If `true`, the operation is completed, and either `error` or
  828. // `response` is
  829. // available.
  830. Done bool `json:"done,omitempty"`
  831. // Error: The error result of the operation in case of failure or
  832. // cancellation.
  833. Error *Status `json:"error,omitempty"`
  834. // Metadata: Represents the transfer operation object.
  835. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  836. // Name: The server-assigned name, which is only unique within the same
  837. // service that originally returns it. If you use the default HTTP
  838. // mapping, the `name` should have the format of
  839. // `transferOperations/some/unique/name`.
  840. Name string `json:"name,omitempty"`
  841. // Response: The normal response of the operation in case of success.
  842. // If the original
  843. // method returns no data on success, such as `Delete`, the response
  844. // is
  845. // `google.protobuf.Empty`. If the original method is
  846. // standard
  847. // `Get`/`Create`/`Update`, the response should be the resource. For
  848. // other
  849. // methods, the response should have the type `XxxResponse`, where
  850. // `Xxx`
  851. // is the original method name. For example, if the original method
  852. // name
  853. // is `TakeSnapshot()`, the inferred response type
  854. // is
  855. // `TakeSnapshotResponse`.
  856. Response googleapi.RawMessage `json:"response,omitempty"`
  857. // ServerResponse contains the HTTP response code and headers from the
  858. // server.
  859. googleapi.ServerResponse `json:"-"`
  860. // ForceSendFields is a list of field names (e.g. "Done") to
  861. // unconditionally include in API requests. By default, fields with
  862. // empty values are omitted from API requests. However, any non-pointer,
  863. // non-interface field appearing in ForceSendFields will be sent to the
  864. // server regardless of whether the field is empty or not. This may be
  865. // used to include empty fields in Patch requests.
  866. ForceSendFields []string `json:"-"`
  867. // NullFields is a list of field names (e.g. "Done") to include in API
  868. // requests with the JSON null value. By default, fields with empty
  869. // values are omitted from API requests. However, any field with an
  870. // empty value appearing in NullFields will be sent to the server as
  871. // null. It is an error if a field in this list has a non-empty value.
  872. // This may be used to include null fields in Patch requests.
  873. NullFields []string `json:"-"`
  874. }
  875. func (s *Operation) MarshalJSON() ([]byte, error) {
  876. type NoMethod Operation
  877. raw := NoMethod(*s)
  878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  879. }
  880. // PauseTransferOperationRequest: Request passed to
  881. // PauseTransferOperation.
  882. type PauseTransferOperationRequest struct {
  883. }
  884. // ResumeTransferOperationRequest: Request passed to
  885. // ResumeTransferOperation.
  886. type ResumeTransferOperationRequest struct {
  887. }
  888. // Schedule: Transfers can be scheduled to recur or to run just once.
  889. type Schedule struct {
  890. // ScheduleEndDate: The last day the recurring transfer will be run. If
  891. // `scheduleEndDate`
  892. // is the same as `scheduleStartDate`, the transfer will be executed
  893. // only
  894. // once.
  895. ScheduleEndDate *Date `json:"scheduleEndDate,omitempty"`
  896. // ScheduleStartDate: The first day the recurring transfer is scheduled
  897. // to run. If
  898. // `scheduleStartDate` is in the past, the transfer will run for the
  899. // first
  900. // time on the following day.
  901. // Required.
  902. ScheduleStartDate *Date `json:"scheduleStartDate,omitempty"`
  903. // StartTimeOfDay: The time in UTC at which the transfer will be
  904. // scheduled to start in a day.
  905. // Transfers may start later than this time. If not specified, recurring
  906. // and
  907. // one-time transfers that are scheduled to run today will run
  908. // immediately;
  909. // recurring transfers that are scheduled to run on a future date will
  910. // start
  911. // at approximately midnight UTC on that date. Note that when
  912. // configuring a
  913. // transfer with the Cloud Platform Console, the transfer's start time
  914. // in a
  915. // day is specified in your local timezone.
  916. StartTimeOfDay *TimeOfDay `json:"startTimeOfDay,omitempty"`
  917. // ForceSendFields is a list of field names (e.g. "ScheduleEndDate") to
  918. // unconditionally include in API requests. By default, fields with
  919. // empty values are omitted from API requests. However, any non-pointer,
  920. // non-interface field appearing in ForceSendFields will be sent to the
  921. // server regardless of whether the field is empty or not. This may be
  922. // used to include empty fields in Patch requests.
  923. ForceSendFields []string `json:"-"`
  924. // NullFields is a list of field names (e.g. "ScheduleEndDate") to
  925. // include in API requests with the JSON null value. By default, fields
  926. // with empty values are omitted from API requests. However, any field
  927. // with an empty value appearing in NullFields will be sent to the
  928. // server as null. It is an error if a field in this list has a
  929. // non-empty value. This may be used to include null fields in Patch
  930. // requests.
  931. NullFields []string `json:"-"`
  932. }
  933. func (s *Schedule) MarshalJSON() ([]byte, error) {
  934. type NoMethod Schedule
  935. raw := NoMethod(*s)
  936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  937. }
  938. // Status: The `Status` type defines a logical error model that is
  939. // suitable for
  940. // different programming environments, including REST APIs and RPC APIs.
  941. // It is
  942. // used by [gRPC](https://github.com/grpc). The error model is designed
  943. // to be:
  944. //
  945. // - Simple to use and understand for most users
  946. // - Flexible enough to meet unexpected needs
  947. //
  948. // # Overview
  949. //
  950. // The `Status` message contains three pieces of data: error code,
  951. // error
  952. // message, and error details. The error code should be an enum value
  953. // of
  954. // google.rpc.Code, but it may accept additional error codes if needed.
  955. // The
  956. // error message should be a developer-facing English message that
  957. // helps
  958. // developers *understand* and *resolve* the error. If a localized
  959. // user-facing
  960. // error message is needed, put the localized message in the error
  961. // details or
  962. // localize it in the client. The optional error details may contain
  963. // arbitrary
  964. // information about the error. There is a predefined set of error
  965. // detail types
  966. // in the package `google.rpc` that can be used for common error
  967. // conditions.
  968. //
  969. // # Language mapping
  970. //
  971. // The `Status` message is the logical representation of the error
  972. // model, but it
  973. // is not necessarily the actual wire format. When the `Status` message
  974. // is
  975. // exposed in different client libraries and different wire protocols,
  976. // it can be
  977. // mapped differently. For example, it will likely be mapped to some
  978. // exceptions
  979. // in Java, but more likely mapped to some error codes in C.
  980. //
  981. // # Other uses
  982. //
  983. // The error model and the `Status` message can be used in a variety
  984. // of
  985. // environments, either with or without APIs, to provide a
  986. // consistent developer experience across different
  987. // environments.
  988. //
  989. // Example uses of this error model include:
  990. //
  991. // - Partial errors. If a service needs to return partial errors to the
  992. // client,
  993. // it may embed the `Status` in the normal response to indicate the
  994. // partial
  995. // errors.
  996. //
  997. // - Workflow errors. A typical workflow has multiple steps. Each step
  998. // may
  999. // have a `Status` message for error reporting.
  1000. //
  1001. // - Batch operations. If a client uses batch request and batch
  1002. // response, the
  1003. // `Status` message should be used directly inside batch response,
  1004. // one for
  1005. // each error sub-response.
  1006. //
  1007. // - Asynchronous operations. If an API call embeds asynchronous
  1008. // operation
  1009. // results in its response, the status of those operations should
  1010. // be
  1011. // represented directly using the `Status` message.
  1012. //
  1013. // - Logging. If some API errors are stored in logs, the message
  1014. // `Status` could
  1015. // be used directly after any stripping needed for security/privacy
  1016. // reasons.
  1017. type Status struct {
  1018. // Code: The status code, which should be an enum value of
  1019. // google.rpc.Code.
  1020. Code int64 `json:"code,omitempty"`
  1021. // Details: A list of messages that carry the error details. There is a
  1022. // common set of
  1023. // message types for APIs to use.
  1024. Details []googleapi.RawMessage `json:"details,omitempty"`
  1025. // Message: A developer-facing error message, which should be in
  1026. // English. Any
  1027. // user-facing error message should be localized and sent in
  1028. // the
  1029. // google.rpc.Status.details field, or localized by the client.
  1030. Message string `json:"message,omitempty"`
  1031. // ForceSendFields is a list of field names (e.g. "Code") to
  1032. // unconditionally include in API requests. By default, fields with
  1033. // empty values are omitted from API requests. However, any non-pointer,
  1034. // non-interface field appearing in ForceSendFields will be sent to the
  1035. // server regardless of whether the field is empty or not. This may be
  1036. // used to include empty fields in Patch requests.
  1037. ForceSendFields []string `json:"-"`
  1038. // NullFields is a list of field names (e.g. "Code") to include in API
  1039. // requests with the JSON null value. By default, fields with empty
  1040. // values are omitted from API requests. However, any field with an
  1041. // empty value appearing in NullFields will be sent to the server as
  1042. // null. It is an error if a field in this list has a non-empty value.
  1043. // This may be used to include null fields in Patch requests.
  1044. NullFields []string `json:"-"`
  1045. }
  1046. func (s *Status) MarshalJSON() ([]byte, error) {
  1047. type NoMethod Status
  1048. raw := NoMethod(*s)
  1049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1050. }
  1051. // TimeOfDay: Represents a time of day. The date and time zone are
  1052. // either not significant
  1053. // or are specified elsewhere. An API may choose to allow leap seconds.
  1054. // Related
  1055. // types are google.type.Date and `google.protobuf.Timestamp`.
  1056. type TimeOfDay struct {
  1057. // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API
  1058. // may choose
  1059. // to allow the value "24:00:00" for scenarios like business closing
  1060. // time.
  1061. Hours int64 `json:"hours,omitempty"`
  1062. // Minutes: Minutes of hour of day. Must be from 0 to 59.
  1063. Minutes int64 `json:"minutes,omitempty"`
  1064. // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to
  1065. // 999,999,999.
  1066. Nanos int64 `json:"nanos,omitempty"`
  1067. // Seconds: Seconds of minutes of the time. Must normally be from 0 to
  1068. // 59. An API may
  1069. // allow the value 60 if it allows leap-seconds.
  1070. Seconds int64 `json:"seconds,omitempty"`
  1071. // ForceSendFields is a list of field names (e.g. "Hours") to
  1072. // unconditionally include in API requests. By default, fields with
  1073. // empty values are omitted from API requests. However, any non-pointer,
  1074. // non-interface field appearing in ForceSendFields will be sent to the
  1075. // server regardless of whether the field is empty or not. This may be
  1076. // used to include empty fields in Patch requests.
  1077. ForceSendFields []string `json:"-"`
  1078. // NullFields is a list of field names (e.g. "Hours") to include in API
  1079. // requests with the JSON null value. By default, fields with empty
  1080. // values are omitted from API requests. However, any field with an
  1081. // empty value appearing in NullFields will be sent to the server as
  1082. // null. It is an error if a field in this list has a non-empty value.
  1083. // This may be used to include null fields in Patch requests.
  1084. NullFields []string `json:"-"`
  1085. }
  1086. func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
  1087. type NoMethod TimeOfDay
  1088. raw := NoMethod(*s)
  1089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1090. }
  1091. // TransferCounters: A collection of counters that report the progress
  1092. // of a transfer operation.
  1093. type TransferCounters struct {
  1094. // BytesCopiedToSink: Bytes that are copied to the data sink.
  1095. BytesCopiedToSink int64 `json:"bytesCopiedToSink,omitempty,string"`
  1096. // BytesDeletedFromSink: Bytes that are deleted from the data sink.
  1097. BytesDeletedFromSink int64 `json:"bytesDeletedFromSink,omitempty,string"`
  1098. // BytesDeletedFromSource: Bytes that are deleted from the data source.
  1099. BytesDeletedFromSource int64 `json:"bytesDeletedFromSource,omitempty,string"`
  1100. // BytesFailedToDeleteFromSink: Bytes that failed to be deleted from the
  1101. // data sink.
  1102. BytesFailedToDeleteFromSink int64 `json:"bytesFailedToDeleteFromSink,omitempty,string"`
  1103. // BytesFoundFromSource: Bytes found in the data source that are
  1104. // scheduled to be transferred,
  1105. // excluding any that are filtered based on object conditions or skipped
  1106. // due
  1107. // to sync.
  1108. BytesFoundFromSource int64 `json:"bytesFoundFromSource,omitempty,string"`
  1109. // BytesFoundOnlyFromSink: Bytes found only in the data sink that are
  1110. // scheduled to be deleted.
  1111. BytesFoundOnlyFromSink int64 `json:"bytesFoundOnlyFromSink,omitempty,string"`
  1112. // BytesFromSourceFailed: Bytes in the data source that failed to be
  1113. // transferred or that failed to
  1114. // be deleted after being transferred.
  1115. BytesFromSourceFailed int64 `json:"bytesFromSourceFailed,omitempty,string"`
  1116. // BytesFromSourceSkippedBySync: Bytes in the data source that are not
  1117. // transferred because they already
  1118. // exist in the data sink.
  1119. BytesFromSourceSkippedBySync int64 `json:"bytesFromSourceSkippedBySync,omitempty,string"`
  1120. // ObjectsCopiedToSink: Objects that are copied to the data sink.
  1121. ObjectsCopiedToSink int64 `json:"objectsCopiedToSink,omitempty,string"`
  1122. // ObjectsDeletedFromSink: Objects that are deleted from the data sink.
  1123. ObjectsDeletedFromSink int64 `json:"objectsDeletedFromSink,omitempty,string"`
  1124. // ObjectsDeletedFromSource: Objects that are deleted from the data
  1125. // source.
  1126. ObjectsDeletedFromSource int64 `json:"objectsDeletedFromSource,omitempty,string"`
  1127. // ObjectsFailedToDeleteFromSink: Objects that failed to be deleted from
  1128. // the data sink.
  1129. ObjectsFailedToDeleteFromSink int64 `json:"objectsFailedToDeleteFromSink,omitempty,string"`
  1130. // ObjectsFoundFromSource: Objects found in the data source that are
  1131. // scheduled to be transferred,
  1132. // excluding any that are filtered based on object conditions or skipped
  1133. // due
  1134. // to sync.
  1135. ObjectsFoundFromSource int64 `json:"objectsFoundFromSource,omitempty,string"`
  1136. // ObjectsFoundOnlyFromSink: Objects found only in the data sink that
  1137. // are scheduled to be deleted.
  1138. ObjectsFoundOnlyFromSink int64 `json:"objectsFoundOnlyFromSink,omitempty,string"`
  1139. // ObjectsFromSourceFailed: Objects in the data source that failed to be
  1140. // transferred or that failed
  1141. // to be deleted after being transferred.
  1142. ObjectsFromSourceFailed int64 `json:"objectsFromSourceFailed,omitempty,string"`
  1143. // ObjectsFromSourceSkippedBySync: Objects in the data source that are
  1144. // not transferred because they already
  1145. // exist in the data sink.
  1146. ObjectsFromSourceSkippedBySync int64 `json:"objectsFromSourceSkippedBySync,omitempty,string"`
  1147. // ForceSendFields is a list of field names (e.g. "BytesCopiedToSink")
  1148. // to unconditionally include in API requests. By default, fields with
  1149. // empty values are omitted from API requests. However, any non-pointer,
  1150. // non-interface field appearing in ForceSendFields will be sent to the
  1151. // server regardless of whether the field is empty or not. This may be
  1152. // used to include empty fields in Patch requests.
  1153. ForceSendFields []string `json:"-"`
  1154. // NullFields is a list of field names (e.g. "BytesCopiedToSink") to
  1155. // include in API requests with the JSON null value. By default, fields
  1156. // with empty values are omitted from API requests. However, any field
  1157. // with an empty value appearing in NullFields will be sent to the
  1158. // server as null. It is an error if a field in this list has a
  1159. // non-empty value. This may be used to include null fields in Patch
  1160. // requests.
  1161. NullFields []string `json:"-"`
  1162. }
  1163. func (s *TransferCounters) MarshalJSON() ([]byte, error) {
  1164. type NoMethod TransferCounters
  1165. raw := NoMethod(*s)
  1166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1167. }
  1168. // TransferJob: This resource represents the configuration of a transfer
  1169. // job that runs
  1170. // periodically.
  1171. type TransferJob struct {
  1172. // CreationTime: This field cannot be changed by user requests.
  1173. CreationTime string `json:"creationTime,omitempty"`
  1174. // DeletionTime: This field cannot be changed by user requests.
  1175. DeletionTime string `json:"deletionTime,omitempty"`
  1176. // Description: A description provided by the user for the job. Its max
  1177. // length is 1024
  1178. // bytes when Unicode-encoded.
  1179. Description string `json:"description,omitempty"`
  1180. // LastModificationTime: This field cannot be changed by user requests.
  1181. LastModificationTime string `json:"lastModificationTime,omitempty"`
  1182. // Name: A globally unique name assigned by Storage Transfer Service
  1183. // when the
  1184. // job is created. This field should be left empty in requests to create
  1185. // a new
  1186. // transfer job; otherwise, the requests result in an
  1187. // `INVALID_ARGUMENT`
  1188. // error.
  1189. Name string `json:"name,omitempty"`
  1190. // ProjectId: The ID of the Google Cloud Platform Project that owns the
  1191. // job.
  1192. ProjectId string `json:"projectId,omitempty"`
  1193. // Schedule: Schedule specification.
  1194. Schedule *Schedule `json:"schedule,omitempty"`
  1195. // Status: Status of the job. This value MUST be specified
  1196. // for
  1197. // `CreateTransferJobRequests`.
  1198. //
  1199. // NOTE: The effect of the new job status takes place during a
  1200. // subsequent job
  1201. // run. For example, if you change the job status from `ENABLED`
  1202. // to
  1203. // `DISABLED`, and an operation spawned by the transfer is running, the
  1204. // status
  1205. // change would not affect the current operation.
  1206. //
  1207. // Possible values:
  1208. // "STATUS_UNSPECIFIED" - Zero is an illegal value.
  1209. // "ENABLED" - New transfers will be performed based on the schedule.
  1210. // "DISABLED" - New transfers will not be scheduled.
  1211. // "DELETED" - This is a soft delete state. After a transfer job is
  1212. // set to this
  1213. // state, the job and all the transfer executions are subject to
  1214. // garbage collection. Transfer jobs become eligible for garbage
  1215. // collection
  1216. // 30 days after their status is set to `DELETED`.
  1217. Status string `json:"status,omitempty"`
  1218. // TransferSpec: Transfer specification.
  1219. TransferSpec *TransferSpec `json:"transferSpec,omitempty"`
  1220. // ServerResponse contains the HTTP response code and headers from the
  1221. // server.
  1222. googleapi.ServerResponse `json:"-"`
  1223. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. // NullFields is a list of field names (e.g. "CreationTime") to include
  1231. // in API requests with the JSON null value. By default, fields with
  1232. // empty values are omitted from API requests. However, any field with
  1233. // an empty value appearing in NullFields will be sent to the server as
  1234. // null. It is an error if a field in this list has a non-empty value.
  1235. // This may be used to include null fields in Patch requests.
  1236. NullFields []string `json:"-"`
  1237. }
  1238. func (s *TransferJob) MarshalJSON() ([]byte, error) {
  1239. type NoMethod TransferJob
  1240. raw := NoMethod(*s)
  1241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1242. }
  1243. // TransferOperation: A description of the execution of a transfer.
  1244. type TransferOperation struct {
  1245. // Counters: Information about the progress of the transfer operation.
  1246. Counters *TransferCounters `json:"counters,omitempty"`
  1247. // EndTime: End time of this transfer execution.
  1248. EndTime string `json:"endTime,omitempty"`
  1249. // ErrorBreakdowns: Summarizes errors encountered with sample error log
  1250. // entries.
  1251. ErrorBreakdowns []*ErrorSummary `json:"errorBreakdowns,omitempty"`
  1252. // Name: A globally unique ID assigned by the system.
  1253. Name string `json:"name,omitempty"`
  1254. // ProjectId: The ID of the Google Cloud Platform Project that owns the
  1255. // operation.
  1256. // Required.
  1257. ProjectId string `json:"projectId,omitempty"`
  1258. // StartTime: Start time of this transfer execution.
  1259. StartTime string `json:"startTime,omitempty"`
  1260. // Status: Status of the transfer operation.
  1261. //
  1262. // Possible values:
  1263. // "STATUS_UNSPECIFIED" - Zero is an illegal value.
  1264. // "IN_PROGRESS" - In progress.
  1265. // "PAUSED" - Paused.
  1266. // "SUCCESS" - Completed successfully.
  1267. // "FAILED" - Terminated due to an unrecoverable failure.
  1268. // "ABORTED" - Aborted by the user.
  1269. Status string `json:"status,omitempty"`
  1270. // TransferJobName: The name of the transfer job that triggers this
  1271. // transfer operation.
  1272. TransferJobName string `json:"transferJobName,omitempty"`
  1273. // TransferSpec: Transfer specification.
  1274. // Required.
  1275. TransferSpec *TransferSpec `json:"transferSpec,omitempty"`
  1276. // ForceSendFields is a list of field names (e.g. "Counters") to
  1277. // unconditionally include in API requests. By default, fields with
  1278. // empty values are omitted from API requests. However, any non-pointer,
  1279. // non-interface field appearing in ForceSendFields will be sent to the
  1280. // server regardless of whether the field is empty or not. This may be
  1281. // used to include empty fields in Patch requests.
  1282. ForceSendFields []string `json:"-"`
  1283. // NullFields is a list of field names (e.g. "Counters") to include in
  1284. // API requests with the JSON null value. By default, fields with empty
  1285. // values are omitted from API requests. However, any field with an
  1286. // empty value appearing in NullFields will be sent to the server as
  1287. // null. It is an error if a field in this list has a non-empty value.
  1288. // This may be used to include null fields in Patch requests.
  1289. NullFields []string `json:"-"`
  1290. }
  1291. func (s *TransferOperation) MarshalJSON() ([]byte, error) {
  1292. type NoMethod TransferOperation
  1293. raw := NoMethod(*s)
  1294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1295. }
  1296. // TransferOptions: TransferOptions uses three boolean parameters to
  1297. // define the actions
  1298. // to be performed on objects in a transfer.
  1299. type TransferOptions struct {
  1300. // DeleteObjectsFromSourceAfterTransfer: Whether objects should be
  1301. // deleted from the source after they are
  1302. // transferred to the sink. Note that this option
  1303. // and
  1304. // `deleteObjectsUniqueInSink` are mutually exclusive.
  1305. DeleteObjectsFromSourceAfterTransfer bool `json:"deleteObjectsFromSourceAfterTransfer,omitempty"`
  1306. // DeleteObjectsUniqueInSink: Whether objects that exist only in the
  1307. // sink should be deleted. Note that
  1308. // this option and `deleteObjectsFromSourceAfterTransfer` are
  1309. // mutually
  1310. // exclusive.
  1311. DeleteObjectsUniqueInSink bool `json:"deleteObjectsUniqueInSink,omitempty"`
  1312. // OverwriteObjectsAlreadyExistingInSink: Whether overwriting objects
  1313. // that already exist in the sink is allowed.
  1314. OverwriteObjectsAlreadyExistingInSink bool `json:"overwriteObjectsAlreadyExistingInSink,omitempty"`
  1315. // ForceSendFields is a list of field names (e.g.
  1316. // "DeleteObjectsFromSourceAfterTransfer") to unconditionally include in
  1317. // API requests. By default, fields with empty values are omitted from
  1318. // API requests. However, any non-pointer, non-interface field appearing
  1319. // in ForceSendFields will be sent to the server regardless of whether
  1320. // the field is empty or not. This may be used to include empty fields
  1321. // in Patch requests.
  1322. ForceSendFields []string `json:"-"`
  1323. // NullFields is a list of field names (e.g.
  1324. // "DeleteObjectsFromSourceAfterTransfer") to include in API requests
  1325. // with the JSON null value. By default, fields with empty values are
  1326. // omitted from API requests. However, any field with an empty value
  1327. // appearing in NullFields will be sent to the server as null. It is an
  1328. // error if a field in this list has a non-empty value. This may be used
  1329. // to include null fields in Patch requests.
  1330. NullFields []string `json:"-"`
  1331. }
  1332. func (s *TransferOptions) MarshalJSON() ([]byte, error) {
  1333. type NoMethod TransferOptions
  1334. raw := NoMethod(*s)
  1335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1336. }
  1337. // TransferSpec: Configuration for running a transfer.
  1338. type TransferSpec struct {
  1339. // AwsS3DataSource: An AWS S3 data source.
  1340. AwsS3DataSource *AwsS3Data `json:"awsS3DataSource,omitempty"`
  1341. // GcsDataSink: A Google Cloud Storage data sink.
  1342. GcsDataSink *GcsData `json:"gcsDataSink,omitempty"`
  1343. // GcsDataSource: A Google Cloud Storage data source.
  1344. GcsDataSource *GcsData `json:"gcsDataSource,omitempty"`
  1345. // HttpDataSource: An HTTP URL data source.
  1346. HttpDataSource *HttpData `json:"httpDataSource,omitempty"`
  1347. // ObjectConditions: Only objects that satisfy these object conditions
  1348. // are included in the set
  1349. // of data source and data sink objects. Object conditions based
  1350. // on
  1351. // objects' `lastModificationTime` do not exclude objects in a data
  1352. // sink.
  1353. ObjectConditions *ObjectConditions `json:"objectConditions,omitempty"`
  1354. // TransferOptions: If the option `deleteObjectsUniqueInSink` is `true`,
  1355. // object conditions
  1356. // based on objects' `lastModificationTime` are ignored and do not
  1357. // exclude
  1358. // objects in a data source or a data sink.
  1359. TransferOptions *TransferOptions `json:"transferOptions,omitempty"`
  1360. // ForceSendFields is a list of field names (e.g. "AwsS3DataSource") to
  1361. // unconditionally include in API requests. By default, fields with
  1362. // empty values are omitted from API requests. However, any non-pointer,
  1363. // non-interface field appearing in ForceSendFields will be sent to the
  1364. // server regardless of whether the field is empty or not. This may be
  1365. // used to include empty fields in Patch requests.
  1366. ForceSendFields []string `json:"-"`
  1367. // NullFields is a list of field names (e.g. "AwsS3DataSource") to
  1368. // include in API requests with the JSON null value. By default, fields
  1369. // with empty values are omitted from API requests. However, any field
  1370. // with an empty value appearing in NullFields will be sent to the
  1371. // server as null. It is an error if a field in this list has a
  1372. // non-empty value. This may be used to include null fields in Patch
  1373. // requests.
  1374. NullFields []string `json:"-"`
  1375. }
  1376. func (s *TransferSpec) MarshalJSON() ([]byte, error) {
  1377. type NoMethod TransferSpec
  1378. raw := NoMethod(*s)
  1379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1380. }
  1381. // UpdateTransferJobRequest: Request passed to UpdateTransferJob.
  1382. type UpdateTransferJobRequest struct {
  1383. // ProjectId: The ID of the Google Cloud Platform Console project that
  1384. // owns the job.
  1385. // Required.
  1386. ProjectId string `json:"projectId,omitempty"`
  1387. // TransferJob: The job to update. `transferJob` is expected to specify
  1388. // only three fields:
  1389. // `description`, `transferSpec`, and `status`. An
  1390. // UpdateTransferJobRequest
  1391. // that specifies other fields will be rejected with an
  1392. // error
  1393. // `INVALID_ARGUMENT`.
  1394. // Required.
  1395. TransferJob *TransferJob `json:"transferJob,omitempty"`
  1396. // UpdateTransferJobFieldMask: The field mask of the fields in
  1397. // `transferJob` that are to be updated in
  1398. // this request. Fields in `transferJob` that can be updated
  1399. // are:
  1400. // `description`, `transferSpec`, and `status`. To update the
  1401. // `transferSpec`
  1402. // of the job, a complete transfer specification has to be provided.
  1403. // An
  1404. // incomplete specification which misses any required fields will be
  1405. // rejected
  1406. // with the error `INVALID_ARGUMENT`.
  1407. UpdateTransferJobFieldMask string `json:"updateTransferJobFieldMask,omitempty"`
  1408. // ForceSendFields is a list of field names (e.g. "ProjectId") to
  1409. // unconditionally include in API requests. By default, fields with
  1410. // empty values are omitted from API requests. However, any non-pointer,
  1411. // non-interface field appearing in ForceSendFields will be sent to the
  1412. // server regardless of whether the field is empty or not. This may be
  1413. // used to include empty fields in Patch requests.
  1414. ForceSendFields []string `json:"-"`
  1415. // NullFields is a list of field names (e.g. "ProjectId") to include in
  1416. // API requests with the JSON null value. By default, fields with empty
  1417. // values are omitted from API requests. However, any field with an
  1418. // empty value appearing in NullFields will be sent to the server as
  1419. // null. It is an error if a field in this list has a non-empty value.
  1420. // This may be used to include null fields in Patch requests.
  1421. NullFields []string `json:"-"`
  1422. }
  1423. func (s *UpdateTransferJobRequest) MarshalJSON() ([]byte, error) {
  1424. type NoMethod UpdateTransferJobRequest
  1425. raw := NoMethod(*s)
  1426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1427. }
  1428. // method id "storagetransfer.googleServiceAccounts.get":
  1429. type GoogleServiceAccountsGetCall struct {
  1430. s *Service
  1431. projectId string
  1432. urlParams_ gensupport.URLParams
  1433. ifNoneMatch_ string
  1434. ctx_ context.Context
  1435. header_ http.Header
  1436. }
  1437. // Get: Returns the Google service account that is used by Storage
  1438. // Transfer
  1439. // Service to access buckets in the project where transfers
  1440. // run or in other projects. Each Google service account is
  1441. // associated
  1442. // with one Google Cloud Platform Console project. Users
  1443. // should add this service account to the Google Cloud Storage
  1444. // bucket
  1445. // ACLs to grant access to Storage Transfer Service. This
  1446. // service
  1447. // account is created and owned by Storage Transfer Service and can
  1448. // only be used by Storage Transfer Service.
  1449. func (r *GoogleServiceAccountsService) Get(projectId string) *GoogleServiceAccountsGetCall {
  1450. c := &GoogleServiceAccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1451. c.projectId = projectId
  1452. return c
  1453. }
  1454. // Fields allows partial responses to be retrieved. See
  1455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1456. // for more information.
  1457. func (c *GoogleServiceAccountsGetCall) Fields(s ...googleapi.Field) *GoogleServiceAccountsGetCall {
  1458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1459. return c
  1460. }
  1461. // IfNoneMatch sets the optional parameter which makes the operation
  1462. // fail if the object's ETag matches the given value. This is useful for
  1463. // getting updates only after the object has changed since the last
  1464. // request. Use googleapi.IsNotModified to check whether the response
  1465. // error from Do is the result of In-None-Match.
  1466. func (c *GoogleServiceAccountsGetCall) IfNoneMatch(entityTag string) *GoogleServiceAccountsGetCall {
  1467. c.ifNoneMatch_ = entityTag
  1468. return c
  1469. }
  1470. // Context sets the context to be used in this call's Do method. Any
  1471. // pending HTTP request will be aborted if the provided context is
  1472. // canceled.
  1473. func (c *GoogleServiceAccountsGetCall) Context(ctx context.Context) *GoogleServiceAccountsGetCall {
  1474. c.ctx_ = ctx
  1475. return c
  1476. }
  1477. // Header returns an http.Header that can be modified by the caller to
  1478. // add HTTP headers to the request.
  1479. func (c *GoogleServiceAccountsGetCall) Header() http.Header {
  1480. if c.header_ == nil {
  1481. c.header_ = make(http.Header)
  1482. }
  1483. return c.header_
  1484. }
  1485. func (c *GoogleServiceAccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1486. reqHeaders := make(http.Header)
  1487. for k, v := range c.header_ {
  1488. reqHeaders[k] = v
  1489. }
  1490. reqHeaders.Set("User-Agent", c.s.userAgent())
  1491. if c.ifNoneMatch_ != "" {
  1492. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1493. }
  1494. var body io.Reader = nil
  1495. c.urlParams_.Set("alt", alt)
  1496. c.urlParams_.Set("prettyPrint", "false")
  1497. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/googleServiceAccounts/{projectId}")
  1498. urls += "?" + c.urlParams_.Encode()
  1499. req, err := http.NewRequest("GET", urls, body)
  1500. if err != nil {
  1501. return nil, err
  1502. }
  1503. req.Header = reqHeaders
  1504. googleapi.Expand(req.URL, map[string]string{
  1505. "projectId": c.projectId,
  1506. })
  1507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1508. }
  1509. // Do executes the "storagetransfer.googleServiceAccounts.get" call.
  1510. // Exactly one of *GoogleServiceAccount or error will be non-nil. Any
  1511. // non-2xx status code is an error. Response headers are in either
  1512. // *GoogleServiceAccount.ServerResponse.Header or (if a response was
  1513. // returned at all) in error.(*googleapi.Error).Header. Use
  1514. // googleapi.IsNotModified to check whether the returned error was
  1515. // because http.StatusNotModified was returned.
  1516. func (c *GoogleServiceAccountsGetCall) Do(opts ...googleapi.CallOption) (*GoogleServiceAccount, error) {
  1517. gensupport.SetOptions(c.urlParams_, opts...)
  1518. res, err := c.doRequest("json")
  1519. if res != nil && res.StatusCode == http.StatusNotModified {
  1520. if res.Body != nil {
  1521. res.Body.Close()
  1522. }
  1523. return nil, &googleapi.Error{
  1524. Code: res.StatusCode,
  1525. Header: res.Header,
  1526. }
  1527. }
  1528. if err != nil {
  1529. return nil, err
  1530. }
  1531. defer googleapi.CloseBody(res)
  1532. if err := googleapi.CheckResponse(res); err != nil {
  1533. return nil, err
  1534. }
  1535. ret := &GoogleServiceAccount{
  1536. ServerResponse: googleapi.ServerResponse{
  1537. Header: res.Header,
  1538. HTTPStatusCode: res.StatusCode,
  1539. },
  1540. }
  1541. target := &ret
  1542. if err := gensupport.DecodeResponse(target, res); err != nil {
  1543. return nil, err
  1544. }
  1545. return ret, nil
  1546. // {
  1547. // "description": "Returns the Google service account that is used by Storage Transfer\nService to access buckets in the project where transfers\nrun or in other projects. Each Google service account is associated\nwith one Google Cloud Platform Console project. Users\nshould add this service account to the Google Cloud Storage bucket\nACLs to grant access to Storage Transfer Service. This service\naccount is created and owned by Storage Transfer Service and can\nonly be used by Storage Transfer Service.",
  1548. // "flatPath": "v1/googleServiceAccounts/{projectId}",
  1549. // "httpMethod": "GET",
  1550. // "id": "storagetransfer.googleServiceAccounts.get",
  1551. // "parameterOrder": [
  1552. // "projectId"
  1553. // ],
  1554. // "parameters": {
  1555. // "projectId": {
  1556. // "description": "The ID of the Google Cloud Platform Console project that the Google service\naccount is associated with.\nRequired.",
  1557. // "location": "path",
  1558. // "required": true,
  1559. // "type": "string"
  1560. // }
  1561. // },
  1562. // "path": "v1/googleServiceAccounts/{projectId}",
  1563. // "response": {
  1564. // "$ref": "GoogleServiceAccount"
  1565. // },
  1566. // "scopes": [
  1567. // "https://www.googleapis.com/auth/cloud-platform"
  1568. // ]
  1569. // }
  1570. }
  1571. // method id "storagetransfer.transferJobs.create":
  1572. type TransferJobsCreateCall struct {
  1573. s *Service
  1574. transferjob *TransferJob
  1575. urlParams_ gensupport.URLParams
  1576. ctx_ context.Context
  1577. header_ http.Header
  1578. }
  1579. // Create: Creates a transfer job that runs periodically.
  1580. func (r *TransferJobsService) Create(transferjob *TransferJob) *TransferJobsCreateCall {
  1581. c := &TransferJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1582. c.transferjob = transferjob
  1583. return c
  1584. }
  1585. // Fields allows partial responses to be retrieved. See
  1586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1587. // for more information.
  1588. func (c *TransferJobsCreateCall) Fields(s ...googleapi.Field) *TransferJobsCreateCall {
  1589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1590. return c
  1591. }
  1592. // Context sets the context to be used in this call's Do method. Any
  1593. // pending HTTP request will be aborted if the provided context is
  1594. // canceled.
  1595. func (c *TransferJobsCreateCall) Context(ctx context.Context) *TransferJobsCreateCall {
  1596. c.ctx_ = ctx
  1597. return c
  1598. }
  1599. // Header returns an http.Header that can be modified by the caller to
  1600. // add HTTP headers to the request.
  1601. func (c *TransferJobsCreateCall) Header() http.Header {
  1602. if c.header_ == nil {
  1603. c.header_ = make(http.Header)
  1604. }
  1605. return c.header_
  1606. }
  1607. func (c *TransferJobsCreateCall) doRequest(alt string) (*http.Response, error) {
  1608. reqHeaders := make(http.Header)
  1609. for k, v := range c.header_ {
  1610. reqHeaders[k] = v
  1611. }
  1612. reqHeaders.Set("User-Agent", c.s.userAgent())
  1613. var body io.Reader = nil
  1614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferjob)
  1615. if err != nil {
  1616. return nil, err
  1617. }
  1618. reqHeaders.Set("Content-Type", "application/json")
  1619. c.urlParams_.Set("alt", alt)
  1620. c.urlParams_.Set("prettyPrint", "false")
  1621. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs")
  1622. urls += "?" + c.urlParams_.Encode()
  1623. req, err := http.NewRequest("POST", urls, body)
  1624. if err != nil {
  1625. return nil, err
  1626. }
  1627. req.Header = reqHeaders
  1628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1629. }
  1630. // Do executes the "storagetransfer.transferJobs.create" call.
  1631. // Exactly one of *TransferJob or error will be non-nil. Any non-2xx
  1632. // status code is an error. Response headers are in either
  1633. // *TransferJob.ServerResponse.Header or (if a response was returned at
  1634. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1635. // to check whether the returned error was because
  1636. // http.StatusNotModified was returned.
  1637. func (c *TransferJobsCreateCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
  1638. gensupport.SetOptions(c.urlParams_, opts...)
  1639. res, err := c.doRequest("json")
  1640. if res != nil && res.StatusCode == http.StatusNotModified {
  1641. if res.Body != nil {
  1642. res.Body.Close()
  1643. }
  1644. return nil, &googleapi.Error{
  1645. Code: res.StatusCode,
  1646. Header: res.Header,
  1647. }
  1648. }
  1649. if err != nil {
  1650. return nil, err
  1651. }
  1652. defer googleapi.CloseBody(res)
  1653. if err := googleapi.CheckResponse(res); err != nil {
  1654. return nil, err
  1655. }
  1656. ret := &TransferJob{
  1657. ServerResponse: googleapi.ServerResponse{
  1658. Header: res.Header,
  1659. HTTPStatusCode: res.StatusCode,
  1660. },
  1661. }
  1662. target := &ret
  1663. if err := gensupport.DecodeResponse(target, res); err != nil {
  1664. return nil, err
  1665. }
  1666. return ret, nil
  1667. // {
  1668. // "description": "Creates a transfer job that runs periodically.",
  1669. // "flatPath": "v1/transferJobs",
  1670. // "httpMethod": "POST",
  1671. // "id": "storagetransfer.transferJobs.create",
  1672. // "parameterOrder": [],
  1673. // "parameters": {},
  1674. // "path": "v1/transferJobs",
  1675. // "request": {
  1676. // "$ref": "TransferJob"
  1677. // },
  1678. // "response": {
  1679. // "$ref": "TransferJob"
  1680. // },
  1681. // "scopes": [
  1682. // "https://www.googleapis.com/auth/cloud-platform"
  1683. // ]
  1684. // }
  1685. }
  1686. // method id "storagetransfer.transferJobs.get":
  1687. type TransferJobsGetCall struct {
  1688. s *Service
  1689. jobName string
  1690. urlParams_ gensupport.URLParams
  1691. ifNoneMatch_ string
  1692. ctx_ context.Context
  1693. header_ http.Header
  1694. }
  1695. // Get: Gets a transfer job.
  1696. func (r *TransferJobsService) Get(jobName string) *TransferJobsGetCall {
  1697. c := &TransferJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1698. c.jobName = jobName
  1699. return c
  1700. }
  1701. // ProjectId sets the optional parameter "projectId": The ID of the
  1702. // Google Cloud Platform Console project that owns the job.
  1703. // Required.
  1704. func (c *TransferJobsGetCall) ProjectId(projectId string) *TransferJobsGetCall {
  1705. c.urlParams_.Set("projectId", projectId)
  1706. return c
  1707. }
  1708. // Fields allows partial responses to be retrieved. See
  1709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1710. // for more information.
  1711. func (c *TransferJobsGetCall) Fields(s ...googleapi.Field) *TransferJobsGetCall {
  1712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1713. return c
  1714. }
  1715. // IfNoneMatch sets the optional parameter which makes the operation
  1716. // fail if the object's ETag matches the given value. This is useful for
  1717. // getting updates only after the object has changed since the last
  1718. // request. Use googleapi.IsNotModified to check whether the response
  1719. // error from Do is the result of In-None-Match.
  1720. func (c *TransferJobsGetCall) IfNoneMatch(entityTag string) *TransferJobsGetCall {
  1721. c.ifNoneMatch_ = entityTag
  1722. return c
  1723. }
  1724. // Context sets the context to be used in this call's Do method. Any
  1725. // pending HTTP request will be aborted if the provided context is
  1726. // canceled.
  1727. func (c *TransferJobsGetCall) Context(ctx context.Context) *TransferJobsGetCall {
  1728. c.ctx_ = ctx
  1729. return c
  1730. }
  1731. // Header returns an http.Header that can be modified by the caller to
  1732. // add HTTP headers to the request.
  1733. func (c *TransferJobsGetCall) Header() http.Header {
  1734. if c.header_ == nil {
  1735. c.header_ = make(http.Header)
  1736. }
  1737. return c.header_
  1738. }
  1739. func (c *TransferJobsGetCall) doRequest(alt string) (*http.Response, error) {
  1740. reqHeaders := make(http.Header)
  1741. for k, v := range c.header_ {
  1742. reqHeaders[k] = v
  1743. }
  1744. reqHeaders.Set("User-Agent", c.s.userAgent())
  1745. if c.ifNoneMatch_ != "" {
  1746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1747. }
  1748. var body io.Reader = nil
  1749. c.urlParams_.Set("alt", alt)
  1750. c.urlParams_.Set("prettyPrint", "false")
  1751. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}")
  1752. urls += "?" + c.urlParams_.Encode()
  1753. req, err := http.NewRequest("GET", urls, body)
  1754. if err != nil {
  1755. return nil, err
  1756. }
  1757. req.Header = reqHeaders
  1758. googleapi.Expand(req.URL, map[string]string{
  1759. "jobName": c.jobName,
  1760. })
  1761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1762. }
  1763. // Do executes the "storagetransfer.transferJobs.get" call.
  1764. // Exactly one of *TransferJob or error will be non-nil. Any non-2xx
  1765. // status code is an error. Response headers are in either
  1766. // *TransferJob.ServerResponse.Header or (if a response was returned at
  1767. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1768. // to check whether the returned error was because
  1769. // http.StatusNotModified was returned.
  1770. func (c *TransferJobsGetCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
  1771. gensupport.SetOptions(c.urlParams_, opts...)
  1772. res, err := c.doRequest("json")
  1773. if res != nil && res.StatusCode == http.StatusNotModified {
  1774. if res.Body != nil {
  1775. res.Body.Close()
  1776. }
  1777. return nil, &googleapi.Error{
  1778. Code: res.StatusCode,
  1779. Header: res.Header,
  1780. }
  1781. }
  1782. if err != nil {
  1783. return nil, err
  1784. }
  1785. defer googleapi.CloseBody(res)
  1786. if err := googleapi.CheckResponse(res); err != nil {
  1787. return nil, err
  1788. }
  1789. ret := &TransferJob{
  1790. ServerResponse: googleapi.ServerResponse{
  1791. Header: res.Header,
  1792. HTTPStatusCode: res.StatusCode,
  1793. },
  1794. }
  1795. target := &ret
  1796. if err := gensupport.DecodeResponse(target, res); err != nil {
  1797. return nil, err
  1798. }
  1799. return ret, nil
  1800. // {
  1801. // "description": "Gets a transfer job.",
  1802. // "flatPath": "v1/transferJobs/{transferJobsId}",
  1803. // "httpMethod": "GET",
  1804. // "id": "storagetransfer.transferJobs.get",
  1805. // "parameterOrder": [
  1806. // "jobName"
  1807. // ],
  1808. // "parameters": {
  1809. // "jobName": {
  1810. // "description": "The job to get.\nRequired.",
  1811. // "location": "path",
  1812. // "pattern": "^transferJobs/.+$",
  1813. // "required": true,
  1814. // "type": "string"
  1815. // },
  1816. // "projectId": {
  1817. // "description": "The ID of the Google Cloud Platform Console project that owns the job.\nRequired.",
  1818. // "location": "query",
  1819. // "type": "string"
  1820. // }
  1821. // },
  1822. // "path": "v1/{+jobName}",
  1823. // "response": {
  1824. // "$ref": "TransferJob"
  1825. // },
  1826. // "scopes": [
  1827. // "https://www.googleapis.com/auth/cloud-platform"
  1828. // ]
  1829. // }
  1830. }
  1831. // method id "storagetransfer.transferJobs.list":
  1832. type TransferJobsListCall struct {
  1833. s *Service
  1834. urlParams_ gensupport.URLParams
  1835. ifNoneMatch_ string
  1836. ctx_ context.Context
  1837. header_ http.Header
  1838. }
  1839. // List: Lists transfer jobs.
  1840. func (r *TransferJobsService) List() *TransferJobsListCall {
  1841. c := &TransferJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1842. return c
  1843. }
  1844. // Filter sets the optional parameter "filter": A list of query
  1845. // parameters specified as JSON text in the form
  1846. // of
  1847. // {"project_id":"my_project_id",
  1848. // "job_names":["jobid1","jobid2",...],
  1849. //
  1850. // "job_statuses":["status1","status2",...]}.
  1851. // Since `job_names` and `job_statuses` support multiple values, their
  1852. // values
  1853. // must be specified with array notation. `project_id` is
  1854. // required.
  1855. // `job_names` and `job_statuses` are optional. The valid values
  1856. // for
  1857. // `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and
  1858. // `DELETED`.
  1859. func (c *TransferJobsListCall) Filter(filter string) *TransferJobsListCall {
  1860. c.urlParams_.Set("filter", filter)
  1861. return c
  1862. }
  1863. // PageSize sets the optional parameter "pageSize": The list page size.
  1864. // The max allowed value is 256.
  1865. func (c *TransferJobsListCall) PageSize(pageSize int64) *TransferJobsListCall {
  1866. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1867. return c
  1868. }
  1869. // PageToken sets the optional parameter "pageToken": The list page
  1870. // token.
  1871. func (c *TransferJobsListCall) PageToken(pageToken string) *TransferJobsListCall {
  1872. c.urlParams_.Set("pageToken", pageToken)
  1873. return c
  1874. }
  1875. // Fields allows partial responses to be retrieved. See
  1876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1877. // for more information.
  1878. func (c *TransferJobsListCall) Fields(s ...googleapi.Field) *TransferJobsListCall {
  1879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1880. return c
  1881. }
  1882. // IfNoneMatch sets the optional parameter which makes the operation
  1883. // fail if the object's ETag matches the given value. This is useful for
  1884. // getting updates only after the object has changed since the last
  1885. // request. Use googleapi.IsNotModified to check whether the response
  1886. // error from Do is the result of In-None-Match.
  1887. func (c *TransferJobsListCall) IfNoneMatch(entityTag string) *TransferJobsListCall {
  1888. c.ifNoneMatch_ = entityTag
  1889. return c
  1890. }
  1891. // Context sets the context to be used in this call's Do method. Any
  1892. // pending HTTP request will be aborted if the provided context is
  1893. // canceled.
  1894. func (c *TransferJobsListCall) Context(ctx context.Context) *TransferJobsListCall {
  1895. c.ctx_ = ctx
  1896. return c
  1897. }
  1898. // Header returns an http.Header that can be modified by the caller to
  1899. // add HTTP headers to the request.
  1900. func (c *TransferJobsListCall) Header() http.Header {
  1901. if c.header_ == nil {
  1902. c.header_ = make(http.Header)
  1903. }
  1904. return c.header_
  1905. }
  1906. func (c *TransferJobsListCall) doRequest(alt string) (*http.Response, error) {
  1907. reqHeaders := make(http.Header)
  1908. for k, v := range c.header_ {
  1909. reqHeaders[k] = v
  1910. }
  1911. reqHeaders.Set("User-Agent", c.s.userAgent())
  1912. if c.ifNoneMatch_ != "" {
  1913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1914. }
  1915. var body io.Reader = nil
  1916. c.urlParams_.Set("alt", alt)
  1917. c.urlParams_.Set("prettyPrint", "false")
  1918. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs")
  1919. urls += "?" + c.urlParams_.Encode()
  1920. req, err := http.NewRequest("GET", urls, body)
  1921. if err != nil {
  1922. return nil, err
  1923. }
  1924. req.Header = reqHeaders
  1925. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1926. }
  1927. // Do executes the "storagetransfer.transferJobs.list" call.
  1928. // Exactly one of *ListTransferJobsResponse or error will be non-nil.
  1929. // Any non-2xx status code is an error. Response headers are in either
  1930. // *ListTransferJobsResponse.ServerResponse.Header or (if a response was
  1931. // returned at all) in error.(*googleapi.Error).Header. Use
  1932. // googleapi.IsNotModified to check whether the returned error was
  1933. // because http.StatusNotModified was returned.
  1934. func (c *TransferJobsListCall) Do(opts ...googleapi.CallOption) (*ListTransferJobsResponse, error) {
  1935. gensupport.SetOptions(c.urlParams_, opts...)
  1936. res, err := c.doRequest("json")
  1937. if res != nil && res.StatusCode == http.StatusNotModified {
  1938. if res.Body != nil {
  1939. res.Body.Close()
  1940. }
  1941. return nil, &googleapi.Error{
  1942. Code: res.StatusCode,
  1943. Header: res.Header,
  1944. }
  1945. }
  1946. if err != nil {
  1947. return nil, err
  1948. }
  1949. defer googleapi.CloseBody(res)
  1950. if err := googleapi.CheckResponse(res); err != nil {
  1951. return nil, err
  1952. }
  1953. ret := &ListTransferJobsResponse{
  1954. ServerResponse: googleapi.ServerResponse{
  1955. Header: res.Header,
  1956. HTTPStatusCode: res.StatusCode,
  1957. },
  1958. }
  1959. target := &ret
  1960. if err := gensupport.DecodeResponse(target, res); err != nil {
  1961. return nil, err
  1962. }
  1963. return ret, nil
  1964. // {
  1965. // "description": "Lists transfer jobs.",
  1966. // "flatPath": "v1/transferJobs",
  1967. // "httpMethod": "GET",
  1968. // "id": "storagetransfer.transferJobs.list",
  1969. // "parameterOrder": [],
  1970. // "parameters": {
  1971. // "filter": {
  1972. // "description": "A list of query parameters specified as JSON text in the form of\n{\"project_id\":\"my_project_id\",\n\"job_names\":[\"jobid1\",\"jobid2\",...],\n\"job_statuses\":[\"status1\",\"status2\",...]}.\nSince `job_names` and `job_statuses` support multiple values, their values\nmust be specified with array notation. `project_id` is required.\n`job_names` and `job_statuses` are optional. The valid values for\n`job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.",
  1973. // "location": "query",
  1974. // "type": "string"
  1975. // },
  1976. // "pageSize": {
  1977. // "description": "The list page size. The max allowed value is 256.",
  1978. // "format": "int32",
  1979. // "location": "query",
  1980. // "type": "integer"
  1981. // },
  1982. // "pageToken": {
  1983. // "description": "The list page token.",
  1984. // "location": "query",
  1985. // "type": "string"
  1986. // }
  1987. // },
  1988. // "path": "v1/transferJobs",
  1989. // "response": {
  1990. // "$ref": "ListTransferJobsResponse"
  1991. // },
  1992. // "scopes": [
  1993. // "https://www.googleapis.com/auth/cloud-platform"
  1994. // ]
  1995. // }
  1996. }
  1997. // Pages invokes f for each page of results.
  1998. // A non-nil error returned from f will halt the iteration.
  1999. // The provided context supersedes any context provided to the Context method.
  2000. func (c *TransferJobsListCall) Pages(ctx context.Context, f func(*ListTransferJobsResponse) error) error {
  2001. c.ctx_ = ctx
  2002. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2003. for {
  2004. x, err := c.Do()
  2005. if err != nil {
  2006. return err
  2007. }
  2008. if err := f(x); err != nil {
  2009. return err
  2010. }
  2011. if x.NextPageToken == "" {
  2012. return nil
  2013. }
  2014. c.PageToken(x.NextPageToken)
  2015. }
  2016. }
  2017. // method id "storagetransfer.transferJobs.patch":
  2018. type TransferJobsPatchCall struct {
  2019. s *Service
  2020. jobName string
  2021. updatetransferjobrequest *UpdateTransferJobRequest
  2022. urlParams_ gensupport.URLParams
  2023. ctx_ context.Context
  2024. header_ http.Header
  2025. }
  2026. // Patch: Updates a transfer job. Updating a job's transfer spec does
  2027. // not affect
  2028. // transfer operations that are running already. Updating the
  2029. // scheduling
  2030. // of a job is not allowed.
  2031. func (r *TransferJobsService) Patch(jobName string, updatetransferjobrequest *UpdateTransferJobRequest) *TransferJobsPatchCall {
  2032. c := &TransferJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2033. c.jobName = jobName
  2034. c.updatetransferjobrequest = updatetransferjobrequest
  2035. return c
  2036. }
  2037. // Fields allows partial responses to be retrieved. See
  2038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2039. // for more information.
  2040. func (c *TransferJobsPatchCall) Fields(s ...googleapi.Field) *TransferJobsPatchCall {
  2041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2042. return c
  2043. }
  2044. // Context sets the context to be used in this call's Do method. Any
  2045. // pending HTTP request will be aborted if the provided context is
  2046. // canceled.
  2047. func (c *TransferJobsPatchCall) Context(ctx context.Context) *TransferJobsPatchCall {
  2048. c.ctx_ = ctx
  2049. return c
  2050. }
  2051. // Header returns an http.Header that can be modified by the caller to
  2052. // add HTTP headers to the request.
  2053. func (c *TransferJobsPatchCall) Header() http.Header {
  2054. if c.header_ == nil {
  2055. c.header_ = make(http.Header)
  2056. }
  2057. return c.header_
  2058. }
  2059. func (c *TransferJobsPatchCall) doRequest(alt string) (*http.Response, error) {
  2060. reqHeaders := make(http.Header)
  2061. for k, v := range c.header_ {
  2062. reqHeaders[k] = v
  2063. }
  2064. reqHeaders.Set("User-Agent", c.s.userAgent())
  2065. var body io.Reader = nil
  2066. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatetransferjobrequest)
  2067. if err != nil {
  2068. return nil, err
  2069. }
  2070. reqHeaders.Set("Content-Type", "application/json")
  2071. c.urlParams_.Set("alt", alt)
  2072. c.urlParams_.Set("prettyPrint", "false")
  2073. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}")
  2074. urls += "?" + c.urlParams_.Encode()
  2075. req, err := http.NewRequest("PATCH", urls, body)
  2076. if err != nil {
  2077. return nil, err
  2078. }
  2079. req.Header = reqHeaders
  2080. googleapi.Expand(req.URL, map[string]string{
  2081. "jobName": c.jobName,
  2082. })
  2083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2084. }
  2085. // Do executes the "storagetransfer.transferJobs.patch" call.
  2086. // Exactly one of *TransferJob or error will be non-nil. Any non-2xx
  2087. // status code is an error. Response headers are in either
  2088. // *TransferJob.ServerResponse.Header or (if a response was returned at
  2089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2090. // to check whether the returned error was because
  2091. // http.StatusNotModified was returned.
  2092. func (c *TransferJobsPatchCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
  2093. gensupport.SetOptions(c.urlParams_, opts...)
  2094. res, err := c.doRequest("json")
  2095. if res != nil && res.StatusCode == http.StatusNotModified {
  2096. if res.Body != nil {
  2097. res.Body.Close()
  2098. }
  2099. return nil, &googleapi.Error{
  2100. Code: res.StatusCode,
  2101. Header: res.Header,
  2102. }
  2103. }
  2104. if err != nil {
  2105. return nil, err
  2106. }
  2107. defer googleapi.CloseBody(res)
  2108. if err := googleapi.CheckResponse(res); err != nil {
  2109. return nil, err
  2110. }
  2111. ret := &TransferJob{
  2112. ServerResponse: googleapi.ServerResponse{
  2113. Header: res.Header,
  2114. HTTPStatusCode: res.StatusCode,
  2115. },
  2116. }
  2117. target := &ret
  2118. if err := gensupport.DecodeResponse(target, res); err != nil {
  2119. return nil, err
  2120. }
  2121. return ret, nil
  2122. // {
  2123. // "description": "Updates a transfer job. Updating a job's transfer spec does not affect\ntransfer operations that are running already. Updating the scheduling\nof a job is not allowed.",
  2124. // "flatPath": "v1/transferJobs/{transferJobsId}",
  2125. // "httpMethod": "PATCH",
  2126. // "id": "storagetransfer.transferJobs.patch",
  2127. // "parameterOrder": [
  2128. // "jobName"
  2129. // ],
  2130. // "parameters": {
  2131. // "jobName": {
  2132. // "description": "The name of job to update.\nRequired.",
  2133. // "location": "path",
  2134. // "pattern": "^transferJobs/.+$",
  2135. // "required": true,
  2136. // "type": "string"
  2137. // }
  2138. // },
  2139. // "path": "v1/{+jobName}",
  2140. // "request": {
  2141. // "$ref": "UpdateTransferJobRequest"
  2142. // },
  2143. // "response": {
  2144. // "$ref": "TransferJob"
  2145. // },
  2146. // "scopes": [
  2147. // "https://www.googleapis.com/auth/cloud-platform"
  2148. // ]
  2149. // }
  2150. }
  2151. // method id "storagetransfer.transferOperations.cancel":
  2152. type TransferOperationsCancelCall struct {
  2153. s *Service
  2154. name string
  2155. urlParams_ gensupport.URLParams
  2156. ctx_ context.Context
  2157. header_ http.Header
  2158. }
  2159. // Cancel: Cancels a transfer. Use the get method to check whether the
  2160. // cancellation succeeded or whether the operation completed despite
  2161. // cancellation.
  2162. func (r *TransferOperationsService) Cancel(name string) *TransferOperationsCancelCall {
  2163. c := &TransferOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2164. c.name = name
  2165. return c
  2166. }
  2167. // Fields allows partial responses to be retrieved. See
  2168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2169. // for more information.
  2170. func (c *TransferOperationsCancelCall) Fields(s ...googleapi.Field) *TransferOperationsCancelCall {
  2171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2172. return c
  2173. }
  2174. // Context sets the context to be used in this call's Do method. Any
  2175. // pending HTTP request will be aborted if the provided context is
  2176. // canceled.
  2177. func (c *TransferOperationsCancelCall) Context(ctx context.Context) *TransferOperationsCancelCall {
  2178. c.ctx_ = ctx
  2179. return c
  2180. }
  2181. // Header returns an http.Header that can be modified by the caller to
  2182. // add HTTP headers to the request.
  2183. func (c *TransferOperationsCancelCall) Header() http.Header {
  2184. if c.header_ == nil {
  2185. c.header_ = make(http.Header)
  2186. }
  2187. return c.header_
  2188. }
  2189. func (c *TransferOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  2190. reqHeaders := make(http.Header)
  2191. for k, v := range c.header_ {
  2192. reqHeaders[k] = v
  2193. }
  2194. reqHeaders.Set("User-Agent", c.s.userAgent())
  2195. var body io.Reader = nil
  2196. c.urlParams_.Set("alt", alt)
  2197. c.urlParams_.Set("prettyPrint", "false")
  2198. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  2199. urls += "?" + c.urlParams_.Encode()
  2200. req, err := http.NewRequest("POST", urls, body)
  2201. if err != nil {
  2202. return nil, err
  2203. }
  2204. req.Header = reqHeaders
  2205. googleapi.Expand(req.URL, map[string]string{
  2206. "name": c.name,
  2207. })
  2208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2209. }
  2210. // Do executes the "storagetransfer.transferOperations.cancel" call.
  2211. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2212. // code is an error. Response headers are in either
  2213. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2214. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2215. // check whether the returned error was because http.StatusNotModified
  2216. // was returned.
  2217. func (c *TransferOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2218. gensupport.SetOptions(c.urlParams_, opts...)
  2219. res, err := c.doRequest("json")
  2220. if res != nil && res.StatusCode == http.StatusNotModified {
  2221. if res.Body != nil {
  2222. res.Body.Close()
  2223. }
  2224. return nil, &googleapi.Error{
  2225. Code: res.StatusCode,
  2226. Header: res.Header,
  2227. }
  2228. }
  2229. if err != nil {
  2230. return nil, err
  2231. }
  2232. defer googleapi.CloseBody(res)
  2233. if err := googleapi.CheckResponse(res); err != nil {
  2234. return nil, err
  2235. }
  2236. ret := &Empty{
  2237. ServerResponse: googleapi.ServerResponse{
  2238. Header: res.Header,
  2239. HTTPStatusCode: res.StatusCode,
  2240. },
  2241. }
  2242. target := &ret
  2243. if err := gensupport.DecodeResponse(target, res); err != nil {
  2244. return nil, err
  2245. }
  2246. return ret, nil
  2247. // {
  2248. // "description": "Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.",
  2249. // "flatPath": "v1/transferOperations/{transferOperationsId}:cancel",
  2250. // "httpMethod": "POST",
  2251. // "id": "storagetransfer.transferOperations.cancel",
  2252. // "parameterOrder": [
  2253. // "name"
  2254. // ],
  2255. // "parameters": {
  2256. // "name": {
  2257. // "description": "The name of the operation resource to be cancelled.",
  2258. // "location": "path",
  2259. // "pattern": "^transferOperations/.+$",
  2260. // "required": true,
  2261. // "type": "string"
  2262. // }
  2263. // },
  2264. // "path": "v1/{+name}:cancel",
  2265. // "response": {
  2266. // "$ref": "Empty"
  2267. // },
  2268. // "scopes": [
  2269. // "https://www.googleapis.com/auth/cloud-platform"
  2270. // ]
  2271. // }
  2272. }
  2273. // method id "storagetransfer.transferOperations.delete":
  2274. type TransferOperationsDeleteCall struct {
  2275. s *Service
  2276. name string
  2277. urlParams_ gensupport.URLParams
  2278. ctx_ context.Context
  2279. header_ http.Header
  2280. }
  2281. // Delete: This method is not supported and the server returns
  2282. // `UNIMPLEMENTED`.
  2283. func (r *TransferOperationsService) Delete(name string) *TransferOperationsDeleteCall {
  2284. c := &TransferOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2285. c.name = name
  2286. return c
  2287. }
  2288. // Fields allows partial responses to be retrieved. See
  2289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2290. // for more information.
  2291. func (c *TransferOperationsDeleteCall) Fields(s ...googleapi.Field) *TransferOperationsDeleteCall {
  2292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2293. return c
  2294. }
  2295. // Context sets the context to be used in this call's Do method. Any
  2296. // pending HTTP request will be aborted if the provided context is
  2297. // canceled.
  2298. func (c *TransferOperationsDeleteCall) Context(ctx context.Context) *TransferOperationsDeleteCall {
  2299. c.ctx_ = ctx
  2300. return c
  2301. }
  2302. // Header returns an http.Header that can be modified by the caller to
  2303. // add HTTP headers to the request.
  2304. func (c *TransferOperationsDeleteCall) Header() http.Header {
  2305. if c.header_ == nil {
  2306. c.header_ = make(http.Header)
  2307. }
  2308. return c.header_
  2309. }
  2310. func (c *TransferOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2311. reqHeaders := make(http.Header)
  2312. for k, v := range c.header_ {
  2313. reqHeaders[k] = v
  2314. }
  2315. reqHeaders.Set("User-Agent", c.s.userAgent())
  2316. var body io.Reader = nil
  2317. c.urlParams_.Set("alt", alt)
  2318. c.urlParams_.Set("prettyPrint", "false")
  2319. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2320. urls += "?" + c.urlParams_.Encode()
  2321. req, err := http.NewRequest("DELETE", urls, body)
  2322. if err != nil {
  2323. return nil, err
  2324. }
  2325. req.Header = reqHeaders
  2326. googleapi.Expand(req.URL, map[string]string{
  2327. "name": c.name,
  2328. })
  2329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2330. }
  2331. // Do executes the "storagetransfer.transferOperations.delete" call.
  2332. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2333. // code is an error. Response headers are in either
  2334. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2335. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2336. // check whether the returned error was because http.StatusNotModified
  2337. // was returned.
  2338. func (c *TransferOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2339. gensupport.SetOptions(c.urlParams_, opts...)
  2340. res, err := c.doRequest("json")
  2341. if res != nil && res.StatusCode == http.StatusNotModified {
  2342. if res.Body != nil {
  2343. res.Body.Close()
  2344. }
  2345. return nil, &googleapi.Error{
  2346. Code: res.StatusCode,
  2347. Header: res.Header,
  2348. }
  2349. }
  2350. if err != nil {
  2351. return nil, err
  2352. }
  2353. defer googleapi.CloseBody(res)
  2354. if err := googleapi.CheckResponse(res); err != nil {
  2355. return nil, err
  2356. }
  2357. ret := &Empty{
  2358. ServerResponse: googleapi.ServerResponse{
  2359. Header: res.Header,
  2360. HTTPStatusCode: res.StatusCode,
  2361. },
  2362. }
  2363. target := &ret
  2364. if err := gensupport.DecodeResponse(target, res); err != nil {
  2365. return nil, err
  2366. }
  2367. return ret, nil
  2368. // {
  2369. // "description": "This method is not supported and the server returns `UNIMPLEMENTED`.",
  2370. // "flatPath": "v1/transferOperations/{transferOperationsId}",
  2371. // "httpMethod": "DELETE",
  2372. // "id": "storagetransfer.transferOperations.delete",
  2373. // "parameterOrder": [
  2374. // "name"
  2375. // ],
  2376. // "parameters": {
  2377. // "name": {
  2378. // "description": "The name of the operation resource to be deleted.",
  2379. // "location": "path",
  2380. // "pattern": "^transferOperations/.+$",
  2381. // "required": true,
  2382. // "type": "string"
  2383. // }
  2384. // },
  2385. // "path": "v1/{+name}",
  2386. // "response": {
  2387. // "$ref": "Empty"
  2388. // },
  2389. // "scopes": [
  2390. // "https://www.googleapis.com/auth/cloud-platform"
  2391. // ]
  2392. // }
  2393. }
  2394. // method id "storagetransfer.transferOperations.get":
  2395. type TransferOperationsGetCall struct {
  2396. s *Service
  2397. name string
  2398. urlParams_ gensupport.URLParams
  2399. ifNoneMatch_ string
  2400. ctx_ context.Context
  2401. header_ http.Header
  2402. }
  2403. // Get: Gets the latest state of a long-running operation. Clients can
  2404. // use this
  2405. // method to poll the operation result at intervals as recommended by
  2406. // the API
  2407. // service.
  2408. func (r *TransferOperationsService) Get(name string) *TransferOperationsGetCall {
  2409. c := &TransferOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2410. c.name = name
  2411. return c
  2412. }
  2413. // Fields allows partial responses to be retrieved. See
  2414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2415. // for more information.
  2416. func (c *TransferOperationsGetCall) Fields(s ...googleapi.Field) *TransferOperationsGetCall {
  2417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2418. return c
  2419. }
  2420. // IfNoneMatch sets the optional parameter which makes the operation
  2421. // fail if the object's ETag matches the given value. This is useful for
  2422. // getting updates only after the object has changed since the last
  2423. // request. Use googleapi.IsNotModified to check whether the response
  2424. // error from Do is the result of In-None-Match.
  2425. func (c *TransferOperationsGetCall) IfNoneMatch(entityTag string) *TransferOperationsGetCall {
  2426. c.ifNoneMatch_ = entityTag
  2427. return c
  2428. }
  2429. // Context sets the context to be used in this call's Do method. Any
  2430. // pending HTTP request will be aborted if the provided context is
  2431. // canceled.
  2432. func (c *TransferOperationsGetCall) Context(ctx context.Context) *TransferOperationsGetCall {
  2433. c.ctx_ = ctx
  2434. return c
  2435. }
  2436. // Header returns an http.Header that can be modified by the caller to
  2437. // add HTTP headers to the request.
  2438. func (c *TransferOperationsGetCall) Header() http.Header {
  2439. if c.header_ == nil {
  2440. c.header_ = make(http.Header)
  2441. }
  2442. return c.header_
  2443. }
  2444. func (c *TransferOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2445. reqHeaders := make(http.Header)
  2446. for k, v := range c.header_ {
  2447. reqHeaders[k] = v
  2448. }
  2449. reqHeaders.Set("User-Agent", c.s.userAgent())
  2450. if c.ifNoneMatch_ != "" {
  2451. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2452. }
  2453. var body io.Reader = nil
  2454. c.urlParams_.Set("alt", alt)
  2455. c.urlParams_.Set("prettyPrint", "false")
  2456. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2457. urls += "?" + c.urlParams_.Encode()
  2458. req, err := http.NewRequest("GET", urls, body)
  2459. if err != nil {
  2460. return nil, err
  2461. }
  2462. req.Header = reqHeaders
  2463. googleapi.Expand(req.URL, map[string]string{
  2464. "name": c.name,
  2465. })
  2466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2467. }
  2468. // Do executes the "storagetransfer.transferOperations.get" call.
  2469. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2470. // status code is an error. Response headers are in either
  2471. // *Operation.ServerResponse.Header or (if a response was returned at
  2472. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2473. // to check whether the returned error was because
  2474. // http.StatusNotModified was returned.
  2475. func (c *TransferOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2476. gensupport.SetOptions(c.urlParams_, opts...)
  2477. res, err := c.doRequest("json")
  2478. if res != nil && res.StatusCode == http.StatusNotModified {
  2479. if res.Body != nil {
  2480. res.Body.Close()
  2481. }
  2482. return nil, &googleapi.Error{
  2483. Code: res.StatusCode,
  2484. Header: res.Header,
  2485. }
  2486. }
  2487. if err != nil {
  2488. return nil, err
  2489. }
  2490. defer googleapi.CloseBody(res)
  2491. if err := googleapi.CheckResponse(res); err != nil {
  2492. return nil, err
  2493. }
  2494. ret := &Operation{
  2495. ServerResponse: googleapi.ServerResponse{
  2496. Header: res.Header,
  2497. HTTPStatusCode: res.StatusCode,
  2498. },
  2499. }
  2500. target := &ret
  2501. if err := gensupport.DecodeResponse(target, res); err != nil {
  2502. return nil, err
  2503. }
  2504. return ret, nil
  2505. // {
  2506. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  2507. // "flatPath": "v1/transferOperations/{transferOperationsId}",
  2508. // "httpMethod": "GET",
  2509. // "id": "storagetransfer.transferOperations.get",
  2510. // "parameterOrder": [
  2511. // "name"
  2512. // ],
  2513. // "parameters": {
  2514. // "name": {
  2515. // "description": "The name of the operation resource.",
  2516. // "location": "path",
  2517. // "pattern": "^transferOperations/.+$",
  2518. // "required": true,
  2519. // "type": "string"
  2520. // }
  2521. // },
  2522. // "path": "v1/{+name}",
  2523. // "response": {
  2524. // "$ref": "Operation"
  2525. // },
  2526. // "scopes": [
  2527. // "https://www.googleapis.com/auth/cloud-platform"
  2528. // ]
  2529. // }
  2530. }
  2531. // method id "storagetransfer.transferOperations.list":
  2532. type TransferOperationsListCall struct {
  2533. s *Service
  2534. name string
  2535. urlParams_ gensupport.URLParams
  2536. ifNoneMatch_ string
  2537. ctx_ context.Context
  2538. header_ http.Header
  2539. }
  2540. // List: Lists operations that match the specified filter in the
  2541. // request. If the
  2542. // server doesn't support this method, it returns
  2543. // `UNIMPLEMENTED`.
  2544. //
  2545. // NOTE: the `name` binding allows API services to override the
  2546. // binding
  2547. // to use different resource name schemes, such as `users/*/operations`.
  2548. // To
  2549. // override the binding, API services can add a binding such
  2550. // as
  2551. // "/v1/{name=users/*}/operations" to their service configuration.
  2552. // For backwards compatibility, the default name includes the
  2553. // operations
  2554. // collection id, however overriding users must ensure the name
  2555. // binding
  2556. // is the parent resource, without the operations collection id.
  2557. func (r *TransferOperationsService) List(name string) *TransferOperationsListCall {
  2558. c := &TransferOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2559. c.name = name
  2560. return c
  2561. }
  2562. // Filter sets the optional parameter "filter": A list of query
  2563. // parameters specified as JSON text in the form of {\"project_id\" :
  2564. // \"my_project_id\", \"job_names\" : [\"jobid1\", \"jobid2\",...],
  2565. // \"operation_names\" : [\"opid1\", \"opid2\",...],
  2566. // \"transfer_statuses\":[\"status1\", \"status2\",...]}. Since
  2567. // `job_names`, `operation_names`, and `transfer_statuses` support
  2568. // multiple values, they must be specified with array notation.
  2569. // `job_names`, `operation_names`, and `transfer_statuses` are optional.
  2570. func (c *TransferOperationsListCall) Filter(filter string) *TransferOperationsListCall {
  2571. c.urlParams_.Set("filter", filter)
  2572. return c
  2573. }
  2574. // PageSize sets the optional parameter "pageSize": The list page size.
  2575. // The max allowed value is 256.
  2576. func (c *TransferOperationsListCall) PageSize(pageSize int64) *TransferOperationsListCall {
  2577. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2578. return c
  2579. }
  2580. // PageToken sets the optional parameter "pageToken": The list page
  2581. // token.
  2582. func (c *TransferOperationsListCall) PageToken(pageToken string) *TransferOperationsListCall {
  2583. c.urlParams_.Set("pageToken", pageToken)
  2584. return c
  2585. }
  2586. // Fields allows partial responses to be retrieved. See
  2587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2588. // for more information.
  2589. func (c *TransferOperationsListCall) Fields(s ...googleapi.Field) *TransferOperationsListCall {
  2590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2591. return c
  2592. }
  2593. // IfNoneMatch sets the optional parameter which makes the operation
  2594. // fail if the object's ETag matches the given value. This is useful for
  2595. // getting updates only after the object has changed since the last
  2596. // request. Use googleapi.IsNotModified to check whether the response
  2597. // error from Do is the result of In-None-Match.
  2598. func (c *TransferOperationsListCall) IfNoneMatch(entityTag string) *TransferOperationsListCall {
  2599. c.ifNoneMatch_ = entityTag
  2600. return c
  2601. }
  2602. // Context sets the context to be used in this call's Do method. Any
  2603. // pending HTTP request will be aborted if the provided context is
  2604. // canceled.
  2605. func (c *TransferOperationsListCall) Context(ctx context.Context) *TransferOperationsListCall {
  2606. c.ctx_ = ctx
  2607. return c
  2608. }
  2609. // Header returns an http.Header that can be modified by the caller to
  2610. // add HTTP headers to the request.
  2611. func (c *TransferOperationsListCall) Header() http.Header {
  2612. if c.header_ == nil {
  2613. c.header_ = make(http.Header)
  2614. }
  2615. return c.header_
  2616. }
  2617. func (c *TransferOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2618. reqHeaders := make(http.Header)
  2619. for k, v := range c.header_ {
  2620. reqHeaders[k] = v
  2621. }
  2622. reqHeaders.Set("User-Agent", c.s.userAgent())
  2623. if c.ifNoneMatch_ != "" {
  2624. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2625. }
  2626. var body io.Reader = nil
  2627. c.urlParams_.Set("alt", alt)
  2628. c.urlParams_.Set("prettyPrint", "false")
  2629. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2630. urls += "?" + c.urlParams_.Encode()
  2631. req, err := http.NewRequest("GET", urls, body)
  2632. if err != nil {
  2633. return nil, err
  2634. }
  2635. req.Header = reqHeaders
  2636. googleapi.Expand(req.URL, map[string]string{
  2637. "name": c.name,
  2638. })
  2639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2640. }
  2641. // Do executes the "storagetransfer.transferOperations.list" call.
  2642. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2643. // non-2xx status code is an error. Response headers are in either
  2644. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2645. // returned at all) in error.(*googleapi.Error).Header. Use
  2646. // googleapi.IsNotModified to check whether the returned error was
  2647. // because http.StatusNotModified was returned.
  2648. func (c *TransferOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2649. gensupport.SetOptions(c.urlParams_, opts...)
  2650. res, err := c.doRequest("json")
  2651. if res != nil && res.StatusCode == http.StatusNotModified {
  2652. if res.Body != nil {
  2653. res.Body.Close()
  2654. }
  2655. return nil, &googleapi.Error{
  2656. Code: res.StatusCode,
  2657. Header: res.Header,
  2658. }
  2659. }
  2660. if err != nil {
  2661. return nil, err
  2662. }
  2663. defer googleapi.CloseBody(res)
  2664. if err := googleapi.CheckResponse(res); err != nil {
  2665. return nil, err
  2666. }
  2667. ret := &ListOperationsResponse{
  2668. ServerResponse: googleapi.ServerResponse{
  2669. Header: res.Header,
  2670. HTTPStatusCode: res.StatusCode,
  2671. },
  2672. }
  2673. target := &ret
  2674. if err := gensupport.DecodeResponse(target, res); err != nil {
  2675. return nil, err
  2676. }
  2677. return ret, nil
  2678. // {
  2679. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  2680. // "flatPath": "v1/transferOperations",
  2681. // "httpMethod": "GET",
  2682. // "id": "storagetransfer.transferOperations.list",
  2683. // "parameterOrder": [
  2684. // "name"
  2685. // ],
  2686. // "parameters": {
  2687. // "filter": {
  2688. // "description": "A list of query parameters specified as JSON text in the form of {\\\"project_id\\\" : \\\"my_project_id\\\", \\\"job_names\\\" : [\\\"jobid1\\\", \\\"jobid2\\\",...], \\\"operation_names\\\" : [\\\"opid1\\\", \\\"opid2\\\",...], \\\"transfer_statuses\\\":[\\\"status1\\\", \\\"status2\\\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `job_names`, `operation_names`, and `transfer_statuses` are optional.",
  2689. // "location": "query",
  2690. // "type": "string"
  2691. // },
  2692. // "name": {
  2693. // "description": "The value `transferOperations`.",
  2694. // "location": "path",
  2695. // "pattern": "^transferOperations$",
  2696. // "required": true,
  2697. // "type": "string"
  2698. // },
  2699. // "pageSize": {
  2700. // "description": "The list page size. The max allowed value is 256.",
  2701. // "format": "int32",
  2702. // "location": "query",
  2703. // "type": "integer"
  2704. // },
  2705. // "pageToken": {
  2706. // "description": "The list page token.",
  2707. // "location": "query",
  2708. // "type": "string"
  2709. // }
  2710. // },
  2711. // "path": "v1/{+name}",
  2712. // "response": {
  2713. // "$ref": "ListOperationsResponse"
  2714. // },
  2715. // "scopes": [
  2716. // "https://www.googleapis.com/auth/cloud-platform"
  2717. // ]
  2718. // }
  2719. }
  2720. // Pages invokes f for each page of results.
  2721. // A non-nil error returned from f will halt the iteration.
  2722. // The provided context supersedes any context provided to the Context method.
  2723. func (c *TransferOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2724. c.ctx_ = ctx
  2725. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2726. for {
  2727. x, err := c.Do()
  2728. if err != nil {
  2729. return err
  2730. }
  2731. if err := f(x); err != nil {
  2732. return err
  2733. }
  2734. if x.NextPageToken == "" {
  2735. return nil
  2736. }
  2737. c.PageToken(x.NextPageToken)
  2738. }
  2739. }
  2740. // method id "storagetransfer.transferOperations.pause":
  2741. type TransferOperationsPauseCall struct {
  2742. s *Service
  2743. name string
  2744. pausetransferoperationrequest *PauseTransferOperationRequest
  2745. urlParams_ gensupport.URLParams
  2746. ctx_ context.Context
  2747. header_ http.Header
  2748. }
  2749. // Pause: Pauses a transfer operation.
  2750. func (r *TransferOperationsService) Pause(name string, pausetransferoperationrequest *PauseTransferOperationRequest) *TransferOperationsPauseCall {
  2751. c := &TransferOperationsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2752. c.name = name
  2753. c.pausetransferoperationrequest = pausetransferoperationrequest
  2754. return c
  2755. }
  2756. // Fields allows partial responses to be retrieved. See
  2757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2758. // for more information.
  2759. func (c *TransferOperationsPauseCall) Fields(s ...googleapi.Field) *TransferOperationsPauseCall {
  2760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2761. return c
  2762. }
  2763. // Context sets the context to be used in this call's Do method. Any
  2764. // pending HTTP request will be aborted if the provided context is
  2765. // canceled.
  2766. func (c *TransferOperationsPauseCall) Context(ctx context.Context) *TransferOperationsPauseCall {
  2767. c.ctx_ = ctx
  2768. return c
  2769. }
  2770. // Header returns an http.Header that can be modified by the caller to
  2771. // add HTTP headers to the request.
  2772. func (c *TransferOperationsPauseCall) Header() http.Header {
  2773. if c.header_ == nil {
  2774. c.header_ = make(http.Header)
  2775. }
  2776. return c.header_
  2777. }
  2778. func (c *TransferOperationsPauseCall) doRequest(alt string) (*http.Response, error) {
  2779. reqHeaders := make(http.Header)
  2780. for k, v := range c.header_ {
  2781. reqHeaders[k] = v
  2782. }
  2783. reqHeaders.Set("User-Agent", c.s.userAgent())
  2784. var body io.Reader = nil
  2785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausetransferoperationrequest)
  2786. if err != nil {
  2787. return nil, err
  2788. }
  2789. reqHeaders.Set("Content-Type", "application/json")
  2790. c.urlParams_.Set("alt", alt)
  2791. c.urlParams_.Set("prettyPrint", "false")
  2792. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause")
  2793. urls += "?" + c.urlParams_.Encode()
  2794. req, err := http.NewRequest("POST", urls, body)
  2795. if err != nil {
  2796. return nil, err
  2797. }
  2798. req.Header = reqHeaders
  2799. googleapi.Expand(req.URL, map[string]string{
  2800. "name": c.name,
  2801. })
  2802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2803. }
  2804. // Do executes the "storagetransfer.transferOperations.pause" call.
  2805. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2806. // code is an error. Response headers are in either
  2807. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2808. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2809. // check whether the returned error was because http.StatusNotModified
  2810. // was returned.
  2811. func (c *TransferOperationsPauseCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2812. gensupport.SetOptions(c.urlParams_, opts...)
  2813. res, err := c.doRequest("json")
  2814. if res != nil && res.StatusCode == http.StatusNotModified {
  2815. if res.Body != nil {
  2816. res.Body.Close()
  2817. }
  2818. return nil, &googleapi.Error{
  2819. Code: res.StatusCode,
  2820. Header: res.Header,
  2821. }
  2822. }
  2823. if err != nil {
  2824. return nil, err
  2825. }
  2826. defer googleapi.CloseBody(res)
  2827. if err := googleapi.CheckResponse(res); err != nil {
  2828. return nil, err
  2829. }
  2830. ret := &Empty{
  2831. ServerResponse: googleapi.ServerResponse{
  2832. Header: res.Header,
  2833. HTTPStatusCode: res.StatusCode,
  2834. },
  2835. }
  2836. target := &ret
  2837. if err := gensupport.DecodeResponse(target, res); err != nil {
  2838. return nil, err
  2839. }
  2840. return ret, nil
  2841. // {
  2842. // "description": "Pauses a transfer operation.",
  2843. // "flatPath": "v1/transferOperations/{transferOperationsId}:pause",
  2844. // "httpMethod": "POST",
  2845. // "id": "storagetransfer.transferOperations.pause",
  2846. // "parameterOrder": [
  2847. // "name"
  2848. // ],
  2849. // "parameters": {
  2850. // "name": {
  2851. // "description": "The name of the transfer operation.\nRequired.",
  2852. // "location": "path",
  2853. // "pattern": "^transferOperations/.+$",
  2854. // "required": true,
  2855. // "type": "string"
  2856. // }
  2857. // },
  2858. // "path": "v1/{+name}:pause",
  2859. // "request": {
  2860. // "$ref": "PauseTransferOperationRequest"
  2861. // },
  2862. // "response": {
  2863. // "$ref": "Empty"
  2864. // },
  2865. // "scopes": [
  2866. // "https://www.googleapis.com/auth/cloud-platform"
  2867. // ]
  2868. // }
  2869. }
  2870. // method id "storagetransfer.transferOperations.resume":
  2871. type TransferOperationsResumeCall struct {
  2872. s *Service
  2873. name string
  2874. resumetransferoperationrequest *ResumeTransferOperationRequest
  2875. urlParams_ gensupport.URLParams
  2876. ctx_ context.Context
  2877. header_ http.Header
  2878. }
  2879. // Resume: Resumes a transfer operation that is paused.
  2880. func (r *TransferOperationsService) Resume(name string, resumetransferoperationrequest *ResumeTransferOperationRequest) *TransferOperationsResumeCall {
  2881. c := &TransferOperationsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2882. c.name = name
  2883. c.resumetransferoperationrequest = resumetransferoperationrequest
  2884. return c
  2885. }
  2886. // Fields allows partial responses to be retrieved. See
  2887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2888. // for more information.
  2889. func (c *TransferOperationsResumeCall) Fields(s ...googleapi.Field) *TransferOperationsResumeCall {
  2890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2891. return c
  2892. }
  2893. // Context sets the context to be used in this call's Do method. Any
  2894. // pending HTTP request will be aborted if the provided context is
  2895. // canceled.
  2896. func (c *TransferOperationsResumeCall) Context(ctx context.Context) *TransferOperationsResumeCall {
  2897. c.ctx_ = ctx
  2898. return c
  2899. }
  2900. // Header returns an http.Header that can be modified by the caller to
  2901. // add HTTP headers to the request.
  2902. func (c *TransferOperationsResumeCall) Header() http.Header {
  2903. if c.header_ == nil {
  2904. c.header_ = make(http.Header)
  2905. }
  2906. return c.header_
  2907. }
  2908. func (c *TransferOperationsResumeCall) doRequest(alt string) (*http.Response, error) {
  2909. reqHeaders := make(http.Header)
  2910. for k, v := range c.header_ {
  2911. reqHeaders[k] = v
  2912. }
  2913. reqHeaders.Set("User-Agent", c.s.userAgent())
  2914. var body io.Reader = nil
  2915. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumetransferoperationrequest)
  2916. if err != nil {
  2917. return nil, err
  2918. }
  2919. reqHeaders.Set("Content-Type", "application/json")
  2920. c.urlParams_.Set("alt", alt)
  2921. c.urlParams_.Set("prettyPrint", "false")
  2922. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume")
  2923. urls += "?" + c.urlParams_.Encode()
  2924. req, err := http.NewRequest("POST", urls, body)
  2925. if err != nil {
  2926. return nil, err
  2927. }
  2928. req.Header = reqHeaders
  2929. googleapi.Expand(req.URL, map[string]string{
  2930. "name": c.name,
  2931. })
  2932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2933. }
  2934. // Do executes the "storagetransfer.transferOperations.resume" call.
  2935. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2936. // code is an error. Response headers are in either
  2937. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2938. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2939. // check whether the returned error was because http.StatusNotModified
  2940. // was returned.
  2941. func (c *TransferOperationsResumeCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2942. gensupport.SetOptions(c.urlParams_, opts...)
  2943. res, err := c.doRequest("json")
  2944. if res != nil && res.StatusCode == http.StatusNotModified {
  2945. if res.Body != nil {
  2946. res.Body.Close()
  2947. }
  2948. return nil, &googleapi.Error{
  2949. Code: res.StatusCode,
  2950. Header: res.Header,
  2951. }
  2952. }
  2953. if err != nil {
  2954. return nil, err
  2955. }
  2956. defer googleapi.CloseBody(res)
  2957. if err := googleapi.CheckResponse(res); err != nil {
  2958. return nil, err
  2959. }
  2960. ret := &Empty{
  2961. ServerResponse: googleapi.ServerResponse{
  2962. Header: res.Header,
  2963. HTTPStatusCode: res.StatusCode,
  2964. },
  2965. }
  2966. target := &ret
  2967. if err := gensupport.DecodeResponse(target, res); err != nil {
  2968. return nil, err
  2969. }
  2970. return ret, nil
  2971. // {
  2972. // "description": "Resumes a transfer operation that is paused.",
  2973. // "flatPath": "v1/transferOperations/{transferOperationsId}:resume",
  2974. // "httpMethod": "POST",
  2975. // "id": "storagetransfer.transferOperations.resume",
  2976. // "parameterOrder": [
  2977. // "name"
  2978. // ],
  2979. // "parameters": {
  2980. // "name": {
  2981. // "description": "The name of the transfer operation.\nRequired.",
  2982. // "location": "path",
  2983. // "pattern": "^transferOperations/.+$",
  2984. // "required": true,
  2985. // "type": "string"
  2986. // }
  2987. // },
  2988. // "path": "v1/{+name}:resume",
  2989. // "request": {
  2990. // "$ref": "ResumeTransferOperationRequest"
  2991. // },
  2992. // "response": {
  2993. // "$ref": "Empty"
  2994. // },
  2995. // "scopes": [
  2996. // "https://www.googleapis.com/auth/cloud-platform"
  2997. // ]
  2998. // }
  2999. }