google-cloud-dialogflow-v2 0.31.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/dialogflow/v2/agents/client.rb +33 -8
  4. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +28 -6
  5. data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +35 -7
  6. data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +33 -8
  7. data/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +14 -2
  8. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +32 -8
  9. data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +34 -7
  10. data/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +14 -2
  11. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +32 -8
  12. data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +34 -7
  13. data/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +14 -2
  14. data/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +33 -8
  15. data/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +28 -6
  16. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +35 -7
  17. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +33 -8
  18. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +14 -2
  19. data/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +33 -8
  20. data/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +28 -6
  21. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +35 -7
  22. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +33 -8
  23. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +14 -2
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +33 -8
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +28 -6
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +35 -7
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +33 -8
  28. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +14 -2
  29. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +32 -8
  30. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +34 -7
  31. data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/dialogflow/v2/documents/client.rb +33 -8
  33. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +28 -6
  34. data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +35 -7
  35. data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +33 -8
  36. data/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +14 -2
  37. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +33 -8
  38. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +28 -6
  39. data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +35 -7
  40. data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +33 -8
  41. data/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +14 -2
  42. data/lib/google/cloud/dialogflow/v2/environments/client.rb +32 -8
  43. data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +34 -7
  44. data/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +14 -2
  45. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +32 -8
  46. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +34 -7
  47. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +14 -2
  48. data/lib/google/cloud/dialogflow/v2/intents/client.rb +33 -8
  49. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +28 -6
  50. data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +35 -7
  51. data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +33 -8
  52. data/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +14 -2
  53. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +32 -8
  54. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +34 -7
  55. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +14 -2
  56. data/lib/google/cloud/dialogflow/v2/participants/client.rb +32 -8
  57. data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +34 -7
  58. data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +14 -2
  59. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +32 -8
  60. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +34 -7
  61. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +14 -2
  62. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +32 -8
  63. data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +34 -7
  64. data/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +14 -2
  65. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  66. data/lib/google/cloud/dialogflow/v2/versions/client.rb +32 -8
  67. data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +34 -7
  68. data/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +14 -2
  69. data/proto_docs/google/api/client.rb +1 -0
  70. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -0
  71. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +1 -0
  72. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +1 -0
  73. data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +1 -0
  74. data/proto_docs/google/cloud/dialogflow/v2/session.rb +1 -0
  75. metadata +6 -6
@@ -34,6 +34,9 @@ module Google
34
34
  # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}.
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
+ @conversations_stub.universe_domain
112
+ end
113
+
102
114
  ##
103
115
  # Create a new Conversations 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
- @conversations_stub = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @conversations_stub = ::Google::Cloud::Dialogflow::V2::Conversations::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
  ##
@@ -960,9 +979,9 @@ module Google
960
979
  # end
961
980
  #
962
981
  # @!attribute [rw] endpoint
963
- # The hostname or hostname:port of the service endpoint.
964
- # Defaults to `"dialogflow.googleapis.com"`.
965
- # @return [::String]
982
+ # A custom service endpoint, as a hostname or hostname:port. The default is
983
+ # nil, indicating to use the default endpoint in the current universe domain.
984
+ # @return [::String,nil]
966
985
  # @!attribute [rw] credentials
967
986
  # Credentials to send with calls. You may provide any of the following types:
968
987
  # * (`String`) The path to a service account key file in JSON format
@@ -999,13 +1018,20 @@ module Google
999
1018
  # @!attribute [rw] quota_project
1000
1019
  # A separate project against which to charge quota.
1001
1020
  # @return [::String]
1021
+ # @!attribute [rw] universe_domain
1022
+ # The universe domain within which to make requests. This determines the
1023
+ # default endpoint URL. The default value of nil uses the environment
1024
+ # universe (usually the default "googleapis.com" universe).
1025
+ # @return [::String,nil]
1002
1026
  #
1003
1027
  class Configuration
