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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/agents/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/contexts/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/conversations/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/documents/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/documents/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/environments/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/intents/operations.rb +28 -6
- data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +35 -7
- data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +33 -8
- data/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/participants/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/sessions/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +14 -2
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/versions/client.rb +32 -8
- data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +34 -7
- data/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +14 -2
- data/proto_docs/google/api/client.rb +1 -0
- data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -0
- data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +1 -0
- data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +1 -0
- data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +1 -0
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +1 -0
- metadata +6 -6
@@ -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:
|
88
|
-
|
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
|
-
#
|
482
|
-
#
|
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,
|
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,
|
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,
|
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_model REST call
|
45
57
|
#
|
@@ -32,6 +32,9 @@ module Google
|
|
32
32
|
# {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}.
|
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
|
+
@conversation_profiles_stub.universe_domain
|
110
|
+
end
|
111
|
+
|
100
112
|
##
|
101
113
|
# Create a new ConversationProfiles 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
|
134
|
-
|
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
|
@conversation_profiles_stub = ::Gapic::ServiceStub.new(
|
156
171
|
::Google::Cloud::Dialogflow::V2::ConversationProfiles::Stub,
|
157
|
-
credentials:
|
158
|
-
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
|
@@ -890,9 +907,9 @@ module Google
|
|
890
907
|
# end
|
891
908
|
#
|
892
909
|
# @!attribute [rw] endpoint
|
893
|
-
#
|
894
|
-
#
|
895
|
-
# @return [::String]
|
910
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
911
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
912
|
+
# @return [::String,nil]
|
896
913
|
# @!attribute [rw] credentials
|
897
914
|
# Credentials to send with calls. You may provide any of the following types:
|
898
915
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -938,13 +955,20 @@ module Google
|
|
938
955
|
# @!attribute [rw] quota_project
|
939
956
|
# A separate project against which to charge quota.
|
940
957
|
# @return [::String]
|
958
|
+
# @!attribute [rw] universe_domain
|
959
|
+
# The universe domain within which to make requests. This determines the
|
960
|
+
# default endpoint URL. The default value of nil uses the environment
|
961
|
+
# universe (usually the default "googleapis.com" universe).
|
962
|
+
# @return [::String,nil]
|
941
963
|
#
|
942
964
|
class Configuration
|
943
965
|
extend ::Gapic::Config
|
944
966
|
|
967
|
+
# @private
|
968
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
945
969
|
DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
|
946
970
|
|
947
|
-
config_attr :endpoint,
|
971
|
+
config_attr :endpoint, nil, ::String, nil
|
948
972
|
config_attr :credentials, nil do |value|
|
949
973
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
950
974
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -959,6 +983,7 @@ module Google
|
|
959
983
|
config_attr :metadata, nil, ::Hash, nil
|
960
984
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
961
985
|
config_attr :quota_project, nil, ::String, nil
|
986
|
+
config_attr :universe_domain, nil, ::String, nil
|
962
987
|
|
963
988
|
# @private
|
964
989
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module ConversationProfiles
|
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:
|
94
|
-
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
|
-
#
|
617
|
-
#
|
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,
|
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::ConversationProfile ConversationProfiles}.
|
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
|
+
@conversation_profiles_stub.universe_domain
|
112
|
+
end
|
113
|
+
|
102
114
|
##
|
103
115
|
# Create a new ConversationProfiles 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
|
130
|
-
|
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
|
-
@conversation_profiles_stub = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.new
|
168
|
+
@conversation_profiles_stub = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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
|
##
|
@@ -832,9 +852,9 @@ module Google
|
|
832
852
|
# end
|
833
853
|
#
|
834
854
|
# @!attribute [rw] endpoint
|
835
|
-
#
|
836
|
-
#
|
837
|
-
# @return [::String]
|
855
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
856
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
857
|
+
# @return [::String,nil]
|
838
858
|
# @!attribute [rw] credentials
|
839
859
|
# Credentials to send with calls. You may provide any of the following types:
|
840
860
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -871,13 +891,20 @@ module Google
|
|
871
891
|
# @!attribute [rw] quota_project
|
872
892
|
# A separate project against which to charge quota.
|
873
893
|
# @return [::String]
|
894
|
+
# @!attribute [rw] universe_domain
|
895
|
+
# The universe domain within which to make requests. This determines the
|
896
|
+
# default endpoint URL. The default value of nil uses the environment
|
897
|
+
# universe (usually the default "googleapis.com" universe).
|
898
|
+
# @return [::String,nil]
|
874
899
|
#
|
875
900
|
class Configuration
|
876
901
|
extend ::Gapic::Config
|
877
902
|
|
903
|
+
# @private
|
904
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
878
905
|
DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
|
879
906
|
|
880
|
-
config_attr :endpoint,
|
907
|
+
config_attr :endpoint, nil, ::String, nil
|
881
908
|
config_attr :credentials, nil do |value|
|
882
909
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
883
910
|
allowed.any? { |klass| klass === value }
|
@@ -889,6 +916,7 @@ module Google
|
|
889
916
|
config_attr :metadata, nil, ::Hash, nil
|
890
917
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
891
918
|
config_attr :quota_project, nil, ::String, nil
|
919
|
+
config_attr :universe_domain, nil, ::String, nil
|
892
920
|
|
893
921
|
# @private
|
894
922
|
# 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:
|
88
|
-
|
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
|
-
#
|
482
|
-
#
|
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,
|
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,
|
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,
|
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_conversation_profiles REST call
|
45
57
|
#
|
@@ -32,6 +32,9 @@ module Google
|
|
32
32
|
# {::Google::Cloud::Dialogflow::V2::Conversation Conversations}.
|
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
|
+
@conversations_stub.universe_domain
|
110
|
+
end
|
111
|
+
|
100
112
|
##
|
101
113
|
# Create a new Conversations 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
|
134
|
-
|
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
|
@conversations_stub = ::Gapic::ServiceStub.new(
|
150
164
|
::Google::Cloud::Dialogflow::V2::Conversations::Stub,
|
151
|
-
credentials:
|
152
|
-
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
|
@@ -1025,9 +1041,9 @@ module Google
|
|
1025
1041
|
# end
|
1026
1042
|
#
|
1027
1043
|
# @!attribute [rw] endpoint
|
1028
|
-
#
|
1029
|
-
#
|
1030
|
-
# @return [::String]
|
1044
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1045
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1046
|
+
# @return [::String,nil]
|
1031
1047
|
# @!attribute [rw] credentials
|
1032
1048
|
# Credentials to send with calls. You may provide any of the following types:
|
1033
1049
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1073,13 +1089,20 @@ module Google
|
|
1073
1089
|
# @!attribute [rw] quota_project
|
1074
1090
|
# A separate project against which to charge quota.
|
1075
1091
|
# @return [::String]
|
1092
|
+
# @!attribute [rw] universe_domain
|
1093
|
+
# The universe domain within which to make requests. This determines the
|
1094
|
+
# default endpoint URL. The default value of nil uses the environment
|
1095
|
+
# universe (usually the default "googleapis.com" universe).
|
1096
|
+
# @return [::String,nil]
|
1076
1097
|
#
|
1077
1098
|
class Configuration
|
1078
1099
|
extend ::Gapic::Config
|
1079
1100
|
|
1101
|
+
# @private
|
1102
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1080
1103
|
DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
|
1081
1104
|
|
1082
|
-
config_attr :endpoint,
|
1105
|
+
config_attr :endpoint, nil, ::String, nil
|
1083
1106
|
config_attr :credentials, nil do |value|
|
1084
1107
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1085
1108
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1094,6 +1117,7 @@ module Google
|
|
1094
1117
|
config_attr :metadata, nil, ::Hash, nil
|
1095
1118
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1096
1119
|
config_attr :quota_project, nil, ::String, nil
|
1120
|
+
config_attr :universe_domain, nil, ::String, nil
|
1097
1121
|
|
1098
1122
|
# @private
|
1099
1123
|
def initialize parent_config = nil
|