Storage Transfer v1 API - Class StorageTransferServiceClient (2.6.0)

public abstract class StorageTransferServiceClient

Reference documentation and code samples for the Storage Transfer v1 API class StorageTransferServiceClient.

StorageTransferService client wrapper, for convenient use.

Inheritance

object > StorageTransferServiceClient

Namespace

Google.Cloud.StorageTransfer.V1

Assembly

Google.Cloud.StorageTransfer.V1.dll

Remarks

Storage Transfer Service and its protos. Transfers data between between Google Cloud Storage buckets or from a data source external to Google to a Cloud Storage bucket.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the StorageTransferService service, which is a host of "storagetransfer.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default StorageTransferService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default StorageTransferService scopes are:

GrpcClient

public virtual StorageTransferService.StorageTransferServiceClient GrpcClient { get; }

The underlying gRPC StorageTransferService client

Property Value
Type Description
StorageTransferServiceStorageTransferServiceClient

RunTransferJobOperationsClient

public virtual OperationsClient RunTransferJobOperationsClient { get; }

The long-running operations client for RunTransferJob.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static StorageTransferServiceClient Create()

Synchronously creates a StorageTransferServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use StorageTransferServiceClientBuilder.

Returns
Type Description
StorageTransferServiceClient

The created StorageTransferServiceClient.

CreateAgentPool(CreateAgentPoolRequest, CallSettings)

public virtual AgentPool CreateAgentPool(CreateAgentPoolRequest request, CallSettings callSettings = null)

Creates an agent pool resource.

Parameters
Name Description
request CreateAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
CreateAgentPoolRequest request = new CreateAgentPoolRequest
{
    ProjectId = "",
    AgentPool = new AgentPool(),
    AgentPoolId = "",
};
// Make the request
AgentPool response = storageTransferServiceClient.CreateAgentPool(request);

CreateAgentPool(string, AgentPool, string, CallSettings)

public virtual AgentPool CreateAgentPool(string projectId, AgentPool agentPool, string agentPoolId, CallSettings callSettings = null)

Creates an agent pool resource.

Parameters
Name Description
projectId string

Required. The ID of the Google Cloud project that owns the agent pool.

agentPool AgentPool

Required. The agent pool to create.

agentPoolId string

Required. The ID of the agent pool to create.

The agent_pool_id must meet the following requirements:

  • Length of 128 characters or less.
  • Not start with the string goog.
  • Start with a lowercase ASCII character, followed by:
  • Zero or more: lowercase Latin alphabet characters, numerals, hyphens (-), periods (.), underscores (_), or tildes (~).
  • One or more numerals or lowercase ASCII characters.

As expressed by the regular expression: ^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
string projectId = "";
AgentPool agentPool = new AgentPool();
string agentPoolId = "";
// Make the request
AgentPool response = storageTransferServiceClient.CreateAgentPool(projectId, agentPool, agentPoolId);

CreateAgentPoolAsync(CreateAgentPoolRequest, CallSettings)

public virtual Task<AgentPool> CreateAgentPoolAsync(CreateAgentPoolRequest request, CallSettings callSettings = null)

Creates an agent pool resource.

Parameters
Name Description
request CreateAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAgentPoolRequest request = new CreateAgentPoolRequest
{
    ProjectId = "",
    AgentPool = new AgentPool(),
    AgentPoolId = "",
};
// Make the request
AgentPool response = await storageTransferServiceClient.CreateAgentPoolAsync(request);

CreateAgentPoolAsync(CreateAgentPoolRequest, CancellationToken)

public virtual Task<AgentPool> CreateAgentPoolAsync(CreateAgentPoolRequest request, CancellationToken cancellationToken)

Creates an agent pool resource.

Parameters
Name Description
request CreateAgentPoolRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAgentPoolRequest request = new CreateAgentPoolRequest
{
    ProjectId = "",
    AgentPool = new AgentPool(),
    AgentPoolId = "",
};
// Make the request
AgentPool response = await storageTransferServiceClient.CreateAgentPoolAsync(request);

