Class: Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client
- 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
-
.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) {|response, 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) {|response, operation| ... } ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient
Creates an Identity Aware Proxy (IAP) OAuth client.
-
#delete_identity_aware_proxy_client(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an Identity Aware Proxy (IAP) OAuth client.
-
#get_brand(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Iap::V1::Brand
Retrieves the OAuth brand of the project.
-
#get_identity_aware_proxy_client(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Iap::V1::IdentityAwareProxyClient
Retrieves an Identity Aware Proxy (IAP) OAuth client.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new IdentityAwareProxyOAuthService client object.
-
#list_brands(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Iap::V1::ListBrandsResponse
Lists the existing brands for the project.
-
#list_identity_aware_proxy_clients(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Iap::V1::IdentityAwareProxyClient>
Lists the existing clients for the brand.
-
#reset_identity_aware_proxy_client_secret(request, options = nil) {|response, 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 client object.
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.
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.
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.
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, = 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 [:"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 .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.call_rpc :create_brand, request, 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.
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, = 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 [:"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 .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.call_rpc :create_identity_aware_proxy_client, request, 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.
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, = 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 [:"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 .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.call_rpc :delete_identity_aware_proxy_client, request, 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.
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, = 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 [:"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 .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.call_rpc :get_brand, request, 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.
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, = 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 [:"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 .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.call_rpc :get_identity_aware_proxy_client, request, 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.
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, = 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 [:"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 .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.call_rpc :list_brands, request, 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.
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, = 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 [:"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 .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.call_rpc :list_identity_aware_proxy_clients, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @identity_aware_proxy_o_auth_service_stub, :list_identity_aware_proxy_clients, request, response, operation, 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.
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, = 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 [:"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 .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.call_rpc :reset_identity_aware_proxy_client_secret, request, 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_domain ⇒ String
The effective universe domain
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 |