google-cloud-discovery_engine-v1beta 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +42 -9
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +50 -7
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +42 -9
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +134 -7
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +43 -9
- data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +38 -7
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +165 -7
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +108 -8
- data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +42 -9
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +50 -7
- data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +43 -9
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +38 -7
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +140 -7
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +108 -8
- data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +42 -9
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +54 -7
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +43 -9
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +38 -7
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +90 -7
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +108 -8
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +3 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +2 -0
- metadata +7 -7
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# Service for making recommendations.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$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
|
+
@recommendation_service_stub.universe_domain
|
111
|
+
end
|
112
|
+
|
101
113
|
##
|
102
114
|
# Create a new RecommendationService REST client object.
|
103
115
|
#
|
@@ -125,8 +137,9 @@ module Google
|
|
125
137
|
credentials = @config.credentials
|
126
138
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
139
|
# but only if the default endpoint does not have a region prefix.
|
128
|
-
enable_self_signed_jwt = @config.endpoint
|
129
|
-
|
140
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
141
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-"))
|
130
143
|
credentials ||= Credentials.default scope: @config.scope,
|
131
144
|
enable_self_signed_jwt: enable_self_signed_jwt
|
132
145
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -140,9 +153,15 @@ module Google
|
|
140
153
|
config.credentials = credentials
|
141
154
|
config.quota_project = @quota_project_id
|
142
155
|
config.endpoint = @config.endpoint
|
156
|
+
config.universe_domain = @config.universe_domain
|
143
157
|
end
|
144
158
|
|
145
|
-
@recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::ServiceStub.new
|
159
|
+
@recommendation_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::ServiceStub.new(
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
|
+
universe_domain: @config.universe_domain,
|
163
|
+
credentials: credentials
|
164
|
+
)
|
146
165
|
end
|
147
166
|
|
148
167
|
##
|
@@ -275,6 +294,22 @@ module Google
|
|
275
294
|
# @return [::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse]
|
276
295
|
#
|
277
296
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
297
|
+
#
|
298
|
+
# @example Basic example
|
299
|
+
# require "google/cloud/discovery_engine/v1beta"
|
300
|
+
#
|
301
|
+
# # Create a client object. The client can be reused for multiple calls.
|
302
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::Client.new
|
303
|
+
#
|
304
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
305
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::RecommendRequest.new
|
306
|
+
#
|
307
|
+
# # Call the recommend method.
|
308
|
+
# result = client.recommend request
|
309
|
+
#
|
310
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse.
|
311
|
+
# p result
|
312
|
+
#
|
278
313
|
def recommend request, options = nil
|
279
314
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
280
315
|
|
@@ -340,9 +375,9 @@ module Google
|
|
340
375
|
# end
|
341
376
|
#
|
342
377
|
# @!attribute [rw] endpoint
|
343
|
-
#
|
344
|
-
#
|
345
|
-
# @return [::String]
|
378
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
379
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
380
|
+
# @return [::String,nil]
|
346
381
|
# @!attribute [rw] credentials
|
347
382
|
# Credentials to send with calls. You may provide any of the following types:
|
348
383
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -379,13 +414,20 @@ module Google
|
|
379
414
|
# @!attribute [rw] quota_project
|
380
415
|
# A separate project against which to charge quota.
|
381
416
|
# @return [::String]
|
417
|
+
# @!attribute [rw] universe_domain
|
418
|
+
# The universe domain within which to make requests. This determines the
|
419
|
+
# default endpoint URL. The default value of nil uses the environment
|
420
|
+
# universe (usually the default "googleapis.com" universe).
|
421
|
+
# @return [::String,nil]
|
382
422
|
#
|
383
423
|
class Configuration
|
384
424
|
extend ::Gapic::Config
|
385
425
|
|
426
|
+
# @private
|
427
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
386
428
|
DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
|
387
429
|
|
388
|
-
config_attr :endpoint,
|
430
|
+
config_attr :endpoint, nil, ::String, nil
|
389
431
|
config_attr :credentials, nil do |value|
|
390
432
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
391
433
|
allowed.any? { |klass| klass === value }
|
@@ -397,6 +439,7 @@ module Google
|
|
397
439
|
config_attr :metadata, nil, ::Hash, nil
|
398
440
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
399
441
|
config_attr :quota_project, nil, ::String, nil
|
442
|
+
config_attr :universe_domain, nil, ::String, nil
|
400
443
|
|
401
444
|
# @private
|
402
445
|
def initialize parent_config = nil
|
@@ -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 recommend REST call
|
45
57
|
#
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Service for managing {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$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
|
+
@schema_service_stub.universe_domain
|
109
|
+
end
|
110
|
+
|
99
111
|
##
|
100
112
|
# Create a new SchemaService 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
|
133
|
-
|
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,20 +156,25 @@ 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
|
@schema_service_stub = ::Gapic::ServiceStub.new(
|
155
170
|
::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Stub,
|
156
|
-
credentials:
|
157
|
-
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
|
-
interceptors: @config.interceptors
|
176
|
+
interceptors: @config.interceptors,
|
177
|
+
channel_pool_config: @config.channel_pool
|
160
178
|
)
|
161
179
|
end
|
162
180
|
|
@@ -698,9 +716,9 @@ module Google
|
|
698
716
|
# end
|
699
717
|
#
|
700
718
|
# @!attribute [rw] endpoint
|
701
|
-
#
|
702
|
-
#
|
703
|
-
# @return [::String]
|
719
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
720
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
721
|
+
# @return [::String,nil]
|
704
722
|
# @!attribute [rw] credentials
|
705
723
|
# Credentials to send with calls. You may provide any of the following types:
|
706
724
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -746,13 +764,20 @@ module Google
|
|
746
764
|
# @!attribute [rw] quota_project
|
747
765
|
# A separate project against which to charge quota.
|
748
766
|
# @return [::String]
|
767
|
+
# @!attribute [rw] universe_domain
|
768
|
+
# The universe domain within which to make requests. This determines the
|
769
|
+
# default endpoint URL. The default value of nil uses the environment
|
770
|
+
# universe (usually the default "googleapis.com" universe).
|
771
|
+
# @return [::String,nil]
|
749
772
|
#
|
750
773
|
class Configuration
|
751
774
|
extend ::Gapic::Config
|
752
775
|
|
776
|
+
# @private
|
777
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
753
778
|
DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
|
754
779
|
|
755
|
-
config_attr :endpoint,
|
780
|
+
config_attr :endpoint, nil, ::String, nil
|
756
781
|
config_attr :credentials, nil do |value|
|
757
782
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
758
783
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -767,6 +792,7 @@ module Google
|
|
767
792
|
config_attr :metadata, nil, ::Hash, nil
|
768
793
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
769
794
|
config_attr :quota_project, nil, ::String, nil
|
795
|
+
config_attr :universe_domain, nil, ::String, nil
|
770
796
|
|
771
797
|
# @private
|
772
798
|
def initialize parent_config = nil
|
@@ -787,6 +813,14 @@ module Google
|
|
787
813
|
end
|
788
814
|
end
|
789
815
|
|
816
|
+
##
|
817
|
+
# Configuration for the channel pool
|
818
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
819
|
+
#
|
820
|
+
def channel_pool
|
821
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
822
|
+
end
|
823
|
+
|
790
824
|
##
|
791
825
|
# Configuration RPC class for the SchemaService API.
|
792
826
|
#
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module SchemaService
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$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,10 +102,13 @@ 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
|
-
interceptors: @config.interceptors
|
110
|
+
interceptors: @config.interceptors,
|
111
|
+
channel_pool_config: @config.channel_pool
|
97
112
|
)
|
98
113
|
|
99
114
|
# Used by an LRO wrapper for some methods of this service
|
@@ -612,9 +627,9 @@ module Google
|
|
612
627
|
# end
|
613
628
|
#
|
614
629
|
# @!attribute [rw] endpoint
|
615
|
-
#
|
616
|
-
#
|
617
|
-
# @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]
|
618
633
|
# @!attribute [rw] credentials
|
619
634
|
# Credentials to send with calls. You may provide any of the following types:
|
620
635
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -660,13 +675,20 @@ module Google
|
|
660
675
|
# @!attribute [rw] quota_project
|
661
676
|
# A separate project against which to charge quota.
|
662
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]
|
663
683
|
#
|
664
684
|
class Configuration
|
665
685
|
extend ::Gapic::Config
|
666
686
|
|
687
|
+
# @private
|
688
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
667
689
|
DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
|
668
690
|
|
669
|
-
config_attr :endpoint,
|
691
|
+
config_attr :endpoint, nil, ::String, nil
|
670
692
|
config_attr :credentials, nil do |value|
|
671
693
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
672
694
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -681,6 +703,7 @@ module Google
|
|
681
703
|
config_attr :metadata, nil, ::Hash, nil
|
682
704
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
683
705
|
config_attr :quota_project, nil, ::String, nil
|
706
|
+
config_attr :universe_domain, nil, ::String, nil
|
684
707
|
|
685
708
|
# @private
|
686
709
|
def initialize parent_config = nil
|
@@ -701,6 +724,14 @@ module Google
|
|
701
724
|
end
|
702
725
|
end
|
703
726
|
|
727
|
+
##
|
728
|
+
# Configuration for the channel pool
|
729
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
730
|
+
#
|
731
|
+
def channel_pool
|
732
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
733
|
+
end
|
734
|
+
|
704
735
|
##
|
705
736
|
# Configuration RPC class for the Operations API.
|
706
737
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# Service for managing {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$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
|
+
@schema_service_stub.universe_domain
|
111
|
+
end
|
112
|
+
|
101
113
|
##
|
102
114
|
# Create a new SchemaService REST client object.
|
103
115
|
#
|
@@ -125,8 +137,9 @@ module Google
|
|
125
137
|
credentials = @config.credentials
|
126
138
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
139
|
# but only if the default endpoint does not have a region prefix.
|
128
|
-
enable_self_signed_jwt = @config.endpoint
|
129
|
-
|
140
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
141
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-"))
|
130
143
|
credentials ||= Credentials.default scope: @config.scope,
|
131
144
|
enable_self_signed_jwt: enable_self_signed_jwt
|
132
145
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -140,15 +153,22 @@ module Google
|
|
140
153
|
config.credentials = credentials
|
141
154
|
config.quota_project = @quota_project_id
|
142
155
|
config.endpoint = @config.endpoint
|
156
|
+
config.universe_domain = @config.universe_domain
|
143
157
|
end
|
144
158
|
|
145
159
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
146
160
|
config.credentials = credentials
|
147
161
|
config.quota_project = @quota_project_id
|
148
162
|
config.endpoint = @config.endpoint
|
163
|
+
config.universe_domain = @config.universe_domain
|
149
164
|
end
|
150
165
|
|
151
|
-
@schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::ServiceStub.new
|
166
|
+
@schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::ServiceStub.new(
|
167
|
+
endpoint: @config.endpoint,
|
168
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
169
|
+
universe_domain: @config.universe_domain,
|
170
|
+
credentials: credentials
|
171
|
+
)
|
152
172
|
end
|
153
173
|
|
154
174
|
##
|
@@ -195,6 +215,22 @@ module Google
|
|
195
215
|
# @return [::Google::Cloud::DiscoveryEngine::V1beta::Schema]
|
196
216
|
#
|
197
217
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
218
|
+
#
|
219
|
+
# @example Basic example
|
220
|
+
# require "google/cloud/discovery_engine/v1beta"
|
221
|
+
#
|
222
|
+
# # Create a client object. The client can be reused for multiple calls.
|
223
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
|
224
|
+
#
|
225
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
226
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::GetSchemaRequest.new
|
227
|
+
#
|
228
|
+
# # Call the get_schema method.
|
229
|
+
# result = client.get_schema request
|
230
|
+
#
|
231
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Schema.
|
232
|
+
# p result
|
233
|
+
#
|
198
234
|
def get_schema request, options = nil
|
199
235
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
200
236
|
|
@@ -274,6 +310,26 @@ module Google
|
|
274
310
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Schema>]
|
275
311
|
#
|
276
312
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
313
|
+
#
|
314
|
+
# @example Basic example
|
315
|
+
# require "google/cloud/discovery_engine/v1beta"
|
316
|
+
#
|
317
|
+
# # Create a client object. The client can be reused for multiple calls.
|
318
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
|
319
|
+
#
|
320
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
321
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::ListSchemasRequest.new
|
322
|
+
#
|
323
|
+
# # Call the list_schemas method.
|
324
|
+
# result = client.list_schemas request
|
325
|
+
#
|
326
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
327
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
328
|
+
# result.each do |item|
|
329
|
+
# # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Schema.
|
330
|
+
# p item
|
331
|
+
# end
|
332
|
+
#
|
277
333
|
def list_schemas request, options = nil
|
278
334
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
279
335
|
|
@@ -350,6 +406,29 @@ module Google
|
|
350
406
|
# @return [::Gapic::Operation]
|
351
407
|
#
|
352
408
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
409
|
+
#
|
410
|
+
# @example Basic example
|
411
|
+
# require "google/cloud/discovery_engine/v1beta"
|
412
|
+
#
|
413
|
+
# # Create a client object. The client can be reused for multiple calls.
|
414
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
|
415
|
+
#
|
416
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
417
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::CreateSchemaRequest.new
|
418
|
+
#
|
419
|
+
# # Call the create_schema method.
|
420
|
+
# result = client.create_schema request
|
421
|
+
#
|
422
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
423
|
+
# # check the status of an operation, cancel it, or wait for results.
|
424
|
+
# # Here is how to wait for a response.
|
425
|
+
# result.wait_until_done! timeout: 60
|
426
|
+
# if result.response?
|
427
|
+
# p result.response
|
428
|
+
# else
|
429
|
+
# puts "No response received."
|
430
|
+
# end
|
431
|
+
#
|
353
432
|
def create_schema request, options = nil
|
354
433
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
355
434
|
|
@@ -419,6 +498,29 @@ module Google
|
|
419
498
|
# @return [::Gapic::Operation]
|
420
499
|
#
|
421
500
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
501
|
+
#
|
502
|
+
# @example Basic example
|
503
|
+
# require "google/cloud/discovery_engine/v1beta"
|
504
|
+
#
|
505
|
+
# # Create a client object. The client can be reused for multiple calls.
|
506
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
|
507
|
+
#
|
508
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
509
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::UpdateSchemaRequest.new
|
510
|
+
#
|
511
|
+
# # Call the update_schema method.
|
512
|
+
# result = client.update_schema request
|
513
|
+
#
|
514
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
515
|
+
# # check the status of an operation, cancel it, or wait for results.
|
516
|
+
# # Here is how to wait for a response.
|
517
|
+
# result.wait_until_done! timeout: 60
|
518
|
+
# if result.response?
|
519
|
+
# p result.response
|
520
|
+
# else
|
521
|
+
# puts "No response received."
|
522
|
+
# end
|
523
|
+
#
|
422
524
|
def update_schema request, options = nil
|
423
525
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
424
526
|
|
@@ -483,6 +585,29 @@ module Google
|
|
483
585
|
# @return [::Gapic::Operation]
|
484
586
|
#
|
485
587
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
588
|
+
#
|
589
|
+
# @example Basic example
|
590
|
+
# require "google/cloud/discovery_engine/v1beta"
|
591
|
+
#
|
592
|
+
# # Create a client object. The client can be reused for multiple calls.
|
593
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
|
594
|
+
#
|
595
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
596
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::DeleteSchemaRequest.new
|
597
|
+
#
|
598
|
+
# # Call the delete_schema method.
|
599
|
+
# result = client.delete_schema request
|
600
|
+
#
|
601
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
602
|
+
# # check the status of an operation, cancel it, or wait for results.
|
603
|
+
# # Here is how to wait for a response.
|
604
|
+
# result.wait_until_done! timeout: 60
|
605
|
+
# if result.response?
|
606
|
+
# p result.response
|
607
|
+
# else
|
608
|
+
# puts "No response received."
|
609
|
+
# end
|
610
|
+
#
|
486
611
|
def delete_schema request, options = nil
|
487
612
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
488
613
|
|
@@ -549,9 +674,9 @@ module Google
|
|
549
674
|
# end
|
550
675
|
#
|
551
676
|
# @!attribute [rw] endpoint
|
552
|
-
#
|
553
|
-
#
|
554
|
-
# @return [::String]
|
677
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
678
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
679
|
+
# @return [::String,nil]
|
555
680
|
# @!attribute [rw] credentials
|
556
681
|
# Credentials to send with calls. You may provide any of the following types:
|
557
682
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -588,13 +713,20 @@ module Google
|
|
588
713
|
# @!attribute [rw] quota_project
|
589
714
|
# A separate project against which to charge quota.
|
590
715
|
# @return [::String]
|
716
|
+
# @!attribute [rw] universe_domain
|
717
|
+
# The universe domain within which to make requests. This determines the
|
718
|
+
# default endpoint URL. The default value of nil uses the environment
|
719
|
+
# universe (usually the default "googleapis.com" universe).
|
720
|
+
# @return [::String,nil]
|
591
721
|
#
|
592
722
|
class Configuration
|
593
723
|
extend ::Gapic::Config
|
594
724
|
|
725
|
+
# @private
|
726
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
595
727
|
DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
|
596
728
|
|
597
|
-
config_attr :endpoint,
|
729
|
+
config_attr :endpoint, nil, ::String, nil
|
598
730
|
config_attr :credentials, nil do |value|
|
599
731
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
600
732
|
allowed.any? { |klass| klass === value }
|
@@ -606,6 +738,7 @@ module Google
|
|
606
738
|
config_attr :metadata, nil, ::Hash, nil
|
607
739
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
608
740
|
config_attr :quota_project, nil, ::String, nil
|
741
|
+
config_attr :universe_domain, nil, ::String, nil
|
609
742
|
|
610
743
|
# @private
|
611
744
|
def initialize parent_config = nil
|