google-cloud-app_engine-v1 0.4.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +12 -7
  4. data/lib/google/appengine/v1/appengine_pb.rb +0 -1
  5. data/lib/google/cloud/app_engine/v1/applications/client.rb +12 -12
  6. data/lib/google/cloud/app_engine/v1/applications/operations.rb +15 -14
  7. data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +589 -0
  8. data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +793 -0
  9. data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +285 -0
  10. data/lib/google/cloud/app_engine/v1/applications/rest.rb +52 -0
  11. data/lib/google/cloud/app_engine/v1/applications.rb +7 -1
  12. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +4 -6
  13. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +643 -0
  14. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +345 -0
  15. data/lib/google/cloud/app_engine/v1/authorized_certificates/rest.rb +52 -0
  16. data/lib/google/cloud/app_engine/v1/authorized_certificates.rb +7 -1
  17. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +4 -6
  18. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +349 -0
  19. data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +107 -0
  20. data/lib/google/cloud/app_engine/v1/authorized_domains/rest.rb +53 -0
  21. data/lib/google/cloud/app_engine/v1/authorized_domains.rb +7 -1
  22. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +16 -18
  23. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +15 -14
  24. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +659 -0
  25. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +793 -0
  26. data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +345 -0
  27. data/lib/google/cloud/app_engine/v1/domain_mappings/rest.rb +52 -0
  28. data/lib/google/cloud/app_engine/v1/domain_mappings.rb +7 -1
  29. data/lib/google/cloud/app_engine/v1/firewall/client.rb +4 -6
  30. data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +732 -0
  31. data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +405 -0
  32. data/lib/google/cloud/app_engine/v1/firewall/rest.rb +60 -0
  33. data/lib/google/cloud/app_engine/v1/firewall.rb +7 -1
  34. data/lib/google/cloud/app_engine/v1/instances/client.rb +12 -14
  35. data/lib/google/cloud/app_engine/v1/instances/operations.rb +15 -14
  36. data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +602 -0
  37. data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +793 -0
  38. data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +285 -0
  39. data/lib/google/cloud/app_engine/v1/instances/rest.rb +52 -0
  40. data/lib/google/cloud/app_engine/v1/instances.rb +7 -1
  41. data/lib/google/cloud/app_engine/v1/rest.rb +44 -0
  42. data/lib/google/cloud/app_engine/v1/services/client.rb +12 -14
  43. data/lib/google/cloud/app_engine/v1/services/operations.rb +15 -14
  44. data/lib/google/cloud/app_engine/v1/services/rest/client.rb +587 -0
  45. data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +793 -0
  46. data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +285 -0
  47. data/lib/google/cloud/app_engine/v1/services/rest.rb +52 -0
  48. data/lib/google/cloud/app_engine/v1/services.rb +7 -1
  49. data/lib/google/cloud/app_engine/v1/version.rb +1 -1
  50. data/lib/google/cloud/app_engine/v1/versions/client.rb +16 -18
  51. data/lib/google/cloud/app_engine/v1/versions/operations.rb +15 -14
  52. data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +692 -0
  53. data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +793 -0
  54. data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +345 -0
  55. data/lib/google/cloud/app_engine/v1/versions/rest.rb +52 -0
  56. data/lib/google/cloud/app_engine/v1/versions.rb +7 -1
  57. data/lib/google/cloud/app_engine/v1.rb +7 -2
  58. data/proto_docs/google/api/client.rb +318 -0
  59. data/proto_docs/google/api/launch_stage.rb +71 -0
  60. data/proto_docs/google/protobuf/empty.rb +0 -2
  61. data/proto_docs/google/rpc/status.rb +4 -2
  62. metadata +45 -13
