google-cloud-dialogflow-cx-v3 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +33 -8
  4. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +28 -6
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +35 -7
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +33 -8
  7. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +14 -2
  8. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +32 -8
  9. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +34 -7
  10. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +14 -2
  11. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +32 -8
  12. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +34 -7
  13. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +14 -2
  14. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +32 -8
  15. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +34 -7
  16. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +14 -2
  17. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +33 -8
  18. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +28 -6
  19. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +35 -7
  20. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +33 -8
  21. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +14 -2
  22. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +32 -8
  23. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +34 -7
  24. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +14 -2
  25. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +33 -8
  26. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +28 -6
  27. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +35 -7
  28. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +33 -8
  29. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +14 -2
  30. data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +32 -8
  31. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +34 -7
  32. data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +14 -2
  33. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +33 -8
  34. data/lib/google/cloud/dialogflow/cx/v3/intents/operations.rb +28 -6
  35. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +35 -7
  36. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/operations.rb +33 -8
  37. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +14 -2
  38. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +32 -8
  39. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +34 -7
  40. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +14 -2
  41. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +32 -8
  42. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +34 -7
  43. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +14 -2
  44. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +32 -8
  45. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +34 -7
  46. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +14 -2
  47. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +32 -8
  48. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +34 -7
  49. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +14 -2
  50. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +33 -8
  51. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +28 -6
  52. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +35 -7
  53. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +33 -8
  54. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +14 -2
  55. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +32 -8
  56. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +34 -7
  57. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +14 -2
  58. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  59. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +33 -8
  60. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +28 -6
  61. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +35 -7
  62. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +33 -8
  63. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +14 -2
  64. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +32 -8
  65. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +34 -7
  66. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +14 -2
  67. data/proto_docs/google/api/client.rb +1 -0
  68. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +1 -0
  69. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +2 -0
  70. data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +1 -0
  71. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +2 -0
  72. metadata +6 -6
@@ -34,6 +34,9 @@ module Google
34
34
  # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -99,6 +102,15 @@ module Google
99
102
  @config
100
103
  end
101
104
 
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @pages_stub.universe_domain
112
+ end
113
+
102
114
  ##
103
115
  # Create a new Pages REST client object.
104
116
  #
@@ -126,8 +138,9 @@ module Google
126
138
  credentials = @config.credentials
127
139
  # Use self-signed JWT if the endpoint is unchanged from default,
128
140
  # but only if the default endpoint does not have a region prefix.
129
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
130
- !@config.endpoint.split(".").first.include?("-")
141
+ enable_self_signed_jwt = @config.endpoint.nil? ||
142
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
+ !@config.endpoint.split(".").first.include?("-"))
131
144
  credentials ||= Credentials.default scope: @config.scope,
132
145
  enable_self_signed_jwt: enable_self_signed_jwt
133
146
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -141,10 +154,16 @@ module Google
141
154
  config.credentials = credentials
142
155
  config.quota_project = @quota_project_id
143
156
  config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
144
158
  config.bindings_override = @config.bindings_override
145
159
  end
146
160
 
147
- @pages_stub = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @pages_stub = ::Google::Cloud::Dialogflow::CX::V3::Pages::Rest::ServiceStub.new(
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ credentials: credentials
166
+ )
148
167
  end
149
168
 
150
169
  ##
@@ -708,9 +727,9 @@ module Google
708
727
  # end
709
728
  #
710
729
  # @!attribute [rw] endpoint
711
- # The hostname or hostname:port of the service endpoint.
712
- # Defaults to `"dialogflow.googleapis.com"`.
713
- # @return [::String]
730
+ # A custom service endpoint, as a hostname or hostname:port. The default is
731
+ # nil, indicating to use the default endpoint in the current universe domain.
732
+ # @return [::String,nil]
714
733
  # @!attribute [rw] credentials
715
734
  # Credentials to send with calls. You may provide any of the following types:
716
735
  # * (`String`) The path to a service account key file in JSON format
@@ -747,13 +766,20 @@ module Google
747
766
  # @!attribute [rw] quota_project