CreateAgentPoolAsync(string, AgentPool, string, CallSettings)

public virtual Task<AgentPool> CreateAgentPoolAsync(string projectId, AgentPool agentPool, string agentPoolId, CallSettings callSettings = null)

Creates an agent pool resource.

Parameters
Name Description
projectId string

Required. The ID of the Google Cloud project that owns the agent pool.

agentPool AgentPool

Required. The agent pool to create.

agentPoolId string

Required. The ID of the agent pool to create.

The agent_pool_id must meet the following requirements:

  • Length of 128 characters or less.
  • Not start with the string goog.
  • Start with a lowercase ASCII character, followed by:
  • Zero or more: lowercase Latin alphabet characters, numerals, hyphens (-), periods (.), underscores (_), or tildes (~).
  • One or more numerals or lowercase ASCII characters.

As expressed by the regular expression: ^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
AgentPool agentPool = new AgentPool();
string agentPoolId = "";
// Make the request
AgentPool response = await storageTransferServiceClient.CreateAgentPoolAsync(projectId, agentPool, agentPoolId);

CreateAgentPoolAsync(string, AgentPool, string, CancellationToken)

public virtual Task<AgentPool> CreateAgentPoolAsync(string projectId, AgentPool agentPool, string agentPoolId, CancellationToken cancellationToken)

Creates an agent pool resource.

Parameters
Name Description
projectId string

Required. The ID of the Google Cloud project that owns the agent pool.

agentPool AgentPool

Required. The agent pool to create.

agentPoolId string

Required. The ID of the agent pool to create.

The agent_pool_id must meet the following requirements:

  • Length of 128 characters or less.
  • Not start with the string goog.
  • Start with a lowercase ASCII character, followed by:
  • Zero or more: lowercase Latin alphabet characters, numerals, hyphens (-), periods (.), underscores (_), or tildes (~).
  • One or more numerals or lowercase ASCII characters.

As expressed by the regular expression: ^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
AgentPool agentPool = new AgentPool();
string agentPoolId = "";
// Make the request
AgentPool response = await storageTransferServiceClient.CreateAgentPoolAsync(projectId, agentPool, agentPoolId);

CreateAsync(CancellationToken)

public static Task<StorageTransferServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a StorageTransferServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use StorageTransferServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskStorageTransferServiceClient

The task representing the created StorageTransferServiceClient.

CreateTransferJob(CreateTransferJobRequest, CallSettings)

public virtual TransferJob CreateTransferJob(CreateTransferJobRequest request, CallSettings callSettings = null)

Creates a transfer job that runs periodically.

Parameters
Name Description
request CreateTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TransferJob

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
CreateTransferJobRequest request = new CreateTransferJobRequest
{
    TransferJob = new TransferJob(),
};
// Make the request
TransferJob response = storageTransferServiceClient.CreateTransferJob(request);

CreateTransferJobAsync(CreateTransferJobRequest, CallSettings)

public virtual Task<TransferJob> CreateTransferJobAsync(CreateTransferJobRequest request, CallSettings callSettings = null)

Creates a transfer job that runs periodically.

Parameters
Name Description
request CreateTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
CreateTransferJobRequest request = new CreateTransferJobRequest
{
    TransferJob = new TransferJob(),
};
// Make the request
TransferJob response = await storageTransferServiceClient.CreateTransferJobAsync(request);

CreateTransferJobAsync(CreateTransferJobRequest, CancellationToken)

public virtual Task<TransferJob> CreateTransferJobAsync(CreateTransferJobRequest request, CancellationToken cancellationToken)

Creates a transfer job that runs periodically.

Parameters
Name Description
request CreateTransferJobRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
CreateTransferJobRequest request = new CreateTransferJobRequest
{
    TransferJob = new TransferJob(),
};
// Make the request
TransferJob response = await storageTransferServiceClient.CreateTransferJobAsync(request);

