google-cloud-compute-v1 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +4 -24
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +6 -34
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +8 -44
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +8 -42
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +14 -66
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +8137 -7777
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +4 -24
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +11 -59
  10. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +4 -22
  11. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +13 -63
  12. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +6 -32
  13. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +9 -49
  14. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +4 -22
  15. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +7 -33
  16. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +8 -44
  17. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +6 -30
  18. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +2 -12
  19. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +5 -27
  20. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +8 -44
  21. data/lib/google/cloud/compute/v1/image_family_views/credentials.rb +53 -0
  22. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +313 -0
  23. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +89 -0
  24. data/lib/google/cloud/compute/v1/image_family_views/rest.rb +33 -0
  25. data/lib/google/cloud/compute/v1/image_family_views.rb +44 -0
  26. data/lib/google/cloud/compute/v1/images/rest/client.rb +7 -35
  27. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +30 -150
  28. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +16 -72
  29. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +4 -22
  30. data/lib/google/cloud/compute/v1/instances/rest/client.rb +111 -194
  31. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +43 -0
  32. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +7 -39
  33. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +2 -12
  34. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +5 -27
  35. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +2 -2
  36. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +11 -29
  37. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +4 -24
  38. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +10 -56
  39. data/lib/google/cloud/compute/v1/networks/rest/client.rb +12 -60
  40. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +12 -66
  41. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +6 -34
  42. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +4 -24
  43. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +7 -39
  44. data/lib/google/cloud/compute/v1/projects/rest/client.rb +13 -69
  45. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +5 -27
  46. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +7 -39
  47. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +6 -32
  48. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +9 -35
  49. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +6 -30
  50. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +2 -12
  51. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +9 -47
  52. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +5 -27
  53. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +6 -32
  54. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +27 -133
  55. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +5 -29
  56. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +1 -5
  57. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +4 -22
  58. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +4 -22
  59. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +3 -17
  60. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +4 -22
  61. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +5 -27
  62. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +6 -32
  63. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +2 -12
  64. data/lib/google/cloud/compute/v1/regions/rest/client.rb +2 -12
  65. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +7 -39
  66. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +6 -34
  67. data/lib/google/cloud/compute/v1/routers/rest/client.rb +10 -56
  68. data/lib/google/cloud/compute/v1/routes/rest/client.rb +4 -22
  69. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +7 -39
  70. data/lib/google/cloud/compute/v1/service_attachments/credentials.rb +52 -0
  71. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +924 -0
  72. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +458 -0
  73. data/lib/google/cloud/compute/v1/service_attachments/rest.rb +33 -0
  74. data/lib/google/cloud/compute/v1/service_attachments.rb +44 -0
  75. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +4 -20
  76. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +6 -34
  77. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +7 -39
  78. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +11 -61
  79. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +5 -27
  80. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +9 -45
  81. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +12 -60
  82. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +6 -34
  83. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +11 -59
  84. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +8 -42
  85. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +6 -32
  86. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +6 -34
  87. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +10 -52
  88. data/lib/google/cloud/compute/v1/version.rb +1 -1
  89. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +7 -39
  90. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +6 -34
  91. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +3 -17
  92. data/lib/google/cloud/compute/v1/zones/rest/client.rb +2 -12
  93. data/lib/google/cloud/compute/v1.rb +2 -0
  94. data/proto_docs/google/api/field_behavior.rb +6 -0
  95. data/proto_docs/google/cloud/compute/v1/compute.rb +18905 -21502
  96. data/proto_docs/google/cloud/extended_operations.rb +51 -0
  97. metadata +30 -3
