# Resource Manager V3 API - Class Google::Cloud::ResourceManager::V3::Folders::Rest::Client (v1.8.0)

1.8.0 (latest) 1.7.1 1.6.0 1.5.1 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.9.0 0.8.2 0.7.0 0.6.2 0.5.1 0.4.0 0.3.0 0.2.0 0.1.3 Reference documentation and code samples for the Resource Manager V3 API class Google::Cloud::ResourceManager::V3::Folders::Rest::Client.

REST client for the Folders service.


<br />

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.

## Inherits

- Object

## Includes

- [Google::Cloud::ResourceManager::V3::Folders::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the Folders Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration "Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all Folders clients
::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the Folders Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client#Google__Cloud__ResourceManager__V3__Folders__Rest__Client_configure_class_ "Google::Cloud::ResourceManager::V3::Folders::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration "Google::Cloud::ResourceManager::V3::Folders::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration))

### #create_folder

    def create_folder(request, options = nil) -> ::Gapic::Operation
    def create_folder(folder: nil) -> ::Gapic::Operation

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.

<br />

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

    def create_folder(request, options = nil) -> ::Gapic::Operation

Pass arguments to `create_folder` via a request object, either of type [CreateFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-CreateFolderRequest "Google::Cloud::ResourceManager::V3::CreateFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::CreateFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-CreateFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_folder(folder: nil) -> ::Gapic::Operation

Pass arguments to `create_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **folder** ([::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder), ::Hash) --- Required. The folder being created, only the display name and parent will be consulted. All other fields will be ignored.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new

# Call the create_folder method.
result = client.create_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #delete_folder

    def delete_folder(request, options = nil) -> ::Gapic::Operation
    def delete_folder(name: nil) -> ::Gapic::Operation

Requests deletion of a folder. The folder is moved into the
[DELETE_REQUESTED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__DELETE_REQUESTED "Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED (constant)")
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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__ACTIVE "Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE (constant)") state. If
called on a folder in
[DELETE_REQUESTED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__DELETE_REQUESTED "Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED (constant)")
state the operation will result in a no-op success.
The caller must have `resourcemanager.folders.delete` permission on the
identified folder.
**Overloads**

    def delete_folder(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_folder` via a request object, either of type [DeleteFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-DeleteFolderRequest "Google::Cloud::ResourceManager::V3::DeleteFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::DeleteFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-DeleteFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_folder(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the folder to be deleted. Must be of the form `folders/{folder_id}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new

# Call the delete_folder method.
result = client.delete_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #get_folder

    def get_folder(request, options = nil) -> ::Google::Cloud::ResourceManager::V3::Folder
    def get_folder(name: nil) -> ::Google::Cloud::ResourceManager::V3::Folder

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.
**Overloads**

    def get_folder(request, options = nil) -> ::Google::Cloud::ResourceManager::V3::Folder

Pass arguments to `get_folder` via a request object, either of type [GetFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-GetFolderRequest "Google::Cloud::ResourceManager::V3::GetFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::GetFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-GetFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_folder(name: nil) -> ::Google::Cloud::ResourceManager::V3::Folder

Pass arguments to `get_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the folder to retrieve. Must be of the form `folders/{folder_id}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new

# Call the get_folder method.
result = client.get_folder request

# The returned object is of type Google::Cloud::ResourceManager::V3::Folder.
p result
```

### #get_iam_policy

    def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
    def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

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.
**Overloads**

    def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy

Pass arguments to `get_iam_policy` via a request object, either of type [Iam::V1::GetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-GetIamPolicyRequest "Google::Iam::V1::GetIamPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::GetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-GetIamPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

Pass arguments to `get_iam_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
- **options** ([::Google::Iam::V1::GetPolicyOptions](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-GetPolicyOptions), ::Hash) --- OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-Policy))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-Policy))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new Folders REST client object.
**Yields**

- (config) --- Configure the Folders client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_folders

    def list_folders(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>
    def list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

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.
**Overloads**

    def list_folders(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

Pass arguments to `list_folders` via a request object, either of type [ListFoldersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-ListFoldersRequest "Google::Cloud::ResourceManager::V3::ListFoldersRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::ListFoldersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-ListFoldersRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_folders(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

Pass arguments to `list_folders` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- 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`.
- **page_size** (::Integer) --- Optional. The maximum number of folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default.
- **page_token** (::String) --- Optional. A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from.
- **show_deleted** (::Boolean) --- Optional. Controls whether folders in the [DELETE_REQUESTED](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__DELETE_REQUESTED "Google::Cloud::ResourceManager::V3::Folder::State::DELETE_REQUESTED (constant)") state should be returned. Defaults to false.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new

# Call the list_folders method.
result = client.list_folders request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #move_folder

    def move_folder(request, options = nil) -> ::Gapic::Operation
    def move_folder(name: nil, destination_parent: nil) -> ::Gapic::Operation

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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client#Google__Cloud__ResourceManager__V3__Folders__Rest__Client_create_folder_instance_ "Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder (method)")
documentation. The caller must have `resourcemanager.folders.move`
permission on the folder's current and proposed new parent.
**Overloads**

    def move_folder(request, options = nil) -> ::Gapic::Operation

Pass arguments to `move_folder` via a request object, either of type [MoveFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-MoveFolderRequest "Google::Cloud::ResourceManager::V3::MoveFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::MoveFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-MoveFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def move_folder(name: nil, destination_parent: nil) -> ::Gapic::Operation

Pass arguments to `move_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}
- **destination_parent** (::String) --- 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}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new

# Call the move_folder method.
result = client.move_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #operations_client

    def operations_client() -> ::Google::Cloud::ResourceManager::V3::Folders::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::ResourceManager::V3::Folders::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Operations))

