Class: Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb

Overview

REST client for the IdentityAwareProxyOAuthService service.

API to programmatically create, list and retrieve Identity Aware Proxy (IAP) OAuth brands; and create, retrieve, delete and reset-secret of IAP OAuth clients.

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new IdentityAwareProxyOAuthService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the IdentityAwareProxyOAuthService client.

Yield Parameters:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 128

def initialize
  # 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.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_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

  @identity_aware_proxy_o_auth_service_stub = ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the IdentityAwareProxyOAuthService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all IdentityAwareProxyOAuthService clients
::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Iap", "V1"]
    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.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the IdentityAwareProxyOAuthService 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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



98
99
100
101
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 98

def configure
  yield @config if block_given?
  @config
end

#create_brand(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::Brand #create_brand(parent: nil, brand: nil) ⇒ ::Google::Cloud::Iap::V1::Brand

Constructs a new OAuth brand for the project if one does not exist. The created brand is "internal only", meaning that OAuth clients created under it only accept requests from users who belong to the same Google Workspace organization as the project. The brand is created in an un-reviewed status. NOTE: The "internal only" status can be manually changed in the Google Cloud Console. Requires that a brand does not already exist for the project, and that the specified support email is owned by the caller.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::CreateBrandRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::Brand.
p result

Overloads:

  • #create_brand(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::Brand

    Pass arguments to create_brand via a request object, either of type CreateBrandRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::CreateBrandRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_brand(parent: nil, brand: nil) ⇒ ::Google::Cloud::Iap::V1::Brand

    Pass arguments to create_brand 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) (defaults to: nil)

      Required. GCP Project number/id under which the brand is to be created. In the following format: projects/{project_number/id}.

    • brand (::Google::Cloud::Iap::V1::Brand, ::Hash) (defaults to: nil)

      Required. The brand to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 294

def create_brand request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::CreateBrandRequest

  # 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
   = @config.rpcs.create_brand..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.create_brand request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient #create_identity_aware_proxy_client(parent: nil, identity_aware_proxy_client: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned by IAP. Requires that the brand for the project exists and that it is set for internal-only use.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::CreateIdentityAwareProxyClientRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient.
p result

Overloads:

  • #create_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to create_identity_aware_proxy_client via a request object, either of type CreateIdentityAwareProxyClientRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::CreateIdentityAwareProxyClientRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_identity_aware_proxy_client(parent: nil, identity_aware_proxy_client: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to create_identity_aware_proxy_client 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) (defaults to: nil)

      Required. Path to create the client in. In the following format: projects/{project_number/id}/brands/{brand}. The project must belong to a G Suite account.

    • identity_aware_proxy_client (::Google::Cloud::Iap::V1::IdentityAwareProxyClient, ::Hash) (defaults to: nil)

      Required. Identity Aware Proxy Client to be created.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 460

