Class StorageTransferServiceClient (1.1.0)

public abstract 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

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.

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

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

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

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