Cloud Storage v2 API - Class StorageControlClient (1.0.0-beta02)

public abstract class StorageControlClient

Reference documentation and code samples for the Cloud Storage v2 API class StorageControlClient.

StorageControl client wrapper, for convenient use.

Inheritance

object > StorageControlClient

Derived Types

Namespace

Google.Cloud.Storage.Control.V2

Assembly

Google.Cloud.Storage.Control.V2.dll

Remarks

StorageControl service includes selected control plane operations.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default StorageControl scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual StorageControl.StorageControlClient GrpcClient { get; }

The underlying gRPC StorageControl client

Property Value
TypeDescription
StorageControlStorageControlClient

RenameFolderOperationsClient

public virtual OperationsClient RenameFolderOperationsClient { get; }

The long-running operations client for RenameFolder.

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 StorageControlClient Create()

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

Returns
TypeDescription
StorageControlClient

The created StorageControlClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskStorageControlClient

The task representing the created StorageControlClient.

CreateFolder(BucketName, Folder, string, CallSettings)

public virtual Folder CreateFolder(BucketName parent, Folder folder, string folderId, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
parentBucketName

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = storageControlClient.CreateFolder(parent, folder, folderId);

CreateFolder(CreateFolderRequest, CallSettings)

public virtual Folder CreateFolder(CreateFolderRequest request, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
requestCreateFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Folder = new Folder(),
    FolderId = "",
    Recursive = false,
};
// Make the request
Folder response = storageControlClient.CreateFolder(request);

CreateFolder(string, Folder, string, CallSettings)

public virtual Folder CreateFolder(string parent, Folder folder, string folderId, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
parentstring

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = storageControlClient.CreateFolder(parent, folder, folderId);

CreateFolderAsync(BucketName, Folder, string, CallSettings)

public virtual Task<Folder> CreateFolderAsync(BucketName parent, Folder folder, string folderId, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
parentBucketName

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(parent, folder, folderId);

CreateFolderAsync(BucketName, Folder, string, CancellationToken)

public virtual Task<Folder> CreateFolderAsync(BucketName parent, Folder folder, string folderId, CancellationToken cancellationToken)

Creates a new folder.

Parameters
NameDescription
parentBucketName

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(parent, folder, folderId);

CreateFolderAsync(CreateFolderRequest, CallSettings)

public virtual Task<Folder> CreateFolderAsync(CreateFolderRequest request, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
requestCreateFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Folder = new Folder(),
    FolderId = "",
    Recursive = false,
};
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(request);

CreateFolderAsync(CreateFolderRequest, CancellationToken)

public virtual Task<Folder> CreateFolderAsync(CreateFolderRequest request, CancellationToken cancellationToken)

Creates a new folder.

Parameters
NameDescription
requestCreateFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Folder = new Folder(),
    FolderId = "",
    Recursive = false,
};
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(request);

CreateFolderAsync(string, Folder, string, CallSettings)

public virtual Task<Folder> CreateFolderAsync(string parent, Folder folder, string folderId, CallSettings callSettings = null)

Creates a new folder.

Parameters
NameDescription
parentstring

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(parent, folder, folderId);

CreateFolderAsync(string, Folder, string, CancellationToken)

public virtual Task<Folder> CreateFolderAsync(string parent, Folder folder, string folderId, CancellationToken cancellationToken)

Creates a new folder.

Parameters
NameDescription
parentstring

Required. Name of the bucket in which the folder will reside.

folderFolder

Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

folderIdstring

Required. The absolute path of the folder, using a single / as delimiter.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
Folder folder = new Folder();
string folderId = "";
// Make the request
Folder response = await storageControlClient.CreateFolderAsync(parent, folder, folderId);

DeleteFolder(DeleteFolderRequest, CallSettings)

public virtual void DeleteFolder(DeleteFolderRequest request, CallSettings callSettings = null)

Permanently deletes an empty folder.

Parameters
NameDescription
requestDeleteFolderRequest

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
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
storageControlClient.DeleteFolder(request);

DeleteFolder(FolderName, CallSettings)

public virtual void DeleteFolder(FolderName name, CallSettings callSettings = null)

Permanently deletes an empty folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
storageControlClient.DeleteFolder(name);

DeleteFolder(string, CallSettings)

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

Permanently deletes an empty folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
storageControlClient.DeleteFolder(name);

DeleteFolderAsync(DeleteFolderRequest, CallSettings)

public virtual Task DeleteFolderAsync(DeleteFolderRequest request, CallSettings callSettings = null)

Permanently deletes an empty folder.

Parameters
NameDescription
requestDeleteFolderRequest

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
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
await storageControlClient.DeleteFolderAsync(request);

DeleteFolderAsync(DeleteFolderRequest, CancellationToken)

public virtual Task DeleteFolderAsync(DeleteFolderRequest request, CancellationToken cancellationToken)

Permanently deletes an empty folder.

Parameters
NameDescription
requestDeleteFolderRequest

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
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
await storageControlClient.DeleteFolderAsync(request);

DeleteFolderAsync(FolderName, CallSettings)

public virtual Task DeleteFolderAsync(FolderName name, CallSettings callSettings = null)

Permanently deletes an empty folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
await storageControlClient.DeleteFolderAsync(name);

DeleteFolderAsync(FolderName, CancellationToken)

public virtual Task DeleteFolderAsync(FolderName name, CancellationToken cancellationToken)

Permanently deletes an empty folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
await storageControlClient.DeleteFolderAsync(name);

DeleteFolderAsync(string, CallSettings)

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

Permanently deletes an empty folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
await storageControlClient.DeleteFolderAsync(name);

DeleteFolderAsync(string, CancellationToken)

public virtual Task DeleteFolderAsync(string name, CancellationToken cancellationToken)

Permanently deletes an empty folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
await storageControlClient.DeleteFolderAsync(name);

GetFolder(FolderName, CallSettings)

public virtual Folder GetFolder(FolderName name, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
Folder response = storageControlClient.GetFolder(name);

GetFolder(GetFolderRequest, CallSettings)

public virtual Folder GetFolder(GetFolderRequest request, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
requestGetFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
Folder response = storageControlClient.GetFolder(request);

GetFolder(string, CallSettings)

public virtual Folder GetFolder(string name, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
Folder response = storageControlClient.GetFolder(name);

GetFolderAsync(FolderName, CallSettings)

public virtual Task<Folder> GetFolderAsync(FolderName name, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
Folder response = await storageControlClient.GetFolderAsync(name);

GetFolderAsync(FolderName, CancellationToken)

public virtual Task<Folder> GetFolderAsync(FolderName name, CancellationToken cancellationToken)

Returns metadata for the specified folder.

Parameters
NameDescription
nameFolderName

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
// Make the request
Folder response = await storageControlClient.GetFolderAsync(name);

GetFolderAsync(GetFolderRequest, CallSettings)

public virtual Task<Folder> GetFolderAsync(GetFolderRequest request, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
requestGetFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
Folder response = await storageControlClient.GetFolderAsync(request);

GetFolderAsync(GetFolderRequest, CancellationToken)

public virtual Task<Folder> GetFolderAsync(GetFolderRequest request, CancellationToken cancellationToken)

Returns metadata for the specified folder.

Parameters
NameDescription
requestGetFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
};
// Make the request
Folder response = await storageControlClient.GetFolderAsync(request);

GetFolderAsync(string, CallSettings)

public virtual Task<Folder> GetFolderAsync(string name, CallSettings callSettings = null)

Returns metadata for the specified folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
Folder response = await storageControlClient.GetFolderAsync(name);

GetFolderAsync(string, CancellationToken)

public virtual Task<Folder> GetFolderAsync(string name, CancellationToken cancellationToken)

Returns metadata for the specified folder.

Parameters
NameDescription
namestring

Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
// Make the request
Folder response = await storageControlClient.GetFolderAsync(name);

GetStorageLayout(GetStorageLayoutRequest, CallSettings)

public virtual StorageLayout GetStorageLayout(GetStorageLayoutRequest request, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
requestGetStorageLayoutRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
StorageLayout

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
GetStorageLayoutRequest request = new GetStorageLayoutRequest
{
    StorageLayoutName = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Prefix = "",
};
// Make the request
StorageLayout response = storageControlClient.GetStorageLayout(request);

GetStorageLayout(StorageLayoutName, CallSettings)

public virtual StorageLayout GetStorageLayout(StorageLayoutName name, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
nameStorageLayoutName

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
StorageLayout

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
StorageLayoutName name = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]");
// Make the request
StorageLayout response = storageControlClient.GetStorageLayout(name);

GetStorageLayout(string, CallSettings)

public virtual StorageLayout GetStorageLayout(string name, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
namestring

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
StorageLayout

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/storageLayout";
// Make the request
StorageLayout response = storageControlClient.GetStorageLayout(name);

GetStorageLayoutAsync(GetStorageLayoutRequest, CallSettings)

public virtual Task<StorageLayout> GetStorageLayoutAsync(GetStorageLayoutRequest request, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
requestGetStorageLayoutRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
GetStorageLayoutRequest request = new GetStorageLayoutRequest
{
    StorageLayoutName = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Prefix = "",
};
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(request);

GetStorageLayoutAsync(GetStorageLayoutRequest, CancellationToken)

public virtual Task<StorageLayout> GetStorageLayoutAsync(GetStorageLayoutRequest request, CancellationToken cancellationToken)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
requestGetStorageLayoutRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
GetStorageLayoutRequest request = new GetStorageLayoutRequest
{
    StorageLayoutName = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Prefix = "",
};
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(request);

GetStorageLayoutAsync(StorageLayoutName, CallSettings)

public virtual Task<StorageLayout> GetStorageLayoutAsync(StorageLayoutName name, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
nameStorageLayoutName

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
StorageLayoutName name = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]");
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(name);

GetStorageLayoutAsync(StorageLayoutName, CancellationToken)

public virtual Task<StorageLayout> GetStorageLayoutAsync(StorageLayoutName name, CancellationToken cancellationToken)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
nameStorageLayoutName

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
StorageLayoutName name = StorageLayoutName.FromProjectBucket("[PROJECT]", "[BUCKET]");
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(name);

GetStorageLayoutAsync(string, CallSettings)

public virtual Task<StorageLayout> GetStorageLayoutAsync(string name, CallSettings callSettings = null)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
namestring

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/storageLayout";
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(name);

GetStorageLayoutAsync(string, CancellationToken)

public virtual Task<StorageLayout> GetStorageLayoutAsync(string name, CancellationToken cancellationToken)

Returns the storage layout configuration for a given bucket.

Parameters
NameDescription
namestring

Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskStorageLayout

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/storageLayout";
// Make the request
StorageLayout response = await storageControlClient.GetStorageLayoutAsync(name);

ListFolders(BucketName, string, int?, CallSettings)

public virtual PagedEnumerable<ListFoldersResponse, Folder> ListFolders(BucketName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
parentBucketName

Required. Name of the bucket in which to look for folders.

pageTokenstring

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

pageSizeint

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
PagedEnumerableListFoldersResponseFolder

A pageable sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFolders(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Folder 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 (ListFoldersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

ListFolders(ListFoldersRequest, CallSettings)

public virtual PagedEnumerable<ListFoldersResponse, Folder> ListFolders(ListFoldersRequest request, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
requestListFoldersRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListFoldersResponseFolder

A pageable sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
ListFoldersRequest request = new ListFoldersRequest
{
    ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Prefix = "",
    LexicographicStart = "",
    LexicographicEnd = "",
    Delimiter = "",
    RequestId = "",
};
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFolders(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Folder 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 (ListFoldersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

ListFolders(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListFoldersResponse, Folder> ListFolders(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
parentstring

Required. Name of the bucket in which to look for folders.

pageTokenstring

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

pageSizeint

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
PagedEnumerableListFoldersResponseFolder

A pageable sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFolders(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Folder 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 (ListFoldersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

ListFoldersAsync(BucketName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListFoldersResponse, Folder> ListFoldersAsync(BucketName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
parentBucketName

Required. Name of the bucket in which to look for folders.

pageTokenstring

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

pageSizeint

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
PagedAsyncEnumerableListFoldersResponseFolder

A pageable asynchronous sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFoldersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Folder 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((ListFoldersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

ListFoldersAsync(ListFoldersRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListFoldersResponse, Folder> ListFoldersAsync(ListFoldersRequest request, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
requestListFoldersRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListFoldersResponseFolder

A pageable asynchronous sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
ListFoldersRequest request = new ListFoldersRequest
{
    ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
    Prefix = "",
    LexicographicStart = "",
    LexicographicEnd = "",
    Delimiter = "",
    RequestId = "",
};
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFoldersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Folder 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((ListFoldersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

ListFoldersAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListFoldersResponse, Folder> ListFoldersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves a list of folders for a given bucket.

Parameters
NameDescription
parentstring

Required. Name of the bucket in which to look for folders.

pageTokenstring

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

pageSizeint

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
PagedAsyncEnumerableListFoldersResponseFolder

A pageable asynchronous sequence of Folder resources.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = storageControlClient.ListFoldersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Folder 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((ListFoldersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Folder 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<Folder> 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 (Folder 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;

PollOnceRenameFolder(string, CallSettings)

public virtual Operation<Folder, RenameFolderMetadata> PollOnceRenameFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderRenameFolderMetadata

The result of polling the operation.

PollOnceRenameFolderAsync(string, CallSettings)

public virtual Task<Operation<Folder, RenameFolderMetadata>> PollOnceRenameFolderAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationFolderRenameFolderMetadata

A task representing the result of polling the operation.

RenameFolder(FolderName, string, CallSettings)

public virtual Operation<Folder, RenameFolderMetadata> RenameFolder(FolderName name, string destinationFolderId, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
nameFolderName

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderRenameFolderMetadata

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = storageControlClient.RenameFolder(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = storageControlClient.PollOnceRenameFolder(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolder(RenameFolderRequest, CallSettings)

public virtual Operation<Folder, RenameFolderMetadata> RenameFolder(RenameFolderRequest request, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
requestRenameFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderRenameFolderMetadata

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
RenameFolderRequest request = new RenameFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
    DestinationFolderId = "",
};
// Make the request
Operation<Folder, RenameFolderMetadata> response = storageControlClient.RenameFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = storageControlClient.PollOnceRenameFolder(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolder(string, string, CallSettings)

public virtual Operation<Folder, RenameFolderMetadata> RenameFolder(string name, string destinationFolderId, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
namestring

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderRenameFolderMetadata

The RPC response.

Example
// Create client
StorageControlClient storageControlClient = StorageControlClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = storageControlClient.RenameFolder(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = storageControlClient.PollOnceRenameFolder(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(FolderName, string, CallSettings)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(FolderName name, string destinationFolderId, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
nameFolderName

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(FolderName, string, CancellationToken)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(FolderName name, string destinationFolderId, CancellationToken cancellationToken)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
nameFolderName

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]");
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(RenameFolderRequest, CallSettings)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(RenameFolderRequest request, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
requestRenameFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
RenameFolderRequest request = new RenameFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
    DestinationFolderId = "",
};
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(RenameFolderRequest, CancellationToken)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(RenameFolderRequest request, CancellationToken cancellationToken)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
requestRenameFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
RenameFolderRequest request = new RenameFolderRequest
{
    IfMetagenerationMatch = 0L,
    IfMetagenerationNotMatch = 0L,
    FolderName = FolderName.FromProjectBucketFolder("[PROJECT]", "[BUCKET]", "[FOLDER]"),
    DestinationFolderId = "",
};
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(string, string, CallSettings)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(string name, string destinationFolderId, CallSettings callSettings = null)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
namestring

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder retrievedResult = retrievedResponse.Result;
}

RenameFolderAsync(string, string, CancellationToken)

public virtual Task<Operation<Folder, RenameFolderMetadata>> RenameFolderAsync(string name, string destinationFolderId, CancellationToken cancellationToken)

Renames a source folder to a destination folder. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
NameDescription
namestring

Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

destinationFolderIdstring

Required. The destination folder ID, e.g. foo/bar/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderRenameFolderMetadata

A Task containing the RPC response.

Example
// Create client
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/buckets/[BUCKET]/folders/[FOLDER]";
string destinationFolderId = "";
// Make the request
Operation<Folder, RenameFolderMetadata> response = await storageControlClient.RenameFolderAsync(name, destinationFolderId);

// Poll until the returned long-running operation is complete
Operation<Folder, RenameFolderMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Folder 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<Folder, RenameFolderMetadata> retrievedResponse = await storageControlClient.PollOnceRenameFolderAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Folder 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.