Policy Troubleshooter V3 API - Class Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client (v0.1.0)

Reference documentation and code samples for the Policy Troubleshooter V3 API class Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.

Client for the PolicyTroubleshooter service.

IAM Policy Troubleshooter service.

This service helps you troubleshoot access issues for Google Cloud resources.

Inherits

  • Object

Methods

.configure

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

Configure the PolicyTroubleshooter Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all PolicyTroubleshooter clients
::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the PolicyTroubleshooter 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

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

Create a new PolicyTroubleshooter client object.

Yields
  • (config) — Configure the PolicyTroubleshooter client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client.new do |config|
  config.timeout = 10.0
end

#troubleshoot_iam_policy

def troubleshoot_iam_policy(request, options = nil) -> ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse
def troubleshoot_iam_policy(access_tuple: nil) -> ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse

Checks whether a principal has a specific permission for a specific resource, and explains why the principal does or doesn't have that permission.

Overloads
def troubleshoot_iam_policy(request, options = nil) -> ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse
Pass arguments to troubleshoot_iam_policy via a request object, either of type TroubleshootIamPolicyRequest or an equivalent Hash.
Parameters
def troubleshoot_iam_policy(access_tuple: nil) -> ::Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse
Pass arguments to troubleshoot_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).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/policy_troubleshooter/iam/v3"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyRequest.new

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

# The returned object is of type Google::Cloud::PolicyTroubleshooter::Iam::V3::TroubleshootIamPolicyResponse.
p result