748
767
  # A separate project against which to charge quota.
749
768
  # @return [::String]
769
+ # @!attribute [rw] universe_domain
770
+ # The universe domain within which to make requests. This determines the
771
+ # default endpoint URL. The default value of nil uses the environment
772
+ # universe (usually the default "googleapis.com" universe).
773
+ # @return [::String,nil]
750
774
  #
751
775
  class Configuration
752
776
  extend ::Gapic::Config
753
777
 
778
+ # @private
779
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
754
780
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
755
781
 
756
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
782
+ config_attr :endpoint, nil, ::String, nil
757
783
  config_attr :credentials, nil do |value|
758
784
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
759
785
  allowed.any? { |klass| klass === value }
@@ -765,6 +791,7 @@ module Google
765
791
  config_attr :metadata, nil, ::Hash, nil
766
792
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
767
793
  config_attr :quota_project, nil, ::String, nil
794
+ config_attr :universe_domain, nil, ::String, nil
768
795
 
769
796
  # @private
770
797
  # Overrides for http bindings for the RPCs of this service
@@ -31,16 +31,28 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, credentials:
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
35
35
  # These require statements are intentionally placed here to initialize
36
36
  # the REST modules only when it's required.
37
37
  require "gapic/rest"
38
38
 
39
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
40
43
  numeric_enums: true,
41
44
  raise_faraday_errors: false
42
45
  end
43
46
 
47
+ ##
48
+ # The effective universe domain
49
+ #
50
+ # @return [String]
51
+ #
52
+ def universe_domain
53
+ @client_stub.universe_domain
54
+ end
55
+
44
56
  ##
45
57
  # Baseline implementation for the list_pages REST call
46
58
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # Service for managing security settings for Dialogflow.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -97,6 +100,15 @@ module Google
97
100
  @config
98
101
  end
99
102
 
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @security_settings_service_stub.universe_domain
110
+ end
111
+
100
112
  ##
101
113
  # Create a new SecuritySettingsService client object.
102
114
  #
@@ -130,8 +142,9 @@ module Google
130
142
  credentials = @config.credentials
131
143
  # Use self-signed JWT if the endpoint is unchanged from default,
132
144
  # but only if the default endpoint does not have a region prefix.
133
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
134
- !@config.endpoint.split(".").first.include?("-")
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
135
148
  credentials ||= Credentials.default scope: @config.scope,
136
149
  enable_self_signed_jwt: enable_self_signed_jwt
137
150
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -144,12 +157,15 @@ module Google
144
157
  config.credentials = credentials
145
158
  config.quota_project = @quota_project_id
146
159
  config.endpoint = @config.endpoint
160
+ config.universe_domain = @config.universe_domain
147
161
  end
148
162
 
