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