DeleteAgentPool(DeleteAgentPoolRequest, CallSettings)

public virtual void DeleteAgentPool(DeleteAgentPoolRequest request, CallSettings callSettings = null)

Deletes an agent pool.

Parameters
Name Description
request DeleteAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
DeleteAgentPoolRequest request = new DeleteAgentPoolRequest { Name = "", };
// Make the request
storageTransferServiceClient.DeleteAgentPool(request);

DeleteAgentPool(string, CallSettings)

public virtual void DeleteAgentPool(string name, CallSettings callSettings = null)

Deletes an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
storageTransferServiceClient.DeleteAgentPool(name);

DeleteAgentPoolAsync(DeleteAgentPoolRequest, CallSettings)

public virtual Task DeleteAgentPoolAsync(DeleteAgentPoolRequest request, CallSettings callSettings = null)

Deletes an agent pool.

Parameters
Name Description
request DeleteAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAgentPoolRequest request = new DeleteAgentPoolRequest { Name = "", };
// Make the request
await storageTransferServiceClient.DeleteAgentPoolAsync(request);

DeleteAgentPoolAsync(DeleteAgentPoolRequest, CancellationToken)

public virtual Task DeleteAgentPoolAsync(DeleteAgentPoolRequest request, CancellationToken cancellationToken)

Deletes an agent pool.

Parameters
Name Description
request DeleteAgentPoolRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAgentPoolRequest request = new DeleteAgentPoolRequest { Name = "", };
// Make the request
await storageTransferServiceClient.DeleteAgentPoolAsync(request);

DeleteAgentPoolAsync(string, CallSettings)

public virtual Task DeleteAgentPoolAsync(string name, CallSettings callSettings = null)

Deletes an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
await storageTransferServiceClient.DeleteAgentPoolAsync(name);

DeleteAgentPoolAsync(string, CancellationToken)

public virtual Task DeleteAgentPoolAsync(string name, CancellationToken cancellationToken)

Deletes an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
await storageTransferServiceClient.DeleteAgentPoolAsync(name);

DeleteTransferJob(DeleteTransferJobRequest, CallSettings)

public virtual void DeleteTransferJob(DeleteTransferJobRequest request, CallSettings callSettings = null)

Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

Parameters
Name Description
request DeleteTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
DeleteTransferJobRequest request = new DeleteTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
storageTransferServiceClient.DeleteTransferJob(request);

DeleteTransferJobAsync(DeleteTransferJobRequest, CallSettings)

public virtual Task DeleteTransferJobAsync(DeleteTransferJobRequest request, CallSettings callSettings = null)

Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

Parameters
Name Description
request DeleteTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteTransferJobRequest request = new DeleteTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
await storageTransferServiceClient.DeleteTransferJobAsync(request);

DeleteTransferJobAsync(DeleteTransferJobRequest, CancellationToken)

public virtual Task DeleteTransferJobAsync(DeleteTransferJobRequest request, CancellationToken cancellationToken)

Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

Parameters
Name Description
request DeleteTransferJobRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteTransferJobRequest request = new DeleteTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
await storageTransferServiceClient.DeleteTransferJobAsync(request);

GetAgentPool(GetAgentPoolRequest, CallSettings)

public virtual AgentPool GetAgentPool(GetAgentPoolRequest request, CallSettings callSettings = null)

Gets an agent pool.

Parameters
Name Description
request GetAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
GetAgentPoolRequest request = new GetAgentPoolRequest { Name = "", };
// Make the request
AgentPool response = storageTransferServiceClient.GetAgentPool(request);

GetAgentPool(string, CallSettings)

public virtual AgentPool GetAgentPool(string name, CallSettings callSettings = null)

Gets an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
AgentPool response = storageTransferServiceClient.GetAgentPool(name);

GetAgentPoolAsync(GetAgentPoolRequest, CallSettings)