149
163
  @security_settings_service_stub = ::Gapic::ServiceStub.new(
150
164
  ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Stub,
151
- credentials: credentials,
152
- endpoint: @config.endpoint,
165
+ credentials: credentials,
166
+ endpoint: @config.endpoint,
167
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
168
+ universe_domain: @config.universe_domain,
153
169
  channel_args: @config.channel_args,
154
170
  interceptors: @config.interceptors,
155
171
  channel_pool_config: @config.channel_pool
@@ -648,9 +664,9 @@ module Google
648
664
  # end
649
665
  #
650
666
  # @!attribute [rw] endpoint
651
- # The hostname or hostname:port of the service endpoint.
652
- # Defaults to `"dialogflow.googleapis.com"`.
653
- # @return [::String]
667
+ # A custom service endpoint, as a hostname or hostname:port. The default is
668
+ # nil, indicating to use the default endpoint in the current universe domain.
669
+ # @return [::String,nil]
654
670
  # @!attribute [rw] credentials
655
671
  # Credentials to send with calls. You may provide any of the following types:
656
672
  # * (`String`) The path to a service account key file in JSON format
@@ -696,13 +712,20 @@ module Google
696
712
  # @!attribute [rw] quota_project
697
713
  # A separate project against which to charge quota.
698
714
  # @return [::String]
715
+ # @!attribute [rw] universe_domain
716
+ # The universe domain within which to make requests. This determines the
717
+ # default endpoint URL. The default value of nil uses the environment
718
+ # universe (usually the default "googleapis.com" universe).
719
+ # @return [::String,nil]
699
720
  #
700
721
  class Configuration
701
722
  extend ::Gapic::Config
702
723
 
724
+ # @private
725
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
703
726
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
704
727
 
705
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
728
+ config_attr :endpoint, nil, ::String, nil
706
729
  config_attr :credentials, nil do |value|
707
730
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
708
731
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -717,6 +740,7 @@ module Google
717
740
  config_attr :metadata, nil, ::Hash, nil
718
741
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
719
742
  config_attr :quota_project, nil, ::String, nil
743
+ config_attr :universe_domain, nil, ::String, nil
720
744
 
721
745
  # @private
722
746
  def initialize parent_config = nil
@@ -34,6 +34,9 @@ module Google
34
34
  # Service for managing security settings for Dialogflow.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -99,6 +102,15 @@ module Google
99
102
  @config
100
103
  end
101
104
 
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @security_settings_service_stub.universe_domain
112
+ end
113
+
102
114
  ##
103
115
  # Create a new SecuritySettingsService REST client object.
104
116
  #
@@ -126,8 +138,9 @@ module Google
126
138
  credentials = @config.credentials
127
139
  # Use self-signed JWT if the endpoint is unchanged from default,
128
140
  # but only if the default endpoint does not have a region prefix.
129
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
130
- !@config.endpoint.split(".").first.include?("-")
141
+ enable_self_signed_jwt = @config.endpoint.nil? ||
142
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
+ !@config.endpoint.split(".").first.include?("-"))
131
144
  credentials ||= Credentials.default scope: @config.scope,
132
145
  enable_self_signed_jwt: enable_self_signed_jwt
133
146
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -141,10 +154,16 @@ module Google
141
154
  config.credentials = credentials
142
155
  config.quota_project = @quota_project_id
143
156
  config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
144
158
  config.bindings_override = @config.bindings_override
145
159
  end
146
160
 
147
- @security_settings_service_stub = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @security_settings_service_stub = ::Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::ServiceStub.new(
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ credentials: credentials
166
+ )
148
167
  end
149
168
 
150
169
  ##
@@ -604,9 +623,9 @@ module Google
604
623
  # end
605
624
  #
606
625
  # @!attribute [rw] endpoint
607
- # The hostname or hostname:port of the service endpoint.
608
- # Defaults to `"dialogflow.googleapis.com"`.
609
- # @return [::String]
626
+ # A custom service endpoint, as a hostname or hostname:port. The default is
627
+ # nil, indicating to use the default endpoint in the current universe domain.
628
+ # @return [::String,nil]
610
629
  # @!attribute [rw] credentials
611
630
  # Credentials to send with calls. You may provide any of the following types:
612
631
  # * (`String`) The path to a service account key file in JSON format
@@ -643,13 +662,20 @@ module Google
643
662
  # @!attribute [rw] quota_project
644
663
  # A separate project against which to charge quota.
645
664
  # @return [::String]
665
+ # @!attribute [rw] universe_domain
666
+ # The universe domain within which to make requests. This determines the
667
+ # default endpoint URL. The default value of nil uses the environment
668
+ # universe (usually the default "googleapis.com" universe).
669
+ # @return [::String,nil]
646
670
  #
647
671
  class Configuration
648
672
  extend ::Gapic::Config
649
673
 
674
+ # @private
675
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
650
676
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
651
677
 
652
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
678
+ config_attr :endpoint, nil, ::String, nil
653
679
  config_attr :credentials, nil do |value|
654
680
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
655
681
  allowed.any? { |klass| klass === value }
@@ -661,6 +687,7 @@ module Google
661
687
  config_attr :metadata, nil, ::Hash, nil
662
688
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
663
689
  config_attr :quota_project, nil, ::String, nil
