Debian Codegraph @

storagetransfer/v1/storagetransfer-gen.go

raw
1 // Copyright 2026 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
5 // Code generated file. DO NOT EDIT.
6
7 // Package storagetransfer provides access to the Storage Transfer API.
8 //
9 // For product documentation, see: https://cloud.google.com/storage-transfer/docs
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/storagetransfer/v1"
27 // ...
28 // ctx := context.Background()
29 // storagetransferService, err := storagetransfer.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // storagetransferService, err := storagetransfer.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // storagetransferService, err := storagetransfer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package storagetransfer // import "google.golang.org/api/storagetransfer/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "storagetransfer:v1"
93 const apiName = "storagetransfer"
94 const apiVersion = "v1"
95 const basePath = "https://storagetransfer.googleapis.com/"
96 const basePathTemplate = "https://storagetransfer.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://storagetransfer.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, edit, configure, and delete your Google Cloud data and see the email
102 // address for your Google Account.
103 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
104 )
105
106 // NewService creates a new Service.
107 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108 scopesOption := internaloption.WithDefaultScopes(
109 "https://www.googleapis.com/auth/cloud-platform",
110 )
111 // NOTE: prepend, so we don't override user-specified scopes.
112 opts = append([]option.ClientOption{scopesOption}, opts...)
113 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
114 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
115 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
116 opts = append(opts, internaloption.EnableNewAuthLibrary())
117 client, endpoint, err := htransport.NewClient(ctx, opts...)
118 if err != nil {
119 return nil, err
120 }
121 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
122 s.GoogleServiceAccounts = NewGoogleServiceAccountsService(s)
123 s.Projects = NewProjectsService(s)
124 s.TransferJobs = NewTransferJobsService(s)
125 s.TransferOperations = NewTransferOperationsService(s)
126 if endpoint != "" {
127 s.BasePath = endpoint
128 }
129 return s, nil
130 }
131
132 // New creates a new Service. It uses the provided http.Client for requests.
133 //
134 // Deprecated: please use NewService instead.
135 // To provide a custom HTTP client, use option.WithHTTPClient.
136 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
137 func New(client *http.Client) (*Service, error) {
138 if client == nil {
139 return nil, errors.New("client is nil")
140 }
141 return NewService(context.TODO(), option.WithHTTPClient(client))
142 }
143
144 type Service struct {
145 client *http.Client
146 logger *slog.Logger
147 BasePath string // API endpoint base URL
148 UserAgent string // optional additional User-Agent fragment
149
150 GoogleServiceAccounts *GoogleServiceAccountsService
151
152 Projects *ProjectsService
153
154 TransferJobs *TransferJobsService
155
156 TransferOperations *TransferOperationsService
157 }
158
159 func (s *Service) userAgent() string {
160 if s.UserAgent == "" {
161 return googleapi.UserAgent
162 }
163 return googleapi.UserAgent + " " + s.UserAgent
164 }
165
166 func NewGoogleServiceAccountsService(s *Service) *GoogleServiceAccountsService {
167 rs := &GoogleServiceAccountsService{s: s}
168 return rs
169 }
170
171 type GoogleServiceAccountsService struct {
172 s *Service
173 }
174
175 func NewProjectsService(s *Service) *ProjectsService {
176 rs := &ProjectsService{s: s}
177 rs.AgentPools = NewProjectsAgentPoolsService(s)
178 return rs
179 }
180
181 type ProjectsService struct {
182 s *Service
183
184 AgentPools *ProjectsAgentPoolsService
185 }
186
187 func NewProjectsAgentPoolsService(s *Service) *ProjectsAgentPoolsService {
188 rs := &ProjectsAgentPoolsService{s: s}
189 return rs
190 }
191
192 type ProjectsAgentPoolsService struct {
193 s *Service
194 }
195
196 func NewTransferJobsService(s *Service) *TransferJobsService {
197 rs := &TransferJobsService{s: s}
198 return rs
199 }
200
201 type TransferJobsService struct {
202 s *Service
203 }
204
205 func NewTransferOperationsService(s *Service) *TransferOperationsService {
206 rs := &TransferOperationsService{s: s}
207 return rs
208 }
209
210 type TransferOperationsService struct {
211 s *Service
212 }
213
214 // AgentPool: Represents an agent pool.
215 type AgentPool struct {
216 // BandwidthLimit: Specifies the bandwidth limit details. If this field is
217 // unspecified, the default value is set as 'No Limit'.
218 BandwidthLimit *BandwidthLimit `json:"bandwidthLimit,omitempty"`
219 // DisplayName: Specifies the client-specified AgentPool description.
220 DisplayName string `json:"displayName,omitempty"`
221 // Name: Required. Specifies a unique string that identifies the agent pool.
222 // Format: `projects/{project_id}/agentPools/{agent_pool_id}`
223 Name string `json:"name,omitempty"`
224 // State: Output only. Specifies the state of the AgentPool.
225 //
226 // Possible values:
227 // "STATE_UNSPECIFIED" - Default value. This value is unused.
228 // "CREATING" - This is an initialization state. During this stage, resources
229 // are allocated for the AgentPool.
230 // "CREATED" - Determines that the AgentPool is created for use. At this
231 // state, Agents can join the AgentPool and participate in the transfer jobs in
232 // that pool.
233 // "DELETING" - Determines that the AgentPool deletion has been initiated,
234 // and all the resources are scheduled to be cleaned up and freed.
235 State string `json:"state,omitempty"`
236
237 // ServerResponse contains the HTTP response code and headers from the server.
238 googleapi.ServerResponse `json:"-"`
239 // ForceSendFields is a list of field names (e.g. "BandwidthLimit") to
240 // unconditionally include in API requests. By default, fields with empty or
241 // default values are omitted from API requests. See
242 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
243 // details.
244 ForceSendFields []string `json:"-"`
245 // NullFields is a list of field names (e.g. "BandwidthLimit") to include in
246 // API requests with the JSON null value. By default, fields with empty values
247 // are omitted from API requests. See
248 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
249 NullFields []string `json:"-"`
250 }
251
252 func (s AgentPool) MarshalJSON() ([]byte, error) {
253 type NoMethod AgentPool
254 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
255 }
256
257 // AwsAccessKey: AWS access key (see AWS Security Credentials
258 // (https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)).
259 // For information on our data retention policy for user credentials, see User
260 // credentials (/storage-transfer/docs/data-retention#user-credentials).
261 type AwsAccessKey struct {
262 // AccessKeyId: Required. AWS access key ID.
263 AccessKeyId string `json:"accessKeyId,omitempty"`
264 // SecretAccessKey: Required. AWS secret access key. This field is not returned
265 // in RPC responses.
266 SecretAccessKey string `json:"secretAccessKey,omitempty"`
267 // ForceSendFields is a list of field names (e.g. "AccessKeyId") to
268 // unconditionally include in API requests. By default, fields with empty or
269 // default values are omitted from API requests. See
270 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
271 // details.
272 ForceSendFields []string `json:"-"`
273 // NullFields is a list of field names (e.g. "AccessKeyId") to include in API
274 // requests with the JSON null value. By default, fields with empty values are
275 // omitted from API requests. See
276 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
277 NullFields []string `json:"-"`
278 }
279
280 func (s AwsAccessKey) MarshalJSON() ([]byte, error) {
281 type NoMethod AwsAccessKey
282 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
283 }
284
285 // AwsS3CompatibleData: An AwsS3CompatibleData resource.
286 type AwsS3CompatibleData struct {
287 // BucketName: Required. Specifies the name of the bucket.
288 BucketName string `json:"bucketName,omitempty"`
289 // Endpoint: Required. Specifies the endpoint of the storage service.
290 Endpoint string `json:"endpoint,omitempty"`
291 // Path: Specifies the root path to transfer objects. Must be an empty string
292 // or full path name that ends with a '/'. This field is treated as an object
293 // prefix. As such, it should generally not begin with a '/'.
294 Path string `json:"path,omitempty"`
295 // Region: Specifies the region to sign requests with. This can be left blank
296 // if requests should be signed with an empty region.
297 Region string `json:"region,omitempty"`
298 // S3Metadata: A S3 compatible metadata.
299 S3Metadata *S3CompatibleMetadata `json:"s3Metadata,omitempty"`
300 // ForceSendFields is a list of field names (e.g. "BucketName") to
301 // unconditionally include in API requests. By default, fields with empty or
302 // default values are omitted from API requests. See
303 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
304 // details.
305 ForceSendFields []string `json:"-"`
306 // NullFields is a list of field names (e.g. "BucketName") to include in API
307 // requests with the JSON null value. By default, fields with empty values are
308 // omitted from API requests. See
309 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
310 NullFields []string `json:"-"`
311 }
312
313 func (s AwsS3CompatibleData) MarshalJSON() ([]byte, error) {
314 type NoMethod AwsS3CompatibleData
315 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
316 }
317
318 // AwsS3Data: An AwsS3Data resource can be a data source, but not a data sink.
319 // In an AwsS3Data resource, an object's name is the S3 object's key name.
320 type AwsS3Data struct {
321 // AwsAccessKey: Input only. AWS access key used to sign the API requests to
322 // the AWS S3 bucket. Permissions on the bucket must be granted to the access
323 // ID of the AWS access key. For information on our data retention policy for
324 // user credentials, see User credentials
325 // (/storage-transfer/docs/data-retention#user-credentials).
326 AwsAccessKey *AwsAccessKey `json:"awsAccessKey,omitempty"`
327 // BucketName: Required. S3 Bucket name (see Creating a bucket
328 // (https://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)).
329 BucketName string `json:"bucketName,omitempty"`
330 // CloudfrontDomain: Optional. The CloudFront distribution domain name pointing
331 // to this bucket, to use when fetching. See Transfer from S3 via CloudFront
332 // (https://cloud.google.com/storage-transfer/docs/s3-cloudfront) for more
333 // information. Format: `https://{id}.cloudfront.net` or any valid custom
334 // domain. Must begin with `https://`.
335 CloudfrontDomain string `json:"cloudfrontDomain,omitempty"`
336 // CredentialsSecret: Optional. The Resource name of a secret in Secret
337 // Manager. AWS credentials must be stored in Secret Manager in JSON format: {
338 // "access_key_id": "ACCESS_KEY_ID", "secret_access_key": "SECRET_ACCESS_KEY" }
339 // GoogleServiceAccount must be granted `roles/secretmanager.secretAccessor`
340 // for the resource. See [Configure access to a source: Amazon S3]
341 // (https://cloud.google.com/storage-transfer/docs/source-amazon-s3#secret_manager)
342 // for more information. If `credentials_secret` is specified, do not specify
343 // role_arn or aws_access_key. Format:
344 // `projects/{project_number}/secrets/{secret_name}`
345 CredentialsSecret string `json:"credentialsSecret,omitempty"`
346 // ManagedPrivateNetwork: Egress bytes over a Google-managed private network.
347 // This network is shared between other users of Storage Transfer Service.
348 ManagedPrivateNetwork bool `json:"managedPrivateNetwork,omitempty"`
349 // Path: Root path to transfer objects. Must be an empty string or full path
350 // name that ends with a '/'. This field is treated as an object prefix. As
351 // such, it should generally not begin with a '/'.
352 Path string `json:"path,omitempty"`
353 // PrivateNetworkService: Service Directory Service to be used as the endpoint
354 // for transfers from a custom VPC. Format:
355 // `projects/{project_id}/locations/{location}/namespaces/{namespace}/services/{
356 // service}`
357 PrivateNetworkService string `json:"privateNetworkService,omitempty"`
358 // RoleArn: The Amazon Resource Name (ARN) of the role to support temporary
359 // credentials via `AssumeRoleWithWebIdentity`. For more information about
360 // ARNs, see IAM ARNs
361 // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns).
362 // When a role ARN is provided, Transfer Service fetches temporary credentials
363 // for the session using a `AssumeRoleWithWebIdentity` call for the provided
364 // role using the GoogleServiceAccount for this project.
365 RoleArn string `json:"roleArn,omitempty"`
366 // ForceSendFields is a list of field names (e.g. "AwsAccessKey") to
367 // unconditionally include in API requests. By default, fields with empty or
368 // default values are omitted from API requests. See
369 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
370 // details.
371 ForceSendFields []string `json:"-"`
372 // NullFields is a list of field names (e.g. "AwsAccessKey") to include in API
373 // requests with the JSON null value. By default, fields with empty values are
374 // omitted from API requests. See
375 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
376 NullFields []string `json:"-"`
377 }
378
379 func (s AwsS3Data) MarshalJSON() ([]byte, error) {
380 type NoMethod AwsS3Data
381 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
382 }
383
384 // AzureBlobStorageData: An AzureBlobStorageData resource can be a data source,
385 // but not a data sink. An AzureBlobStorageData resource represents one Azure
386 // container. The storage account determines the Azure endpoint
387 // (https://docs.microsoft.com/en-us/azure/storage/common/storage-create-storage-account#storage-account-endpoints).
388 // In an AzureBlobStorageData resource, a blobs's name is the Azure Blob
389 // Storage blob's key name
390 // (https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#blob-names).
391 type AzureBlobStorageData struct {
392 // AzureCredentials: Required. Input only. Credentials used to authenticate API
393 // requests to Azure. For information on our data retention policy for user
394 // credentials, see User credentials
395 // (/storage-transfer/docs/data-retention#user-credentials).
396 AzureCredentials *AzureCredentials `json:"azureCredentials,omitempty"`
397 // Container: Required. The container to transfer from the Azure Storage
398 // account.
399 Container string `json:"container,omitempty"`
400 // CredentialsSecret: Optional. The Resource name of a secret in Secret
401 // Manager. The Azure SAS token must be stored in Secret Manager in JSON
402 // format: { "sas_token" : "SAS_TOKEN" } GoogleServiceAccount must be granted
403 // `roles/secretmanager.secretAccessor` for the resource. See [Configure access
404 // to a source: Microsoft Azure Blob Storage]
405 // (https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#secret_manager)
406 // for more information. If `credentials_secret` is specified, do not specify
407 // azure_credentials. Format: `projects/{project_number}/secrets/{secret_name}`
408 CredentialsSecret string `json:"credentialsSecret,omitempty"`
409 // FederatedIdentityConfig: Optional. Federated identity config of a user
410 // registered Azure application. If `federated_identity_config` is specified,
411 // do not specify azure_credentials or credentials_secret.
412 FederatedIdentityConfig *FederatedIdentityConfig `json:"federatedIdentityConfig,omitempty"`
413 // Path: Root path to transfer objects. Must be an empty string or full path
414 // name that ends with a '/'. This field is treated as an object prefix. As
415 // such, it should generally not begin with a '/'.
416 Path string `json:"path,omitempty"`
417 // PrivateNetworkService: Service Directory Service to be used as the endpoint
418 // for transfers from a custom VPC. Format:
419 // `projects/{project_id}/locations/{location}/namespaces/{namespace}/services/{
420 // service}`
421 PrivateNetworkService string `json:"privateNetworkService,omitempty"`
422 // StorageAccount: Required. The name of the Azure Storage account.
423 StorageAccount string `json:"storageAccount,omitempty"`
424 // ForceSendFields is a list of field names (e.g. "AzureCredentials") to
425 // unconditionally include in API requests. By default, fields with empty or
426 // default values are omitted from API requests. See
427 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
428 // details.
429 ForceSendFields []string `json:"-"`
430 // NullFields is a list of field names (e.g. "AzureCredentials") to include in
431 // API requests with the JSON null value. By default, fields with empty values
432 // are omitted from API requests. See
433 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
434 NullFields []string `json:"-"`
435 }
436
437 func (s AzureBlobStorageData) MarshalJSON() ([]byte, error) {
438 type NoMethod AzureBlobStorageData
439 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
440 }
441
442 // AzureCredentials: Azure credentials For information on our data retention
443 // policy for user credentials, see User credentials
444 // (/storage-transfer/docs/data-retention#user-credentials).
445 type AzureCredentials struct {
446 // SasToken: Required. Azure shared access signature (SAS). For more
447 // information about SAS, see Grant limited access to Azure Storage resources
448 // using shared access signatures (SAS)
449 // (https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview).
450 SasToken string `json:"sasToken,omitempty"`
451 // ForceSendFields is a list of field names (e.g. "SasToken") to
452 // unconditionally include in API requests. By default, fields with empty or
453 // default values are omitted from API requests. See
454 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
455 // details.
456 ForceSendFields []string `json:"-"`
457 // NullFields is a list of field names (e.g. "SasToken") to include in API
458 // requests with the JSON null value. By default, fields with empty values are
459 // omitted from API requests. See
460 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
461 NullFields []string `json:"-"`
462 }
463
464 func (s AzureCredentials) MarshalJSON() ([]byte, error) {
465 type NoMethod AzureCredentials
466 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
467 }
468
469 // BandwidthLimit: Specifies a bandwidth limit for an agent pool.
470 type BandwidthLimit struct {
471 // LimitMbps: Bandwidth rate in megabytes per second, distributed across all
472 // the agents in the pool.
473 LimitMbps int64 `json:"limitMbps,omitempty,string"`
474 // ForceSendFields is a list of field names (e.g. "LimitMbps") to
475 // unconditionally include in API requests. By default, fields with empty or
476 // default values are omitted from API requests. See
477 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
478 // details.
479 ForceSendFields []string `json:"-"`
480 // NullFields is a list of field names (e.g. "LimitMbps") to include in API
481 // requests with the JSON null value. By default, fields with empty values are
482 // omitted from API requests. See
483 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
484 NullFields []string `json:"-"`
485 }
486
487 func (s BandwidthLimit) MarshalJSON() ([]byte, error) {
488 type NoMethod BandwidthLimit
489 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
490 }
491
492 // CancelOperationRequest: The request message for Operations.CancelOperation.
493 type CancelOperationRequest struct {
494 }
495
496 // Date: Represents a whole or partial calendar date, such as a birthday. The
497 // time of day and time zone are either specified elsewhere or are
498 // insignificant. The date is relative to the Gregorian Calendar. This can
499 // represent one of the following: * A full date, with non-zero year, month,
500 // and day values. * A month and day, with a zero year (for example, an
501 // anniversary). * A year on its own, with a zero month and a zero day. * A
502 // year and month, with a zero day (for example, a credit card expiration
503 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
504 // google.protobuf.Timestamp
505 type Date struct {
506 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
507 // or 0 to specify a year by itself or a year and month where the day isn't
508 // significant.
509 Day int64 `json:"day,omitempty"`
510 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
511 // a month and day.
512 Month int64 `json:"month,omitempty"`
513 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
514 // without a year.
515 Year int64 `json:"year,omitempty"`
516 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
517 // include in API requests. By default, fields with empty or default values are
518 // omitted from API requests. See
519 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
520 // details.
521 ForceSendFields []string `json:"-"`
522 // NullFields is a list of field names (e.g. "Day") to include in API requests
523 // with the JSON null value. By default, fields with empty values are omitted
524 // from API requests. See
525 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
526 NullFields []string `json:"-"`
527 }
528
529 func (s Date) MarshalJSON() ([]byte, error) {
530 type NoMethod Date
531 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
532 }
533
534 // Empty: A generic empty message that you can re-use to avoid defining
535 // duplicated empty messages in your APIs. A typical example is to use it as
536 // the request or the response type of an API method. For instance: service Foo
537 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
538 type Empty struct {
539 // ServerResponse contains the HTTP response code and headers from the server.
540 googleapi.ServerResponse `json:"-"`
541 }
542
543 // ErrorLogEntry: LINT.IfChange An entry describing an error that has occurred.
544 type ErrorLogEntry struct {
545 // ErrorDetails: Optional. A list of messages that carry the error details.
546 ErrorDetails []string `json:"errorDetails,omitempty"`
547 // Url: Output only. A URL that refers to the target (a data source, a data
548 // sink, or an object) with which the error is associated.
549 Url string `json:"url,omitempty"`
550 // ForceSendFields is a list of field names (e.g. "ErrorDetails") to
551 // unconditionally include in API requests. By default, fields with empty or
552 // default values are omitted from API requests. See
553 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
554 // details.
555 ForceSendFields []string `json:"-"`
556 // NullFields is a list of field names (e.g. "ErrorDetails") to include in API
557 // requests with the JSON null value. By default, fields with empty values are
558 // omitted from API requests. See
559 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
560 NullFields []string `json:"-"`
561 }
562
563 func (s ErrorLogEntry) MarshalJSON() ([]byte, error) {
564 type NoMethod ErrorLogEntry
565 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
566 }
567
568 // ErrorSummary: A summary of errors by error code, plus a count and sample
569 // error log entries.
570 type ErrorSummary struct {
571 // ErrorCode: Required.
572 //
573 // Possible values:
574 // "OK" - Not an error; returned on success. HTTP Mapping: 200 OK
575 // "CANCELLED" - The operation was cancelled, typically by the caller. HTTP
576 // Mapping: 499 Client Closed Request
577 // "UNKNOWN" - Unknown error. For example, this error may be returned when a
578 // `Status` value received from another address space belongs to an error space
579 // that is not known in this address space. Also errors raised by APIs that do
580 // not return enough error information may be converted to this error. HTTP
581 // Mapping: 500 Internal Server Error
582 // "INVALID_ARGUMENT" - The client specified an invalid argument. Note that
583 // this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates
584 // arguments that are problematic regardless of the state of the system (e.g.,
585 // a malformed file name). HTTP Mapping: 400 Bad Request
586 // "DEADLINE_EXCEEDED" - The deadline expired before the operation could
587 // complete. For operations that change the state of the system, this error may
588 // be returned even if the operation has completed successfully. For example, a
589 // successful response from a server could have been delayed long enough for
590 // the deadline to expire. HTTP Mapping: 504 Gateway Timeout
591 // "NOT_FOUND" - Some requested entity (e.g., file or directory) was not
592 // found. Note to server developers: if a request is denied for an entire class
593 // of users, such as gradual feature rollout or undocumented allowlist,
594 // `NOT_FOUND` may be used. If a request is denied for some users within a
595 // class of users, such as user-based access control, `PERMISSION_DENIED` must
596 // be used. HTTP Mapping: 404 Not Found
597 // "ALREADY_EXISTS" - The entity that a client attempted to create (e.g.,
598 // file or directory) already exists. HTTP Mapping: 409 Conflict
599 // "PERMISSION_DENIED" - The caller does not have permission to execute the
600 // specified operation. `PERMISSION_DENIED` must not be used for rejections
601 // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for
602 // those errors). `PERMISSION_DENIED` must not be used if the caller can not be
603 // identified (use `UNAUTHENTICATED` instead for those errors). This error code
604 // does not imply the request is valid or the requested entity exists or
605 // satisfies other pre-conditions. HTTP Mapping: 403 Forbidden
606 // "UNAUTHENTICATED" - The request does not have valid authentication
607 // credentials for the operation. HTTP Mapping: 401 Unauthorized
608 // "RESOURCE_EXHAUSTED" - Some resource has been exhausted, perhaps a
609 // per-user quota, or perhaps the entire file system is out of space. HTTP
610 // Mapping: 429 Too Many Requests
611 // "FAILED_PRECONDITION" - The operation was rejected because the system is
612 // not in a state required for the operation's execution. For example, the
613 // directory to be deleted is non-empty, an rmdir operation is applied to a
614 // non-directory, etc. Service implementors can use the following guidelines to
615 // decide between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use
616 // `UNAVAILABLE` if the client can retry just the failing call. (b) Use
617 // `ABORTED` if the client should retry at a higher level. For example, when a
618 // client-specified test-and-set fails, indicating the client should restart a
619 // read-modify-write sequence. (c) Use `FAILED_PRECONDITION` if the client
620 // should not retry until the system state has been explicitly fixed. For
621 // example, if an "rmdir" fails because the directory is non-empty,
622 // `FAILED_PRECONDITION` should be returned since the client should not retry
623 // unless the files are deleted from the directory. HTTP Mapping: 400 Bad
624 // Request
625 // "ABORTED" - The operation was aborted, typically due to a concurrency
626 // issue such as a sequencer check failure or transaction abort. See the
627 // guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and
628 // `UNAVAILABLE`. HTTP Mapping: 409 Conflict
629 // "OUT_OF_RANGE" - The operation was attempted past the valid range. E.g.,
630 // seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error
631 // indicates a problem that may be fixed if the system state changes. For
632 // example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to
633 // read at an offset that is not in the range [0,2^32-1], but it will generate
634 // `OUT_OF_RANGE` if asked to read from an offset past the current file size.
635 // There is a fair bit of overlap between `FAILED_PRECONDITION` and
636 // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error)
637 // when it applies so that callers who are iterating through a space can easily
638 // look for an `OUT_OF_RANGE` error to detect when they are done. HTTP Mapping:
639 // 400 Bad Request
640 // "UNIMPLEMENTED" - The operation is not implemented or is not
641 // supported/enabled in this service. HTTP Mapping: 501 Not Implemented
642 // "INTERNAL" - Internal errors. This means that some invariants expected by
643 // the underlying system have been broken. This error code is reserved for
644 // serious errors. HTTP Mapping: 500 Internal Server Error
645 // "UNAVAILABLE" - The service is currently unavailable. This is most likely
646 // a transient condition, which can be corrected by retrying with a backoff.
647 // Note that it is not always safe to retry non-idempotent operations. See the
648 // guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and
649 // `UNAVAILABLE`. HTTP Mapping: 503 Service Unavailable
650 // "DATA_LOSS" - Unrecoverable data loss or corruption. HTTP Mapping: 500
651 // Internal Server Error
652 ErrorCode string `json:"errorCode,omitempty"`
653 // ErrorCount: Required. Count of this type of error.
654 ErrorCount int64 `json:"errorCount,omitempty,string"`
655 // ErrorLogEntries: Error samples. At most 5 error log entries are recorded for
656 // a given error code for a single transfer operation.
657 ErrorLogEntries []*ErrorLogEntry `json:"errorLogEntries,omitempty"`
658 // ForceSendFields is a list of field names (e.g. "ErrorCode") to
659 // unconditionally include in API requests. By default, fields with empty or
660 // default values are omitted from API requests. See
661 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
662 // details.
663 ForceSendFields []string `json:"-"`
664 // NullFields is a list of field names (e.g. "ErrorCode") to include in API
665 // requests with the JSON null value. By default, fields with empty values are
666 // omitted from API requests. See
667 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
668 NullFields []string `json:"-"`
669 }
670
671 func (s ErrorSummary) MarshalJSON() ([]byte, error) {
672 type NoMethod ErrorSummary
673 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
674 }
675
676 // EventStream: Specifies the Event-driven transfer options. Event-driven
677 // transfers listen to an event stream to transfer updated files.
678 type EventStream struct {
679 // EventStreamExpirationTime: Specifies the data and time at which Storage
680 // Transfer Service stops listening for events from this stream. After this
681 // time, any transfers in progress will complete, but no new transfers are
682 // initiated.
683 EventStreamExpirationTime string `json:"eventStreamExpirationTime,omitempty"`
684 // EventStreamStartTime: Specifies the date and time that Storage Transfer
685 // Service starts listening for events from this stream. If no start time is
686 // specified or start time is in the past, Storage Transfer Service starts
687 // listening immediately.
688 EventStreamStartTime string `json:"eventStreamStartTime,omitempty"`
689 // Name: Required. Specifies a unique name of the resource such as AWS SQS ARN
690 // in the form 'arn:aws:sqs:region:account_id:queue_name', or Pub/Sub
691 // subscription resource name in the form
692 // 'projects/{project}/subscriptions/{sub}'.
693 Name string `json:"name,omitempty"`
694 // ForceSendFields is a list of field names (e.g. "EventStreamExpirationTime")
695 // to unconditionally include in API requests. By default, fields with empty or
696 // default values are omitted from API requests. See
697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
698 // details.
699 ForceSendFields []string `json:"-"`
700 // NullFields is a list of field names (e.g. "EventStreamExpirationTime") to
701 // include in API requests with the JSON null value. By default, fields with
702 // empty values are omitted from API requests. See
703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
704 NullFields []string `json:"-"`
705 }
706
707 func (s EventStream) MarshalJSON() ([]byte, error) {
708 type NoMethod EventStream
709 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
710 }
711
712 // FederatedIdentityConfig: The identity of an Azure application through which
713 // Storage Transfer Service can authenticate requests using Azure workload
714 // identity federation. Storage Transfer Service can issue requests to Azure
715 // Storage through registered Azure applications, eliminating the need to pass
716 // credentials to Storage Transfer Service directly. To configure federated
717 // identity, see Configure access to Microsoft Azure Storage
718 // (https://cloud.google.com/storage-transfer/docs/source-microsoft-azure#option_3_authenticate_using_federated_identity).
719 type FederatedIdentityConfig struct {
720 // ClientId: Required. The client (application) ID of the application with
721 // federated credentials.
722 ClientId string `json:"clientId,omitempty"`
723 // TenantId: Required. The tenant (directory) ID of the application with
724 // federated credentials.
725 TenantId string `json:"tenantId,omitempty"`
726 // ForceSendFields is a list of field names (e.g. "ClientId") to
727 // unconditionally include in API requests. By default, fields with empty or
728 // default values are omitted from API requests. See
729 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
730 // details.
731 ForceSendFields []string `json:"-"`
732 // NullFields is a list of field names (e.g. "ClientId") to include in API
733 // requests with the JSON null value. By default, fields with empty values are
734 // omitted from API requests. See
735 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
736 NullFields []string `json:"-"`
737 }
738
739 func (s FederatedIdentityConfig) MarshalJSON() ([]byte, error) {
740 type NoMethod FederatedIdentityConfig
741 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
742 }
743
744 // GcsData: In a GcsData resource, an object's name is the Cloud Storage
745 // object's name and its "last modification time" refers to the object's
746 // `updated` property of Cloud Storage objects, which changes when the content
747 // or the metadata of the object is updated.
748 type GcsData struct {
749 // BucketName: Required. Cloud Storage bucket name. Must meet Bucket Name
750 // Requirements (/storage/docs/naming#requirements).
751 BucketName string `json:"bucketName,omitempty"`
752 // ManagedFolderTransferEnabled: Preview. Enables the transfer of managed
753 // folders between Cloud Storage buckets. Set this option on the
754 // gcs_data_source. If set to true: - Managed folders in the source bucket are
755 // transferred to the destination bucket. - Managed folders in the destination
756 // bucket are overwritten. Other OVERWRITE options are not supported. See
757 // Transfer Cloud Storage managed folders
758 // (/storage-transfer/docs/managed-folders).
759 ManagedFolderTransferEnabled bool `json:"managedFolderTransferEnabled,omitempty"`
760 // Path: Root path to transfer objects. Must be an empty string or full path
761 // name that ends with a '/'. This field is treated as an object prefix. As
762 // such, it should generally not begin with a '/'. The root path value must
763 // meet Object Name Requirements (/storage/docs/naming#objectnames).
764 Path string `json:"path,omitempty"`
765 // ForceSendFields is a list of field names (e.g. "BucketName") to
766 // unconditionally include in API requests. By default, fields with empty or
767 // default values are omitted from API requests. See
768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
769 // details.
770 ForceSendFields []string `json:"-"`
771 // NullFields is a list of field names (e.g. "BucketName") to include in API
772 // requests with the JSON null value. By default, fields with empty values are
773 // omitted from API requests. See
774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
775 NullFields []string `json:"-"`
776 }
777
778 func (s GcsData) MarshalJSON() ([]byte, error) {
779 type NoMethod GcsData
780 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
781 }
782
783 // GoogleServiceAccount: Google service account
784 type GoogleServiceAccount struct {
785 // AccountEmail: Email address of the service account.
786 AccountEmail string `json:"accountEmail,omitempty"`
787 // SubjectId: Unique identifier for the service account.
788 SubjectId string `json:"subjectId,omitempty"`
789
790 // ServerResponse contains the HTTP response code and headers from the server.
791 googleapi.ServerResponse `json:"-"`
792 // ForceSendFields is a list of field names (e.g. "AccountEmail") to
793 // unconditionally include in API requests. By default, fields with empty or
794 // default values are omitted from API requests. See
795 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
796 // details.
797 ForceSendFields []string `json:"-"`
798 // NullFields is a list of field names (e.g. "AccountEmail") to include in API
799 // requests with the JSON null value. By default, fields with empty values are
800 // omitted from API requests. See
801 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
802 NullFields []string `json:"-"`
803 }
804
805 func (s GoogleServiceAccount) MarshalJSON() ([]byte, error) {
806 type NoMethod GoogleServiceAccount
807 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
808 }
809
810 // HdfsData: An HdfsData resource specifies a path within an HDFS entity (e.g.
811 // a cluster). All cluster-specific settings, such as namenodes and ports, are
812 // configured on the transfer agents servicing requests, so HdfsData only
813 // contains the root path to the data in our transfer.
814 type HdfsData struct {
815 // Path: Root path to transfer files.
816 Path string `json:"path,omitempty"`
817 // ForceSendFields is a list of field names (e.g. "Path") to unconditionally
818 // include in API requests. By default, fields with empty or default values are
819 // omitted from API requests. See
820 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
821 // details.
822 ForceSendFields []string `json:"-"`
823 // NullFields is a list of field names (e.g. "Path") to include in API requests
824 // with the JSON null value. By default, fields with empty values are omitted
825 // from API requests. See
826 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
827 NullFields []string `json:"-"`
828 }
829
830 func (s HdfsData) MarshalJSON() ([]byte, error) {
831 type NoMethod HdfsData
832 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
833 }
834
835 // HttpData: An HttpData resource specifies a list of objects on the web to be
836 // transferred over HTTP. The information of the objects to be transferred is
837 // contained in a file referenced by a URL. The first line in the file must be
838 // "TsvHttpData-1.0", which specifies the format of the file. Subsequent
839 // lines specify the information of the list of objects, one object per list
840 // entry. Each entry has the following tab-delimited fields: * **HTTP URL** —
841 // The location of the object. * **Length** — The size of the object in
842 // bytes. * **MD5** — The base64-encoded MD5 hash of the object. For an
843 // example of a valid TSV file, see Transferring data from URLs
844 // (https://cloud.google.com/storage-transfer/docs/create-url-list). When
845 // transferring data based on a URL list, keep the following in mind: * When an
846 // object located at `http(s)://hostname:port/` is transferred to a data sink,
847 // the name of the object at the data sink is `/`. * If the specified size of
848 // an object does not match the actual size of the object fetched, the object
849 // is not transferred. * If the specified MD5 does not match the MD5 computed
850 // from the transferred bytes, the object transfer fails. * Ensure that each
851 // URL you specify is publicly accessible. For example, in Cloud Storage you
852 // can [share an object publicly] (/storage/docs/cloud-console#_sharingdata)
853 // and get a link to it. * Storage Transfer Service obeys `robots.txt` rules
854 // and requires the source HTTP server to support `Range` requests and to
855 // return a `Content-Length` header in each response. * ObjectConditions have
856 // no effect when filtering objects to transfer.
857 type HttpData struct {
858 // ListUrl: Required. The URL that points to the file that stores the object
859 // list entries. This file must allow public access. The URL is either an
860 // HTTP/HTTPS address (e.g. `https://example.com/urllist.tsv`) or a Cloud
861 // Storage path (e.g. `gs://my-bucket/urllist.tsv`).
862 ListUrl string `json:"listUrl,omitempty"`
863 // ForceSendFields is a list of field names (e.g. "ListUrl") to unconditionally
864 // include in API requests. By default, fields with empty or default values are
865 // omitted from API requests. See
866 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
867 // details.
868 ForceSendFields []string `json:"-"`
869 // NullFields is a list of field names (e.g. "ListUrl") to include in API
870 // requests with the JSON null value. By default, fields with empty values are
871 // omitted from API requests. See
872 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
873 NullFields []string `json:"-"`
874 }
875
876 func (s HttpData) MarshalJSON() ([]byte, error) {
877 type NoMethod HttpData
878 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
879 }
880
881 // ListAgentPoolsResponse: Response from ListAgentPools.
882 type ListAgentPoolsResponse struct {
883 // AgentPools: A list of agent pools.
884 AgentPools []*AgentPool `json:"agentPools,omitempty"`
885 // NextPageToken: The list next page token.
886 NextPageToken string `json:"nextPageToken,omitempty"`
887
888 // ServerResponse contains the HTTP response code and headers from the server.
889 googleapi.ServerResponse `json:"-"`
890 // ForceSendFields is a list of field names (e.g. "AgentPools") to
891 // unconditionally include in API requests. By default, fields with empty or
892 // default values are omitted from API requests. See
893 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
894 // details.
895 ForceSendFields []string `json:"-"`
896 // NullFields is a list of field names (e.g. "AgentPools") to include in API
897 // requests with the JSON null value. By default, fields with empty values are
898 // omitted from API requests. See
899 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
900 NullFields []string `json:"-"`
901 }
902
903 func (s ListAgentPoolsResponse) MarshalJSON() ([]byte, error) {
904 type NoMethod ListAgentPoolsResponse
905 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
906 }
907
908 // ListOperationsResponse: The response message for Operations.ListOperations.
909 type ListOperationsResponse struct {
910 // NextPageToken: The standard List next-page token.
911 NextPageToken string `json:"nextPageToken,omitempty"`
912 // Operations: A list of operations that matches the specified filter in the
913 // request.
914 Operations []*Operation `json:"operations,omitempty"`
915 // Unreachable: Unordered list. Unreachable resources. Populated when the
916 // request sets `ListOperationsRequest.return_partial_success` and reads across
917 // collections. For example, when attempting to list all resources across all
918 // supported locations.
919 Unreachable []string `json:"unreachable,omitempty"`
920
921 // ServerResponse contains the HTTP response code and headers from the server.
922 googleapi.ServerResponse `json:"-"`
923 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
924 // unconditionally include in API requests. By default, fields with empty or
925 // default values are omitted from API requests. See
926 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
927 // details.
928 ForceSendFields []string `json:"-"`
929 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
930 // requests with the JSON null value. By default, fields with empty values are
931 // omitted from API requests. See
932 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
933 NullFields []string `json:"-"`
934 }
935
936 func (s ListOperationsResponse) MarshalJSON() ([]byte, error) {
937 type NoMethod ListOperationsResponse
938 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
939 }
940
941 // ListTransferJobsResponse: Response from ListTransferJobs.
942 type ListTransferJobsResponse struct {
943 // NextPageToken: The list next page token.
944 NextPageToken string `json:"nextPageToken,omitempty"`
945 // TransferJobs: A list of transfer jobs.
946 TransferJobs []*TransferJob `json:"transferJobs,omitempty"`
947
948 // ServerResponse contains the HTTP response code and headers from the server.
949 googleapi.ServerResponse `json:"-"`
950 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
951 // unconditionally include in API requests. By default, fields with empty or
952 // default values are omitted from API requests. See
953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
954 // details.
955 ForceSendFields []string `json:"-"`
956 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
957 // requests with the JSON null value. By default, fields with empty values are
958 // omitted from API requests. See
959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
960 NullFields []string `json:"-"`
961 }
962
963 func (s ListTransferJobsResponse) MarshalJSON() ([]byte, error) {
964 type NoMethod ListTransferJobsResponse
965 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
966 }
967
968 // LoggingConfig: Specifies the logging behavior for transfer operations. Logs
969 // can be sent to Cloud Logging for all transfer types. See Read transfer logs
970 // (https://cloud.google.com/storage-transfer/docs/read-transfer-logs) for
971 // details.
972 type LoggingConfig struct {
973 // EnableOnpremGcsTransferLogs: For PosixFilesystem transfers, enables file
974 // system transfer logs
975 // (https://cloud.google.com/storage-transfer/docs/on-prem-transfer-log-format)
976 // instead of, or in addition to, Cloud Logging. This option ignores
977 // [LoggableAction] and [LoggableActionState]. If these are set, Cloud Logging
978 // will also be enabled for this transfer.
979 EnableOnpremGcsTransferLogs bool `json:"enableOnpremGcsTransferLogs,omitempty"`
980 // LogActionStates: States in which `log_actions` are logged. If empty, no logs
981 // are generated.
982 //
983 // Possible values:
984 // "LOGGABLE_ACTION_STATE_UNSPECIFIED" - Default value. This value is unused.
985 // "SUCCEEDED" - `LoggableAction` completed successfully. `SUCCEEDED` actions
986 // are logged as INFO.
987 // "FAILED" - `LoggableAction` terminated in an error state. `FAILED` actions
988 // are logged as ERROR.
989 // "SKIPPED" - The `COPY` action was skipped for this file. Only supported
990 // for agent-based transfers. `SKIPPED` actions are logged as INFO.
991 LogActionStates []string `json:"logActionStates,omitempty"`
992 // LogActions: Specifies the actions to be logged. If empty, no logs are
993 // generated.
994 //
995 // Possible values:
996 // "LOGGABLE_ACTION_UNSPECIFIED" - Default value. This value is unused.
997 // "FIND" - Listing objects in a bucket.
998 // "DELETE" - Deleting objects at the source or the destination.
999 // "COPY" - Copying objects to the destination.
1000 LogActions []string `json:"logActions,omitempty"`
1001 // ForceSendFields is a list of field names (e.g.
1002 // "EnableOnpremGcsTransferLogs") to unconditionally include in API requests.
1003 // By default, fields with empty or default values are omitted from API
1004 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
1005 // for more details.
1006 ForceSendFields []string `json:"-"`
1007 // NullFields is a list of field names (e.g. "EnableOnpremGcsTransferLogs") to
1008 // include in API requests with the JSON null value. By default, fields with
1009 // empty values are omitted from API requests. See
1010 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1011 NullFields []string `json:"-"`
1012 }
1013
1014 func (s LoggingConfig) MarshalJSON() ([]byte, error) {
1015 type NoMethod LoggingConfig
1016 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1017 }
1018
1019 // MetadataOptions: Specifies the metadata options for running a transfer.
1020 type MetadataOptions struct {
1021 // Acl: Specifies how each object's ACLs should be preserved for transfers
1022 // between Google Cloud Storage buckets. If unspecified, the default behavior
1023 // is the same as ACL_DESTINATION_BUCKET_DEFAULT.
1024 //
1025 // Possible values:
1026 // "ACL_UNSPECIFIED" - ACL behavior is unspecified.
1027 // "ACL_DESTINATION_BUCKET_DEFAULT" - Use the destination bucket's default
1028 // object ACLS, if applicable.
1029 // "ACL_PRESERVE" - Preserve the object's original ACLs. This requires the
1030 // service account to have `storage.objects.getIamPolicy` permission for the
1031 // source object. [Uniform bucket-level
1032 // access](https://cloud.google.com/storage/docs/uniform-bucket-level-access)
1033 // must not be enabled on either the source or destination buckets.
1034 Acl string `json:"acl,omitempty"`
1035 // Gid: Specifies how each file's POSIX group ID (GID) attribute should be
1036 // handled by the transfer. By default, GID is not preserved. Only applicable
1037 // to transfers involving POSIX file systems, and ignored for other transfers.
1038 //
1039 // Possible values:
1040 // "GID_UNSPECIFIED" - GID behavior is unspecified.
1041 // "GID_SKIP" - Do not preserve GID during a transfer job.
1042 // "GID_NUMBER" - Preserve GID during a transfer job.
1043 Gid string `json:"gid,omitempty"`
1044 // KmsKey: Specifies how each object's Cloud KMS customer-managed encryption
1045 // key (CMEK) is preserved for transfers between Google Cloud Storage buckets.
1046 // If unspecified, the default behavior is the same as
1047 // KMS_KEY_DESTINATION_BUCKET_DEFAULT.
1048 //
1049 // Possible values:
1050 // "KMS_KEY_UNSPECIFIED" - KmsKey behavior is unspecified.
1051 // "KMS_KEY_DESTINATION_BUCKET_DEFAULT" - Use the destination bucket's
1052 // default encryption settings.
1053 // "KMS_KEY_PRESERVE" - Preserve the object's original Cloud KMS
1054 // customer-managed encryption key (CMEK) if present. Objects that do not use a
1055 // Cloud KMS encryption key will be encrypted using the destination bucket's
1056 // encryption settings.
1057 KmsKey string `json:"kmsKey,omitempty"`
1058 // Mode: Specifies how each file's mode attribute should be handled by the
1059 // transfer. By default, mode is not preserved. Only applicable to transfers
1060 // involving POSIX file systems, and ignored for other transfers.
1061 //
1062 // Possible values:
1063 // "MODE_UNSPECIFIED" - Mode behavior is unspecified.
1064 // "MODE_SKIP" - Do not preserve mode during a transfer job.
1065 // "MODE_PRESERVE" - Preserve mode during a transfer job.
1066 Mode string `json:"mode,omitempty"`
1067 // StorageClass: Specifies the storage class to set on objects being
1068 // transferred to Google Cloud Storage buckets. If unspecified, the default
1069 // behavior is the same as STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT.
1070 //
1071 // Possible values:
1072 // "STORAGE_CLASS_UNSPECIFIED" - Storage class behavior is unspecified.
1073 // "STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT" - Use the destination bucket's
1074 // default storage class.
1075 // "STORAGE_CLASS_PRESERVE" - Preserve the object's original storage class.
1076 // This is only supported for transfers from Google Cloud Storage buckets.
1077 // REGIONAL and MULTI_REGIONAL storage classes will be mapped to STANDARD to
1078 // ensure they can be written to the destination bucket.
1079 // "STORAGE_CLASS_STANDARD" - Set the storage class to STANDARD.
1080 // "STORAGE_CLASS_NEARLINE" - Set the storage class to NEARLINE.
1081 // "STORAGE_CLASS_COLDLINE" - Set the storage class to COLDLINE.
1082 // "STORAGE_CLASS_ARCHIVE" - Set the storage class to ARCHIVE.
1083 StorageClass string `json:"storageClass,omitempty"`
1084 // Symlink: Specifies how symlinks should be handled by the transfer. By
1085 // default, symlinks are not preserved. Only applicable to transfers involving
1086 // POSIX file systems, and ignored for other transfers.
1087 //
1088 // Possible values:
1089 // "SYMLINK_UNSPECIFIED" - Symlink behavior is unspecified.
1090 // "SYMLINK_SKIP" - Do not preserve symlinks during a transfer job.
1091 // "SYMLINK_PRESERVE" - Preserve symlinks during a transfer job.
1092 Symlink string `json:"symlink,omitempty"`
1093 // TemporaryHold: Specifies how each object's temporary hold status should be
1094 // preserved for transfers between Google Cloud Storage buckets. If
1095 // unspecified, the default behavior is the same as TEMPORARY_HOLD_PRESERVE.
1096 //
1097 // Possible values:
1098 // "TEMPORARY_HOLD_UNSPECIFIED" - Temporary hold behavior is unspecified.
1099 // "TEMPORARY_HOLD_SKIP" - Do not set a temporary hold on the destination
1100 // object.
1101 // "TEMPORARY_HOLD_PRESERVE" - Preserve the object's original temporary hold
1102 // status.
1103 TemporaryHold string `json:"temporaryHold,omitempty"`
1104 // TimeCreated: Specifies how each object's `timeCreated` metadata is preserved
1105 // for transfers. If unspecified, the default behavior is the same as
1106 // TIME_CREATED_SKIP. This behavior is supported for transfers to Cloud Storage
1107 // buckets from Cloud Storage, Amazon S3, S3-compatible storage, and Azure
1108 // sources.
1109 //
1110 // Possible values:
1111 // "TIME_CREATED_UNSPECIFIED" - TimeCreated behavior is unspecified.
1112 // "TIME_CREATED_SKIP" - Do not preserve the `timeCreated` metadata from the
1113 // source object.
1114 // "TIME_CREATED_PRESERVE_AS_CUSTOM_TIME" - Preserves the source object's
1115 // `timeCreated` or `lastModified` metadata in the `customTime` field in the
1116 // destination object. Note that any value stored in the source object's
1117 // `customTime` field will not be propagated to the destination object.
1118 TimeCreated string `json:"timeCreated,omitempty"`
1119 // Uid: Specifies how each file's POSIX user ID (UID) attribute should be
1120 // handled by the transfer. By default, UID is not preserved. Only applicable
1121 // to transfers involving POSIX file systems, and ignored for other transfers.
1122 //
1123 // Possible values:
1124 // "UID_UNSPECIFIED" - UID behavior is unspecified.
1125 // "UID_SKIP" - Do not preserve UID during a transfer job.
1126 // "UID_NUMBER" - Preserve UID during a transfer job.
1127 Uid string `json:"uid,omitempty"`
1128 // ForceSendFields is a list of field names (e.g. "Acl") to unconditionally
1129 // include in API requests. By default, fields with empty or default values are
1130 // omitted from API requests. See
1131 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1132 // details.
1133 ForceSendFields []string `json:"-"`
1134 // NullFields is a list of field names (e.g. "Acl") to include in API requests
1135 // with the JSON null value. By default, fields with empty values are omitted
1136 // from API requests. See
1137 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1138 NullFields []string `json:"-"`
1139 }
1140
1141 func (s MetadataOptions) MarshalJSON() ([]byte, error) {
1142 type NoMethod MetadataOptions
1143 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1144 }
1145
1146 // NotificationConfig: Specification to configure notifications published to
1147 // Pub/Sub. Notifications are published to the customer-provided topic using
1148 // the following `PubsubMessage.attributes`: * "eventType": one of the
1149 // EventType values * "payloadFormat": one of the PayloadFormat values *
1150 // "projectId": the project_id of the `TransferOperation` *
1151 // "transferJobName": the transfer_job_name of the `TransferOperation` *
1152 // "transferOperationName": the name of the `TransferOperation` The
1153 // `PubsubMessage.data` contains a TransferOperation resource formatted
1154 // according to the specified `PayloadFormat`.
1155 type NotificationConfig struct {
1156 // EventTypes: Event types for which a notification is desired. If empty, send
1157 // notifications for all event types.
1158 //
1159 // Possible values:
1160 // "EVENT_TYPE_UNSPECIFIED" - Illegal value, to avoid allowing a default.
1161 // "TRANSFER_OPERATION_SUCCESS" - `TransferOperation` completed with status
1162 // SUCCESS.
1163 // "TRANSFER_OPERATION_FAILED" - `TransferOperation` completed with status
1164 // FAILED.
1165 // "TRANSFER_OPERATION_ABORTED" - `TransferOperation` completed with status
1166 // ABORTED.
1167 EventTypes []string `json:"eventTypes,omitempty"`
1168 // PayloadFormat: Required. The desired format of the notification message
1169 // payloads.
1170 //
1171 // Possible values:
1172 // "PAYLOAD_FORMAT_UNSPECIFIED" - Illegal value, to avoid allowing a default.
1173 // "NONE" - No payload is included with the notification.
1174 // "JSON" - `TransferOperation` is [formatted as a JSON
1175 // response](https://developers.google.com/protocol-buffers/docs/proto3#json),
1176 // in application/json.
1177 PayloadFormat string `json:"payloadFormat,omitempty"`
1178 // PubsubTopic: Required. The `Topic.name` of the Pub/Sub topic to which to
1179 // publish notifications. Must be of the format:
1180 // `projects/{project}/topics/{topic}`. Not matching this format results in an
1181 // INVALID_ARGUMENT error.
1182 PubsubTopic string `json:"pubsubTopic,omitempty"`
1183 // ForceSendFields is a list of field names (e.g. "EventTypes") to
1184 // unconditionally include in API requests. By default, fields with empty or
1185 // default values are omitted from API requests. See
1186 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1187 // details.
1188 ForceSendFields []string `json:"-"`
1189 // NullFields is a list of field names (e.g. "EventTypes") to include in API
1190 // requests with the JSON null value. By default, fields with empty values are
1191 // omitted from API requests. See
1192 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1193 NullFields []string `json:"-"`
1194 }
1195
1196 func (s NotificationConfig) MarshalJSON() ([]byte, error) {
1197 type NoMethod NotificationConfig
1198 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1199 }
1200
1201 // ObjectConditions: Conditions that determine which objects are transferred.
1202 // Applies only to Cloud Data Sources such as S3, Azure, and Cloud Storage. The
1203 // "last modification time" refers to the time of the last change to the
1204 // object's content or metadata — specifically, this is the `updated`
1205 // property of Cloud Storage objects, the `LastModified` field of S3 objects,
1206 // and the `Last-Modified` header of Azure blobs. For S3 objects, the
1207 // `LastModified` value is the time the object begins uploading. If the object
1208 // meets your "last modification time" criteria, but has not finished
1209 // uploading, the object is not transferred. See Transfer from Amazon S3 to
1210 // Cloud Storage
1211 // (https://cloud.google.com/storage-transfer/docs/create-transfers/agentless/s3#transfer_options)
1212 // for more information. Transfers with a PosixFilesystem source or destination
1213 // don't support `ObjectConditions`.
1214 type ObjectConditions struct {
1215 // ExcludePrefixes: If you specify `exclude_prefixes`, Storage Transfer Service
1216 // uses the items in the `exclude_prefixes` array to determine which objects to
1217 // exclude from a transfer. Objects must not start with one of the matching
1218 // `exclude_prefixes` for inclusion in a transfer. The following are
1219 // requirements of `exclude_prefixes`: * Each exclude-prefix can contain any
1220 // sequence of Unicode characters, to a max length of 1024 bytes when
1221 // UTF8-encoded, and must not contain Carriage Return or Line Feed characters.
1222 // Wildcard matching and regular expression matching are not supported. * Each
1223 // exclude-prefix must omit the leading slash. For example, to exclude the
1224 // object `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the
1225 // exclude-prefix as `logs/y=2015/requests.gz`. * None of the exclude-prefix
1226 // values can be empty, if specified. * Each exclude-prefix must exclude a
1227 // distinct portion of the object namespace. No exclude-prefix may be a prefix
1228 // of another exclude-prefix. * If include_prefixes is specified, then each
1229 // exclude-prefix must start with the value of a path explicitly included by
1230 // `include_prefixes`. The max size of `exclude_prefixes` is 1000. For more
1231 // information, see Filtering objects from transfers
1232 // (/storage-transfer/docs/filtering-objects-from-transfers).
1233 ExcludePrefixes []string `json:"excludePrefixes,omitempty"`
1234 // IncludePrefixes: If you specify `include_prefixes`, Storage Transfer Service
1235 // uses the items in the `include_prefixes` array to determine which objects to
1236 // include in a transfer. Objects must start with one of the matching
1237 // `include_prefixes` for inclusion in the transfer. If exclude_prefixes is
1238 // specified, objects must not start with any of the `exclude_prefixes`
1239 // specified for inclusion in the transfer. The following are requirements of
1240 // `include_prefixes`: * Each include-prefix can contain any sequence of
1241 // Unicode characters, to a max length of 1024 bytes when UTF8-encoded, and
1242 // must not contain Carriage Return or Line Feed characters. Wildcard matching
1243 // and regular expression matching are not supported. * Each include-prefix
1244 // must omit the leading slash. For example, to include the object
1245 // `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include-prefix as
1246 // `logs/y=2015/requests.gz`. * None of the include-prefix values can be empty,
1247 // if specified. * Each include-prefix must include a distinct portion of the
1248 // object namespace. No include-prefix may be a prefix of another
1249 // include-prefix. The max size of `include_prefixes` is 1000. For more
1250 // information, see Filtering objects from transfers
1251 // (/storage-transfer/docs/filtering-objects-from-transfers).
1252 IncludePrefixes []string `json:"includePrefixes,omitempty"`
1253 // LastModifiedBefore: If specified, only objects with a "last modification
1254 // time" before this timestamp and objects that don't have a "last modification
1255 // time" are transferred.
1256 LastModifiedBefore string `json:"lastModifiedBefore,omitempty"`
1257 // LastModifiedSince: If specified, only objects with a "last modification
1258 // time" on or after this timestamp and objects that don't have a "last
1259 // modification time" are transferred. The `last_modified_since` and
1260 // `last_modified_before` fields can be used together for chunked data
1261 // processing. For example, consider a script that processes each day's worth
1262 // of data at a time. For that you'd set each of the fields as follows: *
1263 // `last_modified_since` to the start of the day * `last_modified_before` to
1264 // the end of the day
1265 LastModifiedSince string `json:"lastModifiedSince,omitempty"`
1266 // MatchGlob: Optional. If specified, only objects matching this glob are
1267 // transferred.
1268 MatchGlob string `json:"matchGlob,omitempty"`
1269 // MaxTimeElapsedSinceLastModification: Ensures that objects are not
1270 // transferred if a specific maximum time has elapsed since the "last
1271 // modification time". When a TransferOperation begins, objects with a "last
1272 // modification time" are transferred only if the elapsed time between the
1273 // start_time of the `TransferOperation`and the "last modification time" of the
1274 // object is less than the value of max_time_elapsed_since_last_modification`.
1275 // Objects that do not have a "last modification time" are also transferred.
1276 MaxTimeElapsedSinceLastModification string `json:"maxTimeElapsedSinceLastModification,omitempty"`
1277 // MinTimeElapsedSinceLastModification: Ensures that objects are not
1278 // transferred until a specific minimum time has elapsed after the "last
1279 // modification time". When a TransferOperation begins, objects with a "last
1280 // modification time" are transferred only if the elapsed time between the
1281 // start_time of the `TransferOperation` and the "last modification time" of
1282 // the object is equal to or greater than the value of
1283 // min_time_elapsed_since_last_modification`. Objects that do not have a "last
1284 // modification time" are also transferred.
1285 MinTimeElapsedSinceLastModification string `json:"minTimeElapsedSinceLastModification,omitempty"`
1286 // ForceSendFields is a list of field names (e.g. "ExcludePrefixes") to
1287 // unconditionally include in API requests. By default, fields with empty or
1288 // default values are omitted from API requests. See
1289 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1290 // details.
1291 ForceSendFields []string `json:"-"`
1292 // NullFields is a list of field names (e.g. "ExcludePrefixes") to include in
1293 // API requests with the JSON null value. By default, fields with empty values
1294 // are omitted from API requests. See
1295 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1296 NullFields []string `json:"-"`
1297 }
1298
1299 func (s ObjectConditions) MarshalJSON() ([]byte, error) {
1300 type NoMethod ObjectConditions
1301 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1302 }
1303
1304 // Operation: This resource represents a long-running operation that is the
1305 // result of a network API call.
1306 type Operation struct {
1307 // Done: If the value is `false`, it means the operation is still in progress.
1308 // If `true`, the operation is completed, and either `error` or `response` is
1309 // available.
1310 Done bool `json:"done,omitempty"`
1311 // Error: The error result of the operation in case of failure or cancellation.
1312 Error *Status `json:"error,omitempty"`
1313 // Metadata: Represents the transfer operation object. To request a
1314 // TransferOperation object, use transferOperations.get.
1315 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1316 // Name: The server-assigned unique name. The format of `name` is
1317 // `transferOperations/some/unique/name`.
1318 Name string `json:"name,omitempty"`
1319 // Response: The normal, successful response of the operation. If the original
1320 // method returns no data on success, such as `Delete`, the response is
1321 // `google.protobuf.Empty`. If the original method is standard
1322 // `Get`/`Create`/`Update`, the response should be the resource. For other
1323 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
1324 // original method name. For example, if the original method name is
1325 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
1326 Response googleapi.RawMessage `json:"response,omitempty"`
1327
1328 // ServerResponse contains the HTTP response code and headers from the server.
1329 googleapi.ServerResponse `json:"-"`
1330 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
1331 // include in API requests. By default, fields with empty or default values are
1332 // omitted from API requests. See
1333 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1334 // details.
1335 ForceSendFields []string `json:"-"`
1336 // NullFields is a list of field names (e.g. "Done") to include in API requests
1337 // with the JSON null value. By default, fields with empty values are omitted
1338 // from API requests. See
1339 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1340 NullFields []string `json:"-"`
1341 }
1342
1343 func (s Operation) MarshalJSON() ([]byte, error) {
1344 type NoMethod Operation
1345 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1346 }
1347
1348 // PauseTransferOperationRequest: Request passed to PauseTransferOperation.
1349 type PauseTransferOperationRequest struct {
1350 }
1351
1352 // PosixFilesystem: A POSIX filesystem resource.
1353 type PosixFilesystem struct {
1354 // RootDirectory: Root directory path to the filesystem.
1355 RootDirectory string `json:"rootDirectory,omitempty"`
1356 // ForceSendFields is a list of field names (e.g. "RootDirectory") to
1357 // unconditionally include in API requests. By default, fields with empty or
1358 // default values are omitted from API requests. See
1359 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1360 // details.
1361 ForceSendFields []string `json:"-"`
1362 // NullFields is a list of field names (e.g. "RootDirectory") to include in API
1363 // requests with the JSON null value. By default, fields with empty values are
1364 // omitted from API requests. See
1365 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1366 NullFields []string `json:"-"`
1367 }
1368
1369 func (s PosixFilesystem) MarshalJSON() ([]byte, error) {
1370 type NoMethod PosixFilesystem
1371 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1372 }
1373
1374 // ReplicationSpec: Specifies the configuration for a cross-bucket replication
1375 // job. Cross-bucket replication copies new or updated objects from a source
1376 // Cloud Storage bucket to a destination Cloud Storage bucket. Existing objects
1377 // in the source bucket are not copied by a new cross-bucket replication job.
1378 type ReplicationSpec struct {
1379 // GcsDataSink: The Cloud Storage bucket to which to replicate objects.
1380 GcsDataSink *GcsData `json:"gcsDataSink,omitempty"`
1381 // GcsDataSource: The Cloud Storage bucket from which to replicate objects.
1382 GcsDataSource *GcsData `json:"gcsDataSource,omitempty"`
1383 // ObjectConditions: Object conditions that determine which objects are
1384 // transferred. For replication jobs, only `include_prefixes` and
1385 // `exclude_prefixes` are supported.
1386 ObjectConditions *ObjectConditions `json:"objectConditions,omitempty"`
1387 // TransferOptions: Specifies the metadata options to be applied during
1388 // replication. Delete options are not supported. If a delete option is
1389 // specified, the request fails with an INVALID_ARGUMENT error.
1390 TransferOptions *TransferOptions `json:"transferOptions,omitempty"`
1391 // ForceSendFields is a list of field names (e.g. "GcsDataSink") to
1392 // unconditionally include in API requests. By default, fields with empty or
1393 // default values are omitted from API requests. See
1394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1395 // details.
1396 ForceSendFields []string `json:"-"`
1397 // NullFields is a list of field names (e.g. "GcsDataSink") to include in API
1398 // requests with the JSON null value. By default, fields with empty values are
1399 // omitted from API requests. See
1400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1401 NullFields []string `json:"-"`
1402 }
1403
1404 func (s ReplicationSpec) MarshalJSON() ([]byte, error) {
1405 type NoMethod ReplicationSpec
1406 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1407 }
1408
1409 // ResumeTransferOperationRequest: Request passed to ResumeTransferOperation.
1410 type ResumeTransferOperationRequest struct {
1411 }
1412
1413 // RunTransferJobRequest: Request passed to RunTransferJob.
1414 type RunTransferJobRequest struct {
1415 // ProjectId: Required. The ID of the Google Cloud project that owns the
1416 // transfer job.
1417 ProjectId string `json:"projectId,omitempty"`
1418 // ForceSendFields is a list of field names (e.g. "ProjectId") to
1419 // unconditionally include in API requests. By default, fields with empty or
1420 // default values are omitted from API requests. See
1421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1422 // details.
1423 ForceSendFields []string `json:"-"`
1424 // NullFields is a list of field names (e.g. "ProjectId") to include in API
1425 // requests with the JSON null value. By default, fields with empty values are
1426 // omitted from API requests. See
1427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1428 NullFields []string `json:"-"`
1429 }
1430
1431 func (s RunTransferJobRequest) MarshalJSON() ([]byte, error) {
1432 type NoMethod RunTransferJobRequest
1433 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1434 }
1435
1436 // S3CompatibleMetadata: S3CompatibleMetadata contains the metadata fields that
1437 // apply to the basic types of S3-compatible data providers.
1438 type S3CompatibleMetadata struct {
1439 // AuthMethod: Specifies the authentication and authorization method used by
1440 // the storage service. When not specified, Transfer Service will attempt to
1441 // determine right auth method to use.
1442 //
1443 // Possible values:
1444 // "AUTH_METHOD_UNSPECIFIED" - AuthMethod is not specified.
1445 // "AUTH_METHOD_AWS_SIGNATURE_V4" - Auth requests with AWS SigV4.
1446 // "AUTH_METHOD_AWS_SIGNATURE_V2" - Auth requests with AWS SigV2.
1447 AuthMethod string `json:"authMethod,omitempty"`
1448 // ListApi: The Listing API to use for discovering objects. When not specified,
1449 // Transfer Service will attempt to determine the right API to use.
1450 //
1451 // Possible values:
1452 // "LIST_API_UNSPECIFIED" - ListApi is not specified.
1453 // "LIST_OBJECTS_V2" - Perform listing using ListObjectsV2 API.
1454 // "LIST_OBJECTS" - Legacy ListObjects API.
1455 ListApi string `json:"listApi,omitempty"`
1456 // Protocol: Specifies the network protocol of the agent. When not specified,
1457 // the default value of NetworkProtocol NETWORK_PROTOCOL_HTTPS is used.
1458 //
1459 // Possible values:
1460 // "NETWORK_PROTOCOL_UNSPECIFIED" - NetworkProtocol is not specified.
1461 // "NETWORK_PROTOCOL_HTTPS" - Perform requests using HTTPS.
1462 // "NETWORK_PROTOCOL_HTTP" - Not recommended: This sends data in clear-text.
1463 // This is only appropriate within a closed network or for publicly available
1464 // data. Perform requests using HTTP.
1465 Protocol string `json:"protocol,omitempty"`
1466 // RequestModel: Specifies the API request model used to call the storage
1467 // service. When not specified, the default value of RequestModel
1468 // REQUEST_MODEL_VIRTUAL_HOSTED_STYLE is used.
1469 //
1470 // Possible values:
1471 // "REQUEST_MODEL_UNSPECIFIED" - RequestModel is not specified.
1472 // "REQUEST_MODEL_VIRTUAL_HOSTED_STYLE" - Perform requests using Virtual
1473 // Hosted Style. Example: https://bucket-name.s3.region.amazonaws.com/key-name
1474 // "REQUEST_MODEL_PATH_STYLE" - Perform requests using Path Style. Example:
1475 // https://s3.region.amazonaws.com/bucket-name/key-name
1476 RequestModel string `json:"requestModel,omitempty"`
1477 // ForceSendFields is a list of field names (e.g. "AuthMethod") to
1478 // unconditionally include in API requests. By default, fields with empty or
1479 // default values are omitted from API requests. See
1480 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1481 // details.
1482 ForceSendFields []string `json:"-"`
1483 // NullFields is a list of field names (e.g. "AuthMethod") to include in API
1484 // requests with the JSON null value. By default, fields with empty values are
1485 // omitted from API requests. See
1486 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1487 NullFields []string `json:"-"`
1488 }
1489
1490 func (s S3CompatibleMetadata) MarshalJSON() ([]byte, error) {
1491 type NoMethod S3CompatibleMetadata
1492 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1493 }
1494
1495 // Schedule: Transfers can be scheduled to recur or to run just once.
1496 type Schedule struct {
1497 // EndTimeOfDay: The time in UTC that no further transfer operations are
1498 // scheduled. Combined with schedule_end_date, `end_time_of_day` specifies the
1499 // end date and time for starting new transfer operations. This field must be
1500 // greater than or equal to the timestamp corresponding to the combination of
1501 // schedule_start_date and start_time_of_day, and is subject to the following:
1502 // * If `end_time_of_day` is not set and `schedule_end_date` is set, then a
1503 // default value of `23:59:59` is used for `end_time_of_day`. * If
1504 // `end_time_of_day` is set and `schedule_end_date` is not set, then
1505 // INVALID_ARGUMENT is returned.
1506 EndTimeOfDay *TimeOfDay `json:"endTimeOfDay,omitempty"`
1507 // RepeatInterval: Interval between the start of each scheduled
1508 // TransferOperation. If unspecified, the default value is 24 hours. This value
1509 // may not be less than 1 hour.
1510 RepeatInterval string `json:"repeatInterval,omitempty"`
1511 // ScheduleEndDate: The last day a transfer runs. Date boundaries are
1512 // determined relative to UTC time. A job runs once per 24 hours within the
1513 // following guidelines: * If `schedule_end_date` and schedule_start_date are
1514 // the same and in the future relative to UTC, the transfer is executed only
1515 // one time. * If `schedule_end_date` is later than `schedule_start_date` and
1516 // `schedule_end_date` is in the future relative to UTC, the job runs each day
1517 // at start_time_of_day through `schedule_end_date`.
1518 ScheduleEndDate *Date `json:"scheduleEndDate,omitempty"`
1519 // ScheduleStartDate: Required. The start date of a transfer. Date boundaries
1520 // are determined relative to UTC time. If `schedule_start_date` and
1521 // start_time_of_day are in the past relative to the job's creation time, the
1522 // transfer starts the day after you schedule the transfer request. **Note:**
1523 // When starting jobs at or near midnight UTC it is possible that a job starts
1524 // later than expected. For example, if you send an outbound request on June 1
1525 // one millisecond prior to midnight UTC and the Storage Transfer Service
1526 // server receives the request on June 2, then it creates a TransferJob with
1527 // `schedule_start_date` set to June 2 and a `start_time_of_day` set to
1528 // midnight UTC. The first scheduled TransferOperation takes place on June 3 at
1529 // midnight UTC.
1530 ScheduleStartDate *Date `json:"scheduleStartDate,omitempty"`
1531 // StartTimeOfDay: The time in UTC that a transfer job is scheduled to run.
1532 // Transfers may start later than this time. If `start_time_of_day` is not
1533 // specified: * One-time transfers run immediately. * Recurring transfers run
1534 // immediately, and each day at midnight UTC, through schedule_end_date. If
1535 // `start_time_of_day` is specified: * One-time transfers run at the specified
1536 // time. * Recurring transfers run at the specified time each day, through
1537 // `schedule_end_date`.
1538 StartTimeOfDay *TimeOfDay `json:"startTimeOfDay,omitempty"`
1539 // ForceSendFields is a list of field names (e.g. "EndTimeOfDay") to
1540 // unconditionally include in API requests. By default, fields with empty or
1541 // default values are omitted from API requests. See
1542 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1543 // details.
1544 ForceSendFields []string `json:"-"`
1545 // NullFields is a list of field names (e.g. "EndTimeOfDay") to include in API
1546 // requests with the JSON null value. By default, fields with empty values are
1547 // omitted from API requests. See
1548 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1549 NullFields []string `json:"-"`
1550 }
1551
1552 func (s Schedule) MarshalJSON() ([]byte, error) {
1553 type NoMethod Schedule
1554 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1555 }
1556
1557 // Status: The `Status` type defines a logical error model that is suitable for
1558 // different programming environments, including REST APIs and RPC APIs. It is
1559 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
1560 // pieces of data: error code, error message, and error details. You can find
1561 // out more about this error model and how to work with it in the API Design
1562 // Guide (https://cloud.google.com/apis/design/errors).
1563 type Status struct {
1564 // Code: The status code, which should be an enum value of google.rpc.Code.
1565 Code int64 `json:"code,omitempty"`
1566 // Details: A list of messages that carry the error details. There is a common
1567 // set of message types for APIs to use.
1568 Details []googleapi.RawMessage `json:"details,omitempty"`
1569 // Message: A developer-facing error message, which should be in English. Any
1570 // user-facing error message should be localized and sent in the
1571 // google.rpc.Status.details field, or localized by the client.
1572 Message string `json:"message,omitempty"`
1573 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1574 // include in API requests. By default, fields with empty or default values are
1575 // omitted from API requests. See
1576 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1577 // details.
1578 ForceSendFields []string `json:"-"`
1579 // NullFields is a list of field names (e.g. "Code") to include in API requests
1580 // with the JSON null value. By default, fields with empty values are omitted
1581 // from API requests. See
1582 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1583 NullFields []string `json:"-"`
1584 }
1585
1586 func (s Status) MarshalJSON() ([]byte, error) {
1587 type NoMethod Status
1588 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1589 }
1590
1591 // TimeOfDay: Represents a time of day. The date and time zone are either not
1592 // significant or are specified elsewhere. An API may choose to allow leap
1593 // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
1594 type TimeOfDay struct {
1595 // Hours: Hours of a day in 24 hour format. Must be greater than or equal to 0
1596 // and typically must be less than or equal to 23. An API may choose to allow
1597 // the value "24:00:00" for scenarios like business closing time.
1598 Hours int64 `json:"hours,omitempty"`
1599 // Minutes: Minutes of an hour. Must be greater than or equal to 0 and less
1600 // than or equal to 59.
1601 Minutes int64 `json:"minutes,omitempty"`
1602 // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal
1603 // to 0 and less than or equal to 999,999,999.
1604 Nanos int64 `json:"nanos,omitempty"`
1605 // Seconds: Seconds of a minute. Must be greater than or equal to 0 and
1606 // typically must be less than or equal to 59. An API may allow the value 60 if
1607 // it allows leap-seconds.
1608 Seconds int64 `json:"seconds,omitempty"`
1609 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally
1610 // include in API requests. By default, fields with empty or default values are
1611 // omitted from API requests. See
1612 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1613 // details.
1614 ForceSendFields []string `json:"-"`
1615 // NullFields is a list of field names (e.g. "Hours") to include in API
1616 // requests with the JSON null value. By default, fields with empty values are
1617 // omitted from API requests. See
1618 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1619 NullFields []string `json:"-"`
1620 }
1621
1622 func (s TimeOfDay) MarshalJSON() ([]byte, error) {
1623 type NoMethod TimeOfDay
1624 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1625 }
1626
1627 // TransferCounters: A collection of counters that report the progress of a
1628 // transfer operation.
1629 type TransferCounters struct {
1630 // BytesCopiedToSink: Bytes that are copied to the data sink.
1631 BytesCopiedToSink int64 `json:"bytesCopiedToSink,omitempty,string"`
1632 // BytesDeletedFromSink: Bytes that are deleted from the data sink.
1633 BytesDeletedFromSink int64 `json:"bytesDeletedFromSink,omitempty,string"`
1634 // BytesDeletedFromSource: Bytes that are deleted from the data source.
1635 BytesDeletedFromSource int64 `json:"bytesDeletedFromSource,omitempty,string"`
1636 // BytesFailedToDeleteFromSink: Bytes that failed to be deleted from the data
1637 // sink.
1638 BytesFailedToDeleteFromSink int64 `json:"bytesFailedToDeleteFromSink,omitempty,string"`
1639 // BytesFoundFromSource: Bytes found in the data source that are scheduled to
1640 // be transferred, excluding any that are filtered based on object conditions
1641 // or skipped due to sync.
1642 BytesFoundFromSource int64 `json:"bytesFoundFromSource,omitempty,string"`
1643 // BytesFoundOnlyFromSink: Bytes found only in the data sink that are scheduled
1644 // to be deleted.
1645 BytesFoundOnlyFromSink int64 `json:"bytesFoundOnlyFromSink,omitempty,string"`
1646 // BytesFromSourceFailed: Bytes in the data source that failed to be
1647 // transferred or that failed to be deleted after being transferred.
1648 BytesFromSourceFailed int64 `json:"bytesFromSourceFailed,omitempty,string"`
1649 // BytesFromSourceSkippedBySync: Bytes in the data source that are not
1650 // transferred because they already exist in the data sink.
1651 BytesFromSourceSkippedBySync int64 `json:"bytesFromSourceSkippedBySync,omitempty,string"`
1652 // DirectoriesFailedToListFromSource: For transfers involving PosixFilesystem
1653 // only. Number of listing failures for each directory found at the source.
1654 // Potential failures when listing a directory include permission failure or
1655 // block failure. If listing a directory fails, no files in the directory are
1656 // transferred.
1657 DirectoriesFailedToListFromSource int64 `json:"directoriesFailedToListFromSource,omitempty,string"`
1658 // DirectoriesFoundFromSource: For transfers involving PosixFilesystem only.
1659 // Number of directories found while listing. For example, if the root
1660 // directory of the transfer is `base/` and there are two other directories,
1661 // `a/` and `b/` under this directory, the count after listing `base/`,
1662 // `base/a/` and `base/b/` is 3.
1663 DirectoriesFoundFromSource int64 `json:"directoriesFoundFromSource,omitempty,string"`
1664 // DirectoriesSuccessfullyListedFromSource: For transfers involving
1665 // PosixFilesystem only. Number of successful listings for each directory found
1666 // at the source.
1667 DirectoriesSuccessfullyListedFromSource int64 `json:"directoriesSuccessfullyListedFromSource,omitempty,string"`
1668 // IntermediateObjectsCleanedUp: Number of successfully cleaned up intermediate
1669 // objects.
1670 IntermediateObjectsCleanedUp int64 `json:"intermediateObjectsCleanedUp,omitempty,string"`
1671 // IntermediateObjectsFailedCleanedUp: Number of intermediate objects failed
1672 // cleaned up.
1673 IntermediateObjectsFailedCleanedUp int64 `json:"intermediateObjectsFailedCleanedUp,omitempty,string"`
1674 // ObjectsCopiedToSink: Objects that are copied to the data sink.
1675 ObjectsCopiedToSink int64 `json:"objectsCopiedToSink,omitempty,string"`
1676 // ObjectsDeletedFromSink: Objects that are deleted from the data sink.
1677 ObjectsDeletedFromSink int64 `json:"objectsDeletedFromSink,omitempty,string"`
1678 // ObjectsDeletedFromSource: Objects that are deleted from the data source.
1679 ObjectsDeletedFromSource int64 `json:"objectsDeletedFromSource,omitempty,string"`
1680 // ObjectsFailedToDeleteFromSink: Objects that failed to be deleted from the
1681 // data sink.
1682 ObjectsFailedToDeleteFromSink int64 `json:"objectsFailedToDeleteFromSink,omitempty,string"`
1683 // ObjectsFoundFromSource: Objects found in the data source that are scheduled
1684 // to be transferred, excluding any that are filtered based on object
1685 // conditions or skipped due to sync.
1686 ObjectsFoundFromSource int64 `json:"objectsFoundFromSource,omitempty,string"`
1687 // ObjectsFoundOnlyFromSink: Objects found only in the data sink that are
1688 // scheduled to be deleted.
1689 ObjectsFoundOnlyFromSink int64 `json:"objectsFoundOnlyFromSink,omitempty,string"`
1690 // ObjectsFromSourceFailed: Objects in the data source that failed to be
1691 // transferred or that failed to be deleted after being transferred.
1692 ObjectsFromSourceFailed int64 `json:"objectsFromSourceFailed,omitempty,string"`
1693 // ObjectsFromSourceSkippedBySync: Objects in the data source that are not
1694 // transferred because they already exist in the data sink.
1695 ObjectsFromSourceSkippedBySync int64 `json:"objectsFromSourceSkippedBySync,omitempty,string"`
1696 // UnrestoredDeepArchiveObjectsSkippedCount: Number of unrestored deep archive
1697 // objects skipped.
1698 UnrestoredDeepArchiveObjectsSkippedCount int64 `json:"unrestoredDeepArchiveObjectsSkippedCount,omitempty,string"`
1699 // UnsupportedS3GlacierObjectsSkippedCount: Number of glacier objects skipped,
1700 // glacier objects are unsupported by default regardless of the restore status.
1701 // Allowlist the project to copy glacier objects if needed.
1702 UnsupportedS3GlacierObjectsSkippedCount int64 `json:"unsupportedS3GlacierObjectsSkippedCount,omitempty,string"`
1703 // ForceSendFields is a list of field names (e.g. "BytesCopiedToSink") to
1704 // unconditionally include in API requests. By default, fields with empty or
1705 // default values are omitted from API requests. See
1706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1707 // details.
1708 ForceSendFields []string `json:"-"`
1709 // NullFields is a list of field names (e.g. "BytesCopiedToSink") to include in
1710 // API requests with the JSON null value. By default, fields with empty values
1711 // are omitted from API requests. See
1712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1713 NullFields []string `json:"-"`
1714 }
1715
1716 func (s TransferCounters) MarshalJSON() ([]byte, error) {
1717 type NoMethod TransferCounters
1718 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1719 }
1720
1721 // TransferJob: This resource represents the configuration of a transfer job
1722 // that runs periodically.
1723 type TransferJob struct {
1724 // CreationTime: Output only. The time that the transfer job was created.
1725 CreationTime string `json:"creationTime,omitempty"`
1726 // DeletionTime: Output only. The time that the transfer job was deleted.
1727 DeletionTime string `json:"deletionTime,omitempty"`
1728 // Description: A description provided by the user for the job. Its max length
1729 // is 1024 bytes when Unicode-encoded.
1730 Description string `json:"description,omitempty"`
1731 // EventStream: Specifies the event stream for the transfer job for
1732 // event-driven transfers. When EventStream is specified, the Schedule fields
1733 // are ignored.
1734 EventStream *EventStream `json:"eventStream,omitempty"`
1735 // LastModificationTime: Output only. The time that the transfer job was last
1736 // modified.
1737 LastModificationTime string `json:"lastModificationTime,omitempty"`
1738 // LatestOperationName: The name of the most recently started TransferOperation
1739 // of this JobConfig. Present if a TransferOperation has been created for this
1740 // JobConfig.
1741 LatestOperationName string `json:"latestOperationName,omitempty"`
1742 // LoggingConfig: Logging configuration.
1743 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
1744 // Name: A unique name (within the transfer project) assigned when the job is
1745 // created. If this field is empty in a CreateTransferJobRequest, Storage
1746 // Transfer Service assigns a unique name. Otherwise, the specified name is
1747 // used as the unique name for this job. If the specified name is in use by a
1748 // job, the creation request fails with an ALREADY_EXISTS error. This name must
1749 // start with "transferJobs/" prefix and end with a letter or a number, and
1750 // should be no more than 128 characters. For transfers involving
1751 // PosixFilesystem, this name must start with `transferJobs/OPI` specifically.
1752 // For all other transfer types, this name must not start with
1753 // `transferJobs/OPI`. Non-PosixFilesystem example:
1754 // "transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$" PosixFilesystem
1755 // example: "transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$" Applications must
1756 // not rely on the enforcement of naming requirements involving OPI. Invalid
1757 // job names fail with an INVALID_ARGUMENT error.
1758 Name string `json:"name,omitempty"`
1759 // NotificationConfig: Notification configuration.
1760 NotificationConfig *NotificationConfig `json:"notificationConfig,omitempty"`
1761 // ProjectId: The ID of the Google Cloud project that owns the job.
1762 ProjectId string `json:"projectId,omitempty"`
1763 // ReplicationSpec: Replication specification.
1764 ReplicationSpec *ReplicationSpec `json:"replicationSpec,omitempty"`
1765 // Schedule: Specifies schedule for the transfer job. This is an optional
1766 // field. When the field is not set, the job never executes a transfer, unless
1767 // you invoke RunTransferJob or update the job to have a non-empty schedule.
1768 Schedule *Schedule `json:"schedule,omitempty"`
1769 // ServiceAccount: Optional. The user-managed service account to which to
1770 // delegate service agent permissions. You can grant Cloud Storage bucket
1771 // permissions to this service account instead of to the Transfer Service
1772 // service agent. Either the service account email
1773 // (`SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com`) or the unique ID
1774 // (`123456789012345678901`) are accepted. See
1775 // https://docs.cloud.google.com/storage-transfer/docs/delegate-service-agent-permissions
1776 // for required permissions.
1777 ServiceAccount string `json:"serviceAccount,omitempty"`
1778 // Status: Status of the job. This value MUST be specified for
1779 // `CreateTransferJobRequests`. **Note:** The effect of the new job status
1780 // takes place during a subsequent job run. For example, if you change the job
1781 // status from ENABLED to DISABLED, and an operation spawned by the transfer is
1782 // running, the status change would not affect the current operation.
1783 //
1784 // Possible values:
1785 // "STATUS_UNSPECIFIED" - Zero is an illegal value.
1786 // "ENABLED" - New transfers are performed based on the schedule.
1787 // "DISABLED" - New transfers are not scheduled.
1788 // "DELETED" - This is a soft delete state. After a transfer job is set to
1789 // this state, the job and all the transfer executions are subject to garbage
1790 // collection. Transfer jobs become eligible for garbage collection 30 days
1791 // after their status is set to `DELETED`.
1792 Status string `json:"status,omitempty"`
1793 // TransferSpec: Transfer specification.
1794 TransferSpec *TransferSpec `json:"transferSpec,omitempty"`
1795
1796 // ServerResponse contains the HTTP response code and headers from the server.
1797 googleapi.ServerResponse `json:"-"`
1798 // ForceSendFields is a list of field names (e.g. "CreationTime") to
1799 // unconditionally include in API requests. By default, fields with empty or
1800 // default values are omitted from API requests. See
1801 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1802 // details.
1803 ForceSendFields []string `json:"-"`
1804 // NullFields is a list of field names (e.g. "CreationTime") to include in API
1805 // requests with the JSON null value. By default, fields with empty values are
1806 // omitted from API requests. See
1807 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1808 NullFields []string `json:"-"`
1809 }
1810
1811 func (s TransferJob) MarshalJSON() ([]byte, error) {
1812 type NoMethod TransferJob
1813 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1814 }
1815
1816 // TransferManifest: Specifies where the manifest is located.
1817 type TransferManifest struct {
1818 // Location: Specifies the path to the manifest in Cloud Storage. The
1819 // Google-managed service account for the transfer must have
1820 // `storage.objects.get` permission for this object. An example path is
1821 // `gs://bucket_name/path/manifest.csv`.
1822 Location string `json:"location,omitempty"`
1823 // ForceSendFields is a list of field names (e.g. "Location") to
1824 // unconditionally include in API requests. By default, fields with empty or
1825 // default values are omitted from API requests. See
1826 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1827 // details.
1828 ForceSendFields []string `json:"-"`
1829 // NullFields is a list of field names (e.g. "Location") to include in API
1830 // requests with the JSON null value. By default, fields with empty values are
1831 // omitted from API requests. See
1832 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1833 NullFields []string `json:"-"`
1834 }
1835
1836 func (s TransferManifest) MarshalJSON() ([]byte, error) {
1837 type NoMethod TransferManifest
1838 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1839 }
1840
1841 // TransferOperation: A description of the execution of a transfer.
1842 type TransferOperation struct {
1843 // Counters: Information about the progress of the transfer operation.
1844 Counters *TransferCounters `json:"counters,omitempty"`
1845 // EndTime: End time of this transfer execution.
1846 EndTime string `json:"endTime,omitempty"`
1847 // ErrorBreakdowns: Summarizes errors encountered with sample error log
1848 // entries.
1849 ErrorBreakdowns []*ErrorSummary `json:"errorBreakdowns,omitempty"`
1850 // LoggingConfig: Cloud Logging configuration.
1851 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
1852 // Name: A globally unique ID assigned by the system.
1853 Name string `json:"name,omitempty"`
1854 // NotificationConfig: Notification configuration.
1855 NotificationConfig *NotificationConfig `json:"notificationConfig,omitempty"`
1856 // ProjectId: The ID of the Google Cloud project that owns the operation.
1857 ProjectId string `json:"projectId,omitempty"`
1858 // StartTime: Start time of this transfer execution.
1859 StartTime string `json:"startTime,omitempty"`
1860 // Status: Status of the transfer operation.
1861 //
1862 // Possible values:
1863 // "STATUS_UNSPECIFIED" - Zero is an illegal value.
1864 // "IN_PROGRESS" - In progress.
1865 // "PAUSED" - Paused.
1866 // "SUCCESS" - Completed successfully.
1867 // "FAILED" - Terminated due to an unrecoverable failure.
1868 // "ABORTED" - Aborted by the user.
1869 // "QUEUED" - Temporarily delayed by the system. No user action is required.
1870 // "SUSPENDING" - The operation is suspending and draining the ongoing work
1871 // to completion.
1872 Status string `json:"status,omitempty"`
1873 // TransferJobName: The name of the transfer job that triggers this transfer
1874 // operation.
1875 TransferJobName string `json:"transferJobName,omitempty"`
1876 // TransferSpec: Transfer specification.
1877 TransferSpec *TransferSpec `json:"transferSpec,omitempty"`
1878 // ForceSendFields is a list of field names (e.g. "Counters") to
1879 // unconditionally include in API requests. By default, fields with empty or
1880 // default values are omitted from API requests. See
1881 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1882 // details.
1883 ForceSendFields []string `json:"-"`
1884 // NullFields is a list of field names (e.g. "Counters") to include in API
1885 // requests with the JSON null value. By default, fields with empty values are
1886 // omitted from API requests. See
1887 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1888 NullFields []string `json:"-"`
1889 }
1890
1891 func (s TransferOperation) MarshalJSON() ([]byte, error) {
1892 type NoMethod TransferOperation
1893 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1894 }
1895
1896 // TransferOptions: TransferOptions define the actions to be performed on
1897 // objects in a transfer.
1898 type TransferOptions struct {
1899 // DeleteObjectsFromSourceAfterTransfer: Whether objects should be deleted from
1900 // the source after they are transferred to the sink. **Note:** This option and
1901 // delete_objects_unique_in_sink are mutually exclusive.
1902 DeleteObjectsFromSourceAfterTransfer bool `json:"deleteObjectsFromSourceAfterTransfer,omitempty"`
1903 // DeleteObjectsUniqueInSink: Whether objects that exist only in the sink
1904 // should be deleted. **Note:** This option and
1905 // delete_objects_from_source_after_transfer are mutually exclusive.
1906 DeleteObjectsUniqueInSink bool `json:"deleteObjectsUniqueInSink,omitempty"`
1907 // MetadataOptions: Represents the selected metadata options for a transfer
1908 // job.
1909 MetadataOptions *MetadataOptions `json:"metadataOptions,omitempty"`
1910 // OverwriteObjectsAlreadyExistingInSink: When to overwrite objects that
1911 // already exist in the sink. The default is that only objects that are
1912 // different from the source are overwritten. If true, all objects in the sink
1913 // whose name matches an object in the source are overwritten with the source
1914 // object.
1915 OverwriteObjectsAlreadyExistingInSink bool `json:"overwriteObjectsAlreadyExistingInSink,omitempty"`
1916 // OverwriteWhen: When to overwrite objects that already exist in the sink. If
1917 // not set, overwrite behavior is determined by
1918 // overwrite_objects_already_existing_in_sink.
1919 //
1920 // Possible values:
1921 // "OVERWRITE_WHEN_UNSPECIFIED" - Overwrite behavior is unspecified.
1922 // "DIFFERENT" - Overwrites destination objects with the source objects, only
1923 // if the objects have the same name but different HTTP ETags or checksum
1924 // values.
1925 // "NEVER" - Never overwrites a destination object if a source object has the
1926 // same name. In this case, the source object is not transferred.
1927 // "ALWAYS" - Always overwrite the destination object with the source object,
1928 // even if the HTTP Etags or checksum values are the same.
1929 OverwriteWhen string `json:"overwriteWhen,omitempty"`
1930 // ForceSendFields is a list of field names (e.g.
1931 // "DeleteObjectsFromSourceAfterTransfer") to unconditionally include in API
1932 // requests. By default, fields with empty or default values are omitted from
1933 // API requests. See
1934 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1935 // details.
1936 ForceSendFields []string `json:"-"`
1937 // NullFields is a list of field names (e.g.
1938 // "DeleteObjectsFromSourceAfterTransfer") to include in API requests with the
1939 // JSON null value. By default, fields with empty values are omitted from API
1940 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
1941 // more details.
1942 NullFields []string `json:"-"`
1943 }
1944
1945 func (s TransferOptions) MarshalJSON() ([]byte, error) {
1946 type NoMethod TransferOptions
1947 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1948 }
1949
1950 // TransferSpec: Configuration for running a transfer.
1951 type TransferSpec struct {
1952 // AwsS3CompatibleDataSource: Optional. An AWS S3 compatible data source.
1953 AwsS3CompatibleDataSource *AwsS3CompatibleData `json:"awsS3CompatibleDataSource,omitempty"`
1954 // AwsS3DataSource: Optional. An AWS S3 data source.
1955 AwsS3DataSource *AwsS3Data `json:"awsS3DataSource,omitempty"`
1956 // AzureBlobStorageDataSource: Optional. An Azure Blob Storage data source.
1957 AzureBlobStorageDataSource *AzureBlobStorageData `json:"azureBlobStorageDataSource,omitempty"`
1958 // GcsDataSink: Optional. A Cloud Storage data sink.
1959 GcsDataSink *GcsData `json:"gcsDataSink,omitempty"`
1960 // GcsDataSource: Optional. A Cloud Storage data source.
1961 GcsDataSource *GcsData `json:"gcsDataSource,omitempty"`
1962 // GcsIntermediateDataLocation: For transfers between file systems, specifies a
1963 // Cloud Storage bucket to be used as an intermediate location through which to
1964 // transfer data. See Transfer data between file systems
1965 // (https://cloud.google.com/storage-transfer/docs/file-to-file) for more
1966 // information.
1967 GcsIntermediateDataLocation *GcsData `json:"gcsIntermediateDataLocation,omitempty"`
1968 // HdfsDataSource: Optional. An HDFS cluster data source.
1969 HdfsDataSource *HdfsData `json:"hdfsDataSource,omitempty"`
1970 // HttpDataSource: Optional. An HTTP URL data source.
1971 HttpDataSource *HttpData `json:"httpDataSource,omitempty"`
1972 // ObjectConditions: Only objects that satisfy these object conditions are
1973 // included in the set of data source and data sink objects. Object conditions
1974 // based on objects' "last modification time" do not exclude objects in a data
1975 // sink.
1976 ObjectConditions *ObjectConditions `json:"objectConditions,omitempty"`
1977 // PosixDataSink: Optional. A POSIX Filesystem data sink.
1978 PosixDataSink *PosixFilesystem `json:"posixDataSink,omitempty"`
1979 // PosixDataSource: Optional. A POSIX Filesystem data source.
1980 PosixDataSource *PosixFilesystem `json:"posixDataSource,omitempty"`
1981 // SinkAgentPoolName: Specifies the agent pool name associated with the posix
1982 // data sink. When unspecified, the default name is used.
1983 SinkAgentPoolName string `json:"sinkAgentPoolName,omitempty"`
1984 // SourceAgentPoolName: Specifies the agent pool name associated with the posix
1985 // data source. When unspecified, the default name is used.
1986 SourceAgentPoolName string `json:"sourceAgentPoolName,omitempty"`
1987 // TransferManifest: A manifest file provides a list of objects to be
1988 // transferred from the data source. This field points to the location of the
1989 // manifest file. Otherwise, the entire source bucket is used. ObjectConditions
1990 // still apply.
1991 TransferManifest *TransferManifest `json:"transferManifest,omitempty"`
1992 // TransferOptions: If the option delete_objects_unique_in_sink is `true` and
1993 // time-based object conditions such as 'last modification time' are specified,
1994 // the request fails with an INVALID_ARGUMENT error.
1995 TransferOptions *TransferOptions `json:"transferOptions,omitempty"`
1996 // ForceSendFields is a list of field names (e.g. "AwsS3CompatibleDataSource")
1997 // to unconditionally include in API requests. By default, fields with empty or
1998 // default values are omitted from API requests. See
1999 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2000 // details.
2001 ForceSendFields []string `json:"-"`
2002 // NullFields is a list of field names (e.g. "AwsS3CompatibleDataSource") to
2003 // include in API requests with the JSON null value. By default, fields with
2004 // empty values are omitted from API requests. See
2005 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2006 NullFields []string `json:"-"`
2007 }
2008
2009 func (s TransferSpec) MarshalJSON() ([]byte, error) {
2010 type NoMethod TransferSpec
2011 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2012 }
2013
2014 // UpdateTransferJobRequest: Request passed to UpdateTransferJob.
2015 type UpdateTransferJobRequest struct {
2016 // ProjectId: Required. The ID of the Google Cloud project that owns the job.
2017 ProjectId string `json:"projectId,omitempty"`
2018 // TransferJob: Required. The job to update. `transferJob` is expected to
2019 // specify one or more of five fields: description, transfer_spec,
2020 // notification_config, logging_config, and status. An
2021 // `UpdateTransferJobRequest` that specifies other fields are rejected with the
2022 // error INVALID_ARGUMENT. Updating a job status to DELETED requires
2023 // `storagetransfer.jobs.delete` permission.
2024 TransferJob *TransferJob `json:"transferJob,omitempty"`
2025 // UpdateTransferJobFieldMask: The field mask of the fields in `transferJob`
2026 // that are to be updated in this request. Fields in `transferJob` that can be
2027 // updated are: description, transfer_spec, notification_config,
2028 // logging_config, and status. To update the `transfer_spec` of the job, a
2029 // complete transfer specification must be provided. An incomplete
2030 // specification missing any required fields is rejected with the error
2031 // INVALID_ARGUMENT.
2032 UpdateTransferJobFieldMask string `json:"updateTransferJobFieldMask,omitempty"`
2033 // ForceSendFields is a list of field names (e.g. "ProjectId") to
2034 // unconditionally include in API requests. By default, fields with empty or
2035 // default values are omitted from API requests. See
2036 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2037 // details.
2038 ForceSendFields []string `json:"-"`
2039 // NullFields is a list of field names (e.g. "ProjectId") to include in API
2040 // requests with the JSON null value. By default, fields with empty values are
2041 // omitted from API requests. See
2042 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2043 NullFields []string `json:"-"`
2044 }
2045
2046 func (s UpdateTransferJobRequest) MarshalJSON() ([]byte, error) {
2047 type NoMethod UpdateTransferJobRequest
2048 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2049 }
2050
2051 type GoogleServiceAccountsGetCall struct {
2052 s *Service
2053 projectId string
2054 urlParams_ gensupport.URLParams
2055 ifNoneMatch_ string
2056 ctx_ context.Context
2057 header_ http.Header
2058 }
2059
2060 // Get: Returns the Google service account that is used by Storage Transfer
2061 // Service to access buckets in the project where transfers run or in other
2062 // projects. Each Google service account is associated with one Google Cloud
2063 // project. Users should add this service account to the Google Cloud Storage
2064 // bucket ACLs to grant access to Storage Transfer Service. This service
2065 // account is created and owned by Storage Transfer Service and can only be
2066 // used by Storage Transfer Service.
2067 //
2068 // - projectId: The ID of the Google Cloud project that the Google service
2069 // account is associated with.
2070 func (r *GoogleServiceAccountsService) Get(projectId string) *GoogleServiceAccountsGetCall {
2071 c := &GoogleServiceAccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2072 c.projectId = projectId
2073 return c
2074 }
2075
2076 // Fields allows partial responses to be retrieved. See
2077 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2078 // details.
2079 func (c *GoogleServiceAccountsGetCall) Fields(s ...googleapi.Field) *GoogleServiceAccountsGetCall {
2080 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2081 return c
2082 }
2083
2084 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2085 // object's ETag matches the given value. This is useful for getting updates
2086 // only after the object has changed since the last request.
2087 func (c *GoogleServiceAccountsGetCall) IfNoneMatch(entityTag string) *GoogleServiceAccountsGetCall {
2088 c.ifNoneMatch_ = entityTag
2089 return c
2090 }
2091
2092 // Context sets the context to be used in this call's Do method.
2093 func (c *GoogleServiceAccountsGetCall) Context(ctx context.Context) *GoogleServiceAccountsGetCall {
2094 c.ctx_ = ctx
2095 return c
2096 }
2097
2098 // Header returns a http.Header that can be modified by the caller to add
2099 // headers to the request.
2100 func (c *GoogleServiceAccountsGetCall) Header() http.Header {
2101 if c.header_ == nil {
2102 c.header_ = make(http.Header)
2103 }
2104 return c.header_
2105 }
2106
2107 func (c *GoogleServiceAccountsGetCall) doRequest(alt string) (*http.Response, error) {
2108 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2109 if c.ifNoneMatch_ != "" {
2110 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2111 }
2112 c.urlParams_.Set("alt", alt)
2113 c.urlParams_.Set("prettyPrint", "false")
2114 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/googleServiceAccounts/{projectId}")
2115 urls += "?" + c.urlParams_.Encode()
2116 req, err := http.NewRequest("GET", urls, nil)
2117 if err != nil {
2118 return nil, err
2119 }
2120 req.Header = reqHeaders
2121 googleapi.Expand(req.URL, map[string]string{
2122 "projectId": c.projectId,
2123 })
2124 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.googleServiceAccounts.get", "request", internallog.HTTPRequest(req, nil))
2125 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2126 }
2127
2128 // Do executes the "storagetransfer.googleServiceAccounts.get" call.
2129 // Any non-2xx status code is an error. Response headers are in either
2130 // *GoogleServiceAccount.ServerResponse.Header or (if a response was returned
2131 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2132 // check whether the returned error was because http.StatusNotModified was
2133 // returned.
2134 func (c *GoogleServiceAccountsGetCall) Do(opts ...googleapi.CallOption) (*GoogleServiceAccount, error) {
2135 gensupport.SetOptions(c.urlParams_, opts...)
2136 res, err := c.doRequest("json")
2137 if res != nil && res.StatusCode == http.StatusNotModified {
2138 if res.Body != nil {
2139 res.Body.Close()
2140 }
2141 return nil, gensupport.WrapError(&googleapi.Error{
2142 Code: res.StatusCode,
2143 Header: res.Header,
2144 })
2145 }
2146 if err != nil {
2147 return nil, err
2148 }
2149 defer googleapi.CloseBody(res)
2150 if err := googleapi.CheckResponse(res); err != nil {
2151 return nil, gensupport.WrapError(err)
2152 }
2153 ret := &GoogleServiceAccount{
2154 ServerResponse: googleapi.ServerResponse{
2155 Header: res.Header,
2156 HTTPStatusCode: res.StatusCode,
2157 },
2158 }
2159 target := &ret
2160 b, err := gensupport.DecodeResponseBytes(target, res)
2161 if err != nil {
2162 return nil, err
2163 }
2164 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.googleServiceAccounts.get", "response", internallog.HTTPResponse(res, b))
2165 return ret, nil
2166 }
2167
2168 type ProjectsAgentPoolsCreateCall struct {
2169 s *Service
2170 projectId string
2171 agentpool *AgentPool
2172 urlParams_ gensupport.URLParams
2173 ctx_ context.Context
2174 header_ http.Header
2175 }
2176
2177 // Create: Creates an agent pool resource.
2178 //
2179 // - projectId: The ID of the Google Cloud project that owns the agent pool.
2180 func (r *ProjectsAgentPoolsService) Create(projectId string, agentpool *AgentPool) *ProjectsAgentPoolsCreateCall {
2181 c := &ProjectsAgentPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2182 c.projectId = projectId
2183 c.agentpool = agentpool
2184 return c
2185 }
2186
2187 // AgentPoolId sets the optional parameter "agentPoolId": Required. The ID of
2188 // the agent pool to create. The `agent_pool_id` must meet the following
2189 // requirements: * Length of 128 characters or less. * Not start with the
2190 // string `goog`. * Start with a lowercase ASCII character, followed by: * Zero
2191 // or more: lowercase Latin alphabet characters, numerals, hyphens (`-`),
2192 // periods (`.`), underscores (`_`), or tildes (`~`). * One or more numerals or
2193 // lowercase ASCII characters. As expressed by the regular expression:
2194 // `^(?!goog)a-z ([a-z0-9-._~]*[a-z0-9])?$`.
2195 func (c *ProjectsAgentPoolsCreateCall) AgentPoolId(agentPoolId string) *ProjectsAgentPoolsCreateCall {
2196 c.urlParams_.Set("agentPoolId", agentPoolId)
2197 return c
2198 }
2199
2200 // Fields allows partial responses to be retrieved. See
2201 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2202 // details.
2203 func (c *ProjectsAgentPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsAgentPoolsCreateCall {
2204 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2205 return c
2206 }
2207
2208 // Context sets the context to be used in this call's Do method.
2209 func (c *ProjectsAgentPoolsCreateCall) Context(ctx context.Context) *ProjectsAgentPoolsCreateCall {
2210 c.ctx_ = ctx
2211 return c
2212 }
2213
2214 // Header returns a http.Header that can be modified by the caller to add
2215 // headers to the request.
2216 func (c *ProjectsAgentPoolsCreateCall) Header() http.Header {
2217 if c.header_ == nil {
2218 c.header_ = make(http.Header)
2219 }
2220 return c.header_
2221 }
2222
2223 func (c *ProjectsAgentPoolsCreateCall) doRequest(alt string) (*http.Response, error) {
2224 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2225 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentpool)
2226 if err != nil {
2227 return nil, err
2228 }
2229 c.urlParams_.Set("alt", alt)
2230 c.urlParams_.Set("prettyPrint", "false")
2231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{+projectId}/agentPools")
2232 urls += "?" + c.urlParams_.Encode()
2233 req, err := http.NewRequest("POST", urls, body)
2234 if err != nil {
2235 return nil, err
2236 }
2237 req.Header = reqHeaders
2238 googleapi.Expand(req.URL, map[string]string{
2239 "projectId": c.projectId,
2240 })
2241 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2242 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2243 }
2244
2245 // Do executes the "storagetransfer.projects.agentPools.create" call.
2246 // Any non-2xx status code is an error. Response headers are in either
2247 // *AgentPool.ServerResponse.Header or (if a response was returned at all) in
2248 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2249 // whether the returned error was because http.StatusNotModified was returned.
2250 func (c *ProjectsAgentPoolsCreateCall) Do(opts ...googleapi.CallOption) (*AgentPool, error) {
2251 gensupport.SetOptions(c.urlParams_, opts...)
2252 res, err := c.doRequest("json")
2253 if res != nil && res.StatusCode == http.StatusNotModified {
2254 if res.Body != nil {
2255 res.Body.Close()
2256 }
2257 return nil, gensupport.WrapError(&googleapi.Error{
2258 Code: res.StatusCode,
2259 Header: res.Header,
2260 })
2261 }
2262 if err != nil {
2263 return nil, err
2264 }
2265 defer googleapi.CloseBody(res)
2266 if err := googleapi.CheckResponse(res); err != nil {
2267 return nil, gensupport.WrapError(err)
2268 }
2269 ret := &AgentPool{
2270 ServerResponse: googleapi.ServerResponse{
2271 Header: res.Header,
2272 HTTPStatusCode: res.StatusCode,
2273 },
2274 }
2275 target := &ret
2276 b, err := gensupport.DecodeResponseBytes(target, res)
2277 if err != nil {
2278 return nil, err
2279 }
2280 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.create", "response", internallog.HTTPResponse(res, b))
2281 return ret, nil
2282 }
2283
2284 type ProjectsAgentPoolsDeleteCall struct {
2285 s *Service
2286 name string
2287 urlParams_ gensupport.URLParams
2288 ctx_ context.Context
2289 header_ http.Header
2290 }
2291
2292 // Delete: Deletes an agent pool.
2293 //
2294 // - name: The name of the agent pool to delete.
2295 func (r *ProjectsAgentPoolsService) Delete(name string) *ProjectsAgentPoolsDeleteCall {
2296 c := &ProjectsAgentPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2297 c.name = name
2298 return c
2299 }
2300
2301 // Fields allows partial responses to be retrieved. See
2302 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2303 // details.
2304 func (c *ProjectsAgentPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsAgentPoolsDeleteCall {
2305 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2306 return c
2307 }
2308
2309 // Context sets the context to be used in this call's Do method.
2310 func (c *ProjectsAgentPoolsDeleteCall) Context(ctx context.Context) *ProjectsAgentPoolsDeleteCall {
2311 c.ctx_ = ctx
2312 return c
2313 }
2314
2315 // Header returns a http.Header that can be modified by the caller to add
2316 // headers to the request.
2317 func (c *ProjectsAgentPoolsDeleteCall) Header() http.Header {
2318 if c.header_ == nil {
2319 c.header_ = make(http.Header)
2320 }
2321 return c.header_
2322 }
2323
2324 func (c *ProjectsAgentPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
2325 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2326 c.urlParams_.Set("alt", alt)
2327 c.urlParams_.Set("prettyPrint", "false")
2328 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2329 urls += "?" + c.urlParams_.Encode()
2330 req, err := http.NewRequest("DELETE", urls, nil)
2331 if err != nil {
2332 return nil, err
2333 }
2334 req.Header = reqHeaders
2335 googleapi.Expand(req.URL, map[string]string{
2336 "name": c.name,
2337 })
2338 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.delete", "request", internallog.HTTPRequest(req, nil))
2339 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2340 }
2341
2342 // Do executes the "storagetransfer.projects.agentPools.delete" call.
2343 // Any non-2xx status code is an error. Response headers are in either
2344 // *Empty.ServerResponse.Header or (if a response was returned at all) in
2345 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2346 // whether the returned error was because http.StatusNotModified was returned.
2347 func (c *ProjectsAgentPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2348 gensupport.SetOptions(c.urlParams_, opts...)
2349 res, err := c.doRequest("json")
2350 if res != nil && res.StatusCode == http.StatusNotModified {
2351 if res.Body != nil {
2352 res.Body.Close()
2353 }
2354 return nil, gensupport.WrapError(&googleapi.Error{
2355 Code: res.StatusCode,
2356 Header: res.Header,
2357 })
2358 }
2359 if err != nil {
2360 return nil, err
2361 }
2362 defer googleapi.CloseBody(res)
2363 if err := googleapi.CheckResponse(res); err != nil {
2364 return nil, gensupport.WrapError(err)
2365 }
2366 ret := &Empty{
2367 ServerResponse: googleapi.ServerResponse{
2368 Header: res.Header,
2369 HTTPStatusCode: res.StatusCode,
2370 },
2371 }
2372 target := &ret
2373 b, err := gensupport.DecodeResponseBytes(target, res)
2374 if err != nil {
2375 return nil, err
2376 }
2377 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.delete", "response", internallog.HTTPResponse(res, b))
2378 return ret, nil
2379 }
2380
2381 type ProjectsAgentPoolsGetCall struct {
2382 s *Service
2383 name string
2384 urlParams_ gensupport.URLParams
2385 ifNoneMatch_ string
2386 ctx_ context.Context
2387 header_ http.Header
2388 }
2389
2390 // Get: Gets an agent pool.
2391 //
2392 // - name: The name of the agent pool to get.
2393 func (r *ProjectsAgentPoolsService) Get(name string) *ProjectsAgentPoolsGetCall {
2394 c := &ProjectsAgentPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2395 c.name = name
2396 return c
2397 }
2398
2399 // Fields allows partial responses to be retrieved. See
2400 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2401 // details.
2402 func (c *ProjectsAgentPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsAgentPoolsGetCall {
2403 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2404 return c
2405 }
2406
2407 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2408 // object's ETag matches the given value. This is useful for getting updates
2409 // only after the object has changed since the last request.
2410 func (c *ProjectsAgentPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsAgentPoolsGetCall {
2411 c.ifNoneMatch_ = entityTag
2412 return c
2413 }
2414
2415 // Context sets the context to be used in this call's Do method.
2416 func (c *ProjectsAgentPoolsGetCall) Context(ctx context.Context) *ProjectsAgentPoolsGetCall {
2417 c.ctx_ = ctx
2418 return c
2419 }
2420
2421 // Header returns a http.Header that can be modified by the caller to add
2422 // headers to the request.
2423 func (c *ProjectsAgentPoolsGetCall) Header() http.Header {
2424 if c.header_ == nil {
2425 c.header_ = make(http.Header)
2426 }
2427 return c.header_
2428 }
2429
2430 func (c *ProjectsAgentPoolsGetCall) doRequest(alt string) (*http.Response, error) {
2431 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2432 if c.ifNoneMatch_ != "" {
2433 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2434 }
2435 c.urlParams_.Set("alt", alt)
2436 c.urlParams_.Set("prettyPrint", "false")
2437 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2438 urls += "?" + c.urlParams_.Encode()
2439 req, err := http.NewRequest("GET", urls, nil)
2440 if err != nil {
2441 return nil, err
2442 }
2443 req.Header = reqHeaders
2444 googleapi.Expand(req.URL, map[string]string{
2445 "name": c.name,
2446 })
2447 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.get", "request", internallog.HTTPRequest(req, nil))
2448 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2449 }
2450
2451 // Do executes the "storagetransfer.projects.agentPools.get" call.
2452 // Any non-2xx status code is an error. Response headers are in either
2453 // *AgentPool.ServerResponse.Header or (if a response was returned at all) in
2454 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2455 // whether the returned error was because http.StatusNotModified was returned.
2456 func (c *ProjectsAgentPoolsGetCall) Do(opts ...googleapi.CallOption) (*AgentPool, error) {
2457 gensupport.SetOptions(c.urlParams_, opts...)
2458 res, err := c.doRequest("json")
2459 if res != nil && res.StatusCode == http.StatusNotModified {
2460 if res.Body != nil {
2461 res.Body.Close()
2462 }
2463 return nil, gensupport.WrapError(&googleapi.Error{
2464 Code: res.StatusCode,
2465 Header: res.Header,
2466 })
2467 }
2468 if err != nil {
2469 return nil, err
2470 }
2471 defer googleapi.CloseBody(res)
2472 if err := googleapi.CheckResponse(res); err != nil {
2473 return nil, gensupport.WrapError(err)
2474 }
2475 ret := &AgentPool{
2476 ServerResponse: googleapi.ServerResponse{
2477 Header: res.Header,
2478 HTTPStatusCode: res.StatusCode,
2479 },
2480 }
2481 target := &ret
2482 b, err := gensupport.DecodeResponseBytes(target, res)
2483 if err != nil {
2484 return nil, err
2485 }
2486 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.get", "response", internallog.HTTPResponse(res, b))
2487 return ret, nil
2488 }
2489
2490 type ProjectsAgentPoolsListCall struct {
2491 s *Service
2492 projectId string
2493 urlParams_ gensupport.URLParams
2494 ifNoneMatch_ string
2495 ctx_ context.Context
2496 header_ http.Header
2497 }
2498
2499 // List: Lists agent pools.
2500 //
2501 // - projectId: The ID of the Google Cloud project that owns the job.
2502 func (r *ProjectsAgentPoolsService) List(projectId string) *ProjectsAgentPoolsListCall {
2503 c := &ProjectsAgentPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2504 c.projectId = projectId
2505 return c
2506 }
2507
2508 // Filter sets the optional parameter "filter": An optional list of query
2509 // parameters specified as JSON text in the form of:
2510 // `{"agentPoolNames":["agentpool1","agentpool2",...]}` Since `agentPoolNames`
2511 // support multiple values, its values must be specified with array notation.
2512 // When the filter is either empty or not provided, the list returns all agent
2513 // pools for the project.
2514 func (c *ProjectsAgentPoolsListCall) Filter(filter string) *ProjectsAgentPoolsListCall {
2515 c.urlParams_.Set("filter", filter)
2516 return c
2517 }
2518
2519 // PageSize sets the optional parameter "pageSize": The list page size. The max
2520 // allowed value is `256`.
2521 func (c *ProjectsAgentPoolsListCall) PageSize(pageSize int64) *ProjectsAgentPoolsListCall {
2522 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2523 return c
2524 }
2525
2526 // PageToken sets the optional parameter "pageToken": The list page token.
2527 func (c *ProjectsAgentPoolsListCall) PageToken(pageToken string) *ProjectsAgentPoolsListCall {
2528 c.urlParams_.Set("pageToken", pageToken)
2529 return c
2530 }
2531
2532 // Fields allows partial responses to be retrieved. See
2533 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2534 // details.
2535 func (c *ProjectsAgentPoolsListCall) Fields(s ...googleapi.Field) *ProjectsAgentPoolsListCall {
2536 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2537 return c
2538 }
2539
2540 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2541 // object's ETag matches the given value. This is useful for getting updates
2542 // only after the object has changed since the last request.
2543 func (c *ProjectsAgentPoolsListCall) IfNoneMatch(entityTag string) *ProjectsAgentPoolsListCall {
2544 c.ifNoneMatch_ = entityTag
2545 return c
2546 }
2547
2548 // Context sets the context to be used in this call's Do method.
2549 func (c *ProjectsAgentPoolsListCall) Context(ctx context.Context) *ProjectsAgentPoolsListCall {
2550 c.ctx_ = ctx
2551 return c
2552 }
2553
2554 // Header returns a http.Header that can be modified by the caller to add
2555 // headers to the request.
2556 func (c *ProjectsAgentPoolsListCall) Header() http.Header {
2557 if c.header_ == nil {
2558 c.header_ = make(http.Header)
2559 }
2560 return c.header_
2561 }
2562
2563 func (c *ProjectsAgentPoolsListCall) doRequest(alt string) (*http.Response, error) {
2564 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2565 if c.ifNoneMatch_ != "" {
2566 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2567 }
2568 c.urlParams_.Set("alt", alt)
2569 c.urlParams_.Set("prettyPrint", "false")
2570 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{+projectId}/agentPools")
2571 urls += "?" + c.urlParams_.Encode()
2572 req, err := http.NewRequest("GET", urls, nil)
2573 if err != nil {
2574 return nil, err
2575 }
2576 req.Header = reqHeaders
2577 googleapi.Expand(req.URL, map[string]string{
2578 "projectId": c.projectId,
2579 })
2580 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.list", "request", internallog.HTTPRequest(req, nil))
2581 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2582 }
2583
2584 // Do executes the "storagetransfer.projects.agentPools.list" call.
2585 // Any non-2xx status code is an error. Response headers are in either
2586 // *ListAgentPoolsResponse.ServerResponse.Header or (if a response was returned
2587 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2588 // check whether the returned error was because http.StatusNotModified was
2589 // returned.
2590 func (c *ProjectsAgentPoolsListCall) Do(opts ...googleapi.CallOption) (*ListAgentPoolsResponse, error) {
2591 gensupport.SetOptions(c.urlParams_, opts...)
2592 res, err := c.doRequest("json")
2593 if res != nil && res.StatusCode == http.StatusNotModified {
2594 if res.Body != nil {
2595 res.Body.Close()
2596 }
2597 return nil, gensupport.WrapError(&googleapi.Error{
2598 Code: res.StatusCode,
2599 Header: res.Header,
2600 })
2601 }
2602 if err != nil {
2603 return nil, err
2604 }
2605 defer googleapi.CloseBody(res)
2606 if err := googleapi.CheckResponse(res); err != nil {
2607 return nil, gensupport.WrapError(err)
2608 }
2609 ret := &ListAgentPoolsResponse{
2610 ServerResponse: googleapi.ServerResponse{
2611 Header: res.Header,
2612 HTTPStatusCode: res.StatusCode,
2613 },
2614 }
2615 target := &ret
2616 b, err := gensupport.DecodeResponseBytes(target, res)
2617 if err != nil {
2618 return nil, err
2619 }
2620 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.list", "response", internallog.HTTPResponse(res, b))
2621 return ret, nil
2622 }
2623
2624 // Pages invokes f for each page of results.
2625 // A non-nil error returned from f will halt the iteration.
2626 // The provided context supersedes any context provided to the Context method.
2627 func (c *ProjectsAgentPoolsListCall) Pages(ctx context.Context, f func(*ListAgentPoolsResponse) error) error {
2628 c.ctx_ = ctx
2629 defer c.PageToken(c.urlParams_.Get("pageToken"))
2630 for {
2631 x, err := c.Do()
2632 if err != nil {
2633 return err
2634 }
2635 if err := f(x); err != nil {
2636 return err
2637 }
2638 if x.NextPageToken == "" {
2639 return nil
2640 }
2641 c.PageToken(x.NextPageToken)
2642 }
2643 }
2644
2645 type ProjectsAgentPoolsPatchCall struct {
2646 s *Service
2647 name string
2648 agentpool *AgentPool
2649 urlParams_ gensupport.URLParams
2650 ctx_ context.Context
2651 header_ http.Header
2652 }
2653
2654 // Patch: Updates an existing agent pool resource.
2655 //
2656 // - name: Specifies a unique string that identifies the agent pool. Format:
2657 // `projects/{project_id}/agentPools/{agent_pool_id}`.
2658 func (r *ProjectsAgentPoolsService) Patch(name string, agentpool *AgentPool) *ProjectsAgentPoolsPatchCall {
2659 c := &ProjectsAgentPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2660 c.name = name
2661 c.agentpool = agentpool
2662 return c
2663 }
2664
2665 // UpdateMask sets the optional parameter "updateMask": The [field mask]
2666 // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf)
2667 // of the fields in `agentPool` to update in this request. The following
2668 // `agentPool` fields can be updated: * display_name * bandwidth_limit
2669 func (c *ProjectsAgentPoolsPatchCall) UpdateMask(updateMask string) *ProjectsAgentPoolsPatchCall {
2670 c.urlParams_.Set("updateMask", updateMask)
2671 return c
2672 }
2673
2674 // Fields allows partial responses to be retrieved. See
2675 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2676 // details.
2677 func (c *ProjectsAgentPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsAgentPoolsPatchCall {
2678 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2679 return c
2680 }
2681
2682 // Context sets the context to be used in this call's Do method.
2683 func (c *ProjectsAgentPoolsPatchCall) Context(ctx context.Context) *ProjectsAgentPoolsPatchCall {
2684 c.ctx_ = ctx
2685 return c
2686 }
2687
2688 // Header returns a http.Header that can be modified by the caller to add
2689 // headers to the request.
2690 func (c *ProjectsAgentPoolsPatchCall) Header() http.Header {
2691 if c.header_ == nil {
2692 c.header_ = make(http.Header)
2693 }
2694 return c.header_
2695 }
2696
2697 func (c *ProjectsAgentPoolsPatchCall) doRequest(alt string) (*http.Response, error) {
2698 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2699 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.agentpool)
2700 if err != nil {
2701 return nil, err
2702 }
2703 c.urlParams_.Set("alt", alt)
2704 c.urlParams_.Set("prettyPrint", "false")
2705 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2706 urls += "?" + c.urlParams_.Encode()
2707 req, err := http.NewRequest("PATCH", urls, body)
2708 if err != nil {
2709 return nil, err
2710 }
2711 req.Header = reqHeaders
2712 googleapi.Expand(req.URL, map[string]string{
2713 "name": c.name,
2714 })
2715 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
2716 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2717 }
2718
2719 // Do executes the "storagetransfer.projects.agentPools.patch" call.
2720 // Any non-2xx status code is an error. Response headers are in either
2721 // *AgentPool.ServerResponse.Header or (if a response was returned at all) in
2722 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2723 // whether the returned error was because http.StatusNotModified was returned.
2724 func (c *ProjectsAgentPoolsPatchCall) Do(opts ...googleapi.CallOption) (*AgentPool, error) {
2725 gensupport.SetOptions(c.urlParams_, opts...)
2726 res, err := c.doRequest("json")
2727 if res != nil && res.StatusCode == http.StatusNotModified {
2728 if res.Body != nil {
2729 res.Body.Close()
2730 }
2731 return nil, gensupport.WrapError(&googleapi.Error{
2732 Code: res.StatusCode,
2733 Header: res.Header,
2734 })
2735 }
2736 if err != nil {
2737 return nil, err
2738 }
2739 defer googleapi.CloseBody(res)
2740 if err := googleapi.CheckResponse(res); err != nil {
2741 return nil, gensupport.WrapError(err)
2742 }
2743 ret := &AgentPool{
2744 ServerResponse: googleapi.ServerResponse{
2745 Header: res.Header,
2746 HTTPStatusCode: res.StatusCode,
2747 },
2748 }
2749 target := &ret
2750 b, err := gensupport.DecodeResponseBytes(target, res)
2751 if err != nil {
2752 return nil, err
2753 }
2754 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.projects.agentPools.patch", "response", internallog.HTTPResponse(res, b))
2755 return ret, nil
2756 }
2757
2758 type TransferJobsCreateCall struct {
2759 s *Service
2760 transferjob *TransferJob
2761 urlParams_ gensupport.URLParams
2762 ctx_ context.Context
2763 header_ http.Header
2764 }
2765
2766 // Create: Creates a transfer job that runs periodically.
2767 func (r *TransferJobsService) Create(transferjob *TransferJob) *TransferJobsCreateCall {
2768 c := &TransferJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2769 c.transferjob = transferjob
2770 return c
2771 }
2772
2773 // Fields allows partial responses to be retrieved. See
2774 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2775 // details.
2776 func (c *TransferJobsCreateCall) Fields(s ...googleapi.Field) *TransferJobsCreateCall {
2777 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2778 return c
2779 }
2780
2781 // Context sets the context to be used in this call's Do method.
2782 func (c *TransferJobsCreateCall) Context(ctx context.Context) *TransferJobsCreateCall {
2783 c.ctx_ = ctx
2784 return c
2785 }
2786
2787 // Header returns a http.Header that can be modified by the caller to add
2788 // headers to the request.
2789 func (c *TransferJobsCreateCall) Header() http.Header {
2790 if c.header_ == nil {
2791 c.header_ = make(http.Header)
2792 }
2793 return c.header_
2794 }
2795
2796 func (c *TransferJobsCreateCall) doRequest(alt string) (*http.Response, error) {
2797 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2798 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.transferjob)
2799 if err != nil {
2800 return nil, err
2801 }
2802 c.urlParams_.Set("alt", alt)
2803 c.urlParams_.Set("prettyPrint", "false")
2804 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs")
2805 urls += "?" + c.urlParams_.Encode()
2806 req, err := http.NewRequest("POST", urls, body)
2807 if err != nil {
2808 return nil, err
2809 }
2810 req.Header = reqHeaders
2811 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2812 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2813 }
2814
2815 // Do executes the "storagetransfer.transferJobs.create" call.
2816 // Any non-2xx status code is an error. Response headers are in either
2817 // *TransferJob.ServerResponse.Header or (if a response was returned at all) in
2818 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2819 // whether the returned error was because http.StatusNotModified was returned.
2820 func (c *TransferJobsCreateCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
2821 gensupport.SetOptions(c.urlParams_, opts...)
2822 res, err := c.doRequest("json")
2823 if res != nil && res.StatusCode == http.StatusNotModified {
2824 if res.Body != nil {
2825 res.Body.Close()
2826 }
2827 return nil, gensupport.WrapError(&googleapi.Error{
2828 Code: res.StatusCode,
2829 Header: res.Header,
2830 })
2831 }
2832 if err != nil {
2833 return nil, err
2834 }
2835 defer googleapi.CloseBody(res)
2836 if err := googleapi.CheckResponse(res); err != nil {
2837 return nil, gensupport.WrapError(err)
2838 }
2839 ret := &TransferJob{
2840 ServerResponse: googleapi.ServerResponse{
2841 Header: res.Header,
2842 HTTPStatusCode: res.StatusCode,
2843 },
2844 }
2845 target := &ret
2846 b, err := gensupport.DecodeResponseBytes(target, res)
2847 if err != nil {
2848 return nil, err
2849 }
2850 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.create", "response", internallog.HTTPResponse(res, b))
2851 return ret, nil
2852 }
2853
2854 type TransferJobsDeleteCall struct {
2855 s *Service
2856 jobName string
2857 urlParams_ gensupport.URLParams
2858 ctx_ context.Context
2859 header_ http.Header
2860 }
2861
2862 // Delete: Deletes a transfer job. Deleting a transfer job sets its status to
2863 // DELETED.
2864 //
2865 // - jobName: The job to delete.
2866 // - projectId: The ID of the Google Cloud project that owns the job.
2867 func (r *TransferJobsService) Delete(jobName string, projectId string) *TransferJobsDeleteCall {
2868 c := &TransferJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2869 c.jobName = jobName
2870 c.urlParams_.Set("projectId", projectId)
2871 return c
2872 }
2873
2874 // Fields allows partial responses to be retrieved. See
2875 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2876 // details.
2877 func (c *TransferJobsDeleteCall) Fields(s ...googleapi.Field) *TransferJobsDeleteCall {
2878 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2879 return c
2880 }
2881
2882 // Context sets the context to be used in this call's Do method.
2883 func (c *TransferJobsDeleteCall) Context(ctx context.Context) *TransferJobsDeleteCall {
2884 c.ctx_ = ctx
2885 return c
2886 }
2887
2888 // Header returns a http.Header that can be modified by the caller to add
2889 // headers to the request.
2890 func (c *TransferJobsDeleteCall) Header() http.Header {
2891 if c.header_ == nil {
2892 c.header_ = make(http.Header)
2893 }
2894 return c.header_
2895 }
2896
2897 func (c *TransferJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
2898 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2899 c.urlParams_.Set("alt", alt)
2900 c.urlParams_.Set("prettyPrint", "false")
2901 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}")
2902 urls += "?" + c.urlParams_.Encode()
2903 req, err := http.NewRequest("DELETE", urls, nil)
2904 if err != nil {
2905 return nil, err
2906 }
2907 req.Header = reqHeaders
2908 googleapi.Expand(req.URL, map[string]string{
2909 "jobName": c.jobName,
2910 })
2911 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.delete", "request", internallog.HTTPRequest(req, nil))
2912 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2913 }
2914
2915 // Do executes the "storagetransfer.transferJobs.delete" call.
2916 // Any non-2xx status code is an error. Response headers are in either
2917 // *Empty.ServerResponse.Header or (if a response was returned at all) in
2918 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2919 // whether the returned error was because http.StatusNotModified was returned.
2920 func (c *TransferJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2921 gensupport.SetOptions(c.urlParams_, opts...)
2922 res, err := c.doRequest("json")
2923 if res != nil && res.StatusCode == http.StatusNotModified {
2924 if res.Body != nil {
2925 res.Body.Close()
2926 }
2927 return nil, gensupport.WrapError(&googleapi.Error{
2928 Code: res.StatusCode,
2929 Header: res.Header,
2930 })
2931 }
2932 if err != nil {
2933 return nil, err
2934 }
2935 defer googleapi.CloseBody(res)
2936 if err := googleapi.CheckResponse(res); err != nil {
2937 return nil, gensupport.WrapError(err)
2938 }
2939 ret := &Empty{
2940 ServerResponse: googleapi.ServerResponse{
2941 Header: res.Header,
2942 HTTPStatusCode: res.StatusCode,
2943 },
2944 }
2945 target := &ret
2946 b, err := gensupport.DecodeResponseBytes(target, res)
2947 if err != nil {
2948 return nil, err
2949 }
2950 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.delete", "response", internallog.HTTPResponse(res, b))
2951 return ret, nil
2952 }
2953
2954 type TransferJobsGetCall struct {
2955 s *Service
2956 jobName string
2957 urlParams_ gensupport.URLParams
2958 ifNoneMatch_ string
2959 ctx_ context.Context
2960 header_ http.Header
2961 }
2962
2963 // Get: Gets a transfer job.
2964 //
2965 // - jobName: The job to get.
2966 // - projectId: The ID of the Google Cloud project that owns the job.
2967 func (r *TransferJobsService) Get(jobName string, projectId string) *TransferJobsGetCall {
2968 c := &TransferJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2969 c.jobName = jobName
2970 c.urlParams_.Set("projectId", projectId)
2971 return c
2972 }
2973
2974 // Fields allows partial responses to be retrieved. See
2975 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2976 // details.
2977 func (c *TransferJobsGetCall) Fields(s ...googleapi.Field) *TransferJobsGetCall {
2978 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2979 return c
2980 }
2981
2982 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2983 // object's ETag matches the given value. This is useful for getting updates
2984 // only after the object has changed since the last request.
2985 func (c *TransferJobsGetCall) IfNoneMatch(entityTag string) *TransferJobsGetCall {
2986 c.ifNoneMatch_ = entityTag
2987 return c
2988 }
2989
2990 // Context sets the context to be used in this call's Do method.
2991 func (c *TransferJobsGetCall) Context(ctx context.Context) *TransferJobsGetCall {
2992 c.ctx_ = ctx
2993 return c
2994 }
2995
2996 // Header returns a http.Header that can be modified by the caller to add
2997 // headers to the request.
2998 func (c *TransferJobsGetCall) Header() http.Header {
2999 if c.header_ == nil {
3000 c.header_ = make(http.Header)
3001 }
3002 return c.header_
3003 }
3004
3005 func (c *TransferJobsGetCall) doRequest(alt string) (*http.Response, error) {
3006 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3007 if c.ifNoneMatch_ != "" {
3008 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3009 }
3010 c.urlParams_.Set("alt", alt)
3011 c.urlParams_.Set("prettyPrint", "false")
3012 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}")
3013 urls += "?" + c.urlParams_.Encode()
3014 req, err := http.NewRequest("GET", urls, nil)
3015 if err != nil {
3016 return nil, err
3017 }
3018 req.Header = reqHeaders
3019 googleapi.Expand(req.URL, map[string]string{
3020 "jobName": c.jobName,
3021 })
3022 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.get", "request", internallog.HTTPRequest(req, nil))
3023 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3024 }
3025
3026 // Do executes the "storagetransfer.transferJobs.get" call.
3027 // Any non-2xx status code is an error. Response headers are in either
3028 // *TransferJob.ServerResponse.Header or (if a response was returned at all) in
3029 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3030 // whether the returned error was because http.StatusNotModified was returned.
3031 func (c *TransferJobsGetCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
3032 gensupport.SetOptions(c.urlParams_, opts...)
3033 res, err := c.doRequest("json")
3034 if res != nil && res.StatusCode == http.StatusNotModified {
3035 if res.Body != nil {
3036 res.Body.Close()
3037 }
3038 return nil, gensupport.WrapError(&googleapi.Error{
3039 Code: res.StatusCode,
3040 Header: res.Header,
3041 })
3042 }
3043 if err != nil {
3044 return nil, err
3045 }
3046 defer googleapi.CloseBody(res)
3047 if err := googleapi.CheckResponse(res); err != nil {
3048 return nil, gensupport.WrapError(err)
3049 }
3050 ret := &TransferJob{
3051 ServerResponse: googleapi.ServerResponse{
3052 Header: res.Header,
3053 HTTPStatusCode: res.StatusCode,
3054 },
3055 }
3056 target := &ret
3057 b, err := gensupport.DecodeResponseBytes(target, res)
3058 if err != nil {
3059 return nil, err
3060 }
3061 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.get", "response", internallog.HTTPResponse(res, b))
3062 return ret, nil
3063 }
3064
3065 type TransferJobsListCall struct {
3066 s *Service
3067 urlParams_ gensupport.URLParams
3068 ifNoneMatch_ string
3069 ctx_ context.Context
3070 header_ http.Header
3071 }
3072
3073 // List: Lists transfer jobs.
3074 //
3075 // - filter: A list of query parameters specified as JSON text in the form of:
3076 // ``` { "projectId":"my_project_id", "jobNames":["jobid1","jobid2",...],
3077 // "jobStatuses":["status1","status2",...],
3078 // "dataBackend":"QUERY_REPLICATION_CONFIGS",
3079 // "sourceBucket":"source-bucket-name", "sinkBucket":"sink-bucket-name", }
3080 // ``` The JSON formatting in the example is for display only; provide the
3081 // query parameters without spaces or line breaks. * `projectId` is required.
3082 // - Since `jobNames` and `jobStatuses` support multiple values, their values
3083 // must be specified with array notation. `jobNames` and `jobStatuses` are
3084 // optional. Valid values are case-insensitive: * ENABLED * DISABLED *
3085 // DELETED * Specify "dataBackend":"QUERY_REPLICATION_CONFIGS" to return a
3086 // list of cross-bucket replication jobs. * Limit the results to jobs from a
3087 // particular bucket with `sourceBucket` and/or to a particular bucket with
3088 // `sinkBucket`.
3089 func (r *TransferJobsService) List(filter string) *TransferJobsListCall {
3090 c := &TransferJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3091 c.urlParams_.Set("filter", filter)
3092 return c
3093 }
3094
3095 // PageSize sets the optional parameter "pageSize": The list page size. The max
3096 // allowed value is 256.
3097 func (c *TransferJobsListCall) PageSize(pageSize int64) *TransferJobsListCall {
3098 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3099 return c
3100 }
3101
3102 // PageToken sets the optional parameter "pageToken": The list page token.
3103 func (c *TransferJobsListCall) PageToken(pageToken string) *TransferJobsListCall {
3104 c.urlParams_.Set("pageToken", pageToken)
3105 return c
3106 }
3107
3108 // Fields allows partial responses to be retrieved. See
3109 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3110 // details.
3111 func (c *TransferJobsListCall) Fields(s ...googleapi.Field) *TransferJobsListCall {
3112 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3113 return c
3114 }
3115
3116 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3117 // object's ETag matches the given value. This is useful for getting updates
3118 // only after the object has changed since the last request.
3119 func (c *TransferJobsListCall) IfNoneMatch(entityTag string) *TransferJobsListCall {
3120 c.ifNoneMatch_ = entityTag
3121 return c
3122 }
3123
3124 // Context sets the context to be used in this call's Do method.
3125 func (c *TransferJobsListCall) Context(ctx context.Context) *TransferJobsListCall {
3126 c.ctx_ = ctx
3127 return c
3128 }
3129
3130 // Header returns a http.Header that can be modified by the caller to add
3131 // headers to the request.
3132 func (c *TransferJobsListCall) Header() http.Header {
3133 if c.header_ == nil {
3134 c.header_ = make(http.Header)
3135 }
3136 return c.header_
3137 }
3138
3139 func (c *TransferJobsListCall) doRequest(alt string) (*http.Response, error) {
3140 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3141 if c.ifNoneMatch_ != "" {
3142 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3143 }
3144 c.urlParams_.Set("alt", alt)
3145 c.urlParams_.Set("prettyPrint", "false")
3146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs")
3147 urls += "?" + c.urlParams_.Encode()
3148 req, err := http.NewRequest("GET", urls, nil)
3149 if err != nil {
3150 return nil, err
3151 }
3152 req.Header = reqHeaders
3153 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.list", "request", internallog.HTTPRequest(req, nil))
3154 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3155 }
3156
3157 // Do executes the "storagetransfer.transferJobs.list" call.
3158 // Any non-2xx status code is an error. Response headers are in either
3159 // *ListTransferJobsResponse.ServerResponse.Header or (if a response was
3160 // returned at all) in error.(*googleapi.Error).Header. Use
3161 // googleapi.IsNotModified to check whether the returned error was because
3162 // http.StatusNotModified was returned.
3163 func (c *TransferJobsListCall) Do(opts ...googleapi.CallOption) (*ListTransferJobsResponse, error) {
3164 gensupport.SetOptions(c.urlParams_, opts...)
3165 res, err := c.doRequest("json")
3166 if res != nil && res.StatusCode == http.StatusNotModified {
3167 if res.Body != nil {
3168 res.Body.Close()
3169 }
3170 return nil, gensupport.WrapError(&googleapi.Error{
3171 Code: res.StatusCode,
3172 Header: res.Header,
3173 })
3174 }
3175 if err != nil {
3176 return nil, err
3177 }
3178 defer googleapi.CloseBody(res)
3179 if err := googleapi.CheckResponse(res); err != nil {
3180 return nil, gensupport.WrapError(err)
3181 }
3182 ret := &ListTransferJobsResponse{
3183 ServerResponse: googleapi.ServerResponse{
3184 Header: res.Header,
3185 HTTPStatusCode: res.StatusCode,
3186 },
3187 }
3188 target := &ret
3189 b, err := gensupport.DecodeResponseBytes(target, res)
3190 if err != nil {
3191 return nil, err
3192 }
3193 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.list", "response", internallog.HTTPResponse(res, b))
3194 return ret, nil
3195 }
3196
3197 // Pages invokes f for each page of results.
3198 // A non-nil error returned from f will halt the iteration.
3199 // The provided context supersedes any context provided to the Context method.
3200 func (c *TransferJobsListCall) Pages(ctx context.Context, f func(*ListTransferJobsResponse) error) error {
3201 c.ctx_ = ctx
3202 defer c.PageToken(c.urlParams_.Get("pageToken"))
3203 for {
3204 x, err := c.Do()
3205 if err != nil {
3206 return err
3207 }
3208 if err := f(x); err != nil {
3209 return err
3210 }
3211 if x.NextPageToken == "" {
3212 return nil
3213 }
3214 c.PageToken(x.NextPageToken)
3215 }
3216 }
3217
3218 type TransferJobsPatchCall struct {
3219 s *Service
3220 jobName string
3221 updatetransferjobrequest *UpdateTransferJobRequest
3222 urlParams_ gensupport.URLParams
3223 ctx_ context.Context
3224 header_ http.Header
3225 }
3226
3227 // Patch: Updates a transfer job. Updating a job's transfer spec does not
3228 // affect transfer operations that are running already. **Note:** The job's
3229 // status field can be modified using this RPC (for example, to set a job's
3230 // status to DELETED, DISABLED, or ENABLED).
3231 //
3232 // - jobName: The name of job to update.
3233 func (r *TransferJobsService) Patch(jobName string, updatetransferjobrequest *UpdateTransferJobRequest) *TransferJobsPatchCall {
3234 c := &TransferJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3235 c.jobName = jobName
3236 c.updatetransferjobrequest = updatetransferjobrequest
3237 return c
3238 }
3239
3240 // Fields allows partial responses to be retrieved. See
3241 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3242 // details.
3243 func (c *TransferJobsPatchCall) Fields(s ...googleapi.Field) *TransferJobsPatchCall {
3244 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3245 return c
3246 }
3247
3248 // Context sets the context to be used in this call's Do method.
3249 func (c *TransferJobsPatchCall) Context(ctx context.Context) *TransferJobsPatchCall {
3250 c.ctx_ = ctx
3251 return c
3252 }
3253
3254 // Header returns a http.Header that can be modified by the caller to add
3255 // headers to the request.
3256 func (c *TransferJobsPatchCall) Header() http.Header {
3257 if c.header_ == nil {
3258 c.header_ = make(http.Header)
3259 }
3260 return c.header_
3261 }
3262
3263 func (c *TransferJobsPatchCall) doRequest(alt string) (*http.Response, error) {
3264 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3265 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.updatetransferjobrequest)
3266 if err != nil {
3267 return nil, err
3268 }
3269 c.urlParams_.Set("alt", alt)
3270 c.urlParams_.Set("prettyPrint", "false")
3271 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}")
3272 urls += "?" + c.urlParams_.Encode()
3273 req, err := http.NewRequest("PATCH", urls, body)
3274 if err != nil {
3275 return nil, err
3276 }
3277 req.Header = reqHeaders
3278 googleapi.Expand(req.URL, map[string]string{
3279 "jobName": c.jobName,
3280 })
3281 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3282 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3283 }
3284
3285 // Do executes the "storagetransfer.transferJobs.patch" call.
3286 // Any non-2xx status code is an error. Response headers are in either
3287 // *TransferJob.ServerResponse.Header or (if a response was returned at all) in
3288 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3289 // whether the returned error was because http.StatusNotModified was returned.
3290 func (c *TransferJobsPatchCall) Do(opts ...googleapi.CallOption) (*TransferJob, error) {
3291 gensupport.SetOptions(c.urlParams_, opts...)
3292 res, err := c.doRequest("json")
3293 if res != nil && res.StatusCode == http.StatusNotModified {
3294 if res.Body != nil {
3295 res.Body.Close()
3296 }
3297 return nil, gensupport.WrapError(&googleapi.Error{
3298 Code: res.StatusCode,
3299 Header: res.Header,
3300 })
3301 }
3302 if err != nil {
3303 return nil, err
3304 }
3305 defer googleapi.CloseBody(res)
3306 if err := googleapi.CheckResponse(res); err != nil {
3307 return nil, gensupport.WrapError(err)
3308 }
3309 ret := &TransferJob{
3310 ServerResponse: googleapi.ServerResponse{
3311 Header: res.Header,
3312 HTTPStatusCode: res.StatusCode,
3313 },
3314 }
3315 target := &ret
3316 b, err := gensupport.DecodeResponseBytes(target, res)
3317 if err != nil {
3318 return nil, err
3319 }
3320 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.patch", "response", internallog.HTTPResponse(res, b))
3321 return ret, nil
3322 }
3323
3324 type TransferJobsRunCall struct {
3325 s *Service
3326 jobName string
3327 runtransferjobrequest *RunTransferJobRequest
3328 urlParams_ gensupport.URLParams
3329 ctx_ context.Context
3330 header_ http.Header
3331 }
3332
3333 // Run: Starts a new operation for the specified transfer job. A `TransferJob`
3334 // has a maximum of one active `TransferOperation`. If this method is called
3335 // while a `TransferOperation` is active, an error is returned.
3336 //
3337 // - jobName: The name of the transfer job.
3338 func (r *TransferJobsService) Run(jobName string, runtransferjobrequest *RunTransferJobRequest) *TransferJobsRunCall {
3339 c := &TransferJobsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3340 c.jobName = jobName
3341 c.runtransferjobrequest = runtransferjobrequest
3342 return c
3343 }
3344
3345 // Fields allows partial responses to be retrieved. See
3346 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3347 // details.
3348 func (c *TransferJobsRunCall) Fields(s ...googleapi.Field) *TransferJobsRunCall {
3349 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3350 return c
3351 }
3352
3353 // Context sets the context to be used in this call's Do method.
3354 func (c *TransferJobsRunCall) Context(ctx context.Context) *TransferJobsRunCall {
3355 c.ctx_ = ctx
3356 return c
3357 }
3358
3359 // Header returns a http.Header that can be modified by the caller to add
3360 // headers to the request.
3361 func (c *TransferJobsRunCall) Header() http.Header {
3362 if c.header_ == nil {
3363 c.header_ = make(http.Header)
3364 }
3365 return c.header_
3366 }
3367
3368 func (c *TransferJobsRunCall) doRequest(alt string) (*http.Response, error) {
3369 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3370 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runtransferjobrequest)
3371 if err != nil {
3372 return nil, err
3373 }
3374 c.urlParams_.Set("alt", alt)
3375 c.urlParams_.Set("prettyPrint", "false")
3376 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}:run")
3377 urls += "?" + c.urlParams_.Encode()
3378 req, err := http.NewRequest("POST", urls, body)
3379 if err != nil {
3380 return nil, err
3381 }
3382 req.Header = reqHeaders
3383 googleapi.Expand(req.URL, map[string]string{
3384 "jobName": c.jobName,
3385 })
3386 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.run", "request", internallog.HTTPRequest(req, body.Bytes()))
3387 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3388 }
3389
3390 // Do executes the "storagetransfer.transferJobs.run" call.
3391 // Any non-2xx status code is an error. Response headers are in either
3392 // *Operation.ServerResponse.Header or (if a response was returned at all) in
3393 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3394 // whether the returned error was because http.StatusNotModified was returned.
3395 func (c *TransferJobsRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3396 gensupport.SetOptions(c.urlParams_, opts...)
3397 res, err := c.doRequest("json")
3398 if res != nil && res.StatusCode == http.StatusNotModified {
3399 if res.Body != nil {
3400 res.Body.Close()
3401 }
3402 return nil, gensupport.WrapError(&googleapi.Error{
3403 Code: res.StatusCode,
3404 Header: res.Header,
3405 })
3406 }
3407 if err != nil {
3408 return nil, err
3409 }
3410 defer googleapi.CloseBody(res)
3411 if err := googleapi.CheckResponse(res); err != nil {
3412 return nil, gensupport.WrapError(err)
3413 }
3414 ret := &Operation{
3415 ServerResponse: googleapi.ServerResponse{
3416 Header: res.Header,
3417 HTTPStatusCode: res.StatusCode,
3418 },
3419 }
3420 target := &ret
3421 b, err := gensupport.DecodeResponseBytes(target, res)
3422 if err != nil {
3423 return nil, err
3424 }
3425 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferJobs.run", "response", internallog.HTTPResponse(res, b))
3426 return ret, nil
3427 }
3428
3429 type TransferOperationsCancelCall struct {
3430 s *Service
3431 name string
3432 canceloperationrequest *CancelOperationRequest
3433 urlParams_ gensupport.URLParams
3434 ctx_ context.Context
3435 header_ http.Header
3436 }
3437
3438 // Cancel: Cancels a transfer. Use the transferOperations.get method to check
3439 // if the cancellation succeeded or if the operation completed despite the
3440 // `cancel` request. When you cancel an operation, the currently running
3441 // transfer is interrupted. For recurring transfer jobs, the next instance of
3442 // the transfer job will still run. For example, if your job is configured to
3443 // run every day at 1pm and you cancel Monday's operation at 1:05pm, Monday's
3444 // transfer will stop. However, a transfer job will still be attempted on
3445 // Tuesday. This applies only to currently running operations. If an operation
3446 // is not currently running, `cancel` does nothing. *Caution:* Canceling a
3447 // transfer job can leave your data in an unknown state. We recommend that you
3448 // restore the state at both the destination and the source after the `cancel`
3449 // request completes so that your data is in a consistent state. When you
3450 // cancel a job, the next job computes a delta of files and may repair any
3451 // inconsistent state. For instance, if you run a job every day, and today's
3452 // job found 10 new files and transferred five files before you canceled the
3453 // job, tomorrow's transfer operation will compute a new delta with the five
3454 // files that were not copied today plus any new files discovered tomorrow.
3455 //
3456 // - name: The name of the operation resource to be cancelled.
3457 func (r *TransferOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *TransferOperationsCancelCall {
3458 c := &TransferOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3459 c.name = name
3460 c.canceloperationrequest = canceloperationrequest
3461 return c
3462 }
3463
3464 // Fields allows partial responses to be retrieved. See
3465 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3466 // details.
3467 func (c *TransferOperationsCancelCall) Fields(s ...googleapi.Field) *TransferOperationsCancelCall {
3468 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3469 return c
3470 }
3471
3472 // Context sets the context to be used in this call's Do method.
3473 func (c *TransferOperationsCancelCall) Context(ctx context.Context) *TransferOperationsCancelCall {
3474 c.ctx_ = ctx
3475 return c
3476 }
3477
3478 // Header returns a http.Header that can be modified by the caller to add
3479 // headers to the request.
3480 func (c *TransferOperationsCancelCall) Header() http.Header {
3481 if c.header_ == nil {
3482 c.header_ = make(http.Header)
3483 }
3484 return c.header_
3485 }
3486
3487 func (c *TransferOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3488 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3489 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest)
3490 if err != nil {
3491 return nil, err
3492 }
3493 c.urlParams_.Set("alt", alt)
3494 c.urlParams_.Set("prettyPrint", "false")
3495 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
3496 urls += "?" + c.urlParams_.Encode()
3497 req, err := http.NewRequest("POST", urls, body)
3498 if err != nil {
3499 return nil, err
3500 }
3501 req.Header = reqHeaders
3502 googleapi.Expand(req.URL, map[string]string{
3503 "name": c.name,
3504 })
3505 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
3506 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3507 }
3508
3509 // Do executes the "storagetransfer.transferOperations.cancel" call.
3510 // Any non-2xx status code is an error. Response headers are in either
3511 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3512 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3513 // whether the returned error was because http.StatusNotModified was returned.
3514 func (c *TransferOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3515 gensupport.SetOptions(c.urlParams_, opts...)
3516 res, err := c.doRequest("json")
3517 if res != nil && res.StatusCode == http.StatusNotModified {
3518 if res.Body != nil {
3519 res.Body.Close()
3520 }
3521 return nil, gensupport.WrapError(&googleapi.Error{
3522 Code: res.StatusCode,
3523 Header: res.Header,
3524 })
3525 }
3526 if err != nil {
3527 return nil, err
3528 }
3529 defer googleapi.CloseBody(res)
3530 if err := googleapi.CheckResponse(res); err != nil {
3531 return nil, gensupport.WrapError(err)
3532 }
3533 ret := &Empty{
3534 ServerResponse: googleapi.ServerResponse{
3535 Header: res.Header,
3536 HTTPStatusCode: res.StatusCode,
3537 },
3538 }
3539 target := &ret
3540 b, err := gensupport.DecodeResponseBytes(target, res)
3541 if err != nil {
3542 return nil, err
3543 }
3544 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.cancel", "response", internallog.HTTPResponse(res, b))
3545 return ret, nil
3546 }
3547
3548 type TransferOperationsGetCall struct {
3549 s *Service
3550 name string
3551 urlParams_ gensupport.URLParams
3552 ifNoneMatch_ string
3553 ctx_ context.Context
3554 header_ http.Header
3555 }
3556
3557 // Get: Gets the latest state of a long-running operation. Clients can use this
3558 // method to poll the operation result at intervals as recommended by the API
3559 // service.
3560 //
3561 // - name: The name of the operation resource.
3562 func (r *TransferOperationsService) Get(name string) *TransferOperationsGetCall {
3563 c := &TransferOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3564 c.name = name
3565 return c
3566 }
3567
3568 // Fields allows partial responses to be retrieved. See
3569 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3570 // details.
3571 func (c *TransferOperationsGetCall) Fields(s ...googleapi.Field) *TransferOperationsGetCall {
3572 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3573 return c
3574 }
3575
3576 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3577 // object's ETag matches the given value. This is useful for getting updates
3578 // only after the object has changed since the last request.
3579 func (c *TransferOperationsGetCall) IfNoneMatch(entityTag string) *TransferOperationsGetCall {
3580 c.ifNoneMatch_ = entityTag
3581 return c
3582 }
3583
3584 // Context sets the context to be used in this call's Do method.
3585 func (c *TransferOperationsGetCall) Context(ctx context.Context) *TransferOperationsGetCall {
3586 c.ctx_ = ctx
3587 return c
3588 }
3589
3590 // Header returns a http.Header that can be modified by the caller to add
3591 // headers to the request.
3592 func (c *TransferOperationsGetCall) Header() http.Header {
3593 if c.header_ == nil {
3594 c.header_ = make(http.Header)
3595 }
3596 return c.header_
3597 }
3598
3599 func (c *TransferOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3600 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3601 if c.ifNoneMatch_ != "" {
3602 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3603 }
3604 c.urlParams_.Set("alt", alt)
3605 c.urlParams_.Set("prettyPrint", "false")
3606 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3607 urls += "?" + c.urlParams_.Encode()
3608 req, err := http.NewRequest("GET", urls, nil)
3609 if err != nil {
3610 return nil, err
3611 }
3612 req.Header = reqHeaders
3613 googleapi.Expand(req.URL, map[string]string{
3614 "name": c.name,
3615 })
3616 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.get", "request", internallog.HTTPRequest(req, nil))
3617 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3618 }
3619
3620 // Do executes the "storagetransfer.transferOperations.get" call.
3621 // Any non-2xx status code is an error. Response headers are in either
3622 // *Operation.ServerResponse.Header or (if a response was returned at all) in
3623 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3624 // whether the returned error was because http.StatusNotModified was returned.
3625 func (c *TransferOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3626 gensupport.SetOptions(c.urlParams_, opts...)
3627 res, err := c.doRequest("json")
3628 if res != nil && res.StatusCode == http.StatusNotModified {
3629 if res.Body != nil {
3630 res.Body.Close()
3631 }
3632 return nil, gensupport.WrapError(&googleapi.Error{
3633 Code: res.StatusCode,
3634 Header: res.Header,
3635 })
3636 }
3637 if err != nil {
3638 return nil, err
3639 }
3640 defer googleapi.CloseBody(res)
3641 if err := googleapi.CheckResponse(res); err != nil {
3642 return nil, gensupport.WrapError(err)
3643 }
3644 ret := &Operation{
3645 ServerResponse: googleapi.ServerResponse{
3646 Header: res.Header,
3647 HTTPStatusCode: res.StatusCode,
3648 },
3649 }
3650 target := &ret
3651 b, err := gensupport.DecodeResponseBytes(target, res)
3652 if err != nil {
3653 return nil, err
3654 }
3655 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.get", "response", internallog.HTTPResponse(res, b))
3656 return ret, nil
3657 }
3658
3659 type TransferOperationsListCall struct {
3660 s *Service
3661 name string
3662 urlParams_ gensupport.URLParams
3663 ifNoneMatch_ string
3664 ctx_ context.Context
3665 header_ http.Header
3666 }
3667
3668 // List: Lists transfer operations. Operations are ordered by their creation
3669 // time in reverse chronological order.
3670 //
3671 // - filter: A list of query parameters specified as JSON text in the form of:
3672 // `{"projectId":"my_project_id", "jobNames":["jobid1","jobid2",...],
3673 // "jobNamePattern": "job_name_pattern",
3674 // "operationNames":["opid1","opid2",...], "operationNamePattern":
3675 // "operation_name_pattern", "minCreationTime": "min_creation_time",
3676 // "maxCreationTime": "max_creation_time",
3677 // "transferStatuses":["status1","status2",...]}` Since `jobNames`,
3678 // `operationNames`, and `transferStatuses` support multiple values, they
3679 // must be specified with array notation. `projectId` is the only argument
3680 // that is required. If specified, `jobNamePattern` and
3681 // `operationNamePattern` must match the full job or operation name
3682 // respectively. '*' is a wildcard matching 0 or more characters.
3683 // `minCreationTime` and `maxCreationTime` should be timestamps encoded as a
3684 // string in the RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) format. The
3685 // valid values for `transferStatuses` are case-insensitive: IN_PROGRESS,
3686 // PAUSED, SUCCESS, FAILED, and ABORTED.
3687 // - name: The name of the type being listed; must be `transferOperations`.
3688 func (r *TransferOperationsService) List(name string, filter string) *TransferOperationsListCall {
3689 c := &TransferOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3690 c.name = name
3691 c.urlParams_.Set("filter", filter)
3692 return c
3693 }
3694
3695 // PageSize sets the optional parameter "pageSize": The list page size. The max
3696 // allowed value is 256.
3697 func (c *TransferOperationsListCall) PageSize(pageSize int64) *TransferOperationsListCall {
3698 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3699 return c
3700 }
3701
3702 // PageToken sets the optional parameter "pageToken": The list page token.
3703 func (c *TransferOperationsListCall) PageToken(pageToken string) *TransferOperationsListCall {
3704 c.urlParams_.Set("pageToken", pageToken)
3705 return c
3706 }
3707
3708 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3709 // When set to `true`, operations that are reachable are returned as normal,
3710 // and those that are unreachable are returned in the
3711 // ListOperationsResponse.unreachable field. This can only be `true` when
3712 // reading across collections. For example, when `parent` is set to
3713 // "projects/example/locations/-". This field is not supported by default and
3714 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3715 // otherwise in service or product specific documentation.
3716 func (c *TransferOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TransferOperationsListCall {
3717 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3718 return c
3719 }
3720
3721 // Fields allows partial responses to be retrieved. See
3722 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3723 // details.
3724 func (c *TransferOperationsListCall) Fields(s ...googleapi.Field) *TransferOperationsListCall {
3725 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3726 return c
3727 }
3728
3729 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3730 // object's ETag matches the given value. This is useful for getting updates
3731 // only after the object has changed since the last request.
3732 func (c *TransferOperationsListCall) IfNoneMatch(entityTag string) *TransferOperationsListCall {
3733 c.ifNoneMatch_ = entityTag
3734 return c
3735 }
3736
3737 // Context sets the context to be used in this call's Do method.
3738 func (c *TransferOperationsListCall) Context(ctx context.Context) *TransferOperationsListCall {
3739 c.ctx_ = ctx
3740 return c
3741 }
3742
3743 // Header returns a http.Header that can be modified by the caller to add
3744 // headers to the request.
3745 func (c *TransferOperationsListCall) Header() http.Header {
3746 if c.header_ == nil {
3747 c.header_ = make(http.Header)
3748 }
3749 return c.header_
3750 }
3751
3752 func (c *TransferOperationsListCall) doRequest(alt string) (*http.Response, error) {
3753 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3754 if c.ifNoneMatch_ != "" {
3755 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3756 }
3757 c.urlParams_.Set("alt", alt)
3758 c.urlParams_.Set("prettyPrint", "false")
3759 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3760 urls += "?" + c.urlParams_.Encode()
3761 req, err := http.NewRequest("GET", urls, nil)
3762 if err != nil {
3763 return nil, err
3764 }
3765 req.Header = reqHeaders
3766 googleapi.Expand(req.URL, map[string]string{
3767 "name": c.name,
3768 })
3769 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.list", "request", internallog.HTTPRequest(req, nil))
3770 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3771 }
3772
3773 // Do executes the "storagetransfer.transferOperations.list" call.
3774 // Any non-2xx status code is an error. Response headers are in either
3775 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
3776 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3777 // check whether the returned error was because http.StatusNotModified was
3778 // returned.
3779 func (c *TransferOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
3780 gensupport.SetOptions(c.urlParams_, opts...)
3781 res, err := c.doRequest("json")
3782 if res != nil && res.StatusCode == http.StatusNotModified {
3783 if res.Body != nil {
3784 res.Body.Close()
3785 }
3786 return nil, gensupport.WrapError(&googleapi.Error{
3787 Code: res.StatusCode,
3788 Header: res.Header,
3789 })
3790 }
3791 if err != nil {
3792 return nil, err
3793 }
3794 defer googleapi.CloseBody(res)
3795 if err := googleapi.CheckResponse(res); err != nil {
3796 return nil, gensupport.WrapError(err)
3797 }
3798 ret := &ListOperationsResponse{
3799 ServerResponse: googleapi.ServerResponse{
3800 Header: res.Header,
3801 HTTPStatusCode: res.StatusCode,
3802 },
3803 }
3804 target := &ret
3805 b, err := gensupport.DecodeResponseBytes(target, res)
3806 if err != nil {
3807 return nil, err
3808 }
3809 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.list", "response", internallog.HTTPResponse(res, b))
3810 return ret, nil
3811 }
3812
3813 // Pages invokes f for each page of results.
3814 // A non-nil error returned from f will halt the iteration.
3815 // The provided context supersedes any context provided to the Context method.
3816 func (c *TransferOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
3817 c.ctx_ = ctx
3818 defer c.PageToken(c.urlParams_.Get("pageToken"))
3819 for {
3820 x, err := c.Do()
3821 if err != nil {
3822 return err
3823 }
3824 if err := f(x); err != nil {
3825 return err
3826 }
3827 if x.NextPageToken == "" {
3828 return nil
3829 }
3830 c.PageToken(x.NextPageToken)
3831 }
3832 }
3833
3834 type TransferOperationsPauseCall struct {
3835 s *Service
3836 name string
3837 pausetransferoperationrequest *PauseTransferOperationRequest
3838 urlParams_ gensupport.URLParams
3839 ctx_ context.Context
3840 header_ http.Header
3841 }
3842
3843 // Pause: Pauses a transfer operation.
3844 //
3845 // - name: The name of the transfer operation.
3846 func (r *TransferOperationsService) Pause(name string, pausetransferoperationrequest *PauseTransferOperationRequest) *TransferOperationsPauseCall {
3847 c := &TransferOperationsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3848 c.name = name
3849 c.pausetransferoperationrequest = pausetransferoperationrequest
3850 return c
3851 }
3852
3853 // Fields allows partial responses to be retrieved. See
3854 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3855 // details.
3856 func (c *TransferOperationsPauseCall) Fields(s ...googleapi.Field) *TransferOperationsPauseCall {
3857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3858 return c
3859 }
3860
3861 // Context sets the context to be used in this call's Do method.
3862 func (c *TransferOperationsPauseCall) Context(ctx context.Context) *TransferOperationsPauseCall {
3863 c.ctx_ = ctx
3864 return c
3865 }
3866
3867 // Header returns a http.Header that can be modified by the caller to add
3868 // headers to the request.
3869 func (c *TransferOperationsPauseCall) Header() http.Header {
3870 if c.header_ == nil {
3871 c.header_ = make(http.Header)
3872 }
3873 return c.header_
3874 }
3875
3876 func (c *TransferOperationsPauseCall) doRequest(alt string) (*http.Response, error) {
3877 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3878 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausetransferoperationrequest)
3879 if err != nil {
3880 return nil, err
3881 }
3882 c.urlParams_.Set("alt", alt)
3883 c.urlParams_.Set("prettyPrint", "false")
3884 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause")
3885 urls += "?" + c.urlParams_.Encode()
3886 req, err := http.NewRequest("POST", urls, body)
3887 if err != nil {
3888 return nil, err
3889 }
3890 req.Header = reqHeaders
3891 googleapi.Expand(req.URL, map[string]string{
3892 "name": c.name,
3893 })
3894 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.pause", "request", internallog.HTTPRequest(req, body.Bytes()))
3895 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3896 }
3897
3898 // Do executes the "storagetransfer.transferOperations.pause" call.
3899 // Any non-2xx status code is an error. Response headers are in either
3900 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3901 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3902 // whether the returned error was because http.StatusNotModified was returned.
3903 func (c *TransferOperationsPauseCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3904 gensupport.SetOptions(c.urlParams_, opts...)
3905 res, err := c.doRequest("json")
3906 if res != nil && res.StatusCode == http.StatusNotModified {
3907 if res.Body != nil {
3908 res.Body.Close()
3909 }
3910 return nil, gensupport.WrapError(&googleapi.Error{
3911 Code: res.StatusCode,
3912 Header: res.Header,
3913 })
3914 }
3915 if err != nil {
3916 return nil, err
3917 }
3918 defer googleapi.CloseBody(res)
3919 if err := googleapi.CheckResponse(res); err != nil {
3920 return nil, gensupport.WrapError(err)
3921 }
3922 ret := &Empty{
3923 ServerResponse: googleapi.ServerResponse{
3924 Header: res.Header,
3925 HTTPStatusCode: res.StatusCode,
3926 },
3927 }
3928 target := &ret
3929 b, err := gensupport.DecodeResponseBytes(target, res)
3930 if err != nil {
3931 return nil, err
3932 }
3933 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.pause", "response", internallog.HTTPResponse(res, b))
3934 return ret, nil
3935 }
3936
3937 type TransferOperationsResumeCall struct {
3938 s *Service
3939 name string
3940 resumetransferoperationrequest *ResumeTransferOperationRequest
3941 urlParams_ gensupport.URLParams
3942 ctx_ context.Context
3943 header_ http.Header
3944 }
3945
3946 // Resume: Resumes a transfer operation that is paused.
3947 //
3948 // - name: The name of the transfer operation.
3949 func (r *TransferOperationsService) Resume(name string, resumetransferoperationrequest *ResumeTransferOperationRequest) *TransferOperationsResumeCall {
3950 c := &TransferOperationsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3951 c.name = name
3952 c.resumetransferoperationrequest = resumetransferoperationrequest
3953 return c
3954 }
3955
3956 // Fields allows partial responses to be retrieved. See
3957 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3958 // details.
3959 func (c *TransferOperationsResumeCall) Fields(s ...googleapi.Field) *TransferOperationsResumeCall {
3960 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3961 return c
3962 }
3963
3964 // Context sets the context to be used in this call's Do method.
3965 func (c *TransferOperationsResumeCall) Context(ctx context.Context) *TransferOperationsResumeCall {
3966 c.ctx_ = ctx
3967 return c
3968 }
3969
3970 // Header returns a http.Header that can be modified by the caller to add
3971 // headers to the request.
3972 func (c *TransferOperationsResumeCall) Header() http.Header {
3973 if c.header_ == nil {
3974 c.header_ = make(http.Header)
3975 }
3976 return c.header_
3977 }
3978
3979 func (c *TransferOperationsResumeCall) doRequest(alt string) (*http.Response, error) {
3980 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3981 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumetransferoperationrequest)
3982 if err != nil {
3983 return nil, err
3984 }
3985 c.urlParams_.Set("alt", alt)
3986 c.urlParams_.Set("prettyPrint", "false")
3987 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume")
3988 urls += "?" + c.urlParams_.Encode()
3989 req, err := http.NewRequest("POST", urls, body)
3990 if err != nil {
3991 return nil, err
3992 }
3993 req.Header = reqHeaders
3994 googleapi.Expand(req.URL, map[string]string{
3995 "name": c.name,
3996 })
3997 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.resume", "request", internallog.HTTPRequest(req, body.Bytes()))
3998 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3999 }
4000
4001 // Do executes the "storagetransfer.transferOperations.resume" call.
4002 // Any non-2xx status code is an error. Response headers are in either
4003 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4004 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4005 // whether the returned error was because http.StatusNotModified was returned.
4006 func (c *TransferOperationsResumeCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4007 gensupport.SetOptions(c.urlParams_, opts...)
4008 res, err := c.doRequest("json")
4009 if res != nil && res.StatusCode == http.StatusNotModified {
4010 if res.Body != nil {
4011 res.Body.Close()
4012 }
4013 return nil, gensupport.WrapError(&googleapi.Error{
4014 Code: res.StatusCode,
4015 Header: res.Header,
4016 })
4017 }
4018 if err != nil {
4019 return nil, err
4020 }
4021 defer googleapi.CloseBody(res)
4022 if err := googleapi.CheckResponse(res); err != nil {
4023 return nil, gensupport.WrapError(err)
4024 }
4025 ret := &Empty{
4026 ServerResponse: googleapi.ServerResponse{
4027 Header: res.Header,
4028 HTTPStatusCode: res.StatusCode,
4029 },
4030 }
4031 target := &ret
4032 b, err := gensupport.DecodeResponseBytes(target, res)
4033 if err != nil {
4034 return nil, err
4035 }
4036 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storagetransfer.transferOperations.resume", "response", internallog.HTTPResponse(res, b))
4037 return ret, nil
4038 }