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

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

Overview

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 client object.

Examples:


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

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

Yields:

  • (config)

    Configure the IdentityAwareProxyOAuthService client.

Yield Parameters:



126
127
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
158
159
160
161
162
163
164
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 126

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/cloud/iap/v1/service_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.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 = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
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::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

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:



96
97
98
99
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 96

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 309

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

  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.call_rpc :create_brand, 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

#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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 489

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

  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.call_rpc :create_identity_aware_proxy_client, 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

#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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 861

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

  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.call_rpc :delete_identity_aware_proxy_client, 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_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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 396

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

  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.call_rpc :get_brand, 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_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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 682

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

  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.call_rpc :get_identity_aware_proxy_client, 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_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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 213

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

  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.call_rpc :list_brands, 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_identity_aware_proxy_clients(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient> #list_identity_aware_proxy_clients(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::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::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::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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 592

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

  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.call_rpc :list_identity_aware_proxy_clients, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @identity_aware_proxy_o_auth_service_stub, :list_identity_aware_proxy_clients, 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

#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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 771

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

  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.call_rpc :reset_identity_aware_proxy_client_secret, 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

#universe_domainString

The effective universe domain

Returns:

  • (String)


106
107
108
# File 'lib/google/cloud/iap/v1/identity_aware_proxy_o_auth_service/client.rb', line 106

def universe_domain
  @identity_aware_proxy_o_auth_service_stub.universe_domain
end