690
+ config_attr :universe_domain, nil, ::String, nil
664
691
 
665
692
  # @private
666
693
  # Overrides for http bindings for the RPCs of this service
@@ -31,16 +31,28 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, credentials:
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
35
35
  # These require statements are intentionally placed here to initialize
36
36
  # the REST modules only when it's required.
37
37
  require "gapic/rest"
38
38
 
39
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
40
43
  numeric_enums: true,
41
44
  raise_faraday_errors: false
42
45
  end
43
46
 
47
+ ##
48
+ # The effective universe domain
49
+ #
50
+ # @return [String]
51
+ #
52
+ def universe_domain
53
+ @client_stub.universe_domain
54
+ end
55
+
44
56
  ##
45
57
  # Baseline implementation for the create_security_settings REST call
46
58
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
38
+
36
39
  include Paths
37
40
 
38
41
  # @private
@@ -98,6 +101,15 @@ module Google
98
101
  @config
99
102
  end
100
103
 
104
+ ##
105
+ # The effective universe domain
106
+ #
107
+ # @return [String]
108
+ #
109
+ def universe_domain
110
+ @session_entity_types_stub.universe_domain
111
+ end
112
+
101
113
  ##
102
114
  # Create a new SessionEntityTypes client object.
103
115
  #
@@ -131,8 +143,9 @@ module Google
131
143
  credentials = @config.credentials
132
144
  # Use self-signed JWT if the endpoint is unchanged from default,
133
145
  # but only if the default endpoint does not have a region prefix.
134
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
135
- !@config.endpoint.split(".").first.include?("-")
146
+ enable_self_signed_jwt = @config.endpoint.nil? ||
147
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-"))
136
149
  credentials ||= Credentials.default scope: @config.scope,
137
150
  enable_self_signed_jwt: enable_self_signed_jwt
138
151
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -145,12 +158,15 @@ module Google
145
158
  config.credentials = credentials
146
159
  config.quota_project = @quota_project_id
147
160
  config.endpoint = @config.endpoint
161
+ config.universe_domain = @config.universe_domain
148
162
  end
149
163
 
150
164
  @session_entity_types_stub = ::Gapic::ServiceStub.new(
151
165
  ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Stub,
152
- credentials: credentials,
153
- endpoint: @config.endpoint,
166
+ credentials: credentials,
167
+ endpoint: @config.endpoint,
168
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
169
+ universe_domain: @config.universe_domain,
154
170
  channel_args: @config.channel_args,
155
171
  interceptors: @config.interceptors,
156
172
  channel_pool_config: @config.channel_pool
@@ -663,9 +679,9 @@ module Google
663
679
  # end
664
680
  #
665
681
  # @!attribute [rw] endpoint
666
- # The hostname or hostname:port of the service endpoint.
667
- # Defaults to `"dialogflow.googleapis.com"`.
668
- # @return [::String]
682
+ # A custom service endpoint, as a hostname or hostname:port. The default is
683
+ # nil, indicating to use the default endpoint in the current universe domain.
684
+ # @return [::String,nil]
669
685
  # @!attribute [rw] credentials
670
686
  # Credentials to send with calls. You may provide any of the following types:
671
687
  # * (`String`) The path to a service account key file in JSON format
@@ -711,13 +727,20 @@ module Google
711
727
  # @!attribute [rw] quota_project
712
728
  # A separate project against which to charge quota.
713
729
  # @return [::String]
730
+ # @!attribute [rw] universe_domain
731
+ # The universe domain within which to make requests. This determines the
732
+ # default endpoint URL. The default value of nil uses the environment
733
+ # universe (usually the default "googleapis.com" universe).
734
+ # @return [::String,nil]
714
735
  #
715
736
  class Configuration
716
737
  extend ::Gapic::Config
717
738
 
739
+ # @private
740
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
718
741
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
719
742
 
720
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
743
+ config_attr :endpoint, nil, ::String, nil
721
744
  config_attr :credentials, nil do |value|
722
745
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
723
746
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -732,6 +755,7 @@ module Google
732
755
  config_attr :metadata, nil, ::Hash, nil
733
756
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
734
757
  config_attr :quota_project, nil, ::String, nil
758
+ config_attr :universe_domain, nil, ::String, nil
735
759
 
736
760
  # @private
737
761
  def initialize parent_config = nil
@@ -35,6 +35,9 @@ module Google
35
35
  # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}.
36
36
  #
37
37
  class Client
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
40
+
38
41
  include Paths
39
42
 
40
43
  # @private
@@ -100,6 +103,15 @@ module Google
100
103
  @config
101
104
  end
102
105
 
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @session_entity_types_stub.universe_domain
113
+ end
114
+
103
115
  ##
104
116
  # Create a new SessionEntityTypes REST client object.
105
117
  #
@@ -127,8 +139,9 @@ module Google
127
139
  credentials = @config.credentials
128
140
  # Use self-signed JWT if the endpoint is unchanged from default,
129
141
  # but only if the default endpoint does not have a region prefix.
130
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
131
- !@config.endpoint.split(".").first.include?("-")
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
132
145
  credentials ||= Credentials.default scope: @config.scope,
133
146
  enable_self_signed_jwt: enable_self_signed_jwt
134
147
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -142,10 +155,16 @@ module Google
142
155
  config.credentials = credentials
143
156
  config.quota_project = @quota_project_id
144
157
  config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
145
159
  config.bindings_override = @config.bindings_override
146
160
  end
147
161
 
148
- @session_entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
162
+ @session_entity_types_stub = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials
167
+ )
149
168
  end
