class Google::Iam::V1beta::WorkloadIdentityPools::Client

Client for the WorkloadIdentityPools service.

Manages WorkloadIdentityPools.

Attributes

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Iam::V1beta::WorkloadIdentityPools::Operations]

workload_identity_pools_stub[R]

@private

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the WorkloadIdentityPools Client class.

See {::Google::Iam::V1beta::WorkloadIdentityPools::Client::Configuration} for a description of the configuration fields.

@example

# Modify the configuration for all WorkloadIdentityPools clients
::Google::Iam::V1beta::WorkloadIdentityPools::Client.configure do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 55
def self.configure
  @configure ||= begin
    namespace = ["Google", "Iam", "V1beta"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.list_workload_identity_pools.timeout = 60.0
    default_config.rpcs.list_workload_identity_pools.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_workload_identity_pool.timeout = 60.0
    default_config.rpcs.get_workload_identity_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.create_workload_identity_pool.timeout = 60.0
    default_config.rpcs.create_workload_identity_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.update_workload_identity_pool.timeout = 60.0
    default_config.rpcs.update_workload_identity_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_workload_identity_pool.timeout = 60.0
    default_config.rpcs.delete_workload_identity_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.undelete_workload_identity_pool.timeout = 60.0
    default_config.rpcs.undelete_workload_identity_pool.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_workload_identity_pool_providers.timeout = 60.0
    default_config.rpcs.list_workload_identity_pool_providers.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_workload_identity_pool_provider.timeout = 60.0
    default_config.rpcs.get_workload_identity_pool_provider.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.create_workload_identity_pool_provider.timeout = 60.0
    default_config.rpcs.create_workload_identity_pool_provider.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.update_workload_identity_pool_provider.timeout = 60.0
    default_config.rpcs.update_workload_identity_pool_provider.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_workload_identity_pool_provider.timeout = 60.0
    default_config.rpcs.delete_workload_identity_pool_provider.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.undelete_workload_identity_pool_provider.timeout = 60.0
    default_config.rpcs.undelete_workload_identity_pool_provider.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new WorkloadIdentityPools client object.

@example

# Create a client using the default configuration
client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new

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

@yield [config] Configure the WorkloadIdentityPools client. @yieldparam config [Client::Configuration]

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 168
def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/iam/v1beta/workload_identity_pool_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.endpoint = @config.endpoint
  end

  @workload_identity_pools_stub = ::Gapic::ServiceStub.new(
    ::Google::Iam::V1beta::WorkloadIdentityPools::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

configure() { |config| ... } click to toggle source

Configure the WorkloadIdentityPools 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 {::Google::Iam::V1beta::WorkloadIdentityPools::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 147
def configure
  yield @config if block_given?
  @config
end
create_workload_identity_pool(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}.

You cannot reuse the name of a deleted pool until 30 days after deletion.

@overload create_workload_identity_pool(request, options = nil)

Pass arguments to `create_workload_identity_pool` via a request object, either of type
{::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_workload_identity_pool(parent: nil, workload_identity_pool: nil, workload_identity_pool_id: nil)

Pass arguments to `create_workload_identity_pool` 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).

@param parent [::String]
  Required. The parent resource to create the pool in. The only supported
  location is `global`.
@param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash]
  Required. The pool to create.
@param workload_identity_pool_id [::String]
  Required. The ID to use for the pool, which becomes the
  final component of the resource name. This value should be 4-32 characters,
  and may contain the characters [a-z0-9-]. The prefix `gcp-` is
  reserved for use by Google, and may not be specified.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 408
def create_workload_identity_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_workload_identity_pool.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_workload_identity_pool.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_workload_identity_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :create_workload_identity_pool, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_workload_identity_pool_provider(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new

WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider

in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}.

You cannot reuse the name of a deleted provider until 30 days after deletion.

@overload create_workload_identity_pool_provider(request, options = nil)

Pass arguments to `create_workload_identity_pool_provider` via a request object, either of type
{::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_workload_identity_pool_provider(parent: nil, workload_identity_pool_provider: nil, workload_identity_pool_provider_id: nil)

Pass arguments to `create_workload_identity_pool_provider` 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).

@param parent [::String]
  Required. The pool to create this provider in.
@param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash]
  Required. The provider to create.
@param workload_identity_pool_provider_id [::String]
  Required. The ID for the provider, which becomes the
  final component of the resource name. This value must be 4-32 characters,
  and may contain the characters [a-z0-9-]. The prefix `gcp-` is
  reserved for use by Google, and may not be specified.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 862
def create_workload_identity_pool_provider request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_workload_identity_pool_provider.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_workload_identity_pool_provider.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_workload_identity_pool_provider.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :create_workload_identity_pool_provider, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_workload_identity_pool(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}.

You cannot use a deleted pool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.

@overload delete_workload_identity_pool(request, options = nil)

Pass arguments to `delete_workload_identity_pool` via a request object, either of type
{::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_workload_identity_pool(name: nil)

Pass arguments to `delete_workload_identity_pool` 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).

@param name [::String]
  Required. The name of the pool to delete.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 560
def delete_workload_identity_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_workload_identity_pool.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_workload_identity_pool.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_workload_identity_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_workload_identity_pool_provider(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a [WorkloadIdentityPoolProvider]. Deleting a provider does not revoke credentials that have already been issued; they continue to grant access. You can undelete a provider for 30 days. After 30 days, deletion is permanent. You cannot update deleted providers. However, you can view and list them.

@overload delete_workload_identity_pool_provider(request, options = nil)

Pass arguments to `delete_workload_identity_pool_provider` via a request object, either of type
{::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_workload_identity_pool_provider(name: nil)

Pass arguments to `delete_workload_identity_pool_provider` 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).

@param name [::String]
  Required. The name of the provider to delete.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 1009
def delete_workload_identity_pool_provider request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_workload_identity_pool_provider.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_workload_identity_pool_provider.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_workload_identity_pool_provider.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool_provider, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_workload_identity_pool(request, options = nil) { |response, operation| ... } click to toggle source

Gets an individual {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}.

@overload get_workload_identity_pool(request, options = nil)

Pass arguments to `get_workload_identity_pool` via a request object, either of type
{::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_workload_identity_pool(name: nil)

Pass arguments to `get_workload_identity_pool` 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).

@param name [::String]
  Required. The name of the pool to retrieve.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPool] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1beta::WorkloadIdentityPool]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 329