public virtual Task<AgentPool> GetAgentPoolAsync(GetAgentPoolRequest request, CallSettings callSettings = null)

Gets an agent pool.

Parameters
Name Description
request GetAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetAgentPoolRequest request = new GetAgentPoolRequest { Name = "", };
// Make the request
AgentPool response = await storageTransferServiceClient.GetAgentPoolAsync(request);

GetAgentPoolAsync(GetAgentPoolRequest, CancellationToken)

public virtual Task<AgentPool> GetAgentPoolAsync(GetAgentPoolRequest request, CancellationToken cancellationToken)

Gets an agent pool.

Parameters
Name Description
request GetAgentPoolRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetAgentPoolRequest request = new GetAgentPoolRequest { Name = "", };
// Make the request
AgentPool response = await storageTransferServiceClient.GetAgentPoolAsync(request);

GetAgentPoolAsync(string, CallSettings)

public virtual Task<AgentPool> GetAgentPoolAsync(string name, CallSettings callSettings = null)

Gets an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to get.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
AgentPool response = await storageTransferServiceClient.GetAgentPoolAsync(name);

GetAgentPoolAsync(string, CancellationToken)

public virtual Task<AgentPool> GetAgentPoolAsync(string name, CancellationToken cancellationToken)

Gets an agent pool.

Parameters
Name Description
name string

Required. The name of the agent pool to get.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
AgentPool response = await storageTransferServiceClient.GetAgentPoolAsync(name);

GetGoogleServiceAccount(GetGoogleServiceAccountRequest, CallSettings)

public virtual GoogleServiceAccount GetGoogleServiceAccount(GetGoogleServiceAccountRequest request, CallSettings callSettings = null)

Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.

Parameters
Name Description
request GetGoogleServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GoogleServiceAccount

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
GetGoogleServiceAccountRequest request = new GetGoogleServiceAccountRequest { ProjectId = "", };
// Make the request
GoogleServiceAccount response = storageTransferServiceClient.GetGoogleServiceAccount(request);

GetGoogleServiceAccountAsync(GetGoogleServiceAccountRequest, CallSettings)

public virtual Task<GoogleServiceAccount> GetGoogleServiceAccountAsync(GetGoogleServiceAccountRequest request, CallSettings callSettings = null)

Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.

Parameters
Name Description
request GetGoogleServiceAccountRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGoogleServiceAccount

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetGoogleServiceAccountRequest request = new GetGoogleServiceAccountRequest { ProjectId = "", };
// Make the request
GoogleServiceAccount response = await storageTransferServiceClient.GetGoogleServiceAccountAsync(request);

GetGoogleServiceAccountAsync(GetGoogleServiceAccountRequest, CancellationToken)

public virtual Task<GoogleServiceAccount> GetGoogleServiceAccountAsync(GetGoogleServiceAccountRequest request, CancellationToken cancellationToken)

Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.

Parameters
Name Description
request GetGoogleServiceAccountRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGoogleServiceAccount

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetGoogleServiceAccountRequest request = new GetGoogleServiceAccountRequest { ProjectId = "", };
// Make the request
GoogleServiceAccount response = await storageTransferServiceClient.GetGoogleServiceAccountAsync(request);

GetTransferJob(GetTransferJobRequest, CallSettings)

public virtual TransferJob GetTransferJob(GetTransferJobRequest request, CallSettings callSettings = null)

Gets a transfer job.

Parameters
Name Description
request GetTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TransferJob

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
GetTransferJobRequest request = new GetTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
TransferJob response = storageTransferServiceClient.GetTransferJob(request);

GetTransferJobAsync(GetTransferJobRequest, CallSettings)

public virtual Task<TransferJob> GetTransferJobAsync(GetTransferJobRequest request, CallSettings callSettings = null)

Gets a transfer job.

Parameters
Name Description
request GetTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetTransferJobRequest request = new GetTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
TransferJob response = await storageTransferServiceClient.GetTransferJobAsync(request);

GetTransferJobAsync(GetTransferJobRequest, CancellationToken)

