Class: Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Rest::Client
- 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
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the IdentityAwareProxyOAuthService Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the IdentityAwareProxyOAuthService Client instance.
-
#create_brand(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::Brand
Constructs a new OAuth brand for the project if one does not exist.
-
#create_identity_aware_proxy_client(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient
Creates an Identity Aware Proxy (IAP) OAuth client.
-
#delete_identity_aware_proxy_client(request, options = nil) {|result, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an Identity Aware Proxy (IAP) OAuth client.
-
#get_brand(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::Brand
Retrieves the OAuth brand of the project.
-
#get_identity_aware_proxy_client(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient
Retrieves an Identity Aware Proxy (IAP) OAuth client.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new IdentityAwareProxyOAuthService REST client object.
-
#list_brands(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse
Lists the existing brands for the project.
-
#list_identity_aware_proxy_clients(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient>
Lists the existing clients for the brand.
-
#reset_identity_aware_proxy_client_secret(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient
Resets an Identity Aware Proxy (IAP) OAuth client secret.
-
#universe_domain ⇒ String
The effective universe domain.
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new IdentityAwareProxyOAuthService REST client object.
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.
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.
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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.create_brand.timeout, metadata: , retry_policy: @config.rpcs.create_brand.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @identity_aware_proxy_o_auth_service_stub.create_brand request, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.create_identity_aware_proxy_client.timeout, metadata: , retry_policy: @config.rpcs.create_identity_aware_proxy_client.retry_policy .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, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.delete_identity_aware_proxy_client.timeout, metadata: , retry_policy: @config.rpcs.delete_identity_aware_proxy_client.retry_policy .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, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.get_brand.timeout, metadata: , retry_policy: @config.rpcs.get_brand.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @identity_aware_proxy_o_auth_service_stub.get_brand request, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.get_identity_aware_proxy_client.timeout, metadata: , retry_policy: @config.rpcs.get_identity_aware_proxy_client.retry_policy .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, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.list_brands.timeout, metadata: , retry_policy: @config.rpcs.list_brands.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @identity_aware_proxy_o_auth_service_stub.list_brands request, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .apply_defaults timeout: @config.rpcs.list_identity_aware_proxy_clients.timeout, metadata: , retry_policy: @config.rpcs.list_identity_aware_proxy_clients.retry_policy .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, 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, 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.
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, = 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 = ::Gapic::CallOptions.new(**.to_h) if .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 .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 .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, 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_domain ⇒ String
The effective universe domain
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 |