def get_workload_identity_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_workload_identity_pool.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_workload_identity_pool.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_workload_identity_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :get_workload_identity_pool, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_workload_identity_pool_provider(request, options = nil) { |response, operation| ... } click to toggle source

Gets an individual {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}.

@overload get_workload_identity_pool_provider(request, options = nil)

Pass arguments to `get_workload_identity_pool_provider` via a request object, either of type
{::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_workload_identity_pool_provider(name: nil)

Pass arguments to `get_workload_identity_pool_provider` 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).

@param name [::String]
  Required. The name of the provider to retrieve.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 782
def get_workload_identity_pool_provider request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_workload_identity_pool_provider.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_workload_identity_pool_provider.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_workload_identity_pool_provider.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :get_workload_identity_pool_provider, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_workload_identity_pool_providers(request, options = nil) { |response, operation| ... } click to toggle source

Lists all non-deleted {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}s in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. If `show_deleted` is set to `true`, then deleted providers are also listed.

@overload list_workload_identity_pool_providers(request, options = nil)

Pass arguments to `list_workload_identity_pool_providers` via a request object, either of type
{::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_workload_identity_pool_providers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)

Pass arguments to `list_workload_identity_pool_providers` 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).

@param parent [::String]
  Required. The pool to list providers for.
@param page_size [::Integer]
  The maximum number of providers to return.
  If unspecified, at most 50 providers are returned.
  The maximum value is 100; values above 100 are truncated to 100.