@@ -0,0 +1,349 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/appengine/v1/appengine_pb"
21
+ require "google/cloud/app_engine/v1/authorized_domains/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module AppEngine
26
+ module V1
27
+ module AuthorizedDomains
28
+ module Rest
29
+ ##
30
+ # REST client for the AuthorizedDomains service.
31
+ #
32
+ # Manages domains a user is authorized to administer. To authorize use of a
33
+ # domain, verify ownership via
34
+ # [Webmaster Central](https://www.google.com/webmasters/verification/home).
35
+ #
36
+ class Client
37
+ # @private
38
+ attr_reader :authorized_domains_stub
39
+
40
+ ##
41
+ # Configure the AuthorizedDomains Client class.
42
+ #
43
+ # See {::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all AuthorizedDomains clients
49
+ # ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "AppEngine", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the AuthorizedDomains Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new AuthorizedDomains REST client object.
97
+ #
98
+ # @example
99
+ #
100
+ # # Create a client using the default configuration
101
+ # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new
102
+ #
103
+ # # Create a client using a custom configuration
104
+ # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new do |config|
105
+ # config.timeout = 10.0
106
+ # end
107
+ #
108
+ # @yield [config] Configure the AuthorizedDomains client.
109
+ # @yieldparam config [Client::Configuration]
110
+ #
111
+ def initialize
112
+ # Create the configuration object
113
+ @config = Configuration.new Client.configure
114
+
115
+ # Yield the configuration if needed
116
+ yield @config if block_given?
117
+
118
+ # Create credentials
119
+ credentials = @config.credentials
120
+ # Use self-signed JWT if the endpoint is unchanged from default,
121
+ # but only if the default endpoint does not have a region prefix.
122
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
123
+ !@config.endpoint.split(".").first.include?("-")
124
+ credentials ||= Credentials.default scope: @config.scope,
125
+ enable_self_signed_jwt: enable_self_signed_jwt
126
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
127
+ credentials = Credentials.new credentials, scope: @config.scope
128
+ end
129
+
130
+ @quota_project_id = @config.quota_project
131
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
132
+
133
+ @authorized_domains_stub = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
134
+ end
135
+
136
+ # Service calls
137
+
138
+ ##
139
+ # Lists all domains the user is authorized to administer.
140
+ #
141
+ # @overload list_authorized_domains(request, options = nil)
142
+ # Pass arguments to `list_authorized_domains` via a request object, either of type
143
+ # {::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest, ::Hash]
146
+ # A request object representing the call parameters. Required. To specify no
147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
148
+ # @param options [::Gapic::CallOptions, ::Hash]
149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
150
+ #
151
+ # @overload list_authorized_domains(parent: nil, page_size: nil, page_token: nil)
152
+ # Pass arguments to `list_authorized_domains` via keyword arguments. Note that at
153
+ # least one keyword argument is required. To specify no parameters, or to keep all
154
+ # the default parameter values, pass an empty Hash as a request object (see above).
155
+ #
156
+ # @param parent [::String]
157
+ # Name of the parent Application resource. Example: `apps/myapp`.
158
+ # @param page_size [::Integer]
159
+ # Maximum results to return per page.
160
+ # @param page_token [::String]
161
+ # Continuation token for fetching the next page of results.
162
+ # @yield [result, operation] Access the result along with the TransportOperation object
163
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::AuthorizedDomain>]
164
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
165
+ #
166
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::AuthorizedDomain>]
167
+ #
168
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
169
+ def list_authorized_domains request, options = nil
170
+ raise ::ArgumentError, "request must be provided" if request.nil?
171
+
172
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest
173
+
174
+ # Converts hash and nil to an options object
175
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
176
+
177
+ # Customize the options with defaults
178
+ call_metadata = @config.rpcs.list_authorized_domains.metadata.to_h
179
+
180
+ # Set x-goog-api-client and x-goog-user-project headers
181
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
182
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
183
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
184
+ transports_version_send: [:rest]
185
+
186
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
187
+
188
+ options.apply_defaults timeout: @config.rpcs.list_authorized_domains.timeout,
189
+ metadata: call_metadata,
190
+ retry_policy: @config.rpcs.list_authorized_domains.retry_policy
191
+
192
+ options.apply_defaults timeout: @config.timeout,
193
+ metadata: @config.metadata,
194
+ retry_policy: @config.retry_policy
195
+
196
+ @authorized_domains_stub.list_authorized_domains request, options do |result, operation|
197
+ result = ::Gapic::Rest::PagedEnumerable.new @authorized_domains_stub, :list_authorized_domains, "domains", request, result, options
198
+ yield result, operation if block_given?
199
+ return result
200
+ end
201
+ rescue ::Gapic::Rest::Error => e
202
+ raise ::Google::Cloud::Error.from_error(e)
203
+ end
204
+
205
+ ##
206
+ # Configuration class for the AuthorizedDomains REST API.
207
+ #
208
+ # This class represents the configuration for AuthorizedDomains REST,
209
+ # providing control over timeouts, retry behavior, logging, transport
210
+ # parameters, and other low-level controls. Certain parameters can also be
211
+ # applied individually to specific RPCs. See
212
+ # {::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client::Configuration::Rpcs}
213
+ # for a list of RPCs that can be configured independently.
214
+ #
215
+ # Configuration can be applied globally to all clients, or to a single client
216
+ # on construction.
217
+ #
218
+ # @example
219
+ #
220
+ # # Modify the global config, setting the timeout for
221
+ # # list_authorized_domains to 20 seconds,
222
+ # # and all remaining timeouts to 10 seconds.
223
+ # ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.configure do |config|
224
+ # config.timeout = 10.0
225
+ # config.rpcs.list_authorized_domains.timeout = 20.0
226
+ # end
227
+ #
228
+ # # Apply the above configuration only to a new client.
229
+ # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new do |config|
230
+ # config.timeout = 10.0
231
+ # config.rpcs.list_authorized_domains.timeout = 20.0
232
+ # end
233
+ #
234
+ # @!attribute [rw] endpoint
235
+ # The hostname or hostname:port of the service endpoint.
236
+ # Defaults to `"appengine.googleapis.com"`.
237
+ # @return [::String]
238
+ # @!attribute [rw] credentials
239
+ # Credentials to send with calls. You may provide any of the following types:
240
+ # * (`String`) The path to a service account key file in JSON format
241
+ # * (`Hash`) A service account key as a Hash
242
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
243
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
244
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
245
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
246
+ # * (`nil`) indicating no credentials
247
+ # @return [::Object]
248
+ # @!attribute [rw] scope
249
+ # The OAuth scopes
250
+ # @return [::Array<::String>]
251
+ # @!attribute [rw] lib_name
252
+ # The library name as recorded in instrumentation and logging
253
+ # @return [::String]
254
+ # @!attribute [rw] lib_version
255
+ # The library version as recorded in instrumentation and logging
256
+ # @return [::String]
257
+ # @!attribute [rw] timeout
258
+ # The call timeout in seconds.
259
+ # @return [::Numeric]
260
+ # @!attribute [rw] metadata
261
+ # Additional headers to be sent with the call.
262
+ # @return [::Hash{::Symbol=>::String}]
263
+ # @!attribute [rw] retry_policy
264
+ # The retry policy. The value is a hash with the following keys:
265
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
266
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
267
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
268
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
269
+ # trigger a retry.
270
+ # @return [::Hash]
271
+ # @!attribute [rw] quota_project
272
+ # A separate project against which to charge quota.
273
+ # @return [::String]
274
+ #
275
+ class Configuration
276
+ extend ::Gapic::Config
277
+
278
+ config_attr :endpoint, "appengine.googleapis.com", ::String
279
+ config_attr :credentials, nil do |value|
280
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
281
+ allowed.any? { |klass| klass === value }
282
+ end
283
+ config_attr :scope, nil, ::String, ::Array, nil
284
+ config_attr :lib_name, nil, ::String, nil
285
+ config_attr :lib_version, nil, ::String, nil
286
+ config_attr :timeout, nil, ::Numeric, nil
287
+ config_attr :metadata, nil, ::Hash, nil
288
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
289
+ config_attr :quota_project, nil, ::String, nil
290
+
291
+ # @private
292
+ def initialize parent_config = nil
293
+ @parent_config = parent_config unless parent_config.nil?
294
+
295
+ yield self if block_given?
296
+ end
297
+
298
+ ##
299
+ # Configurations for individual RPCs
300
+ # @return [Rpcs]
301
+ #
302
+ def rpcs
303
+ @rpcs ||= begin
304
+ parent_rpcs = nil
305
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
306
+ Rpcs.new parent_rpcs
307
+ end
308
+ end
309
+
310
+ ##
311
+ # Configuration RPC class for the AuthorizedDomains API.
312
+ #
313
+ # Includes fields providing the configuration for each RPC in this service.
314
+ # Each configuration object is of type `Gapic::Config::Method` and includes
315
+ # the following configuration fields:
316
+ #
317
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
318
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
319
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
320
+ # include the following keys:
321
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
322
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
323
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
324
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
325
+ # trigger a retry.
326
+ #
327
+ class Rpcs
328
+ ##
329
+ # RPC-specific configuration for `list_authorized_domains`
330
+ # @return [::Gapic::Config::Method]
331
+ #
332
+ attr_reader :list_authorized_domains
333
+
334
+ # @private
335
+ def initialize parent_rpcs = nil
336
+ list_authorized_domains_config = parent_rpcs.list_authorized_domains if parent_rpcs.respond_to? :list_authorized_domains
337
+ @list_authorized_domains = ::Gapic::Config::Method.new list_authorized_domains_config
338
+
339
+ yield self if block_given?
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
348
+ end
349
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/appengine/v1/appengine_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module AppEngine
24
+ module V1
25
+ module AuthorizedDomains
26
+ module Rest
27
+ ##
28
+ # REST service stub for the AuthorizedDomains service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
39
+ numeric_enums: true,
40
+ raise_faraday_errors: false
41
+ end
42
+
43
+ ##
44
+ # Baseline implementation for the list_authorized_domains REST call
45
+ #
46
+ # @param request_pb [::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest]
47
+ # A request object representing the call parameters. Required.
48
+ # @param options [::Gapic::CallOptions]
49
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
50
+ #
51
+ # @yield [result, operation] Access the result along with the TransportOperation object
52
+ # @yieldparam result [::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsResponse]
56
+ # A result object deserialized from the server's reply
57
+ def list_authorized_domains request_pb, options = nil
58
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
59
+
60
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_authorized_domains_request request_pb
61
+ query_string_params = if query_string_params.any?
62
+ query_string_params.to_h { |p| p.split("=", 2) }
63
+ else
64
+ {}
65
+ end
66
+
67
+ response = @client_stub.make_http_request(
68
+ verb,
69
+ uri: uri,
70
+ body: body || "",
71
+ params: query_string_params,
72
+ options: options
73
+ )
74
+ operation = ::Gapic::Rest::TransportOperation.new response
75
+ result = ::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsResponse.decode_json response.body, ignore_unknown_fields: true
76
+
77
+ yield result, operation if block_given?
78
+ result
79
+ end
80
+
81
+ ##
82
+ # @private
83
+ #
84
+ # GRPC transcoding helper method for the list_authorized_domains REST call
85
+ #
86
+ # @param request_pb [::Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest]
87
+ # A request object representing the call parameters. Required.
88
+ # @return [Array(String, [String, nil], Hash{String => String})]
89
+ # Uri, Body, Query string parameters
90
+ def self.transcode_list_authorized_domains_request request_pb
91
+ transcoder = Gapic::Rest::GrpcTranscoder.new
92
+ .with_bindings(
93
+ uri_method: :get,
94
+ uri_template: "/v1/{parent}/authorizedDomains",
95
+ matches: [
96
+ ["parent", %r{^apps/[^/]+/?$}, false]
97
+ ]
98
+ )
99
+ transcoder.transcode request_pb
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/app_engine/v1/version"
24
+
25
+ require "google/cloud/app_engine/v1/authorized_domains/credentials"
26
+ require "google/cloud/app_engine/v1/authorized_domains/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module AppEngine
31
+ module V1
32
+ ##
33
+ # Manages domains a user is authorized to administer. To authorize use of a
34
+ # domain, verify ownership via
35
+ # [Webmaster Central](https://www.google.com/webmasters/verification/home).
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/app_engine/v1/authorized_domains/rest"
40
+ # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new
41
+ #
42
+ module AuthorizedDomains
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/app_engine/v1/authorized_domains/rest/helpers" if ::File.file? helper_path
@@ -24,6 +24,7 @@ require "google/cloud/app_engine/v1/version"
24
24
 