def create_identity_aware_proxy_client request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::CreateIdentityAwareProxyClientRequest

  # 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
   = @config.rpcs.create_identity_aware_proxy_client..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.create_identity_aware_proxy_client request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_identity_aware_proxy_client(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing obsolete clients, managing the number of clients in a given project, and cleaning up after tests. Requires that the client is owned by IAP.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::DeleteIdentityAwareProxyClientRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_identity_aware_proxy_client via a request object, either of type DeleteIdentityAwareProxyClientRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::DeleteIdentityAwareProxyClientRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_identity_aware_proxy_client(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_identity_aware_proxy_client 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) (defaults to: nil)

      Required. Name of the Identity Aware Proxy client to be deleted. In the following format: projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 804

def delete_identity_aware_proxy_client request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::DeleteIdentityAwareProxyClientRequest

  # 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
   = @config.rpcs.delete_identity_aware_proxy_client..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.delete_identity_aware_proxy_client request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_brand(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::Brand #get_brand(name: nil) ⇒ ::Google::Cloud::Iap::V1::Brand

Retrieves the OAuth brand of the project.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::GetBrandRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::Brand.
p result

Overloads:

  • #get_brand(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::Brand

    Pass arguments to get_brand via a request object, either of type GetBrandRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::GetBrandRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_brand(name: nil) ⇒ ::Google::Cloud::Iap::V1::Brand

    Pass arguments to get_brand 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) (defaults to: nil)

      Required. Name of the brand to be fetched. In the following format: projects/{project_number/id}/brands/{brand}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 374

def get_brand request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::GetBrandRequest

  # 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
   = @config.rpcs.get_brand..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.get_brand request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient #get_identity_aware_proxy_client(name: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

Retrieves an Identity Aware Proxy (IAP) OAuth client. Requires that the client is owned by IAP.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::GetIdentityAwareProxyClientRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient.
p result

Overloads:

  • #get_identity_aware_proxy_client(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to get_identity_aware_proxy_client via a request object, either of type GetIdentityAwareProxyClientRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::GetIdentityAwareProxyClientRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_identity_aware_proxy_client(name: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to get_identity_aware_proxy_client 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) (defaults to: nil)

      Required. Name of the Identity Aware Proxy client to be fetched. In the following format: projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 639

def get_identity_aware_proxy_client request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::GetIdentityAwareProxyClientRequest

  # 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
   = @config.rpcs.get_identity_aware_proxy_client..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.get_identity_aware_proxy_client request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_brands(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse #list_brands(parent: nil) ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse

Lists the existing brands for the project.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::ListBrandsRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::ListBrandsResponse.
p result

Overloads:

  • #list_brands(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse

    Pass arguments to list_brands via a request object, either of type ListBrandsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::ListBrandsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_brands(parent: nil) ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse

    Pass arguments to list_brands 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) (defaults to: nil)

      Required. GCP Project number/id. In the following format: projects/{project_number/id}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 205

def list_brands request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::ListBrandsRequest

  # 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
   = @config.rpcs.list_brands..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.list_brands request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_identity_aware_proxy_clients(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient> #list_identity_aware_proxy_clients(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient>

Lists the existing clients for the brand.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::ListIdentityAwareProxyClientsRequest.new

# Call the list_identity_aware_proxy_clients method.
result = client.list_identity_aware_proxy_clients 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::Iap::V1::IdentityAwareProxyClient.
  p item
end

Overloads:

  • #list_identity_aware_proxy_clients(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient>

    Pass arguments to list_identity_aware_proxy_clients via a request object, either of type ListIdentityAwareProxyClientsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::ListIdentityAwareProxyClientsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_identity_aware_proxy_clients(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient>

    Pass arguments to list_identity_aware_proxy_clients 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) (defaults to: nil)

      Required. Full brand path. In the following format: projects/{project_number/id}/brands/{brand}.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of clients to return. The service may return fewer than this value. If unspecified, at most 100 clients will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      A page token, received from a previous ListIdentityAwareProxyClients call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListIdentityAwareProxyClients must match the call that provided the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 556

def list_identity_aware_proxy_clients request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::ListIdentityAwareProxyClientsRequest

  # 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
   = @config.rpcs.list_identity_aware_proxy_clients..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.list_identity_aware_proxy_clients request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @identity_aware_proxy_o_auth_service_stub, :list_identity_aware_proxy_clients, "identity_aware_proxy_clients", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#reset_identity_aware_proxy_client_secret(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient #reset_identity_aware_proxy_client_secret(name: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the secret was compromised. Requires that the client is owned by IAP.

Examples:

Basic example

require "google/cloud/iap/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Iap::V1::ResetIdentityAwareProxyClientSecretRequest.new

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

# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient.
p result

Overloads:

  • #reset_identity_aware_proxy_client_secret(request, options = nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to reset_identity_aware_proxy_client_secret via a request object, either of type ResetIdentityAwareProxyClientSecretRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Iap::V1::ResetIdentityAwareProxyClientSecretRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #reset_identity_aware_proxy_client_secret(name: nil) ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient

    Pass arguments to reset_identity_aware_proxy_client_secret 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) (defaults to: nil)

      Required. Name of the Identity Aware Proxy client to that will have its secret reset. In the following format: projects/{project_number/id}/brands/{brand}/identityAwareProxyClients/{client_id}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 721

def reset_identity_aware_proxy_client_secret request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Iap::V1::ResetIdentityAwareProxyClientSecretRequest

  # 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
   = @config.rpcs.reset_identity_aware_proxy_client_secret..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Iap::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @identity_aware_proxy_o_auth_service_stub.reset_identity_aware_proxy_client_secret request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


108
109
110
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/rest/client.rb', line 108

def universe_domain
  @identity_aware_proxy_o_auth_service_stub.universe_domain
end