### #search_folders

    def search_folders(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>
    def search_folders(page_size: nil, page_token: nil, query: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

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.


<br />

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

    def search_folders(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

Pass arguments to `search_folders` via a request object, either of type [SearchFoldersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-SearchFoldersRequest "Google::Cloud::ResourceManager::V3::SearchFoldersRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::SearchFoldersRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-SearchFoldersRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def search_folders(page_size: nil, page_token: nil, query: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ResourceManager::V3::Folder>

Pass arguments to `search_folders` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **page_size** (::Integer) --- Optional. The maximum number of folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default.
- **page_token** (::String) --- Optional. A pagination token returned from a previous call to `SearchFolders` that indicates from where search should continue.
- **query** (::String) ---

  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".
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new

# Call the search_folders method.
result = client.search_folders request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder.
  p item
end
```

### #set_iam_policy

    def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
    def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

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.
**Overloads**

    def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy

Pass arguments to `set_iam_policy` via a request object, either of type [Iam::V1::SetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-SetIamPolicyRequest "Google::Iam::V1::SetIamPolicyRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::SetIamPolicyRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-SetIamPolicyRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

Pass arguments to `set_iam_policy` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
- **policy** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-Policy), ::Hash) --- 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.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Protobuf-FieldMask), ::Hash) --- OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:


  `paths: "bindings, etag"`
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-Policy))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::Policy](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-Policy))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result
```

### #test_iam_permissions

    def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
    def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

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


<br />

There are no permissions required for making this API call.
**Overloads**

    def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

Pass arguments to `test_iam_permissions` via a request object, either of type [Iam::V1::TestIamPermissionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-TestIamPermissionsRequest "Google::Iam::V1::TestIamPermissionsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Iam::V1::TestIamPermissionsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-TestIamPermissionsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

Pass arguments to `test_iam_permissions` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **resource** (::String) --- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
- **permissions** (::Array\<::String\>) --- 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](https://cloud.google.com/iam/docs/overview#permissions).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Iam::V1::TestIamPermissionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-TestIamPermissionsResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Iam::V1::TestIamPermissionsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Iam-V1-TestIamPermissionsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result
```

### #undelete_folder

    def undelete_folder(request, options = nil) -> ::Gapic::Operation
    def undelete_folder(name: nil) -> ::Gapic::Operation

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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__ACTIVE "Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE (constant)") state the
result will be a no-op success. In order to succeed, the folder's parent
must be in the
[ACTIVE](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder-State#Google__Cloud__ResourceManager__V3__Folder__State__ACTIVE "Google::Cloud::ResourceManager::V3::Folder::State::ACTIVE (constant)") state. In
addition, reintroducing the folder into the tree must not violate folder
naming, height, and fanout constraints described in the
[CreateFolder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client#Google__Cloud__ResourceManager__V3__Folders__Rest__Client_create_folder_instance_ "Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder (method)")
documentation. The caller must have `resourcemanager.folders.undelete`
permission on the identified folder.
**Overloads**

    def undelete_folder(request, options = nil) -> ::Gapic::Operation

Pass arguments to `undelete_folder` via a request object, either of type [UndeleteFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-UndeleteFolderRequest "Google::Cloud::ResourceManager::V3::UndeleteFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::UndeleteFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-UndeleteFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def undelete_folder(name: nil) -> ::Gapic::Operation

Pass arguments to `undelete_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the folder to undelete. Must be of the form `folders/{folder_id}`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new

# Call the undelete_folder method.
result = client.undelete_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_folder

    def update_folder(request, options = nil) -> ::Gapic::Operation
    def update_folder(folder: nil, update_mask: nil) -> ::Gapic::Operation

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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folders-Rest-Client#Google__Cloud__ResourceManager__V3__Folders__Rest__Client_create_folder_instance_ "Google::Cloud::ResourceManager::V3::Folders::Rest::Client#create_folder (method)")
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.

<br />

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

    def update_folder(request, options = nil) -> ::Gapic::Operation

Pass arguments to `update_folder` via a request object, either of type [UpdateFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-UpdateFolderRequest "Google::Cloud::ResourceManager::V3::UpdateFolderRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ResourceManager::V3::UpdateFolderRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-UpdateFolderRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_folder(folder: nil, update_mask: nil) -> ::Gapic::Operation

Pass arguments to `update_folder` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **folder** ([::Google::Cloud::ResourceManager::V3::Folder](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Cloud-ResourceManager-V3-Folder), ::Hash) --- Required. The new definition of the Folder. It must include the `name` field, which cannot be changed.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-resource_manager-v3/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. Fields to be updated. Only the `display_name` can be updated.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/resource_manager/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ResourceManager::V3::Folders::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new

# Call the update_folder method.
result = client.update_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```