Cloud Resource Manager v3 API - Class FoldersClient (2.4.0)

public abstract class FoldersClient

Reference documentation and code samples for the Cloud Resource Manager v3 API class FoldersClient.

Folders client wrapper, for convenient use.

Inheritance

object > FoldersClient

Derived Types

Namespace

Google.Cloud.ResourceManager.V3

Assembly

Google.Cloud.ResourceManager.V3.dll

Remarks

Manages Cloud Platform folder resources. Folders can be used to organize the resources under an organization and to control the policies applied to groups of resources.

Properties

CreateFolderOperationsClient

public virtual OperationsClient CreateFolderOperationsClient { get; }

The long-running operations client for CreateFolder.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Folders scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteFolderOperationsClient

public virtual OperationsClient DeleteFolderOperationsClient { get; }

The long-running operations client for DeleteFolder.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Folders.FoldersClient GrpcClient { get; }

The underlying gRPC Folders client

Property Value
TypeDescription
FoldersFoldersClient

MoveFolderOperationsClient

public virtual OperationsClient MoveFolderOperationsClient { get; }

The long-running operations client for MoveFolder.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UndeleteFolderOperationsClient

public virtual OperationsClient UndeleteFolderOperationsClient { get; }

The long-running operations client for UndeleteFolder.

Property Value
TypeDescription
OperationsClient

UpdateFolderOperationsClient

public virtual OperationsClient UpdateFolderOperationsClient { get; }

The long-running operations client for UpdateFolder.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static FoldersClient Create()

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

Returns
TypeDescription
FoldersClient

The created FoldersClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskFoldersClient

The task representing the created FoldersClient.

CreateFolder(CreateFolderRequest, CallSettings)

public virtual Operation<Folder, CreateFolderMetadata> CreateFolder(CreateFolderRequest request, CallSettings callSettings = null)

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

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
OperationFolderCreateFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    Folder = new Folder(),
};
// Make the request
Operation<Folder, CreateFolderMetadata> response = foldersClient.CreateFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = foldersClient.PollOnceCreateFolder(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;
}

CreateFolder(Folder, CallSettings)

public virtual Operation<Folder, CreateFolderMetadata> CreateFolder(Folder folder, CallSettings callSettings = null)

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

Parameters
NameDescription
folderFolder

Required. The folder being created, only the display name and parent will be consulted. All other fields will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderCreateFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
Folder folder = new Folder();
// Make the request
Operation<Folder, CreateFolderMetadata> response = foldersClient.CreateFolder(folder);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = foldersClient.PollOnceCreateFolder(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;
}

CreateFolderAsync(CreateFolderRequest, CallSettings)

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

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

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
TaskOperationFolderCreateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    Folder = new Folder(),
};
// Make the request
Operation<Folder, CreateFolderMetadata> response = await foldersClient.CreateFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = await foldersClient.PollOnceCreateFolderAsync(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;
}

CreateFolderAsync(CreateFolderRequest, CancellationToken)

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

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

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
TaskOperationFolderCreateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
CreateFolderRequest request = new CreateFolderRequest
{
    Folder = new Folder(),
};
// Make the request
Operation<Folder, CreateFolderMetadata> response = await foldersClient.CreateFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = await foldersClient.PollOnceCreateFolderAsync(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;
}

CreateFolderAsync(Folder, CallSettings)

public virtual Task<Operation<Folder, CreateFolderMetadata>> CreateFolderAsync(Folder folder, CallSettings callSettings = null)

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

Parameters
NameDescription
folderFolder

Required. The folder being created, only the display name and parent will be consulted. All other fields will be ignored.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderCreateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
Folder folder = new Folder();
// Make the request
Operation<Folder, CreateFolderMetadata> response = await foldersClient.CreateFolderAsync(folder);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = await foldersClient.PollOnceCreateFolderAsync(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;
}

CreateFolderAsync(Folder, CancellationToken)

public virtual Task<Operation<Folder, CreateFolderMetadata>> CreateFolderAsync(Folder folder, CancellationToken cancellationToken)

Creates a folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success, the Operation.response field will be populated with the created Folder.

In order to succeed, the addition of this new folder must not violate the folder naming, height, or fanout constraints.

  • The folder's display_name must be distinct from all other folders that share its parent.
  • The addition of the folder must not cause the active folder hierarchy to exceed a height of 10. Note, the full active + deleted folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders.
  • The addition of the folder must not cause the total number of folders under its parent to exceed 300.

If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned in the details list in the Operation.error field.

