google-cloud-app_engine-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google-cloud-app_engine-v1.rb +21 -0
  7. data/lib/google/appengine/v1/app_yaml_pb.rb +137 -0
  8. data/lib/google/appengine/v1/appengine_pb.rb +261 -0
  9. data/lib/google/appengine/v1/appengine_services_pb.rb +313 -0
  10. data/lib/google/appengine/v1/application_pb.rb +69 -0
  11. data/lib/google/appengine/v1/audit_data_pb.rb +35 -0
  12. data/lib/google/appengine/v1/certificate_pb.rb +52 -0
  13. data/lib/google/appengine/v1/deploy_pb.rb +47 -0
  14. data/lib/google/appengine/v1/deployed_files_pb.rb +19 -0
  15. data/lib/google/appengine/v1/domain_mapping_pb.rb +51 -0
  16. data/lib/google/appengine/v1/domain_pb.rb +24 -0
  17. data/lib/google/appengine/v1/firewall_pb.rb +32 -0
  18. data/lib/google/appengine/v1/instance_pb.rb +45 -0
  19. data/lib/google/appengine/v1/location_pb.rb +24 -0
  20. data/lib/google/appengine/v1/network_settings_pb.rb +19 -0
  21. data/lib/google/appengine/v1/operation_pb.rb +37 -0
  22. data/lib/google/appengine/v1/service_pb.rb +37 -0
  23. data/lib/google/appengine/v1/version_pb.rb +183 -0
  24. data/lib/google/cloud/app_engine/v1.rb +45 -0
  25. data/lib/google/cloud/app_engine/v1/applications.rb +49 -0
  26. data/lib/google/cloud/app_engine/v1/applications/client.rb +624 -0
  27. data/lib/google/cloud/app_engine/v1/applications/credentials.rb +53 -0
  28. data/lib/google/cloud/app_engine/v1/applications/operations.rb +655 -0
  29. data/lib/google/cloud/app_engine/v1/authorized_certificates.rb +49 -0
  30. data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +690 -0
  31. data/lib/google/cloud/app_engine/v1/authorized_certificates/credentials.rb +53 -0
  32. data/lib/google/cloud/app_engine/v1/authorized_domains.rb +50 -0
  33. data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +380 -0
  34. data/lib/google/cloud/app_engine/v1/authorized_domains/credentials.rb +53 -0
  35. data/lib/google/cloud/app_engine/v1/domain_mappings.rb +49 -0
  36. data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +705 -0
  37. data/lib/google/cloud/app_engine/v1/domain_mappings/credentials.rb +53 -0
  38. data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +655 -0
  39. data/lib/google/cloud/app_engine/v1/firewall.rb +57 -0
  40. data/lib/google/cloud/app_engine/v1/firewall/client.rb +783 -0
  41. data/lib/google/cloud/app_engine/v1/firewall/credentials.rb +53 -0
  42. data/lib/google/cloud/app_engine/v1/instances.rb +49 -0
  43. data/lib/google/cloud/app_engine/v1/instances/client.rb +644 -0
  44. data/lib/google/cloud/app_engine/v1/instances/credentials.rb +53 -0
  45. data/lib/google/cloud/app_engine/v1/instances/operations.rb +655 -0
  46. data/lib/google/cloud/app_engine/v1/services.rb +49 -0
  47. data/lib/google/cloud/app_engine/v1/services/client.rb +629 -0
  48. data/lib/google/cloud/app_engine/v1/services/credentials.rb +53 -0
  49. data/lib/google/cloud/app_engine/v1/services/operations.rb +655 -0
  50. data/lib/google/cloud/app_engine/v1/version.rb +28 -0
  51. data/lib/google/cloud/app_engine/v1/versions.rb +49 -0
  52. data/lib/google/cloud/app_engine/v1/versions/client.rb +738 -0
  53. data/lib/google/cloud/app_engine/v1/versions/credentials.rb +53 -0
  54. data/lib/google/cloud/app_engine/v1/versions/operations.rb +655 -0
  55. data/proto_docs/README.md +4 -0
  56. data/proto_docs/google/api/resource.rb +283 -0
  57. data/proto_docs/google/appengine/v1/app_yaml.rb +379 -0
  58. data/proto_docs/google/appengine/v1/appengine.rb +639 -0
  59. data/proto_docs/google/appengine/v1/application.rb +192 -0
  60. data/proto_docs/google/appengine/v1/audit_data.rb +56 -0
  61. data/proto_docs/google/appengine/v1/certificate.rb +161 -0
  62. data/proto_docs/google/appengine/v1/deploy.rb +130 -0
  63. data/proto_docs/google/appengine/v1/domain.rb +42 -0
  64. data/proto_docs/google/appengine/v1/domain_mapping.rb +127 -0
  65. data/proto_docs/google/appengine/v1/firewall.rb +72 -0
  66. data/proto_docs/google/appengine/v1/instance.rb +98 -0
  67. data/proto_docs/google/appengine/v1/location.rb +38 -0
  68. data/proto_docs/google/appengine/v1/operation.rb +67 -0
  69. data/proto_docs/google/appengine/v1/service.rb +100 -0
  70. data/proto_docs/google/appengine/v1/version.rb +597 -0
  71. data/proto_docs/google/longrunning/operations.rb +164 -0
  72. data/proto_docs/google/protobuf/any.rb +141 -0
  73. data/proto_docs/google/protobuf/duration.rb +98 -0
  74. data/proto_docs/google/protobuf/empty.rb +36 -0
  75. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  76. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  77. data/proto_docs/google/rpc/status.rb +46 -0
  78. metadata +261 -0
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module AppEngine
24
+ module V1
25
+ module AuthorizedDomains
26
+ # Credentials for the AuthorizedDomains API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/appengine.admin",
30
+ "https://www.googleapis.com/auth/cloud-platform",
31
+ "https://www.googleapis.com/auth/cloud-platform.read-only"
32
+ ]
33
+ self.env_vars = [
34
+ "APP_ENGINE_CREDENTIALS",
35
+ "APP_ENGINE_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS",
37
+ "GOOGLE_CLOUD_KEYFILE",
38
+ "GCLOUD_KEYFILE",
39
+ "APP_ENGINE_CREDENTIALS_JSON",
40
+ "APP_ENGINE_KEYFILE_JSON",
41
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
42
+ "GOOGLE_CLOUD_KEYFILE_JSON",
43
+ "GCLOUD_KEYFILE_JSON"
44
+ ]
45
+ self.paths = [
46
+ "~/.config/google_cloud/application_default_credentials.json"
47
+ ]
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/common"
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/domain_mappings/credentials"
26
+ require "google/cloud/app_engine/v1/domain_mappings/operations"
27
+ require "google/cloud/app_engine/v1/domain_mappings/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module AppEngine
32
+ module V1
33
+ ##
34
+ # Manages domains serving an application.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/app_engine/v1/domain_mappings"
39
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new
40
+ #
41
+ module DomainMappings
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "domain_mappings", "helpers.rb"
49
+ require "google/cloud/app_engine/v1/domain_mappings/helpers" if ::File.file? helper_path
@@ -0,0 +1,705 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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
+
22
+ module Google
23
+ module Cloud
24
+ module AppEngine
25
+ module V1
26
+ module DomainMappings
27
+ ##
28
+ # Client for the DomainMappings service.
29
+ #
30
+ # Manages domains serving an application.
31
+ #
32
+ class Client
33
+ # @private
34
+ attr_reader :domain_mappings_stub
35
+
36
+ ##
37
+ # Configure the DomainMappings Client class.
38
+ #
39
+ # See {::Google::Cloud::AppEngine::V1::DomainMappings::Client::Configuration}
40
+ # for a description of the configuration fields.
41
+ #
42
+ # ## Example
43
+ #
44
+ # To modify the configuration for all DomainMappings clients:
45
+ #
46
+ # ::Google::Cloud::AppEngine::V1::DomainMappings::Client.configure do |config|
47
+ # config.timeout = 10.0
48
+ # end
49
+ #
50
+ # @yield [config] Configure the Client client.
51
+ # @yieldparam config [Client::Configuration]
52
+ #
53
+ # @return [Client::Configuration]
54
+ #
55
+ def self.configure
56
+ @configure ||= begin
57
+ namespace = ["Google", "Cloud", "AppEngine", "V1"]
58
+ parent_config = while namespace.any?
59
+ parent_name = namespace.join "::"
60
+ parent_const = const_get parent_name
61
+ break parent_const.configure if parent_const&.respond_to? :configure
62
+ namespace.pop
63
+ end
64
+ default_config = Client::Configuration.new parent_config
65
+
66
+ default_config
67
+ end
68
+ yield @configure if block_given?
69
+ @configure
70
+ end
71
+
72
+ ##
73
+ # Configure the DomainMappings Client instance.
74
+ #
75
+ # The configuration is set to the derived mode, meaning that values can be changed,
76
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
77
+ # should be made on {Client.configure}.
78
+ #
79
+ # See {::Google::Cloud::AppEngine::V1::DomainMappings::Client::Configuration}
80
+ # for a description of the configuration fields.
81
+ #
82
+ # @yield [config] Configure the Client client.
83
+ # @yieldparam config [Client::Configuration]
84
+ #
85
+ # @return [Client::Configuration]
86
+ #
87
+ def configure
88
+ yield @config if block_given?
89
+ @config
90
+ end
91
+
92
+ ##
93
+ # Create a new DomainMappings client object.
94
+ #
95
+ # ## Examples
96
+ #
97
+ # To create a new DomainMappings client with the default
98
+ # configuration:
99
+ #
100
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new
101
+ #
102
+ # To create a new DomainMappings client with a custom
103
+ # configuration:
104
+ #
105
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the DomainMappings client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ def initialize
113
+ # These require statements are intentionally placed here to initialize
114
+ # the gRPC module only when it's required.
115
+ # See https://github.com/googleapis/toolkit/issues/446
116
+ require "gapic/grpc"
117
+ require "google/appengine/v1/appengine_services_pb"
118
+
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
130
+ @config.endpoint == Client.configure.endpoint &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @domain_mappings_stub = ::Gapic::ServiceStub.new(
146
+ ::Google::Cloud::AppEngine::V1::DomainMappings::Stub,
147
+ credentials: credentials,
148
+ endpoint: @config.endpoint,
149
+ channel_args: @config.channel_args,
150
+ interceptors: @config.interceptors
151
+ )
152
+ end
153
+
154
+ ##
155
+ # Get the associated client for long-running operations.
156
+ #
157
+ # @return [::Google::Cloud::AppEngine::V1::DomainMappings::Operations]
158
+ #
159
+ attr_reader :operations_client
160
+
161
+ # Service calls
162
+
163
+ ##
164
+ # Lists the domain mappings on an application.
165
+ #
166
+ # @overload list_domain_mappings(request, options = nil)
167
+ # Pass arguments to `list_domain_mappings` via a request object, either of type
168
+ # {::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest} or an equivalent Hash.
169
+ #
170
+ # @param request [::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest, ::Hash]
171
+ # A request object representing the call parameters. Required. To specify no
172
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
173
+ # @param options [::Gapic::CallOptions, ::Hash]
174
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
175
+ #
176
+ # @overload list_domain_mappings(parent: nil, page_size: nil, page_token: nil)
177
+ # Pass arguments to `list_domain_mappings` via keyword arguments. Note that at
178
+ # least one keyword argument is required. To specify no parameters, or to keep all
179
+ # the default parameter values, pass an empty Hash as a request object (see above).
180
+ #
181
+ # @param parent [::String]
182
+ # Name of the parent Application resource. Example: `apps/myapp`.
183
+ # @param page_size [::Integer]
184
+ # Maximum results to return per page.
185
+ # @param page_token [::String]
186
+ # Continuation token for fetching the next page of results.
187
+ #
188
+ # @yield [response, operation] Access the result along with the RPC operation
189
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::DomainMapping>]
190
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
191
+ #
192
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::DomainMapping>]
193
+ #
194
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
195
+ #
196
+ def list_domain_mappings request, options = nil
197
+ raise ::ArgumentError, "request must be provided" if request.nil?
198
+
199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListDomainMappingsRequest
200
+
201
+ # Converts hash and nil to an options object
202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
203
+
204
+ # Customize the options with defaults
205
+ metadata = @config.rpcs.list_domain_mappings.metadata.to_h
206
+
207
+ # Set x-goog-api-client and x-goog-user-project headers
208
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
210
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
211
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
212
+
213
+ header_params = {
214
+ "parent" => request.parent
215
+ }
216
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
217
+ metadata[:"x-goog-request-params"] ||= request_params_header
218
+
219
+ options.apply_defaults timeout: @config.rpcs.list_domain_mappings.timeout,
220
+ metadata: metadata,
221
+ retry_policy: @config.rpcs.list_domain_mappings.retry_policy
222
+ options.apply_defaults metadata: @config.metadata,
223
+ retry_policy: @config.retry_policy
224
+
225
+ @domain_mappings_stub.call_rpc :list_domain_mappings, request, options: options do |response, operation|
226
+ response = ::Gapic::PagedEnumerable.new @domain_mappings_stub, :list_domain_mappings, request, response, operation, options
227
+ yield response, operation if block_given?
228
+ return response
229
+ end
230
+ rescue ::GRPC::BadStatus => e
231
+ raise ::Google::Cloud::Error.from_error(e)
232
+ end
233
+
234
+ ##
235
+ # Gets the specified domain mapping.
236
+ #
237
+ # @overload get_domain_mapping(request, options = nil)
238
+ # Pass arguments to `get_domain_mapping` via a request object, either of type
239
+ # {::Google::Cloud::AppEngine::V1::GetDomainMappingRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::AppEngine::V1::GetDomainMappingRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
246
+ #
247
+ # @overload get_domain_mapping(name: nil)
248
+ # Pass arguments to `get_domain_mapping` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param name [::String]
253
+ # Name of the resource requested. Example:
254
+ # `apps/myapp/domainMappings/example.com`.
255
+ #
256
+ # @yield [response, operation] Access the result along with the RPC operation
257
+ # @yieldparam response [::Google::Cloud::AppEngine::V1::DomainMapping]
258
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
259
+ #
260
+ # @return [::Google::Cloud::AppEngine::V1::DomainMapping]
261
+ #
262
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
263
+ #
264
+ def get_domain_mapping request, options = nil
265
+ raise ::ArgumentError, "request must be provided" if request.nil?
266
+
267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetDomainMappingRequest
268
+
269
+ # Converts hash and nil to an options object
270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
271
+
272
+ # Customize the options with defaults
273
+ metadata = @config.rpcs.get_domain_mapping.metadata.to_h
274
+
275
+ # Set x-goog-api-client and x-goog-user-project headers
276
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
278
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
279
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
+
281
+ header_params = {
282
+ "name" => request.name
283
+ }
284
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
285
+ metadata[:"x-goog-request-params"] ||= request_params_header
286
+
287
+ options.apply_defaults timeout: @config.rpcs.get_domain_mapping.timeout,
288
+ metadata: metadata,
289
+ retry_policy: @config.rpcs.get_domain_mapping.retry_policy
290
+ options.apply_defaults metadata: @config.metadata,
291
+ retry_policy: @config.retry_policy
292
+
293
+ @domain_mappings_stub.call_rpc :get_domain_mapping, request, options: options do |response, operation|
294
+ yield response, operation if block_given?
295
+ return response
296
+ end
297
+ rescue ::GRPC::BadStatus => e
298
+ raise ::Google::Cloud::Error.from_error(e)
299
+ end
300
+
301
+ ##
302
+ # Maps a domain to an application. A user must be authorized to administer a
303
+ # domain in order to map it to an application. For a list of available
304
+ # authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().
305
+ #
306
+ # @overload create_domain_mapping(request, options = nil)
307
+ # Pass arguments to `create_domain_mapping` via a request object, either of type
308
+ # {::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
315
+ #
316
+ # @overload create_domain_mapping(parent: nil, domain_mapping: nil, override_strategy: nil)
317
+ # Pass arguments to `create_domain_mapping` via keyword arguments. Note that at
318
+ # least one keyword argument is required. To specify no parameters, or to keep all
319
+ # the default parameter values, pass an empty Hash as a request object (see above).
320
+ #
321
+ # @param parent [::String]
322
+ # Name of the parent Application resource. Example: `apps/myapp`.
323
+ # @param domain_mapping [::Google::Cloud::AppEngine::V1::DomainMapping, ::Hash]
324
+ # Domain mapping configuration.
325
+ # @param override_strategy [::Google::Cloud::AppEngine::V1::DomainOverrideStrategy]
326
+ # Whether the domain creation should override any existing mappings for this
327
+ # domain. By default, overrides are rejected.
328
+ #
329
+ # @yield [response, operation] Access the result along with the RPC operation
330
+ # @yieldparam response [::Gapic::Operation]
331
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
332
+ #
333
+ # @return [::Gapic::Operation]
334
+ #
335
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
+ #
337
+ def create_domain_mapping request, options = nil
338
+ raise ::ArgumentError, "request must be provided" if request.nil?
339
+
340
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateDomainMappingRequest
341
+
342
+ # Converts hash and nil to an options object
343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
344
+
345
+ # Customize the options with defaults
346
+ metadata = @config.rpcs.create_domain_mapping.metadata.to_h
347
+
348
+ # Set x-goog-api-client and x-goog-user-project headers
349
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
351
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
352
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ header_params = {
355
+ "parent" => request.parent
356
+ }
357
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
+ metadata[:"x-goog-request-params"] ||= request_params_header
359
+
360
+ options.apply_defaults timeout: @config.rpcs.create_domain_mapping.timeout,
361
+ metadata: metadata,
362
+ retry_policy: @config.rpcs.create_domain_mapping.retry_policy
363
+ options.apply_defaults metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @domain_mappings_stub.call_rpc :create_domain_mapping, request, options: options do |response, operation|
367
+ response = ::Gapic::Operation.new response, @operations_client, options: options
368
+ yield response, operation if block_given?
369
+ return response
370
+ end
371
+ rescue ::GRPC::BadStatus => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Updates the specified domain mapping. To map an SSL certificate to a
377
+ # domain mapping, update `certificate_id` to point to an `AuthorizedCertificate`
378
+ # resource. A user must be authorized to administer the associated domain
379
+ # in order to update a `DomainMapping` resource.
380
+ #
381
+ # @overload update_domain_mapping(request, options = nil)
382
+ # Pass arguments to `update_domain_mapping` via a request object, either of type
383
+ # {::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest} or an equivalent Hash.
384
+ #
385
+ # @param request [::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest, ::Hash]
386
+ # A request object representing the call parameters. Required. To specify no
387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
388
+ # @param options [::Gapic::CallOptions, ::Hash]
389
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
390
+ #
391
+ # @overload update_domain_mapping(name: nil, domain_mapping: nil, update_mask: nil)
392
+ # Pass arguments to `update_domain_mapping` via keyword arguments. Note that at
393
+ # least one keyword argument is required. To specify no parameters, or to keep all
394
+ # the default parameter values, pass an empty Hash as a request object (see above).
395
+ #
396
+ # @param name [::String]
397
+ # Name of the resource to update. Example:
398
+ # `apps/myapp/domainMappings/example.com`.
399
+ # @param domain_mapping [::Google::Cloud::AppEngine::V1::DomainMapping, ::Hash]
400
+ # A domain mapping containing the updated resource. Only fields set
401
+ # in the field mask will be updated.
402
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
403
+ # Standard field mask for the set of fields to be updated.
404
+ #
405
+ # @yield [response, operation] Access the result along with the RPC operation
406
+ # @yieldparam response [::Gapic::Operation]
407
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
408
+ #
409
+ # @return [::Gapic::Operation]
410
+ #
411
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
412
+ #
413
+ def update_domain_mapping request, options = nil
414
+ raise ::ArgumentError, "request must be provided" if request.nil?
415
+
416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest
417
+
418
+ # Converts hash and nil to an options object
419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
420
+
421
+ # Customize the options with defaults
422
+ metadata = @config.rpcs.update_domain_mapping.metadata.to_h
423
+
424
+ # Set x-goog-api-client and x-goog-user-project headers
425
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
426
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
427
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
428
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
429
+
430
+ header_params = {
431
+ "name" => request.name
432
+ }
433
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
434
+ metadata[:"x-goog-request-params"] ||= request_params_header
435
+
436
+ options.apply_defaults timeout: @config.rpcs.update_domain_mapping.timeout,
437
+ metadata: metadata,
438
+ retry_policy: @config.rpcs.update_domain_mapping.retry_policy
439
+ options.apply_defaults metadata: @config.metadata,
440
+ retry_policy: @config.retry_policy
441
+
442
+ @domain_mappings_stub.call_rpc :update_domain_mapping, request, options: options do |response, operation|
443
+ response = ::Gapic::Operation.new response, @operations_client, options: options
444
+ yield response, operation if block_given?
445
+ return response
446
+ end
447
+ rescue ::GRPC::BadStatus => e
448
+ raise ::Google::Cloud::Error.from_error(e)
449
+ end
450
+
451
+ ##
452
+ # Deletes the specified domain mapping. A user must be authorized to
453
+ # administer the associated domain in order to delete a `DomainMapping`
454
+ # resource.
455
+ #
456
+ # @overload delete_domain_mapping(request, options = nil)
457
+ # Pass arguments to `delete_domain_mapping` via a request object, either of type
458
+ # {::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
465
+ #
466
+ # @overload delete_domain_mapping(name: nil)
467
+ # Pass arguments to `delete_domain_mapping` via keyword arguments. Note that at
468
+ # least one keyword argument is required. To specify no parameters, or to keep all
469
+ # the default parameter values, pass an empty Hash as a request object (see above).
470
+ #
471
+ # @param name [::String]
472
+ # Name of the resource to delete. Example:
473
+ # `apps/myapp/domainMappings/example.com`.
474
+ #
475
+ # @yield [response, operation] Access the result along with the RPC operation
476
+ # @yieldparam response [::Gapic::Operation]
477
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
478
+ #
479
+ # @return [::Gapic::Operation]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
482
+ #
483
+ def delete_domain_mapping request, options = nil
484
+ raise ::ArgumentError, "request must be provided" if request.nil?
485
+
486
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest
487
+
488
+ # Converts hash and nil to an options object
489
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
490
+
491
+ # Customize the options with defaults
492
+ metadata = @config.rpcs.delete_domain_mapping.metadata.to_h
493
+
494
+ # Set x-goog-api-client and x-goog-user-project headers
495
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
496
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
497
+ gapic_version: ::Google::Cloud::AppEngine::V1::VERSION
498
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
499
+
500
+ header_params = {
501
+ "name" => request.name
502
+ }
503
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
504
+ metadata[:"x-goog-request-params"] ||= request_params_header
505
+
506
+ options.apply_defaults timeout: @config.rpcs.delete_domain_mapping.timeout,
507
+ metadata: metadata,
508
+ retry_policy: @config.rpcs.delete_domain_mapping.retry_policy
509
+ options.apply_defaults metadata: @config.metadata,
510
+ retry_policy: @config.retry_policy
511
+
512
+ @domain_mappings_stub.call_rpc :delete_domain_mapping, request, options: options do |response, operation|
513
+ response = ::Gapic::Operation.new response, @operations_client, options: options
514
+ yield response, operation if block_given?
515
+ return response
516
+ end
517
+ rescue ::GRPC::BadStatus => e
518
+ raise ::Google::Cloud::Error.from_error(e)
519
+ end
520
+
521
+ ##
522
+ # Configuration class for the DomainMappings API.
523
+ #
524
+ # This class represents the configuration for DomainMappings,
525
+ # providing control over timeouts, retry behavior, logging, transport
526
+ # parameters, and other low-level controls. Certain parameters can also be
527
+ # applied individually to specific RPCs. See
528
+ # {::Google::Cloud::AppEngine::V1::DomainMappings::Client::Configuration::Rpcs}
529
+ # for a list of RPCs that can be configured independently.
530
+ #
531
+ # Configuration can be applied globally to all clients, or to a single client
532
+ # on construction.
533
+ #
534
+ # # Examples
535
+ #
536
+ # To modify the global config, setting the timeout for list_domain_mappings
537
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
538
+ #
539
+ # ::Google::Cloud::AppEngine::V1::DomainMappings::Client.configure do |config|
540
+ # config.timeout = 10.0
541
+ # config.rpcs.list_domain_mappings.timeout = 20.0
542
+ # end
543
+ #
544
+ # To apply the above configuration only to a new client:
545
+ #
546
+ # client = ::Google::Cloud::AppEngine::V1::DomainMappings::Client.new do |config|
547
+ # config.timeout = 10.0
548
+ # config.rpcs.list_domain_mappings.timeout = 20.0
549
+ # end
550
+ #
551
+ # @!attribute [rw] endpoint
552
+ # The hostname or hostname:port of the service endpoint.
553
+ # Defaults to `"appengine.googleapis.com"`.
554
+ # @return [::String]
555
+ # @!attribute [rw] credentials
556
+ # Credentials to send with calls. You may provide any of the following types:
557
+ # * (`String`) The path to a service account key file in JSON format
558
+ # * (`Hash`) A service account key as a Hash
559
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
560
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
561
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
562
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
563
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
564
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
565
+ # * (`nil`) indicating no credentials
566
+ # @return [::Object]
567
+ # @!attribute [rw] scope
568
+ # The OAuth scopes
569
+ # @return [::Array<::String>]
570
+ # @!attribute [rw] lib_name
571
+ # The library name as recorded in instrumentation and logging
572
+ # @return [::String]
573
+ # @!attribute [rw] lib_version
574
+ # The library version as recorded in instrumentation and logging
575
+ # @return [::String]
576
+ # @!attribute [rw] channel_args
577
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
578
+ # `GRPC::Core::Channel` object is provided as the credential.
579
+ # @return [::Hash]
580
+ # @!attribute [rw] interceptors
581
+ # An array of interceptors that are run before calls are executed.
582
+ # @return [::Array<::GRPC::ClientInterceptor>]
583
+ # @!attribute [rw] timeout
584
+ # The call timeout in seconds.
585
+ # @return [::Numeric]
586
+ # @!attribute [rw] metadata
587
+ # Additional gRPC headers to be sent with the call.
588
+ # @return [::Hash{::Symbol=>::String}]
589
+ # @!attribute [rw] retry_policy
590
+ # The retry policy. The value is a hash with the following keys:
591
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
592
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
593
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
594
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
595
+ # trigger a retry.
596
+ # @return [::Hash]
597
+ # @!attribute [rw] quota_project
598
+ # A separate project against which to charge quota.
599
+ # @return [::String]
600
+ #
601
+ class Configuration
602
+ extend ::Gapic::Config
603
+
604
+ config_attr :endpoint, "appengine.googleapis.com", ::String
605
+ config_attr :credentials, nil do |value|
606
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
607
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
608
+ allowed.any? { |klass| klass === value }
609
+ end
610
+ config_attr :scope, nil, ::String, ::Array, nil
611
+ config_attr :lib_name, nil, ::String, nil
612
+ config_attr :lib_version, nil, ::String, nil
613
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
614
+ config_attr :interceptors, nil, ::Array, nil
615
+ config_attr :timeout, nil, ::Numeric, nil
616
+ config_attr :metadata, nil, ::Hash, nil
617
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
618
+ config_attr :quota_project, nil, ::String, nil
619
+
620
+ # @private
621
+ def initialize parent_config = nil
622
+ @parent_config = parent_config unless parent_config.nil?
623
+
624
+ yield self if block_given?
625
+ end
626
+
627
+ ##
628
+ # Configurations for individual RPCs
629
+ # @return [Rpcs]
630
+ #
631
+ def rpcs
632
+ @rpcs ||= begin
633
+ parent_rpcs = nil
634
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
635
+ Rpcs.new parent_rpcs
636
+ end
637
+ end
638
+
639
+ ##
640
+ # Configuration RPC class for the DomainMappings API.
641
+ #
642
+ # Includes fields providing the configuration for each RPC in this service.
643
+ # Each configuration object is of type `Gapic::Config::Method` and includes
644
+ # the following configuration fields:
645
+ #
646
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
647
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
648
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
649
+ # include the following keys:
650
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
651
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
652
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
653
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
654
+ # trigger a retry.
655
+ #
656
+ class Rpcs
657
+ ##
658
+ # RPC-specific configuration for `list_domain_mappings`
659
+ # @return [::Gapic::Config::Method]
660
+ #
661
+ attr_reader :list_domain_mappings
662
+ ##
663
+ # RPC-specific configuration for `get_domain_mapping`
664
+ # @return [::Gapic::Config::Method]
665
+ #
666
+ attr_reader :get_domain_mapping
667
+ ##
668
+ # RPC-specific configuration for `create_domain_mapping`
669
+ # @return [::Gapic::Config::Method]
670
+ #
671
+ attr_reader :create_domain_mapping
672
+ ##
673
+ # RPC-specific configuration for `update_domain_mapping`
674
+ # @return [::Gapic::Config::Method]
675
+ #
676
+ attr_reader :update_domain_mapping
677
+ ##
678
+ # RPC-specific configuration for `delete_domain_mapping`
679
+ # @return [::Gapic::Config::Method]
680
+ #
681
+ attr_reader :delete_domain_mapping
682
+
683
+ # @private
684
+ def initialize parent_rpcs = nil
685
+ list_domain_mappings_config = parent_rpcs&.list_domain_mappings if parent_rpcs&.respond_to? :list_domain_mappings
686
+ @list_domain_mappings = ::Gapic::Config::Method.new list_domain_mappings_config
687
+ get_domain_mapping_config = parent_rpcs&.get_domain_mapping if parent_rpcs&.respond_to? :get_domain_mapping
688
+ @get_domain_mapping = ::Gapic::Config::Method.new get_domain_mapping_config
689
+ create_domain_mapping_config = parent_rpcs&.create_domain_mapping if parent_rpcs&.respond_to? :create_domain_mapping
690
+ @create_domain_mapping = ::Gapic::Config::Method.new create_domain_mapping_config
691
+ update_domain_mapping_config = parent_rpcs&.update_domain_mapping if parent_rpcs&.respond_to? :update_domain_mapping
692
+ @update_domain_mapping = ::Gapic::Config::Method.new update_domain_mapping_config
693
+ delete_domain_mapping_config = parent_rpcs&.delete_domain_mapping if parent_rpcs&.respond_to? :delete_domain_mapping
694
+ @delete_domain_mapping = ::Gapic::Config::Method.new delete_domain_mapping_config
695
+
696
+ yield self if block_given?
697
+ end
698
+ end
699
+ end
700
+ end
701
+ end
702
+ end
703
+ end
704
+ end
705
+ end