150
169
 
151
170
  ##
@@ -619,9 +638,9 @@ module Google
619
638
  # end
620
639
  #
621
640
  # @!attribute [rw] endpoint
622
- # The hostname or hostname:port of the service endpoint.
623
- # Defaults to `"dialogflow.googleapis.com"`.
624
- # @return [::String]
641
+ # A custom service endpoint, as a hostname or hostname:port. The default is
642
+ # nil, indicating to use the default endpoint in the current universe domain.
643
+ # @return [::String,nil]
625
644
  # @!attribute [rw] credentials
626
645
  # Credentials to send with calls. You may provide any of the following types:
627
646
  # * (`String`) The path to a service account key file in JSON format
@@ -658,13 +677,20 @@ module Google
658
677
  # @!attribute [rw] quota_project
659
678
  # A separate project against which to charge quota.
660
679
  # @return [::String]
680
+ # @!attribute [rw] universe_domain
681
+ # The universe domain within which to make requests. This determines the
682
+ # default endpoint URL. The default value of nil uses the environment
683
+ # universe (usually the default "googleapis.com" universe).
684
+ # @return [::String,nil]
661
685
  #
662
686
  class Configuration
663
687
  extend ::Gapic::Config
664
688
 
689
+ # @private
690
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
665
691
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
666
692
 
667
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
693
+ config_attr :endpoint, nil, ::String, nil
668
694
  config_attr :credentials, nil do |value|
669
695
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
696
  allowed.any? { |klass| klass === value }
@@ -676,6 +702,7 @@ module Google
676
702
  config_attr :metadata, nil, ::Hash, nil
677
703
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
678
704
  config_attr :quota_project, nil, ::String, nil
705
+ config_attr :universe_domain, nil, ::String, nil
679
706
 
680
707
  # @private
681
708
  # Overrides for http bindings for the RPCs of this service
@@ -31,16 +31,28 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, credentials:
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
35
35
  # These require statements are intentionally placed here to initialize
36
36
  # the REST modules only when it's required.
37
37
  require "gapic/rest"
38
38
 
39
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
40
43
  numeric_enums: true,
41
44
  raise_faraday_errors: false
42
45
  end
43
46
 
47
+ ##
48
+ # The effective universe domain
49
+ #
50
+ # @return [String]
51
+ #
52
+ def universe_domain
53
+ @client_stub.universe_domain
54
+ end
55
+
44
56
  ##
45
57
  # Baseline implementation for the list_session_entity_types REST call
46
58
  #