25
25
  require "google/cloud/app_engine/v1/authorized_domains/credentials"
26
26
  require "google/cloud/app_engine/v1/authorized_domains/client"
27
+ require "google/cloud/app_engine/v1/authorized_domains/rest"
27
28
 
28
29
  module Google
29
30
  module Cloud
@@ -34,11 +35,16 @@ module Google
34
35
  # domain, verify ownership via
35
36
  # [Webmaster Central](https://www.google.com/webmasters/verification/home).
36
37
  #
37
- # To load this service and instantiate a client:
38
+ # @example Load this service and instantiate a gRPC client
38
39
  #
39
40
  # require "google/cloud/app_engine/v1/authorized_domains"
40
41
  # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Client.new
41
42
  #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/app_engine/v1/authorized_domains/rest"
46
+ # client = ::Google::Cloud::AppEngine::V1::AuthorizedDomains::Rest::Client.new
47
+ #
42
48
  module AuthorizedDomains
43
49
  end
44
50
  end
@@ -200,13 +200,11 @@ module Google
200
200
  # # Call the list_domain_mappings method.
201
201
  # result = client.list_domain_mappings request
202
202
  #
203
- # # The returned object is of type Gapic::PagedEnumerable. You can
204
- # # iterate over all elements by calling #each, and the enumerable
205
- # # will lazily make API calls to fetch subsequent pages. Other
206
- # # methods are also available for managing paging directly.
207
- # result.each do |response|
203
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
204
+ # # over elements, and API calls will be issued to fetch pages as needed.
205
+ # result.each do |item|
208
206
  # # Each element is of type ::Google::Cloud::AppEngine::V1::DomainMapping.
