Reference documentation and code samples for the Identity and Access Management (IAM) V3BETA API class Google::Iam::V3beta::AccessPolicies::Rest::Client.
REST client for the AccessPolicies service.
Manages Identity and Access Management (IAM) access policies.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the AccessPolicies Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AccessPolicies clients ::Google::Iam::V3beta::AccessPolicies::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the AccessPolicies 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.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_access_policy
def create_access_policy(request, options = nil) -> ::Gapic::Operation
def create_access_policy(parent: nil, access_policy_id: nil, access_policy: nil, validate_only: nil) -> ::Gapic::OperationCreates an access policy, and returns a long running operation.
def create_access_policy(request, options = nil) -> ::Gapic::Operationcreate_access_policy via a request object, either of type
CreateAccessPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::CreateAccessPolicyRequest, ::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_access_policy(parent: nil, access_policy_id: nil, access_policy: nil, validate_only: nil) -> ::Gapic::Operationcreate_access_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).
-
parent (::String) — Required. The parent resource where this access policy will be created.
Format:
projects/{project_id}/locations/{location}projects/{project_number}/locations/{location}folders/{folder_id}/locations/{location}organizations/{organization_id}/locations/{location} -
access_policy_id (::String) — Required. The ID to use for the access policy, which
will become the final component of the access policy's
resource name.
This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /[a-z][a-z0-9-.]{2,62}/.
This value must be unique among all access policies with the same parent.
- access_policy (::Google::Iam::V3beta::AccessPolicy, ::Hash) — Required. The access policy to create.
- validate_only (::Boolean) — Optional. If set, validate the request and preview the creation, but do not actually post it.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::CreateAccessPolicyRequest.new # Call the create_access_policy method. result = client.create_access_policy 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_access_policy
def delete_access_policy(request, options = nil) -> ::Gapic::Operation
def delete_access_policy(name: nil, etag: nil, validate_only: nil, force: nil) -> ::Gapic::OperationDeletes an access policy.
def delete_access_policy(request, options = nil) -> ::Gapic::Operationdelete_access_policy via a request object, either of type
DeleteAccessPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::DeleteAccessPolicyRequest, ::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_access_policy(name: nil, etag: nil, validate_only: nil, force: nil) -> ::Gapic::Operationdelete_access_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).
-
name (::String) — Required. The name of the access policy to delete.
Format:
projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id} - etag (::String) — Optional. The etag of the access policy. If this is provided, it must match the server's etag.
- validate_only (::Boolean) — Optional. If set, validate the request and preview the deletion, but do not actually post it.
- force (::Boolean) — Optional. If set to true, the request will force the deletion of the Policy even if the Policy references PolicyBindings.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::DeleteAccessPolicyRequest.new # Call the delete_access_policy method. result = client.delete_access_policy 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_access_policy
def get_access_policy(request, options = nil) -> ::Google::Iam::V3beta::AccessPolicy
def get_access_policy(name: nil) -> ::Google::Iam::V3beta::AccessPolicyGets an access policy.
def get_access_policy(request, options = nil) -> ::Google::Iam::V3beta::AccessPolicyget_access_policy via a request object, either of type
GetAccessPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::GetAccessPolicyRequest, ::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_access_policy(name: nil) -> ::Google::Iam::V3beta::AccessPolicyget_access_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).
-
name (::String) — Required. The name of the access policy to retrieve.
Format:
projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Iam::V3beta::AccessPolicy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::GetAccessPolicyRequest.new # Call the get_access_policy method. result = client.get_access_policy request # The returned object is of type Google::Iam::V3beta::AccessPolicy. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new AccessPolicies REST client object.
- (config) — Configure the AccessPolicies client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a client using a custom configuration client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| config.timeout = 10.0 end
#list_access_policies
def list_access_policies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>
def list_access_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>Lists access policies.
def list_access_policies(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>list_access_policies via a request object, either of type
ListAccessPoliciesRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::ListAccessPoliciesRequest, ::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_access_policies(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>list_access_policies 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).
-
parent (::String) — Required. The parent resource, which owns the collection of access policy
resources.
Format:
projects/{project_id}/locations/{location}projects/{project_number}/locations/{location}folders/{folder_id}/locations/{location}organizations/{organization_id}/locations/{location} -
page_size (::Integer) — Optional. The maximum number of access policies to return. The
service may return fewer than this value.
If unspecified, at most 50 access policies will be returned. Valid value ranges from 1 to 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
ListAccessPoliciescall. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
ListAccessPoliciesmust match the call that provided the page token.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::ListAccessPoliciesRequest.new # Call the list_access_policies method. result = client.list_access_policies 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::Iam::V3beta::AccessPolicy. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Iam::V3beta::AccessPolicies::Rest::OperationsGet the associated client for long-running operations.
#search_access_policy_bindings
def search_access_policy_bindings(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>
def search_access_policy_bindings(name: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy.
def search_access_policy_bindings(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>search_access_policy_bindings via a request object, either of type
SearchAccessPolicyBindingsRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest, ::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_access_policy_bindings(name: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>search_access_policy_bindings 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).
-
name (::String) — Required. The name of the access policy.
Format:
organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id} -
page_size (::Integer) — Optional. The maximum number of policy bindings to return. The service may
return fewer than this value.
If unspecified, at most 50 policy bindings will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
-
page_token (::String) — Optional. A page token, received from a previous
SearchAccessPolicyBindingsRequestcall. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
SearchAccessPolicyBindingsRequestmust match the call that provided the page token.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new # Call the search_access_policy_bindings method. result = client.search_access_policy_bindings 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::Iam::V3beta::PolicyBinding. p item end
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_access_policy
def update_access_policy(request, options = nil) -> ::Gapic::Operation
def update_access_policy(access_policy: nil, validate_only: nil) -> ::Gapic::OperationUpdates an access policy.
def update_access_policy(request, options = nil) -> ::Gapic::Operationupdate_access_policy via a request object, either of type
UpdateAccessPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V3beta::UpdateAccessPolicyRequest, ::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_access_policy(access_policy: nil, validate_only: nil) -> ::Gapic::Operationupdate_access_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).
-
access_policy (::Google::Iam::V3beta::AccessPolicy, ::Hash) — Required. The access policy to update.
The access policy's
namefield is used to identify the policy to update. - validate_only (::Boolean) — Optional. If set, validate the request and preview the update, but do not actually post it.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/iam/v3beta" # Create a client object. The client can be reused for multiple calls. client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Iam::V3beta::UpdateAccessPolicyRequest.new # Call the update_access_policy method. result = client.update_access_policy 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