Storage Transfer v1 API - Class StorageTransferServiceClient (2.2.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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default StorageTransferService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default StorageTransferService scopes are:

GrpcClient

public virtual StorageTransferService.StorageTransferServiceClient GrpcClient { get; }

The underlying gRPC StorageTransferService client

Property Value
TypeDescription
StorageTransferService.StorageTransferServiceClient

RunTransferJobOperationsClient

public virtual OperationsClient RunTransferJobOperationsClient { get; }

The long-running operations client for RunTransferJob.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
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
TypeDescription
StorageTransferServiceClient

The created StorageTransferServiceClient.

CreateAgentPool(CreateAgentPoolRequest, CallSettings)

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

Creates an agent pool resource.

Parameters
NameDescription
requestCreateAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
projectIdString

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

agentPoolAgentPool

Required. The agent pool to create.

agentPoolIdString

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])?$.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestCreateAgentPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
projectIdString

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

agentPoolAgentPool

Required. The agent pool to create.

agentPoolIdString

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])?$.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
projectIdString

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

agentPoolAgentPool

Required. The agent pool to create.

agentPoolIdString

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])?$.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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(CancellationToken))

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<StorageTransferServiceClient>

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
NameDescription
requestCreateTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TransferJob>

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
NameDescription
requestCreateTransferJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TransferJob>

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
NameDescription
requestDeleteAgentPoolRequest

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

callSettingsCallSettings

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
NameDescription
nameString

Required. The name of the agent pool to delete.

callSettingsCallSettings

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
NameDescription
requestDeleteAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteAgentPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameString

Required. The name of the agent pool to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameString

Required. The name of the agent pool to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDeleteTransferJobRequest

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

callSettingsCallSettings

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
NameDescription
requestDeleteTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteTransferJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestGetAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameString

Required. The name of the agent pool to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestGetAgentPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
nameString

Required. The name of the agent pool to get.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
nameString

Required. The name of the agent pool to get.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestGetGoogleServiceAccountRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetGoogleServiceAccountRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<GoogleServiceAccount>

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
NameDescription
requestGetGoogleServiceAccountRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<GoogleServiceAccount>

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
NameDescription
requestGetTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TransferJob>

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
NameDescription
requestGetTransferJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TransferJob>

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
NameDescription
requestListAgentPoolsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAgentPoolsResponse, AgentPool>

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, Nullable<Int32>, CallSettings)

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

Lists agent pools.

Parameters
NameDescription
projectIdString

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

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAgentPoolsResponse, AgentPool>

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
NameDescription
requestListAgentPoolsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool>

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, Nullable<Int32>, CallSettings)

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

Lists agent pools.

Parameters
NameDescription
projectIdString

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

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAgentPoolsResponse, AgentPool>

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
NameDescription
requestListTransferJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListTransferJobsResponse, TransferJob>

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
NameDescription
requestListTransferJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListTransferJobsResponse, TransferJob>

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
NameDescription
requestPauseTransferOperationRequest

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

callSettingsCallSettings

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
NameDescription
requestPauseTransferOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestPauseTransferOperationRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, TransferOperation>

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
NameDescription
operationNameString

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, TransferOperation>>

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
NameDescription
requestResumeTransferOperationRequest

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

callSettingsCallSettings

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
NameDescription
requestResumeTransferOperationRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestResumeTransferOperationRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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)

Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.

Parameters
NameDescription
requestRunTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, TransferOperation>

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)

Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.

Parameters
NameDescription
requestRunTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, TransferOperation>>

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)

Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.

Parameters
NameDescription
requestRunTransferJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, TransferOperation>>

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
TypeDescription
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
NameDescription
agentPoolAgentPool

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].

updateMaskFieldMask

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]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
agentPoolAgentPool

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].

updateMaskFieldMask

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]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
agentPoolAgentPool

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].

updateMaskFieldMask

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]

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestUpdateAgentPoolRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestUpdateAgentPoolRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AgentPool>

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
NameDescription
requestUpdateTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateTransferJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<TransferJob>

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
NameDescription
requestUpdateTransferJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<TransferJob>

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);