209
- # p response
207
+ # p item
210
208
  # end
211
209
  #
212
210
  def list_domain_mappings request, options = nil
@@ -385,14 +383,14 @@ module Google
385
383
  # # Call the create_domain_mapping method.
386
384
  # result = client.create_domain_mapping request
387
385
  #
388
- # # The returned object is of type Gapic::Operation. You can use this
389
- # # object to check the status of an operation, cancel it, or wait
390
- # # for results. Here is how to block until completion:
386
+ # # The returned object is of type Gapic::Operation. You can use it to
387
+ # # check the status of an operation, cancel it, or wait for results.
388
+ # # Here is how to wait for a response.
391
389
  # result.wait_until_done! timeout: 60
392
390
  # if result.response?
393
391
  # p result.response
394
392
  # else
395
- # puts "Error!"
393
+ # puts "No response received."
396
394
  # end
397
395
  #
398
396
  def create_domain_mapping request, options = nil
@@ -487,14 +485,14 @@ module Google
487
485
  # # Call the update_domain_mapping method.
488
486
  # result = client.update_domain_mapping request
489
487
  #
490
- # # The returned object is of type Gapic::Operation. You can use this
491
- # # object to check the status of an operation, cancel it, or wait
492
- # # for results. Here is how to block until completion:
488
+ # # The returned object is of type Gapic::Operation. You can use it to
489
+ # # check the status of an operation, cancel it, or wait for results.
490
+ # # Here is how to wait for a response.
493
491
  # result.wait_until_done! timeout: 60
494
492
  # if result.response?
495
493
  # p result.response
496
494
  # else
497
- # puts "Error!"
495
+ # puts "No response received."
498
496
  # end
499
497
  #
500
498
  def update_domain_mapping request, options = nil
@@ -583,14 +581,14 @@ module Google
583
581
  # # Call the delete_domain_mapping method.
584
582
  # result = client.delete_domain_mapping request
585
583
  #
586
- # # The returned object is of type Gapic::Operation. You can use this
587
- # # object to check the status of an operation, cancel it, or wait
588
- # # for results. Here is how to block until completion:
584
+ # # The returned object is of type Gapic::Operation. You can use it to
585
+ # # check the status of an operation, cancel it, or wait for results.
586
+ # # Here is how to wait for a response.
589
587
  # result.wait_until_done! timeout: 60
590
588
  # if result.response?
591
589
  # p result.response
592
590
  # else
593
- # puts "Error!"
591
+ # puts "No response received."
594
592
  # end
595
593
  #
596
594
  def delete_domain_mapping request, options = nil