The caller must have resourcemanager.folders.create permission on the identified parent.

Parameters
NameDescription
folderFolder

Required. The folder being created, only the display name and parent will be consulted. All other fields will be ignored.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderCreateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
Folder folder = new Folder();
// Make the request
Operation<Folder, CreateFolderMetadata> response = await foldersClient.CreateFolderAsync(folder);

// Poll until the returned long-running operation is complete
Operation<Folder, CreateFolderMetadata> 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, CreateFolderMetadata> retrievedResponse = await foldersClient.PollOnceCreateFolderAsync(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;
}

DeleteFolder(FolderName, CallSettings)

public virtual Operation<Folder, DeleteFolderMetadata> DeleteFolder(FolderName name, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderDeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, DeleteFolderMetadata> response = foldersClient.DeleteFolder(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceDeleteFolder(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;
}

DeleteFolder(DeleteFolderRequest, CallSettings)

public virtual Operation<Folder, DeleteFolderMetadata> DeleteFolder(DeleteFolderRequest request, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified 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
OperationFolderDeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, DeleteFolderMetadata> response = foldersClient.DeleteFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceDeleteFolder(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;
}

DeleteFolder(string, CallSettings)

public virtual Operation<Folder, DeleteFolderMetadata> DeleteFolder(string name, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderDeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, DeleteFolderMetadata> response = foldersClient.DeleteFolder(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceDeleteFolder(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;
}

DeleteFolderAsync(FolderName, CallSettings)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(FolderName name, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

DeleteFolderAsync(FolderName, CancellationToken)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(FolderName name, CancellationToken cancellationToken)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

DeleteFolderAsync(DeleteFolderRequest, CallSettings)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(DeleteFolderRequest request, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified 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
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

DeleteFolderAsync(DeleteFolderRequest, CancellationToken)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(DeleteFolderRequest request, CancellationToken cancellationToken)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified 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
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
DeleteFolderRequest request = new DeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

DeleteFolderAsync(string, CallSettings)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(string name, CallSettings callSettings = null)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

DeleteFolderAsync(string, CancellationToken)

public virtual Task<Operation<Folder, DeleteFolderMetadata>> DeleteFolderAsync(string name, CancellationToken cancellationToken)

Requests deletion of a folder. The folder is moved into the [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state immediately, and is deleted approximately 30 days later. This method may only be called on an empty folder, where a folder is empty if it doesn't contain any folders or projects in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. If called on a folder in [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] state the operation will result in a no-op success. The caller must have resourcemanager.folders.delete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to be deleted. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderDeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, DeleteFolderMetadata> response = await foldersClient.DeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, DeleteFolderMetadata> 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, DeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceDeleteFolderAsync(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;
}

GetFolder(FolderName, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Folder response = foldersClient.GetFolder(name);

GetFolder(GetFolderRequest, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified 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
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Folder response = foldersClient.GetFolder(request);

GetFolder(string, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Folder

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Folder response = foldersClient.GetFolder(name);

GetFolderAsync(FolderName, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Folder response = await foldersClient.GetFolderAsync(name);

GetFolderAsync(FolderName, CancellationToken)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Folder response = await foldersClient.GetFolderAsync(name);

GetFolderAsync(GetFolderRequest, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified 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
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Folder response = await foldersClient.GetFolderAsync(request);

GetFolderAsync(GetFolderRequest, CancellationToken)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified 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
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
GetFolderRequest request = new GetFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Folder response = await foldersClient.GetFolderAsync(request);

GetFolderAsync(string, CallSettings)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Folder response = await foldersClient.GetFolderAsync(name);

GetFolderAsync(string, CancellationToken)

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

Retrieves a folder identified by the supplied resource name. Valid folder resource names have the format folders/{folder_id} (for example, folders/1234). The caller must have resourcemanager.folders.get permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to retrieve. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskFolder

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Folder response = await foldersClient.GetFolderAsync(name);

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = foldersClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = foldersClient.GetIamPolicy(request);

GetIamPolicy(string, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = foldersClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
requestGetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Gets the access control policy for a folder. The returned policy may be empty if no such policy or resource exists. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.getIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await foldersClient.GetIamPolicyAsync(resource);

ListFolders(IResourceName, string, int?, CallSettings)

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

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

Parameters
NameDescription
parentIResourceName

Required. The name of the parent resource whose folders are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.

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
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = foldersClient.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)

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

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
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
ListFoldersRequest request = new ListFoldersRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ShowDeleted = false,
};
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = foldersClient.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)

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

Parameters
NameDescription
parentstring

Required. The name of the parent resource whose folders are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.

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
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedEnumerable<ListFoldersResponse, Folder> response = foldersClient.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(IResourceName, string, int?, CallSettings)

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

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

Parameters
NameDescription
parentIResourceName

Required. The name of the parent resource whose folders are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.

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
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = foldersClient.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)

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

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
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
ListFoldersRequest request = new ListFoldersRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ShowDeleted = false,
};
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = foldersClient.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)

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

Parameters
NameDescription
parentstring

Required. The name of the parent resource whose folders are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.

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
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedAsyncEnumerable<ListFoldersResponse, Folder> response = foldersClient.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;

MoveFolder(FolderName, IResourceName, CallSettings)

public virtual Operation<Folder, MoveFolderMetadata> MoveFolder(FolderName name, IResourceName destinationParent, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
nameFolderName

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentIResourceName

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderMoveFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Folder, MoveFolderMetadata> response = foldersClient.MoveFolder(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = foldersClient.PollOnceMoveFolder(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;
}

MoveFolder(MoveFolderRequest, CallSettings)

public virtual Operation<Folder, MoveFolderMetadata> MoveFolder(MoveFolderRequest request, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
requestMoveFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderMoveFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
MoveFolderRequest request = new MoveFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Folder, MoveFolderMetadata> response = foldersClient.MoveFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = foldersClient.PollOnceMoveFolder(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;
}

MoveFolder(string, string, CallSettings)

public virtual Operation<Folder, MoveFolderMetadata> MoveFolder(string name, string destinationParent, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
namestring

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentstring

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderMoveFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Folder, MoveFolderMetadata> response = foldersClient.MoveFolder(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = foldersClient.PollOnceMoveFolder(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;
}

MoveFolderAsync(FolderName, IResourceName, CallSettings)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(FolderName name, IResourceName destinationParent, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
nameFolderName

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentIResourceName

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

MoveFolderAsync(FolderName, IResourceName, CancellationToken)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(FolderName name, IResourceName destinationParent, CancellationToken cancellationToken)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
nameFolderName

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentIResourceName

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

MoveFolderAsync(MoveFolderRequest, CallSettings)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(MoveFolderRequest request, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
requestMoveFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
MoveFolderRequest request = new MoveFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

MoveFolderAsync(MoveFolderRequest, CancellationToken)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(MoveFolderRequest request, CancellationToken cancellationToken)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
requestMoveFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
MoveFolderRequest request = new MoveFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

MoveFolderAsync(string, string, CallSettings)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(string name, string destinationParent, CallSettings callSettings = null)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
namestring

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentstring

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

MoveFolderAsync(string, string, CancellationToken)

public virtual Task<Operation<Folder, MoveFolderMetadata>> MoveFolderAsync(string name, string destinationParent, CancellationToken cancellationToken)

Moves a folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success, the Operation.response field will be populated with the moved folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned in the Status.details field. If it occurs asynchronously, then the FolderOperation will be returned in the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height, or fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.move permission on the folder's current and proposed new parent.

Parameters
NameDescription
namestring

Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}

destinationParentstring

Required. The resource name of the folder or organization which should be the folder's new parent. Must be of the form folders/{folder_id} or organizations/{org_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderMoveFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Folder, MoveFolderMetadata> response = await foldersClient.MoveFolderAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Folder, MoveFolderMetadata> 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, MoveFolderMetadata> retrievedResponse = await foldersClient.PollOnceMoveFolderAsync(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;
}

PollOnceCreateFolder(string, CallSettings)

public virtual Operation<Folder, CreateFolderMetadata> PollOnceCreateFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderCreateFolderMetadata

The result of polling the operation.

PollOnceCreateFolderAsync(string, CallSettings)

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

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

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
TaskOperationFolderCreateFolderMetadata

A task representing the result of polling the operation.

PollOnceDeleteFolder(string, CallSettings)

public virtual Operation<Folder, DeleteFolderMetadata> PollOnceDeleteFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderDeleteFolderMetadata

The result of polling the operation.

PollOnceDeleteFolderAsync(string, CallSettings)

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

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

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
TaskOperationFolderDeleteFolderMetadata

A task representing the result of polling the operation.

PollOnceMoveFolder(string, CallSettings)

public virtual Operation<Folder, MoveFolderMetadata> PollOnceMoveFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderMoveFolderMetadata

The result of polling the operation.

PollOnceMoveFolderAsync(string, CallSettings)

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

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

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
TaskOperationFolderMoveFolderMetadata

A task representing the result of polling the operation.

PollOnceUndeleteFolder(string, CallSettings)

public virtual Operation<Folder, UndeleteFolderMetadata> PollOnceUndeleteFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderUndeleteFolderMetadata

The result of polling the operation.

PollOnceUndeleteFolderAsync(string, CallSettings)

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

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

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
TaskOperationFolderUndeleteFolderMetadata

A task representing the result of polling the operation.

PollOnceUpdateFolder(string, CallSettings)

public virtual Operation<Folder, UpdateFolderMetadata> PollOnceUpdateFolder(string operationName, CallSettings callSettings = null)

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

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
OperationFolderUpdateFolderMetadata

The result of polling the operation.

PollOnceUpdateFolderAsync(string, CallSettings)

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

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

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
TaskOperationFolderUpdateFolderMetadata

A task representing the result of polling the operation.

SearchFolders(SearchFoldersRequest, CallSettings)

public virtual PagedEnumerable<SearchFoldersResponse, Folder> SearchFolders(SearchFoldersRequest request, CallSettings callSettings = null)

Search for folders that match specific filter criteria. search() provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria.

This will only return folders on which the caller has the permission resourcemanager.folders.get.

Parameters
NameDescription
requestSearchFoldersRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchFoldersResponseFolder

A pageable sequence of Folder resources.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
SearchFoldersRequest request = new SearchFoldersRequest { Query = "", };
// Make the request
PagedEnumerable<SearchFoldersResponse, Folder> response = foldersClient.SearchFolders(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 (SearchFoldersResponse 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;

SearchFolders(string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchFoldersResponse, Folder> SearchFolders(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Search for folders that match specific filter criteria. search() provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria.

This will only return folders on which the caller has the permission resourcemanager.folders.get.

Parameters
NameDescription
querystring

Optional. Search criteria used to select the folders to return. If no search criteria is specified then all accessible folders will be returned.

Query expressions can be used to restrict results based upon displayName, state and parent, where the operators = (:) NOT, AND and OR can be used along with the suffix wildcard symbol *.

The displayName field in a query expression should use escaped quotes for values that include whitespace to prevent unexpected behavior.

| Field                   | Description                            |
|-------------------------|----------------------------------------|
| displayName             | Filters by displayName.                |
| parent                  | Filters by parent (for example: folders/123). |
| state, lifecycleState   | Filters by state.                      |

Some example queries are:

  • Query displayName=Test* returns Folder resources whose display name starts with "Test".
  • Query state=ACTIVE returns Folder resources with state set to ACTIVE.
  • Query parent=folders/123 returns Folder resources that have folders/123 as a parent resource.
  • Query parent=folders/123 AND state=ACTIVE returns active Folder resources that have folders/123 as a parent resource.
  • Query displayName=\\"Test String\\" returns Folder resources with display names that include both "Test" and "String".
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
PagedEnumerableSearchFoldersResponseFolder

A pageable sequence of Folder resources.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string query = "";
// Make the request
PagedEnumerable<SearchFoldersResponse, Folder> response = foldersClient.SearchFolders(query);

// 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 (SearchFoldersResponse 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;

SearchFoldersAsync(SearchFoldersRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchFoldersResponse, Folder> SearchFoldersAsync(SearchFoldersRequest request, CallSettings callSettings = null)

Search for folders that match specific filter criteria. search() provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria.

This will only return folders on which the caller has the permission resourcemanager.folders.get.

Parameters
NameDescription
requestSearchFoldersRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchFoldersResponseFolder

A pageable asynchronous sequence of Folder resources.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
SearchFoldersRequest request = new SearchFoldersRequest { Query = "", };
// Make the request
PagedAsyncEnumerable<SearchFoldersResponse, Folder> response = foldersClient.SearchFoldersAsync(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((SearchFoldersResponse 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;

SearchFoldersAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchFoldersResponse, Folder> SearchFoldersAsync(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Search for folders that match specific filter criteria. search() provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria.

This will only return folders on which the caller has the permission resourcemanager.folders.get.

Parameters
NameDescription
querystring

Optional. Search criteria used to select the folders to return. If no search criteria is specified then all accessible folders will be returned.

Query expressions can be used to restrict results based upon displayName, state and parent, where the operators = (:) NOT, AND and OR can be used along with the suffix wildcard symbol *.

The displayName field in a query expression should use escaped quotes for values that include whitespace to prevent unexpected behavior.

| Field                   | Description                            |
|-------------------------|----------------------------------------|
| displayName             | Filters by displayName.                |
| parent                  | Filters by parent (for example: folders/123). |
| state, lifecycleState   | Filters by state.                      |

Some example queries are:

  • Query displayName=Test* returns Folder resources whose display name starts with "Test".
  • Query state=ACTIVE returns Folder resources with state set to ACTIVE.
  • Query parent=folders/123 returns Folder resources that have folders/123 as a parent resource.
  • Query parent=folders/123 AND state=ACTIVE returns active Folder resources that have folders/123 as a parent resource.
  • Query displayName=\\"Test String\\" returns Folder resources with display names that include both "Test" and "String".
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
PagedAsyncEnumerableSearchFoldersResponseFolder

A pageable asynchronous sequence of Folder resources.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string query = "";
// Make the request
PagedAsyncEnumerable<SearchFoldersResponse, Folder> response = foldersClient.SearchFoldersAsync(query);

// 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((SearchFoldersResponse 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;

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = foldersClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = foldersClient.SetIamPolicy(request);

SetIamPolicy(string, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = foldersClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
requestSetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(string, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

Sets the access control policy on a folder, replacing any existing policy. The resource field should be the folder's resource name, for example: "folders/1234". The caller must have resourcemanager.folders.setIamPolicy permission on the identified folder.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await foldersClient.SetIamPolicyAsync(resource, policy);

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.

TestIamPermissions(IResourceName, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = foldersClient.TestIamPermissions(resource, permissions);

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = foldersClient.TestIamPermissions(request);

TestIamPermissions(string, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = foldersClient.TestIamPermissions(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(string, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified folder. The resource field should be the folder's resource name, for example: "folders/1234".

There are no permissions required for making this API call.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await foldersClient.TestIamPermissionsAsync(resource, permissions);

UndeleteFolder(FolderName, CallSettings)

public virtual Operation<Folder, UndeleteFolderMetadata> UndeleteFolder(FolderName name, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderUndeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = foldersClient.UndeleteFolder(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceUndeleteFolder(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;
}

UndeleteFolder(UndeleteFolderRequest, CallSettings)

public virtual Operation<Folder, UndeleteFolderMetadata> UndeleteFolder(UndeleteFolderRequest request, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
requestUndeleteFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderUndeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
UndeleteFolderRequest request = new UndeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = foldersClient.UndeleteFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceUndeleteFolder(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;
}

UndeleteFolder(string, CallSettings)

public virtual Operation<Folder, UndeleteFolderMetadata> UndeleteFolder(string name, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderUndeleteFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = foldersClient.UndeleteFolder(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = foldersClient.PollOnceUndeleteFolder(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;
}

UndeleteFolderAsync(FolderName, CallSettings)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(FolderName name, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UndeleteFolderAsync(FolderName, CancellationToken)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(FolderName name, CancellationToken cancellationToken)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
nameFolderName

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UndeleteFolderAsync(UndeleteFolderRequest, CallSettings)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(UndeleteFolderRequest request, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
requestUndeleteFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
UndeleteFolderRequest request = new UndeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UndeleteFolderAsync(UndeleteFolderRequest, CancellationToken)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(UndeleteFolderRequest request, CancellationToken cancellationToken)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
requestUndeleteFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
UndeleteFolderRequest request = new UndeleteFolderRequest
{
    FolderName = FolderName.FromFolder("[FOLDER]"),
};
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UndeleteFolderAsync(string, CallSettings)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(string name, CallSettings callSettings = null)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UndeleteFolderAsync(string, CancellationToken)

public virtual Task<Operation<Folder, UndeleteFolderMetadata>> UndeleteFolderAsync(string name, CancellationToken cancellationToken)

Cancels the deletion request for a folder. This method may be called on a folder in any state. If the folder is in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state the result will be a no-op success. In order to succeed, the folder's parent must be in the [ACTIVE][google.cloud.resourcemanager.v3.Folder.State.ACTIVE] state. In addition, reintroducing the folder into the tree must not violate folder naming, height, and fanout constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation. The caller must have resourcemanager.folders.undelete permission on the identified folder.

Parameters
NameDescription
namestring

Required. The resource name of the folder to undelete. Must be of the form folders/{folder_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderUndeleteFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
string name = "folders/[FOLDER]";
// Make the request
Operation<Folder, UndeleteFolderMetadata> response = await foldersClient.UndeleteFolderAsync(name);

// Poll until the returned long-running operation is complete
Operation<Folder, UndeleteFolderMetadata> 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, UndeleteFolderMetadata> retrievedResponse = await foldersClient.PollOnceUndeleteFolderAsync(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;
}

UpdateFolder(Folder, FieldMask, CallSettings)

public virtual Operation<Folder, UpdateFolderMetadata> UpdateFolder(Folder folder, FieldMask updateMask, CallSettings callSettings = null)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
folderFolder

Required. The new definition of the Folder. It must include the name field, which cannot be changed.

updateMaskFieldMask

Required. Fields to be updated. Only the display_name can be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderUpdateFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
Folder folder = new Folder();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Folder, UpdateFolderMetadata> response = foldersClient.UpdateFolder(folder, updateMask);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = foldersClient.PollOnceUpdateFolder(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;
}

UpdateFolder(UpdateFolderRequest, CallSettings)

public virtual Operation<Folder, UpdateFolderMetadata> UpdateFolder(UpdateFolderRequest request, CallSettings callSettings = null)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
requestUpdateFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationFolderUpdateFolderMetadata

The RPC response.

Example
// Create client
FoldersClient foldersClient = FoldersClient.Create();
// Initialize request argument(s)
UpdateFolderRequest request = new UpdateFolderRequest
{
    Folder = new Folder(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Folder, UpdateFolderMetadata> response = foldersClient.UpdateFolder(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = foldersClient.PollOnceUpdateFolder(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;
}

UpdateFolderAsync(Folder, FieldMask, CallSettings)

public virtual Task<Operation<Folder, UpdateFolderMetadata>> UpdateFolderAsync(Folder folder, FieldMask updateMask, CallSettings callSettings = null)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
folderFolder

Required. The new definition of the Folder. It must include the name field, which cannot be changed.

updateMaskFieldMask

Required. Fields to be updated. Only the display_name can be updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderUpdateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
Folder folder = new Folder();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Folder, UpdateFolderMetadata> response = await foldersClient.UpdateFolderAsync(folder, updateMask);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = await foldersClient.PollOnceUpdateFolderAsync(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;
}

UpdateFolderAsync(Folder, FieldMask, CancellationToken)

public virtual Task<Operation<Folder, UpdateFolderMetadata>> UpdateFolderAsync(Folder folder, FieldMask updateMask, CancellationToken cancellationToken)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
folderFolder

Required. The new definition of the Folder. It must include the name field, which cannot be changed.

updateMaskFieldMask

Required. Fields to be updated. Only the display_name can be updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderUpdateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
Folder folder = new Folder();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Folder, UpdateFolderMetadata> response = await foldersClient.UpdateFolderAsync(folder, updateMask);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = await foldersClient.PollOnceUpdateFolderAsync(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;
}

UpdateFolderAsync(UpdateFolderRequest, CallSettings)

public virtual Task<Operation<Folder, UpdateFolderMetadata>> UpdateFolderAsync(UpdateFolderRequest request, CallSettings callSettings = null)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
requestUpdateFolderRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationFolderUpdateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
UpdateFolderRequest request = new UpdateFolderRequest
{
    Folder = new Folder(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Folder, UpdateFolderMetadata> response = await foldersClient.UpdateFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = await foldersClient.PollOnceUpdateFolderAsync(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;
}

UpdateFolderAsync(UpdateFolderRequest, CancellationToken)

public virtual Task<Operation<Folder, UpdateFolderMetadata>> UpdateFolderAsync(UpdateFolderRequest request, CancellationToken cancellationToken)

Updates a folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or the naming constraints described in the [CreateFolder][google.cloud.resourcemanager.v3.Folders.CreateFolder] documentation.

The folder's display_name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: [\p{L}\p{N}][\p{L}\p{N}_- ]{1,28}[\p{L}\p{N}]. The caller must have resourcemanager.folders.update permission on the identified folder.

If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.

Parameters
NameDescription
requestUpdateFolderRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationFolderUpdateFolderMetadata

A Task containing the RPC response.

Example
// Create client
FoldersClient foldersClient = await FoldersClient.CreateAsync();
// Initialize request argument(s)
UpdateFolderRequest request = new UpdateFolderRequest
{
    Folder = new Folder(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Folder, UpdateFolderMetadata> response = await foldersClient.UpdateFolderAsync(request);

// Poll until the returned long-running operation is complete
Operation<Folder, UpdateFolderMetadata> 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, UpdateFolderMetadata> retrievedResponse = await foldersClient.PollOnceUpdateFolderAsync(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;
}