@@ -0,0 +1,924 @@
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/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/service_attachments/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module ServiceAttachments
28
+ module Rest
29
+ ##
30
+ # REST client for the ServiceAttachments service.
31
+ #
32
+ # The ServiceAttachments API.
33
+ #
34
+ class Client
35
+ # @private
36
+ attr_reader :service_attachments_stub
37
+
38
+ ##
39
+ # Configure the ServiceAttachments Client class.
40
+ #
41
+ # See {::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all ServiceAttachments clients
47
+ # ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
50
+ #
51
+ # @yield [config] Configure the Client client.
52
+ # @yieldparam config [Client::Configuration]
53
+ #
54
+ # @return [Client::Configuration]
55
+ #
56
+ def self.configure
57
+ @configure ||= begin
58
+ namespace = ["Google", "Cloud", "Compute", "V1"]
59
+ parent_config = while namespace.any?
60
+ parent_name = namespace.join "::"
61
+ parent_const = const_get parent_name
62
+ break parent_const.configure if parent_const.respond_to? :configure
63
+ namespace.pop
64
+ end
65
+ default_config = Client::Configuration.new parent_config
66
+
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # Configure the ServiceAttachments Client instance.
75
+ #
76
+ # The configuration is set to the derived mode, meaning that values can be changed,
77
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
78
+ # should be made on {Client.configure}.
79
+ #
80
+ # See {::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client::Configuration}
81
+ # for a description of the configuration fields.
82
+ #
83
+ # @yield [config] Configure the Client client.
84
+ # @yieldparam config [Client::Configuration]
85
+ #
86
+ # @return [Client::Configuration]
87
+ #
88
+ def configure
89
+ yield @config if block_given?
90
+ @config
91
+ end
92
+
93
+ ##
94
+ # Create a new ServiceAttachments REST client object.
95
+ #
96
+ # @example
97
+ #
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client.new
100
+ #
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
105
+ #
106
+ # @yield [config] Configure the ServiceAttachments client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ def initialize
110
+ # Create the configuration object
111
+ @config = Configuration.new Client.configure
112
+
113
+ # Yield the configuration if needed
114
+ yield @config if block_given?
115
+
116
+ # Create credentials
117
+ credentials = @config.credentials
118
+ credentials ||= Credentials.default scope: @config.scope
119
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
120
+ credentials = Credentials.new credentials, scope: @config.scope
121
+ end
122
+
123
+ @service_attachments_stub = ::Google::Cloud::Compute::V1::ServiceAttachments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
124
+ end
125
+
126
+ # Service calls
127
+
128
+ ##
129
+ # Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project.
130
+ #
131
+ # @overload aggregated_list(request, options = nil)
132
+ # Pass arguments to `aggregated_list` via a request object, either of type
133
+ # {::Google::Cloud::Compute::V1::AggregatedListServiceAttachmentsRequest} or an equivalent Hash.
134
+ #
135
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListServiceAttachmentsRequest, ::Hash]
136
+ # A request object representing the call parameters. Required. To specify no
137
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
138
+ # @param options [::Gapic::CallOptions, ::Hash]
139
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
140
+ # Note: currently retry functionality is not implemented. While it is possible
141
+ # to set it using ::Gapic::CallOptions, it will not be applied
142
+ #
143
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
144
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
145
+ # least one keyword argument is required. To specify no parameters, or to keep all
146
+ # the default parameter values, pass an empty Hash as a request object (see above).
147
+ #
148
+ # @param filter [::String]
149
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
150
+ # @param include_all_scopes [::Boolean]
151
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
152
+ # @param max_results [::Integer]
153
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
154
+ # @param order_by [::String]
155
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
156
+ # @param page_token [::String]
157
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
158
+ # @param project [::String]
159
+ # Name of the project scoping this request.
160
+ # @param return_partial_success [::Boolean]
161
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
162
+ # @yield [result, response] Access the result along with the Faraday response object
163
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ServiceAttachmentsScopedList>]
164
+ # @yieldparam response [::Faraday::Response]
165
+ #
166
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ServiceAttachmentsScopedList>]
167
+ #
168
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
169
+ def aggregated_list request, options = nil
170
+ raise ::ArgumentError, "request must be provided" if request.nil?
171
+
172
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListServiceAttachmentsRequest
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.aggregated_list.metadata.to_h
179
+
180
+ # Set x-goog-api-client header
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::Compute::V1::VERSION,
184
+ transports_version_send: [:rest]
185
+
186
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
187
+ metadata: call_metadata
188
+
189
+ options.apply_defaults timeout: @config.timeout,
190
+ metadata: @config.metadata
191
+
192
+ @service_attachments_stub.aggregated_list request, options do |result, response|
193
+ result = ::Gapic::Rest::PagedEnumerable.new @service_attachments_stub, :aggregated_list, "items", request, result, options
194
+ yield result, response if block_given?
195
+ return result
196
+ end
197
+ rescue ::Faraday::Error => e
198
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
199
+ raise ::Google::Cloud::Error.from_error(gapic_error)
200
+ end
201
+
202
+ ##
203
+ # Deletes the specified ServiceAttachment in the given scope
204
+ #
205
+ # @overload delete(request, options = nil)
206
+ # Pass arguments to `delete` via a request object, either of type
207
+ # {::Google::Cloud::Compute::V1::DeleteServiceAttachmentRequest} or an equivalent Hash.
208
+ #
209
+ # @param request [::Google::Cloud::Compute::V1::DeleteServiceAttachmentRequest, ::Hash]
210
+ # A request object representing the call parameters. Required. To specify no
211
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
212
+ # @param options [::Gapic::CallOptions, ::Hash]
213
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
214
+ # Note: currently retry functionality is not implemented. While it is possible
215
+ # to set it using ::Gapic::CallOptions, it will not be applied
216
+ #
217
+ # @overload delete(project: nil, region: nil, request_id: nil, service_attachment: nil)
218
+ # Pass arguments to `delete` via keyword arguments. Note that at
219
+ # least one keyword argument is required. To specify no parameters, or to keep all
220
+ # the default parameter values, pass an empty Hash as a request object (see above).
221
+ #
222
+ # @param project [::String]
223
+ # Project ID for this request.
224
+ # @param region [::String]
225
+ # Name of the region of this request.
226
+ # @param request_id [::String]
227
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
228
+ # @param service_attachment [::String]
229
+ # Name of the ServiceAttachment resource to delete.
230
+ # @yield [result, response] Access the result along with the Faraday response object
231
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
232
+ # @yieldparam response [::Faraday::Response]
233
+ #
234
+ # @return [::Gapic::Rest::BaseOperation]
235
+ #
236
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
237
+ def delete request, options = nil
238
+ raise ::ArgumentError, "request must be provided" if request.nil?
239
+
240
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteServiceAttachmentRequest
241
+
242
+ # Converts hash and nil to an options object
243
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
244
+
245
+ # Customize the options with defaults
246
+ call_metadata = @config.rpcs.delete.metadata.to_h
247
+
248
+ # Set x-goog-api-client header
249
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
250
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
251
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
252
+ transports_version_send: [:rest]
253
+
254
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
255
+ metadata: call_metadata
256
+
257
+ options.apply_defaults timeout: @config.timeout,
258
+ metadata: @config.metadata
259
+
260
+ @service_attachments_stub.delete request, options do |result, response|
261
+ result = ::Gapic::Rest::BaseOperation.new result
262
+ yield result, response if block_given?
263
+ return result
264
+ end
265
+ rescue ::Faraday::Error => e
266
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
267
+ raise ::Google::Cloud::Error.from_error(gapic_error)
268
+ end
269
+
270
+ ##
271
+ # Returns the specified ServiceAttachment resource in the given scope.
272
+ #
273
+ # @overload get(request, options = nil)
274
+ # Pass arguments to `get` via a request object, either of type
275
+ # {::Google::Cloud::Compute::V1::GetServiceAttachmentRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::Compute::V1::GetServiceAttachmentRequest, ::Hash]
278
+ # A request object representing the call parameters. Required. To specify no
279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
280
+ # @param options [::Gapic::CallOptions, ::Hash]
281
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
282
+ # Note: currently retry functionality is not implemented. While it is possible
283
+ # to set it using ::Gapic::CallOptions, it will not be applied
284
+ #
285
+ # @overload get(project: nil, region: nil, service_attachment: nil)
286
+ # Pass arguments to `get` via keyword arguments. Note that at
287
+ # least one keyword argument is required. To specify no parameters, or to keep all
288
+ # the default parameter values, pass an empty Hash as a request object (see above).
289
+ #
290
+ # @param project [::String]
291
+ # Project ID for this request.
292
+ # @param region [::String]
293
+ # Name of the region of this request.
294
+ # @param service_attachment [::String]
295
+ # Name of the ServiceAttachment resource to return.
296
+ # @yield [result, response] Access the result along with the Faraday response object
297
+ # @yieldparam result [::Google::Cloud::Compute::V1::ServiceAttachment]
298
+ # @yieldparam response [::Faraday::Response]
299
+ #
300
+ # @return [::Google::Cloud::Compute::V1::ServiceAttachment]
301
+ #
302
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
303
+ def get request, options = nil
304
+ raise ::ArgumentError, "request must be provided" if request.nil?
305
+
306
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetServiceAttachmentRequest
307
+
308
+ # Converts hash and nil to an options object
309
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
310
+
311
+ # Customize the options with defaults
312
+ call_metadata = @config.rpcs.get.metadata.to_h
313
+
314
+ # Set x-goog-api-client header
315
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
316
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
317
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
318
+ transports_version_send: [:rest]
319
+
320
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
321
+ metadata: call_metadata
322
+
323
+ options.apply_defaults timeout: @config.timeout,
324
+ metadata: @config.metadata
325
+
326
+ @service_attachments_stub.get request, options do |result, response|
327
+ yield result, response if block_given?
328
+ return result
329
+ end
330
+ rescue ::Faraday::Error => e
331
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
332
+ raise ::Google::Cloud::Error.from_error(gapic_error)
333
+ end
334
+
335
+ ##
336
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
337
+ #
338
+ # @overload get_iam_policy(request, options = nil)
339
+ # Pass arguments to `get_iam_policy` via a request object, either of type
340
+ # {::Google::Cloud::Compute::V1::GetIamPolicyServiceAttachmentRequest} or an equivalent Hash.
341
+ #
342
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyServiceAttachmentRequest, ::Hash]
343
+ # A request object representing the call parameters. Required. To specify no
344
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
345
+ # @param options [::Gapic::CallOptions, ::Hash]
346
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
347
+ # Note: currently retry functionality is not implemented. While it is possible
348
+ # to set it using ::Gapic::CallOptions, it will not be applied
349
+ #
350
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, region: nil, resource: nil)
351
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
352
+ # least one keyword argument is required. To specify no parameters, or to keep all
353
+ # the default parameter values, pass an empty Hash as a request object (see above).
354
+ #
355
+ # @param options_requested_policy_version [::Integer]
356
+ # Requested IAM Policy version.
357
+ # @param project [::String]
358
+ # Project ID for this request.
359
+ # @param region [::String]
360
+ # The name of the region for this request.
361
+ # @param resource [::String]
362
+ # Name or id of the resource for this request.
363
+ # @yield [result, response] Access the result along with the Faraday response object
364
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
365
+ # @yieldparam response [::Faraday::Response]
366
+ #
367
+ # @return [::Google::Cloud::Compute::V1::Policy]
368
+ #
369
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
370
+ def get_iam_policy request, options = nil
371
+ raise ::ArgumentError, "request must be provided" if request.nil?
372
+
373
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyServiceAttachmentRequest
374
+
375
+ # Converts hash and nil to an options object
376
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
377
+
378
+ # Customize the options with defaults
379
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
380
+
381
+ # Set x-goog-api-client header
382
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
383
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
384
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
385
+ transports_version_send: [:rest]
386
+
387
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
388
+ metadata: call_metadata
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata
392
+
393
+ @service_attachments_stub.get_iam_policy request, options do |result, response|
394
+ yield result, response if block_given?
395
+ return result
396
+ end
397
+ rescue ::Faraday::Error => e
398
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
399
+ raise ::Google::Cloud::Error.from_error(gapic_error)
400
+ end
401
+
402
+ ##
403
+ # Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request.
404
+ #
405
+ # @overload insert(request, options = nil)
406
+ # Pass arguments to `insert` via a request object, either of type
407
+ # {::Google::Cloud::Compute::V1::InsertServiceAttachmentRequest} or an equivalent Hash.
408
+ #
409
+ # @param request [::Google::Cloud::Compute::V1::InsertServiceAttachmentRequest, ::Hash]
410
+ # A request object representing the call parameters. Required. To specify no
411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
412
+ # @param options [::Gapic::CallOptions, ::Hash]
413
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
414
+ # Note: currently retry functionality is not implemented. While it is possible
415
+ # to set it using ::Gapic::CallOptions, it will not be applied
416
+ #
417
+ # @overload insert(project: nil, region: nil, request_id: nil, service_attachment_resource: nil)
418
+ # Pass arguments to `insert` via keyword arguments. Note that at
419
+ # least one keyword argument is required. To specify no parameters, or to keep all
420
+ # the default parameter values, pass an empty Hash as a request object (see above).
421
+ #
422
+ # @param project [::String]
423
+ # Project ID for this request.
424
+ # @param region [::String]
425
+ # Name of the region of this request.
426
+ # @param request_id [::String]
427
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
428
+ # @param service_attachment_resource [::Google::Cloud::Compute::V1::ServiceAttachment, ::Hash]
429
+ # The body resource for this request
430
+ # @yield [result, response] Access the result along with the Faraday response object
431
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
432
+ # @yieldparam response [::Faraday::Response]
433
+ #
434
+ # @return [::Gapic::Rest::BaseOperation]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
437
+ def insert request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertServiceAttachmentRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ call_metadata = @config.rpcs.insert.metadata.to_h
447
+
448
+ # Set x-goog-api-client header
449
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
452
+ transports_version_send: [:rest]
453
+
454
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
455
+ metadata: call_metadata
456
+
457
+ options.apply_defaults timeout: @config.timeout,
458
+ metadata: @config.metadata
459
+
460
+ @service_attachments_stub.insert request, options do |result, response|
461
+ result = ::Gapic::Rest::BaseOperation.new result
462
+ yield result, response if block_given?
463
+ return result
464
+ end
465
+ rescue ::Faraday::Error => e
466
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
467
+ raise ::Google::Cloud::Error.from_error(gapic_error)
468
+ end
469
+
470
+ ##
471
+ # Lists the ServiceAttachments for a project in the given scope.
472
+ #
473
+ # @overload list(request, options = nil)
474
+ # Pass arguments to `list` via a request object, either of type
475
+ # {::Google::Cloud::Compute::V1::ListServiceAttachmentsRequest} or an equivalent Hash.
476
+ #
477
+ # @param request [::Google::Cloud::Compute::V1::ListServiceAttachmentsRequest, ::Hash]
478
+ # A request object representing the call parameters. Required. To specify no
479
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
480
+ # @param options [::Gapic::CallOptions, ::Hash]
481
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
482
+ # Note: currently retry functionality is not implemented. While it is possible
483
+ # to set it using ::Gapic::CallOptions, it will not be applied
484
+ #
485
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
486
+ # Pass arguments to `list` via keyword arguments. Note that at
487
+ # least one keyword argument is required. To specify no parameters, or to keep all
488
+ # the default parameter values, pass an empty Hash as a request object (see above).
489
+ #
490
+ # @param filter [::String]
491
+ # A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
492
+ # @param max_results [::Integer]
493
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
494
+ # @param order_by [::String]
495
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
496
+ # @param page_token [::String]
497
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
498
+ # @param project [::String]
499
+ # Project ID for this request.
500
+ # @param region [::String]
501
+ # Name of the region of this request.
502
+ # @param return_partial_success [::Boolean]
503
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
504
+ # @yield [result, response] Access the result along with the Faraday response object
505
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ServiceAttachment>]
506
+ # @yieldparam response [::Faraday::Response]
507
+ #
508
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ServiceAttachment>]
509
+ #
510
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
511
+ def list request, options = nil
512
+ raise ::ArgumentError, "request must be provided" if request.nil?
513
+
514
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListServiceAttachmentsRequest
515
+
516
+ # Converts hash and nil to an options object
517
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
518
+
519
+ # Customize the options with defaults
520
+ call_metadata = @config.rpcs.list.metadata.to_h
521
+
522
+ # Set x-goog-api-client header
523
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
524
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
525
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
526
+ transports_version_send: [:rest]
527
+
528
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
529
+ metadata: call_metadata
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata
533
+
534
+ @service_attachments_stub.list request, options do |result, response|
535
+ result = ::Gapic::Rest::PagedEnumerable.new @service_attachments_stub, :list, "items", request, result, options
536
+ yield result, response if block_given?
537
+ return result
538
+ end
539
+ rescue ::Faraday::Error => e
540
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
541
+ raise ::Google::Cloud::Error.from_error(gapic_error)
542
+ end
543
+
544
+ ##
545
+ # Patches the specified ServiceAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
546
+ #
547
+ # @overload patch(request, options = nil)
548
+ # Pass arguments to `patch` via a request object, either of type
549
+ # {::Google::Cloud::Compute::V1::PatchServiceAttachmentRequest} or an equivalent Hash.
550
+ #
551
+ # @param request [::Google::Cloud::Compute::V1::PatchServiceAttachmentRequest, ::Hash]
552
+ # A request object representing the call parameters. Required. To specify no
553
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
554
+ # @param options [::Gapic::CallOptions, ::Hash]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ # Note: currently retry functionality is not implemented. While it is possible
557
+ # to set it using ::Gapic::CallOptions, it will not be applied
558
+ #
559
+ # @overload patch(project: nil, region: nil, request_id: nil, service_attachment: nil, service_attachment_resource: nil)
560
+ # Pass arguments to `patch` via keyword arguments. Note that at
561
+ # least one keyword argument is required. To specify no parameters, or to keep all
562
+ # the default parameter values, pass an empty Hash as a request object (see above).
563
+ #
564
+ # @param project [::String]
565
+ # Project ID for this request.
566
+ # @param region [::String]
567
+ # The region scoping this request and should conform to RFC1035.
568
+ # @param request_id [::String]
569
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder
570
+ # @param service_attachment [::String]
571
+ # The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number.
572
+ # @param service_attachment_resource [::Google::Cloud::Compute::V1::ServiceAttachment, ::Hash]
573
+ # The body resource for this request
574
+ # @yield [result, response] Access the result along with the Faraday response object
575
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
576
+ # @yieldparam response [::Faraday::Response]
577
+ #
578
+ # @return [::Gapic::Rest::BaseOperation]
579
+ #
580
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
581
+ def patch request, options = nil
582
+ raise ::ArgumentError, "request must be provided" if request.nil?
583
+
584
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchServiceAttachmentRequest
585
+
586
+ # Converts hash and nil to an options object
587
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
588
+
589
+ # Customize the options with defaults
590
+ call_metadata = @config.rpcs.patch.metadata.to_h
591
+
592
+ # Set x-goog-api-client header
593
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
594
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
595
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
596
+ transports_version_send: [:rest]
597
+
598
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
599
+ metadata: call_metadata
600
+
601
+ options.apply_defaults timeout: @config.timeout,
602
+ metadata: @config.metadata
603
+
604
+ @service_attachments_stub.patch request, options do |result, response|
605
+ result = ::Gapic::Rest::BaseOperation.new result
606
+ yield result, response if block_given?
607
+ return result
608
+ end
609
+ rescue ::Faraday::Error => e
610
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
611
+ raise ::Google::Cloud::Error.from_error(gapic_error)
612
+ end
613
+
614
+ ##
615
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
616
+ #
617
+ # @overload set_iam_policy(request, options = nil)
618
+ # Pass arguments to `set_iam_policy` via a request object, either of type
619
+ # {::Google::Cloud::Compute::V1::SetIamPolicyServiceAttachmentRequest} or an equivalent Hash.
620
+ #
621
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyServiceAttachmentRequest, ::Hash]
622
+ # A request object representing the call parameters. Required. To specify no
623
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
624
+ # @param options [::Gapic::CallOptions, ::Hash]
625
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
626
+ # Note: currently retry functionality is not implemented. While it is possible
627
+ # to set it using ::Gapic::CallOptions, it will not be applied
628
+ #
629
+ # @overload set_iam_policy(project: nil, region: nil, region_set_policy_request_resource: nil, resource: nil)
630
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
631
+ # least one keyword argument is required. To specify no parameters, or to keep all
632
+ # the default parameter values, pass an empty Hash as a request object (see above).
633
+ #
634
+ # @param project [::String]
635
+ # Project ID for this request.
636
+ # @param region [::String]
637
+ # The name of the region for this request.
638
+ # @param region_set_policy_request_resource [::Google::Cloud::Compute::V1::RegionSetPolicyRequest, ::Hash]
639
+ # The body resource for this request
640
+ # @param resource [::String]
641
+ # Name or id of the resource for this request.
642
+ # @yield [result, response] Access the result along with the Faraday response object
643
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
644
+ # @yieldparam response [::Faraday::Response]
645
+ #
646
+ # @return [::Google::Cloud::Compute::V1::Policy]
647
+ #
648
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
649
+ def set_iam_policy request, options = nil
650
+ raise ::ArgumentError, "request must be provided" if request.nil?
651
+
652
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyServiceAttachmentRequest
653
+
654
+ # Converts hash and nil to an options object
655
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
656
+
657
+ # Customize the options with defaults
658
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
659
+
660
+ # Set x-goog-api-client header
661
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
662
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
663
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
664
+ transports_version_send: [:rest]
665
+
666
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
667
+ metadata: call_metadata
668
+
669
+ options.apply_defaults timeout: @config.timeout,
670
+ metadata: @config.metadata
671
+
672
+ @service_attachments_stub.set_iam_policy request, options do |result, response|
673
+ yield result, response if block_given?
674
+ return result
675
+ end
676
+ rescue ::Faraday::Error => e
677
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
678
+ raise ::Google::Cloud::Error.from_error(gapic_error)
679
+ end
680
+
681
+ ##
682
+ # Returns permissions that a caller has on the specified resource.
683
+ #
684
+ # @overload test_iam_permissions(request, options = nil)
685
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
686
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsServiceAttachmentRequest} or an equivalent Hash.
687
+ #
688
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsServiceAttachmentRequest, ::Hash]
689
+ # A request object representing the call parameters. Required. To specify no
690
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
691
+ # @param options [::Gapic::CallOptions, ::Hash]
692
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
693
+ # Note: currently retry functionality is not implemented. While it is possible
694
+ # to set it using ::Gapic::CallOptions, it will not be applied
695
+ #
696
+ # @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
697
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
698
+ # least one keyword argument is required. To specify no parameters, or to keep all
699
+ # the default parameter values, pass an empty Hash as a request object (see above).
700
+ #
701
+ # @param project [::String]
702
+ # Project ID for this request.
703
+ # @param region [::String]
704
+ # The name of the region for this request.
705
+ # @param resource [::String]
706
+ # Name or id of the resource for this request.
707
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
708
+ # The body resource for this request
709
+ # @yield [result, response] Access the result along with the Faraday response object
710
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
711
+ # @yieldparam response [::Faraday::Response]
712
+ #
713
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
714
+ #
715
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
716
+ def test_iam_permissions request, options = nil
717
+ raise ::ArgumentError, "request must be provided" if request.nil?
718
+
719
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsServiceAttachmentRequest
720
+
721
+ # Converts hash and nil to an options object
722
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
723
+
724
+ # Customize the options with defaults
725
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
726
+
727
+ # Set x-goog-api-client header
728
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
729
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
730
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
731
+ transports_version_send: [:rest]
732
+
733
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
734
+ metadata: call_metadata
735
+
736
+ options.apply_defaults timeout: @config.timeout,
737
+ metadata: @config.metadata
738
+
739
+ @service_attachments_stub.test_iam_permissions request, options do |result, response|
740
+ yield result, response if block_given?
741
+ return result
742
+ end
743
+ rescue ::Faraday::Error => e
744
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
745
+ raise ::Google::Cloud::Error.from_error(gapic_error)
746
+ end
747
+
748
+ ##
749
+ # Configuration class for the ServiceAttachments REST API.
750
+ #
751
+ # This class represents the configuration for ServiceAttachments REST,
752
+ # providing control over credentials, timeouts, retry behavior, logging.
753
+ #
754
+ # Configuration can be applied globally to all clients, or to a single client
755
+ # on construction.
756
+ #
757
+ # # Examples
758
+ #
759
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
760
+ #
761
+ # ::Google::Cloud::Compute::V1::ServiceAttachments::Client.configure do |config|
762
+ # config.timeout = 10.0
763
+ # end
764
+ #
765
+ # To apply the above configuration only to a new client:
766
+ #
767
+ # client = ::Google::Cloud::Compute::V1::ServiceAttachments::Client.new do |config|
768
+ # config.timeout = 10.0
769
+ # end
770
+ #
771
+ # @!attribute [rw] endpoint
772
+ # The hostname or hostname:port of the service endpoint.
773
+ # Defaults to `"compute.googleapis.com"`.
774
+ # @return [::String]
775
+ # @!attribute [rw] credentials
776
+ # Credentials to send with calls. You may provide any of the following types:
777
+ # * (`String`) The path to a service account key file in JSON format
778
+ # * (`Hash`) A service account key as a Hash
779
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
780
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
781
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
782
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
783
+ # * (`nil`) indicating no credentials
784
+ # @return [::Object]
785
+ # @!attribute [rw] scope
786
+ # The OAuth scopes
787
+ # @return [::Array<::String>]
788
+ # @!attribute [rw] lib_name
789
+ # The library name as recorded in instrumentation and logging
790
+ # @return [::String]
791
+ # @!attribute [rw] lib_version
792
+ # The library version as recorded in instrumentation and logging
793
+ # @return [::String]
794
+ # @!attribute [rw] timeout
795
+ # The call timeout in seconds.
796
+ # @return [::Numeric]
797
+ # @!attribute [rw] metadata
798
+ # Additional REST headers to be sent with the call.
799
+ # @return [::Hash{::Symbol=>::String}]
800
+ #
801
+ class Configuration
802
+ extend ::Gapic::Config
803
+
804
+ config_attr :endpoint, "compute.googleapis.com", ::String
805
+ config_attr :credentials, nil do |value|
806
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
807
+ allowed.any? { |klass| klass === value }
808
+ end
809
+ config_attr :scope, nil, ::String, ::Array, nil
810
+ config_attr :lib_name, nil, ::String, nil
811
+ config_attr :lib_version, nil, ::String, nil
812
+ config_attr :timeout, nil, ::Numeric, nil
813
+ config_attr :metadata, nil, ::Hash, nil
814
+
815
+ # @private
816
+ def initialize parent_config = nil
817
+ @parent_config = parent_config unless parent_config.nil?
818
+
819
+ yield self if block_given?
820
+ end
821
+
822
+ ##
823
+ # Configurations for individual RPCs
824
+ # @return [Rpcs]
825
+ #
826
+ def rpcs
827
+ @rpcs ||= begin
828
+ parent_rpcs = nil
829
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
830
+ Rpcs.new parent_rpcs
831
+ end
832
+ end
833
+
834
+ ##
835
+ # Configuration RPC class for the ServiceAttachments API.
836
+ #
837
+ # Includes fields providing the configuration for each RPC in this service.
838
+ # Each configuration object is of type `Gapic::Config::Method` and includes
839
+ # the following configuration fields:
840
+ #
841
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
842
+ #
843
+ # there is one other field (`retry_policy`) that can be set
844
+ # but is currently not supported for REST Gapic libraries.
845
+ #
846
+ class Rpcs
847
+ ##
848
+ # RPC-specific configuration for `aggregated_list`
849
+ # @return [::Gapic::Config::Method]
850
+ #
851
+ attr_reader :aggregated_list
852
+ ##
853
+ # RPC-specific configuration for `delete`
854
+ # @return [::Gapic::Config::Method]
855
+ #
856
+ attr_reader :delete
857
+ ##
858
+ # RPC-specific configuration for `get`
859
+ # @return [::Gapic::Config::Method]
860
+ #
861
+ attr_reader :get
862
+ ##
863
+ # RPC-specific configuration for `get_iam_policy`
864
+ # @return [::Gapic::Config::Method]
865
+ #
866
+ attr_reader :get_iam_policy
867
+ ##
868
+ # RPC-specific configuration for `insert`
869
+ # @return [::Gapic::Config::Method]
870
+ #
871
+ attr_reader :insert
872
+ ##
873
+ # RPC-specific configuration for `list`
874
+ # @return [::Gapic::Config::Method]
875
+ #
876
+ attr_reader :list
877
+ ##
878
+ # RPC-specific configuration for `patch`
879
+ # @return [::Gapic::Config::Method]
880
+ #
881
+ attr_reader :patch
882
+ ##
883
+ # RPC-specific configuration for `set_iam_policy`
884
+ # @return [::Gapic::Config::Method]
885
+ #
886
+ attr_reader :set_iam_policy
887
+ ##
888
+ # RPC-specific configuration for `test_iam_permissions`
889
+ # @return [::Gapic::Config::Method]
890
+ #
891
+ attr_reader :test_iam_permissions
892
+
893
+ # @private
894
+ def initialize parent_rpcs = nil
895
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
896
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
897
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
898
+ @delete = ::Gapic::Config::Method.new delete_config
899
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
900
+ @get = ::Gapic::Config::Method.new get_config
901
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
902
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
903
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
904
+ @insert = ::Gapic::Config::Method.new insert_config
905
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
906
+ @list = ::Gapic::Config::Method.new list_config
907
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
908
+ @patch = ::Gapic::Config::Method.new patch_config
909
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
910
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
911
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
912
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
913
+
914
+ yield self if block_given?
915
+ end
916
+ end
917
+ end
918
+ end
919
+ end
920
+ end
921
+ end
922
+ end
923
+ end
924
+ end