1004
1028
  extend ::Gapic::Config
1005
1029
 
1030
+ # @private
1031
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1006
1032
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
1007
1033
 
1008
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1034
+ config_attr :endpoint, nil, ::String, nil
1009
1035
  config_attr :credentials, nil do |value|
1010
1036
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1011
1037
  allowed.any? { |klass| klass === value }
@@ -1017,6 +1043,7 @@ module Google
1017
1043
  config_attr :metadata, nil, ::Hash, nil
1018
1044
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1019
1045
  config_attr :quota_project, nil, ::String, nil
1046
+ config_attr :universe_domain, nil, ::String, nil
1020
1047
 
1021
1048
  # @private
1022
1049
  # Overrides for http bindings for the RPCs of this service
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the create_conversation REST call
45
57
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # {::Google::Cloud::Dialogflow::V2::Document Documents}.
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
+ @documents_stub.universe_domain
110
+ end
111
+
100
112
  ##
101
113
  # Create a new Documents 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,18 +157,22 @@ 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
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
150
164
  config.credentials = credentials
151
165
  config.quota_project = @quota_project_id
152
166
  config.endpoint = @config.endpoint
167
+ config.universe_domain = @config.universe_domain
153
168
  end
154
169
 
155
170
  @documents_stub = ::Gapic::ServiceStub.new(
156
171
  ::Google::Cloud::Dialogflow::V2::Documents::Stub,
157
- credentials: credentials,
158
- endpoint: @config.endpoint,
172
+ credentials: credentials,
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
159
176
  channel_args: @config.channel_args,
160
177
  interceptors: @config.interceptors,
161
178
  channel_pool_config: @config.channel_pool
@@ -1079,9 +1096,9 @@ module Google
1079
1096
  # end
1080
1097
  #
1081
1098
  # @!attribute [rw] endpoint
1082
- # The hostname or hostname:port of the service endpoint.
1083
- # Defaults to `"dialogflow.googleapis.com"`.
1084
- # @return [::String]
1099
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1100
+ # nil, indicating to use the default endpoint in the current universe domain.
1101
+ # @return [::String,nil]
1085
1102
  # @!attribute [rw] credentials
1086
1103
  # Credentials to send with calls. You may provide any of the following types:
1087
1104
  # * (`String`) The path to a service account key file in JSON format
@@ -1127,13 +1144,20 @@ module Google
1127
1144
  # @!attribute [rw] quota_project
1128
1145
  # A separate project against which to charge quota.
1129
1146
  # @return [::String]
1147
+ # @!attribute [rw] universe_domain
1148
+ # The universe domain within which to make requests. This determines the
1149
+ # default endpoint URL. The default value of nil uses the environment
1150
+ # universe (usually the default "googleapis.com" universe).
1151
+ # @return [::String,nil]
1130
1152
  #
1131
1153
  class Configuration
1132
1154
  extend ::Gapic::Config
1133
1155
 
1156
+ # @private
1157
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1134
1158
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
1135
1159
 
1136
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1160
+ config_attr :endpoint, nil, ::String, nil
1137
1161
  config_attr :credentials, nil do |value|
1138
1162
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1139
1163
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1148,6 +1172,7 @@ module Google
1148
1172
  config_attr :metadata, nil, ::Hash, nil
1149
1173
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1150
1174
  config_attr :quota_project, nil, ::String, nil
1175
+ config_attr :universe_domain, nil, ::String, nil
1151
1176
 
1152
1177
  # @private
1153
1178
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module Documents
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -90,8 +102,10 @@ module Google
90
102
 
91
103
  @operations_stub = ::Gapic::ServiceStub.new(
92
104
  ::Google::Longrunning::Operations::Stub,
93
- credentials: credentials,
94
- endpoint: @config.endpoint,
105
+ credentials: credentials,
106
+ endpoint: @config.endpoint,
107
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
108
+ universe_domain: @config.universe_domain,
95
109
  channel_args: @config.channel_args,
96
110
  interceptors: @config.interceptors,
97
111
  channel_pool_config: @config.channel_pool
@@ -613,9 +627,9 @@ module Google
613
627
  # end
614
628
  #
615
629
  # @!attribute [rw] endpoint
616
- # The hostname or hostname:port of the service endpoint.
617
- # Defaults to `"dialogflow.googleapis.com"`.
618
- # @return [::String]
630
+ # A custom service endpoint, as a hostname or hostname:port. The default is
631
+ # nil, indicating to use the default endpoint in the current universe domain.
632
+ # @return [::String,nil]
619
633
  # @!attribute [rw] credentials
620
634
  # Credentials to send with calls. You may provide any of the following types:
621
635
  # * (`String`) The path to a service account key file in JSON format
@@ -661,13 +675,20 @@ module Google
661
675
  # @!attribute [rw] quota_project
662
676
  # A separate project against which to charge quota.
663
677
  # @return [::String]
678
+ # @!attribute [rw] universe_domain
679
+ # The universe domain within which to make requests. This determines the
680
+ # default endpoint URL. The default value of nil uses the environment
681
+ # universe (usually the default "googleapis.com" universe).
682
+ # @return [::String,nil]
664
683
  #
665
684
  class Configuration
666
685
  extend ::Gapic::Config
667
686
 
687
+ # @private
688
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
668
689
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
669
690
 
670
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
691
+ config_attr :endpoint, nil, ::String, nil
671
692
  config_attr :credentials, nil do |value|
672
693
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
673
694
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -682,6 +703,7 @@ module Google
682
703
  config_attr :metadata, nil, ::Hash, nil
683
704
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
684
705
  config_attr :quota_project, nil, ::String, nil
706
+ config_attr :universe_domain, nil, ::String, nil
685
707
 
686
708
  # @private
687
709
  def initialize parent_config = nil
@@ -34,6 +34,9 @@ module Google
34
34
  # {::Google::Cloud::Dialogflow::V2::Document Documents}.
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
+ @documents_stub.universe_domain
112
+ end
113
+
102
114
  ##
103
115
  # Create a new Documents 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,16 +154,23 @@ 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
  end
145
159
 
146
160
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
147
161
  config.credentials = credentials
148
162
  config.quota_project = @quota_project_id
149
163
  config.endpoint = @config.endpoint
164
+ config.universe_domain = @config.universe_domain
150
165
  config.bindings_override = @config.bindings_override
151
166
  end
152
167
 
153
- @documents_stub = ::Google::Cloud::Dialogflow::V2::Documents::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
168
+ @documents_stub = ::Google::Cloud::Dialogflow::V2::Documents::Rest::ServiceStub.new(
169
+ endpoint: @config.endpoint,
170
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
+ universe_domain: @config.universe_domain,
172
+ credentials: credentials
173
+ )
154
174
  end
155
175
 
156
176
  ##
@@ -1014,9 +1034,9 @@ module Google
1014
1034
  # end
1015
1035
  #
1016
1036
  # @!attribute [rw] endpoint
1017
- # The hostname or hostname:port of the service endpoint.
1018
- # Defaults to `"dialogflow.googleapis.com"`.
1019
- # @return [::String]
1037
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1038
+ # nil, indicating to use the default endpoint in the current universe domain.
1039
+ # @return [::String,nil]
1020
1040
  # @!attribute [rw] credentials
1021
1041
  # Credentials to send with calls. You may provide any of the following types:
1022
1042
  # * (`String`) The path to a service account key file in JSON format
@@ -1053,13 +1073,20 @@ module Google
1053
1073
  # @!attribute [rw] quota_project
1054
1074
  # A separate project against which to charge quota.
1055
1075
  # @return [::String]
1076
+ # @!attribute [rw] universe_domain
1077
+ # The universe domain within which to make requests. This determines the
1078
+ # default endpoint URL. The default value of nil uses the environment
1079
+ # universe (usually the default "googleapis.com" universe).
1080
+ # @return [::String,nil]
1056
1081
  #
1057
1082
  class Configuration
1058
1083
  extend ::Gapic::Config
1059
1084
 
1085
+ # @private
1086
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1060
1087
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
1061
1088
 
1062
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1089
+ config_attr :endpoint, nil, ::String, nil
1063
1090
  config_attr :credentials, nil do |value|
1064
1091
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1065
1092
  allowed.any? { |klass| klass === value }
@@ -1071,6 +1098,7 @@ module Google
1071
1098
  config_attr :metadata, nil, ::Hash, nil
1072
1099
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1073
1100
  config_attr :quota_project, nil, ::String, nil
1101
+ config_attr :universe_domain, nil, ::String, nil
1074
1102
 
1075
1103
  # @private
1076
1104
  # Overrides for http bindings for the RPCs of this service
@@ -26,6 +26,9 @@ module Google
26
26
  module Rest
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -84,8 +96,10 @@ module Google
84
96
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
85
97
 
86
98
  @operations_stub = OperationsServiceStub.new(
87
- endpoint: @config.endpoint,
88
- credentials: credentials
99
+ endpoint: @config.endpoint,
100
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
101
+ universe_domain: @config.universe_domain,
102
+ credentials: credentials
89
103
  )
90
104
 
91
105
  # Used by an LRO wrapper for some methods of this service
@@ -478,9 +492,9 @@ module Google
478
492
  # end
479
493
  #
480
494
  # @!attribute [rw] endpoint
481
- # The hostname or hostname:port of the service endpoint.
482
- # Defaults to `"dialogflow.googleapis.com"`.
483
- # @return [::String]
495
+ # A custom service endpoint, as a hostname or hostname:port. The default is
496
+ # nil, indicating to use the default endpoint in the current universe domain.
497
+ # @return [::String,nil]
484
498
  # @!attribute [rw] credentials
485
499
  # Credentials to send with calls. You may provide any of the following types:
486
500
  # * (`String`) The path to a service account key file in JSON format
@@ -517,13 +531,20 @@ module Google
517
531
  # @!attribute [rw] quota_project
518
532
  # A separate project against which to charge quota.
519
533
  # @return [::String]
534
+ # @!attribute [rw] universe_domain
535
+ # The universe domain within which to make requests. This determines the
536
+ # default endpoint URL. The default value of nil uses the environment
537
+ # universe (usually the default "googleapis.com" universe).
538
+ # @return [::String,nil]
520
539
  #
521
540
  class Configuration
522
541
  extend ::Gapic::Config
523
542
 
543
+ # @private
544
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
524
545
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
525
546
 
526
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
547
+ config_attr :endpoint, nil, ::String, nil
527
548
  config_attr :credentials, nil do |value|
528
549
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
529
550
  allowed.any? { |klass| klass === value }
@@ -535,6 +556,7 @@ module Google
535
556
  config_attr :metadata, nil, ::Hash, nil
536
557
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
537
558
  config_attr :quota_project, nil, ::String, nil
559
+ config_attr :universe_domain, nil, ::String, nil
538
560
 
539
561
  # @private
540
562
  def initialize parent_config = nil
@@ -617,12 +639,15 @@ module Google
617
639
  # Service stub contains baseline method implementations
618
640
  # including transcoding, making the REST call, and deserialing the response.
619
641
  class OperationsServiceStub
620
- def initialize endpoint:, credentials:
642
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
621
643
  # These require statements are intentionally placed here to initialize
622
644
  # the REST modules only when it's required.
623
645
  require "gapic/rest"
624
646
 
625
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
647
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
648
+ endpoint_template: endpoint_template,
649
+ universe_domain: universe_domain,
650
+ credentials: credentials
626
651
  end
627
652
 
628
653
  ##
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the list_documents REST call
45
57
  #
@@ -31,6 +31,9 @@ module Google
31
31
  # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
36
+
34
37
  include Paths
35
38
 
36
39
  # @private
@@ -96,6 +99,15 @@ module Google
96
99
  @config
97
100
  end
98
101
 
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @entity_types_stub.universe_domain
109
+ end
110
+
99
111
  ##
100
112
  # Create a new EntityTypes client object.
101
113
  #
@@ -129,8 +141,9 @@ module Google
129
141
  credentials = @config.credentials
130
142
  # Use self-signed JWT if the endpoint is unchanged from default,
131
143
  # but only if the default endpoint does not have a region prefix.
132
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
133
- !@config.endpoint.split(".").first.include?("-")
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
134
147
  credentials ||= Credentials.default scope: @config.scope,
135
148
  enable_self_signed_jwt: enable_self_signed_jwt
136
149
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -143,18 +156,22 @@ module Google
143
156
  config.credentials = credentials
144
157
  config.quota_project = @quota_project_id
145
158
  config.endpoint = @config.endpoint
159
+ config.universe_domain = @config.universe_domain
146
160
  end
147
161
 
148
162
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
149
163
  config.credentials = credentials
150
164
  config.quota_project = @quota_project_id
151
165
  config.endpoint = @config.endpoint
166
+ config.universe_domain = @config.universe_domain
152
167
  end
153
168
 
154
169
  @entity_types_stub = ::Gapic::ServiceStub.new(
155
170
  ::Google::Cloud::Dialogflow::V2::EntityTypes::Stub,
156
- credentials: credentials,
157
- endpoint: @config.endpoint,
171
+ credentials: credentials,
172
+ endpoint: @config.endpoint,
173
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
174
+ universe_domain: @config.universe_domain,
158
175
  channel_args: @config.channel_args,
159
176
  interceptors: @config.interceptors,
160
177
  channel_pool_config: @config.channel_pool
@@ -1269,9 +1286,9 @@ module Google
1269
1286
  # end
1270
1287
  #
1271
1288
  # @!attribute [rw] endpoint
1272
- # The hostname or hostname:port of the service endpoint.
1273
- # Defaults to `"dialogflow.googleapis.com"`.
1274
- # @return [::String]
1289
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1290
+ # nil, indicating to use the default endpoint in the current universe domain.
1291
+ # @return [::String,nil]
1275
1292
  # @!attribute [rw] credentials
1276
1293
  # Credentials to send with calls. You may provide any of the following types:
1277
1294
  # * (`String`) The path to a service account key file in JSON format
@@ -1317,13 +1334,20 @@ module Google
1317
1334
  # @!attribute [rw] quota_project
1318
1335
  # A separate project against which to charge quota.
1319
1336
  # @return [::String]
1337
+ # @!attribute [rw] universe_domain
1338
+ # The universe domain within which to make requests. This determines the
1339
+ # default endpoint URL. The default value of nil uses the environment
1340
+ # universe (usually the default "googleapis.com" universe).
1341
+ # @return [::String,nil]
1320
1342
  #
1321
1343
  class Configuration
1322
1344
  extend ::Gapic::Config
1323
1345
 
1346
+ # @private
1347
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1324
1348
  DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
1325
1349
 
1326
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1350
+ config_attr :endpoint, nil, ::String, nil
1327
1351
  config_attr :credentials, nil do |value|
1328
1352
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1329
1353
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1338,6 +1362,7 @@ module Google
1338
1362
  config_attr :metadata, nil, ::Hash, nil
1339
1363
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1340
1364
  config_attr :quota_project, nil, ::String, nil
1365
+ config_attr :universe_domain, nil, ::String, nil
1341
1366
 
1342
1367
  # @private
1343
1368
  def initialize parent_config = nil