@param page_token [::String]
  A page token, received from a previous
  `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the
  subsequent page.
@param show_deleted [::Boolean]
  Whether to return soft-deleted providers.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 712
def list_workload_identity_pool_providers request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_workload_identity_pool_providers.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_workload_identity_pool_providers.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_workload_identity_pool_providers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :list_workload_identity_pool_providers, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pool_providers, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_workload_identity_pools(request, options = nil) { |response, operation| ... } click to toggle source

Lists all non-deleted {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}s in a project. If `show_deleted` is set to `true`, then deleted pools are also listed.

@overload list_workload_identity_pools(request, options = nil)

Pass arguments to `list_workload_identity_pools` via a request object, either of type
{::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_workload_identity_pools(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)

Pass arguments to `list_workload_identity_pools` 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).

@param parent [::String]
  Required. The parent resource to list pools for.
@param page_size [::Integer]
  The maximum number of pools to return.
  If unspecified, at most 50 pools are returned.
  The maximum value is 1000; values above are 1000 truncated to 1000.
@param page_token [::String]
  A page token, received from a previous `ListWorkloadIdentityPools`
  call. Provide this to retrieve the subsequent page.
@param show_deleted [::Boolean]
  Whether to return soft-deleted pools.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 259
def list_workload_identity_pools request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_workload_identity_pools.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_workload_identity_pools.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_workload_identity_pools.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :list_workload_identity_pools, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pools, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
undelete_workload_identity_pool(request, options = nil) { |response, operation| ... } click to toggle source

Undeletes a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}, as long as it was deleted fewer than 30 days ago.

@overload undelete_workload_identity_pool(request, options = nil)

Pass arguments to `undelete_workload_identity_pool` via a request object, either of type
{::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload undelete_workload_identity_pool(name: nil)

Pass arguments to `undelete_workload_identity_pool` 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).

@param name [::String]
  Required. The name of the pool to undelete.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 630
def undelete_workload_identity_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.undelete_workload_identity_pool.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.undelete_workload_identity_pool.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.undelete_workload_identity_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
undelete_workload_identity_pool_provider(request, options = nil) { |response, operation| ... } click to toggle source

Undeletes a [WorkloadIdentityPoolProvider], as long as it was deleted fewer than 30 days ago.

@overload undelete_workload_identity_pool_provider(request, options = nil)

Pass arguments to `undelete_workload_identity_pool_provider` via a request object, either of type
{::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload undelete_workload_identity_pool_provider(name: nil)

Pass arguments to `undelete_workload_identity_pool_provider` 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).

@param name [::String]
  Required. The name of the provider to undelete.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 1080
def undelete_workload_identity_pool_provider request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.undelete_workload_identity_pool_provider.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.undelete_workload_identity_pool_provider.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.undelete_workload_identity_pool_provider.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool_provider, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_workload_identity_pool(request, options = nil) { |response, operation| ... } click to toggle source

Updates an existing {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}.

@overload update_workload_identity_pool(request, options = nil)

Pass arguments to `update_workload_identity_pool` via a request object, either of type
{::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_workload_identity_pool(workload_identity_pool: nil, update_mask: nil)

Pass arguments to `update_workload_identity_pool` 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).

@param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash]
  Required. The pool to update. The `name` field is used to identify the pool.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The list of fields update.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 480
def update_workload_identity_pool request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.update_workload_identity_pool.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "workload_identity_pool.name" => request.workload_identity_pool.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_workload_identity_pool.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_workload_identity_pool.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :update_workload_identity_pool, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_workload_identity_pool_provider(request, options = nil) { |response, operation| ... } click to toggle source

Updates an existing [WorkloadIdentityPoolProvider].

@overload update_workload_identity_pool_provider(request, options = nil)

Pass arguments to `update_workload_identity_pool_provider` via a request object, either of type
{::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest} or an equivalent Hash.

@param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_workload_identity_pool_provider(workload_identity_pool_provider: nil, update_mask: nil)

Pass arguments to `update_workload_identity_pool_provider` 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).

@param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash]
  Required. The provider to update.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The list of fields to update.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/iam/v1beta/workload_identity_pools/client.rb, line 934
def update_workload_identity_pool_provider request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.update_workload_identity_pool_provider.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Iam::V1beta::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "workload_identity_pool_provider.name" => request.workload_identity_pool_provider.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_workload_identity_pool_provider.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_workload_identity_pool_provider.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @workload_identity_pools_stub.call_rpc :update_workload_identity_pool_provider, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end