public virtual Task<TransferJob> GetTransferJobAsync(GetTransferJobRequest request, CancellationToken cancellationToken)

Gets a transfer job.

Parameters
Name Description
request GetTransferJobRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
GetTransferJobRequest request = new GetTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
TransferJob response = await storageTransferServiceClient.GetTransferJobAsync(request);

ListAgentPools(ListAgentPoolsRequest, CallSettings)

public virtual PagedEnumerable<ListAgentPoolsResponse, AgentPool> ListAgentPools(ListAgentPoolsRequest request, CallSettings callSettings = null)

Lists agent pools.

Parameters
Name Description
request ListAgentPoolsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAgentPoolsResponseAgentPool

A pageable sequence of AgentPool resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
ListAgentPoolsRequest request = new ListAgentPoolsRequest
{
    ProjectId = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListAgentPoolsResponse, AgentPool> response = storageTransferServiceClient.ListAgentPools(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AgentPool item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAgentPoolsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AgentPool item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AgentPool> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AgentPool item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAgentPools(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAgentPoolsResponse, AgentPool> ListAgentPools(string projectId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists agent pools.

Parameters
Name Description
projectId string

Required. The ID of the Google Cloud project that owns the job.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAgentPoolsResponseAgentPool

A pageable sequence of AgentPool resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
string projectId = "";
// Make the request
PagedEnumerable<ListAgentPoolsResponse, AgentPool> response = storageTransferServiceClient.ListAgentPools(projectId);

// Iterate over all response items, lazily performing RPCs as required
foreach (AgentPool item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAgentPoolsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AgentPool item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AgentPool> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AgentPool item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAgentPoolsAsync(ListAgentPoolsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool> ListAgentPoolsAsync(ListAgentPoolsRequest request, CallSettings callSettings = null)

Lists agent pools.

Parameters
Name Description
request ListAgentPoolsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAgentPoolsResponseAgentPool

A pageable asynchronous sequence of AgentPool resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
ListAgentPoolsRequest request = new ListAgentPoolsRequest
{
    ProjectId = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool> response = storageTransferServiceClient.ListAgentPoolsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AgentPool item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAgentPoolsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AgentPool item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AgentPool> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AgentPool item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAgentPoolsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool> ListAgentPoolsAsync(string projectId, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists agent pools.

Parameters
Name Description
projectId string

Required. The ID of the Google Cloud project that owns the job.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAgentPoolsResponseAgentPool

A pageable asynchronous sequence of AgentPool resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
// Make the request
PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool> response = storageTransferServiceClient.ListAgentPoolsAsync(projectId);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AgentPool item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAgentPoolsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AgentPool item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AgentPool> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AgentPool item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTransferJobs(ListTransferJobsRequest, CallSettings)

public virtual PagedEnumerable<ListTransferJobsResponse, TransferJob> ListTransferJobs(ListTransferJobsRequest request, CallSettings callSettings = null)

Lists transfer jobs.

Parameters
Name Description
request ListTransferJobsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListTransferJobsResponseTransferJob

A pageable sequence of TransferJob resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
ListTransferJobsRequest request = new ListTransferJobsRequest { Filter = "", };
// Make the request
PagedEnumerable<ListTransferJobsResponse, TransferJob> response = storageTransferServiceClient.ListTransferJobs(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (TransferJob item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListTransferJobsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TransferJob item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<TransferJob> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TransferJob item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListTransferJobsAsync(ListTransferJobsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListTransferJobsResponse, TransferJob> ListTransferJobsAsync(ListTransferJobsRequest request, CallSettings callSettings = null)

Lists transfer jobs.

Parameters
Name Description
request ListTransferJobsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListTransferJobsResponseTransferJob

A pageable asynchronous sequence of TransferJob resources.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
ListTransferJobsRequest request = new ListTransferJobsRequest { Filter = "", };
// Make the request
PagedAsyncEnumerable<ListTransferJobsResponse, TransferJob> response = storageTransferServiceClient.ListTransferJobsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((TransferJob item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListTransferJobsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (TransferJob item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<TransferJob> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (TransferJob item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PauseTransferOperation(PauseTransferOperationRequest, CallSettings)

public virtual void PauseTransferOperation(PauseTransferOperationRequest request, CallSettings callSettings = null)

Pauses a transfer operation.

Parameters
Name Description
request PauseTransferOperationRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
PauseTransferOperationRequest request = new PauseTransferOperationRequest { Name = "", };
// Make the request
storageTransferServiceClient.PauseTransferOperation(request);

PauseTransferOperationAsync(PauseTransferOperationRequest, CallSettings)

public virtual Task PauseTransferOperationAsync(PauseTransferOperationRequest request, CallSettings callSettings = null)

Pauses a transfer operation.

Parameters
Name Description
request PauseTransferOperationRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
PauseTransferOperationRequest request = new PauseTransferOperationRequest { Name = "", };
// Make the request
await storageTransferServiceClient.PauseTransferOperationAsync(request);

PauseTransferOperationAsync(PauseTransferOperationRequest, CancellationToken)

public virtual Task PauseTransferOperationAsync(PauseTransferOperationRequest request, CancellationToken cancellationToken)

Pauses a transfer operation.

Parameters
Name Description
request PauseTransferOperationRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
PauseTransferOperationRequest request = new PauseTransferOperationRequest { Name = "", };
// Make the request
await storageTransferServiceClient.PauseTransferOperationAsync(request);

PollOnceRunTransferJob(string, CallSettings)

public virtual Operation<Empty, TransferOperation> PollOnceRunTransferJob(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RunTransferJob.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyTransferOperation

The result of polling the operation.

PollOnceRunTransferJobAsync(string, CallSettings)

public virtual Task<Operation<Empty, TransferOperation>> PollOnceRunTransferJobAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RunTransferJob.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyTransferOperation

A task representing the result of polling the operation.

ResumeTransferOperation(ResumeTransferOperationRequest, CallSettings)

public virtual void ResumeTransferOperation(ResumeTransferOperationRequest request, CallSettings callSettings = null)

Resumes a transfer operation that is paused.

Parameters
Name Description
request ResumeTransferOperationRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
ResumeTransferOperationRequest request = new ResumeTransferOperationRequest { Name = "", };
// Make the request
storageTransferServiceClient.ResumeTransferOperation(request);

ResumeTransferOperationAsync(ResumeTransferOperationRequest, CallSettings)

public virtual Task ResumeTransferOperationAsync(ResumeTransferOperationRequest request, CallSettings callSettings = null)

Resumes a transfer operation that is paused.

Parameters
Name Description
request ResumeTransferOperationRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
ResumeTransferOperationRequest request = new ResumeTransferOperationRequest { Name = "", };
// Make the request
await storageTransferServiceClient.ResumeTransferOperationAsync(request);

ResumeTransferOperationAsync(ResumeTransferOperationRequest, CancellationToken)

public virtual Task ResumeTransferOperationAsync(ResumeTransferOperationRequest request, CancellationToken cancellationToken)

Resumes a transfer operation that is paused.

Parameters
Name Description
request ResumeTransferOperationRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
ResumeTransferOperationRequest request = new ResumeTransferOperationRequest { Name = "", };
// Make the request
await storageTransferServiceClient.ResumeTransferOperationAsync(request);

RunTransferJob(RunTransferJobRequest, CallSettings)

public virtual Operation<Empty, TransferOperation> RunTransferJob(RunTransferJobRequest request, CallSettings callSettings = null)

Starts a new operation for the specified transfer job. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error is returned.

Parameters
Name Description
request RunTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyTransferOperation

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
RunTransferJobRequest request = new RunTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
Operation<Empty, TransferOperation> response = storageTransferServiceClient.RunTransferJob(request);

// Poll until the returned long-running operation is complete
Operation<Empty, TransferOperation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, TransferOperation> retrievedResponse = storageTransferServiceClient.PollOnceRunTransferJob(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

RunTransferJobAsync(RunTransferJobRequest, CallSettings)

public virtual Task<Operation<Empty, TransferOperation>> RunTransferJobAsync(RunTransferJobRequest request, CallSettings callSettings = null)

Starts a new operation for the specified transfer job. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error is returned.

Parameters
Name Description
request RunTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyTransferOperation

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
RunTransferJobRequest request = new RunTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
Operation<Empty, TransferOperation> response = await storageTransferServiceClient.RunTransferJobAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, TransferOperation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, TransferOperation> retrievedResponse = await storageTransferServiceClient.PollOnceRunTransferJobAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

RunTransferJobAsync(RunTransferJobRequest, CancellationToken)

public virtual Task<Operation<Empty, TransferOperation>> RunTransferJobAsync(RunTransferJobRequest request, CancellationToken cancellationToken)

Starts a new operation for the specified transfer job. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error is returned.

Parameters
Name Description
request RunTransferJobRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyTransferOperation

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
RunTransferJobRequest request = new RunTransferJobRequest
{
    JobName = "",
    ProjectId = "",
};
// Make the request
Operation<Empty, TransferOperation> response = await storageTransferServiceClient.RunTransferJobAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, TransferOperation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, TransferOperation> retrievedResponse = await storageTransferServiceClient.PollOnceRunTransferJobAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateAgentPool(AgentPool, FieldMask, CallSettings)

public virtual AgentPool UpdateAgentPool(AgentPool agentPool, FieldMask updateMask, CallSettings callSettings = null)

Updates an existing agent pool resource.

Parameters
Name Description
agentPool AgentPool

Required. The agent pool to update. agent_pool is expected to specify following fields:

  • [name][google.storagetransfer.v1.AgentPool.name]

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] An UpdateAgentPoolRequest with any other fields is rejected with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].

updateMask FieldMask

The field mask of the fields in agentPool to update in this request. The following agentPool fields can be updated:

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
AgentPool agentPool = new AgentPool();
FieldMask updateMask = new FieldMask();
// Make the request
AgentPool response = storageTransferServiceClient.UpdateAgentPool(agentPool, updateMask);

UpdateAgentPool(UpdateAgentPoolRequest, CallSettings)

public virtual AgentPool UpdateAgentPool(UpdateAgentPoolRequest request, CallSettings callSettings = null)

Updates an existing agent pool resource.

Parameters
Name Description
request UpdateAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentPool

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
UpdateAgentPoolRequest request = new UpdateAgentPoolRequest
{
    AgentPool = new AgentPool(),
    UpdateMask = new FieldMask(),
};
// Make the request
AgentPool response = storageTransferServiceClient.UpdateAgentPool(request);

UpdateAgentPoolAsync(AgentPool, FieldMask, CallSettings)

public virtual Task<AgentPool> UpdateAgentPoolAsync(AgentPool agentPool, FieldMask updateMask, CallSettings callSettings = null)

Updates an existing agent pool resource.

Parameters
Name Description
agentPool AgentPool

Required. The agent pool to update. agent_pool is expected to specify following fields:

  • [name][google.storagetransfer.v1.AgentPool.name]

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] An UpdateAgentPoolRequest with any other fields is rejected with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].

updateMask FieldMask

The field mask of the fields in agentPool to update in this request. The following agentPool fields can be updated:

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
AgentPool agentPool = new AgentPool();
FieldMask updateMask = new FieldMask();
// Make the request
AgentPool response = await storageTransferServiceClient.UpdateAgentPoolAsync(agentPool, updateMask);

UpdateAgentPoolAsync(AgentPool, FieldMask, CancellationToken)

public virtual Task<AgentPool> UpdateAgentPoolAsync(AgentPool agentPool, FieldMask updateMask, CancellationToken cancellationToken)

Updates an existing agent pool resource.

Parameters
Name Description
agentPool AgentPool

Required. The agent pool to update. agent_pool is expected to specify following fields:

  • [name][google.storagetransfer.v1.AgentPool.name]

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] An UpdateAgentPoolRequest with any other fields is rejected with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].

updateMask FieldMask

The field mask of the fields in agentPool to update in this request. The following agentPool fields can be updated:

  • [display_name][google.storagetransfer.v1.AgentPool.display_name]

  • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
AgentPool agentPool = new AgentPool();
FieldMask updateMask = new FieldMask();
// Make the request
AgentPool response = await storageTransferServiceClient.UpdateAgentPoolAsync(agentPool, updateMask);

UpdateAgentPoolAsync(UpdateAgentPoolRequest, CallSettings)

public virtual Task<AgentPool> UpdateAgentPoolAsync(UpdateAgentPoolRequest request, CallSettings callSettings = null)

Updates an existing agent pool resource.

Parameters
Name Description
request UpdateAgentPoolRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAgentPoolRequest request = new UpdateAgentPoolRequest
{
    AgentPool = new AgentPool(),
    UpdateMask = new FieldMask(),
};
// Make the request
AgentPool response = await storageTransferServiceClient.UpdateAgentPoolAsync(request);

UpdateAgentPoolAsync(UpdateAgentPoolRequest, CancellationToken)

public virtual Task<AgentPool> UpdateAgentPoolAsync(UpdateAgentPoolRequest request, CancellationToken cancellationToken)

Updates an existing agent pool resource.

Parameters
Name Description
request UpdateAgentPoolRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentPool

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAgentPoolRequest request = new UpdateAgentPoolRequest
{
    AgentPool = new AgentPool(),
    UpdateMask = new FieldMask(),
};
// Make the request
AgentPool response = await storageTransferServiceClient.UpdateAgentPoolAsync(request);

UpdateTransferJob(UpdateTransferJobRequest, CallSettings)

public virtual TransferJob UpdateTransferJob(UpdateTransferJobRequest request, CallSettings callSettings = null)

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

Note: The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

Parameters
Name Description
request UpdateTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TransferJob

The RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = StorageTransferServiceClient.Create();
// Initialize request argument(s)
UpdateTransferJobRequest request = new UpdateTransferJobRequest
{
    JobName = "",
    ProjectId = "",
    TransferJob = new TransferJob(),
    UpdateTransferJobFieldMask = new FieldMask(),
};
// Make the request
TransferJob response = storageTransferServiceClient.UpdateTransferJob(request);

UpdateTransferJobAsync(UpdateTransferJobRequest, CallSettings)

public virtual Task<TransferJob> UpdateTransferJobAsync(UpdateTransferJobRequest request, CallSettings callSettings = null)

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

Note: The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

Parameters
Name Description
request UpdateTransferJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateTransferJobRequest request = new UpdateTransferJobRequest
{
    JobName = "",
    ProjectId = "",
    TransferJob = new TransferJob(),
    UpdateTransferJobFieldMask = new FieldMask(),
};
// Make the request
TransferJob response = await storageTransferServiceClient.UpdateTransferJobAsync(request);

UpdateTransferJobAsync(UpdateTransferJobRequest, CancellationToken)

public virtual Task<TransferJob> UpdateTransferJobAsync(UpdateTransferJobRequest request, CancellationToken cancellationToken)

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

Note: The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

Parameters
Name Description
request UpdateTransferJobRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTransferJob

A Task containing the RPC response.

Example
// Create client
StorageTransferServiceClient storageTransferServiceClient = await StorageTransferServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateTransferJobRequest request = new UpdateTransferJobRequest
{
    JobName = "",
    ProjectId = "",
    TransferJob = new TransferJob(),
    UpdateTransferJobFieldMask = new FieldMask(),
};
// Make the request
TransferJob response = await storageTransferServiceClient.UpdateTransferJobAsync(request);