google-cloud-compute-v1 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +10 -8
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +6 -3
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +12 -6
  6. data/lib/google/cloud/compute/v1/addresses/rest/grpc_transcoding.rb +1 -0
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +20 -10
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/grpc_transcoding.rb +5 -0
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +24 -12
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/grpc_transcoding.rb +4 -0
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +32 -16
  12. data/lib/google/cloud/compute/v1/backend_services/rest/grpc_transcoding.rb +5 -0
  13. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +6 -3
  14. data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -19
  15. data/lib/google/cloud/compute/v1/disks/rest/grpc_transcoding.rb +8 -0
  16. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +14 -7
  17. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/grpc_transcoding.rb +1 -0
  18. data/lib/google/cloud/compute/v1/firewall_policies.rb +44 -0
  19. data/lib/google/cloud/compute/v1/firewall_policies/credentials.rb +52 -0
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +35 -0
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1459 -0
  22. data/lib/google/cloud/compute/v1/firewall_policies/rest/grpc_transcoding.rb +269 -0
  23. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +18 -9
  24. data/lib/google/cloud/compute/v1/firewalls/rest/grpc_transcoding.rb +3 -0
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +20 -10
  26. data/lib/google/cloud/compute/v1/forwarding_rules/rest/grpc_transcoding.rb +3 -0
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +10 -5
  28. data/lib/google/cloud/compute/v1/global_addresses/rest/grpc_transcoding.rb +1 -0
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +18 -9
  30. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/grpc_transcoding.rb +3 -0
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +20 -10
  32. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/grpc_transcoding.rb +3 -0
  33. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +10 -5
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +6 -3
  35. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes.rb +44 -0
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/credentials.rb +52 -0
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +35 -0
  38. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +576 -0
  39. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/grpc_transcoding.rb +100 -0
  40. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +20 -10
  41. data/lib/google/cloud/compute/v1/health_checks/rest/grpc_transcoding.rb +3 -0
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +28 -14
  43. data/lib/google/cloud/compute/v1/images/rest/grpc_transcoding.rb +4 -0
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +60 -30
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/grpc_transcoding.rb +10 -0
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +28 -14
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/grpc_transcoding.rb +9 -0
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +16 -8
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/grpc_transcoding.rb +1 -0
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +120 -60
  51. data/lib/google/cloud/compute/v1/instances/rest/grpc_transcoding.rb +27 -0
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +16 -8
  53. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/grpc_transcoding.rb +3 -0
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +4 -2
  55. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +16 -8
  56. data/lib/google/cloud/compute/v1/interconnects/rest/grpc_transcoding.rb +2 -0
  57. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +4 -2
  58. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +16 -8
  59. data/lib/google/cloud/compute/v1/licenses/rest/grpc_transcoding.rb +1 -0
  60. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +6 -3
  61. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +26 -13
  62. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/grpc_transcoding.rb +8 -0
  63. data/lib/google/cloud/compute/v1/networks/rest/client.rb +30 -15
  64. data/lib/google/cloud/compute/v1/networks/rest/grpc_transcoding.rb +5 -0
  65. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +36 -18
  66. data/lib/google/cloud/compute/v1/node_groups/rest/grpc_transcoding.rb +6 -0
  67. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +18 -9
  68. data/lib/google/cloud/compute/v1/node_templates/rest/grpc_transcoding.rb +1 -0
  69. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +6 -3
  70. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +18 -9
  71. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/grpc_transcoding.rb +2 -0
  72. data/lib/google/cloud/compute/v1/projects/rest/client.rb +42 -21
  73. data/lib/google/cloud/compute/v1/projects/rest/grpc_transcoding.rb +12 -0
  74. data/lib/google/cloud/compute/v1/public_advertised_prefixes.rb +44 -0
  75. data/lib/google/cloud/compute/v1/public_advertised_prefixes/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +35 -0
  77. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +576 -0
  78. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/grpc_transcoding.rb +100 -0
  79. data/lib/google/cloud/compute/v1/public_delegated_prefixes.rb +44 -0
  80. data/lib/google/cloud/compute/v1/public_delegated_prefixes/credentials.rb +52 -0
  81. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +35 -0
  82. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +671 -0
  83. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/grpc_transcoding.rb +118 -0
  84. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +18 -9
  85. data/lib/google/cloud/compute/v1/region_autoscalers/rest/grpc_transcoding.rb +5 -0
  86. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +20 -10
  87. data/lib/google/cloud/compute/v1/region_backend_services/rest/grpc_transcoding.rb +3 -0
  88. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +10 -5
  89. data/lib/google/cloud/compute/v1/region_commitments/rest/grpc_transcoding.rb +1 -0
  90. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +4 -2
  91. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +36 -18
  92. data/lib/google/cloud/compute/v1/region_disks/rest/grpc_transcoding.rb +7 -0
  93. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +14 -7
  94. data/lib/google/cloud/compute/v1/region_health_check_services/rest/grpc_transcoding.rb +2 -0
  95. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +18 -9
  96. data/lib/google/cloud/compute/v1/region_health_checks/rest/grpc_transcoding.rb +3 -0
  97. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +58 -29
  98. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/grpc_transcoding.rb +10 -0
  99. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +12 -6
  100. data/lib/google/cloud/compute/v1/region_instance_groups/rest/grpc_transcoding.rb +6 -0
  101. data/lib/google/cloud/compute/v1/region_instances.rb +44 -0
  102. data/lib/google/cloud/compute/v1/region_instances/credentials.rb +52 -0
  103. data/lib/google/cloud/compute/v1/region_instances/rest.rb +35 -0
  104. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +287 -0
  105. data/lib/google/cloud/compute/v1/region_instances/rest/grpc_transcoding.rb +46 -0
  106. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +10 -5
  107. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/grpc_transcoding.rb +1 -0
  108. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +10 -5
  109. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/grpc_transcoding.rb +1 -0
  110. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +8 -4
  111. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +10 -5
  112. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/grpc_transcoding.rb +1 -0
  113. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +14 -7
  114. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/grpc_transcoding.rb +2 -0
  115. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +18 -9
  116. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/grpc_transcoding.rb +3 -0
  117. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +20 -10
  118. data/lib/google/cloud/compute/v1/region_url_maps/rest/grpc_transcoding.rb +3 -0
  119. data/lib/google/cloud/compute/v1/regions/rest/client.rb +4 -2
  120. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +22 -11
  121. data/lib/google/cloud/compute/v1/reservations/rest/grpc_transcoding.rb +2 -0
  122. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +18 -9
  123. data/lib/google/cloud/compute/v1/resource_policies/rest/grpc_transcoding.rb +1 -0
  124. data/lib/google/cloud/compute/v1/routers/rest/client.rb +26 -13
  125. data/lib/google/cloud/compute/v1/routers/rest/grpc_transcoding.rb +3 -0
  126. data/lib/google/cloud/compute/v1/routes/rest/client.rb +10 -5
  127. data/lib/google/cloud/compute/v1/routes/rest/grpc_transcoding.rb +1 -0
  128. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +26 -13
  129. data/lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb +3 -0
  130. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +14 -7
  131. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +12 -6
  132. data/lib/google/cloud/compute/v1/ssl_certificates/rest/grpc_transcoding.rb +1 -0
  133. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +16 -8
  134. data/lib/google/cloud/compute/v1/ssl_policies/rest/grpc_transcoding.rb +2 -0
  135. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +32 -16
  136. data/lib/google/cloud/compute/v1/subnetworks/rest/grpc_transcoding.rb +5 -0
  137. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +14 -7
  138. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/grpc_transcoding.rb +2 -0
  139. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +20 -10
  140. data/lib/google/cloud/compute/v1/target_http_proxies/rest/grpc_transcoding.rb +3 -0
  141. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +28 -14
  142. data/lib/google/cloud/compute/v1/target_https_proxies/rest/grpc_transcoding.rb +5 -0
  143. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +12 -6
  144. data/lib/google/cloud/compute/v1/target_instances/rest/grpc_transcoding.rb +1 -0
  145. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +34 -17
  146. data/lib/google/cloud/compute/v1/target_pools/rest/grpc_transcoding.rb +7 -0
  147. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +26 -13
  148. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/grpc_transcoding.rb +5 -0
  149. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +18 -9
  150. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/grpc_transcoding.rb +3 -0
  151. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +12 -6
  152. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/grpc_transcoding.rb +1 -0
  153. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +26 -13
  154. data/lib/google/cloud/compute/v1/url_maps/rest/grpc_transcoding.rb +4 -0
  155. data/lib/google/cloud/compute/v1/version.rb +1 -1
  156. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +20 -10
  157. data/lib/google/cloud/compute/v1/vpn_gateways/rest/grpc_transcoding.rb +2 -0
  158. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +12 -6
  159. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/grpc_transcoding.rb +1 -0
  160. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +8 -4
  161. data/lib/google/cloud/compute/v1/zones/rest/client.rb +4 -2
  162. metadata +37 -12
@@ -0,0 +1,100 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Compute
23
+ module V1
24
+ module PublicAdvertisedPrefixes
25
+ module Rest
26
+ # GRPC transcoding helper methods for the PublicAdvertisedPrefixes REST API.
27
+ module GrpcTranscoding
28
+ # @param request_pb [::Google::Cloud::Compute::V1::DeletePublicAdvertisedPrefixeRequest]
29
+ # A request object representing the call parameters. Required.
30
+ # @return [Array(String, [String, nil], Hash{String => String})]
31
+ # Uri, Body, Query string parameters
32
+ def transcode_delete request_pb
33
+ uri = "/compute/v1/projects/#{request_pb.project}/global/publicAdvertisedPrefixes/#{request_pb.public_advertised_prefix}"
34
+ body = nil
35
+ query_string_params = {}
36
+ query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
37
+
38
+ [uri, body, query_string_params]
39
+ end
40
+
41
+ # @param request_pb [::Google::Cloud::Compute::V1::GetPublicAdvertisedPrefixeRequest]
42
+ # A request object representing the call parameters. Required.
43
+ # @return [Array(String, [String, nil], Hash{String => String})]
44
+ # Uri, Body, Query string parameters
45
+ def transcode_get request_pb
46
+ uri = "/compute/v1/projects/#{request_pb.project}/global/publicAdvertisedPrefixes/#{request_pb.public_advertised_prefix}"
47
+ body = nil
48
+ query_string_params = {}
49
+
50
+ [uri, body, query_string_params]
51
+ end
52
+
53
+ # @param request_pb [::Google::Cloud::Compute::V1::InsertPublicAdvertisedPrefixeRequest]
54
+ # A request object representing the call parameters. Required.
55
+ # @return [Array(String, [String, nil], Hash{String => String})]
56
+ # Uri, Body, Query string parameters
57
+ def transcode_insert request_pb
58
+ uri = "/compute/v1/projects/#{request_pb.project}/global/publicAdvertisedPrefixes"
59
+ body = request_pb.public_advertised_prefix_resource.to_json
60
+ query_string_params = {}
61
+
62
+ [uri, body, query_string_params]
63
+ end
64
+
65
+ # @param request_pb [::Google::Cloud::Compute::V1::ListPublicAdvertisedPrefixesRequest]
66
+ # A request object representing the call parameters. Required.
67
+ # @return [Array(String, [String, nil], Hash{String => String})]
68
+ # Uri, Body, Query string parameters
69
+ def transcode_list request_pb
70
+ uri = "/compute/v1/projects/#{request_pb.project}/global/publicAdvertisedPrefixes"
71
+ body = nil
72
+ query_string_params = {}
73
+ query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
74
+ query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
75
+ query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
76
+ query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
77
+ query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
78
+
79
+ [uri, body, query_string_params]
80
+ end
81
+
82
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchPublicAdvertisedPrefixeRequest]
83
+ # A request object representing the call parameters. Required.
84
+ # @return [Array(String, [String, nil], Hash{String => String})]
85
+ # Uri, Body, Query string parameters
86
+ def transcode_patch request_pb
87
+ uri = "/compute/v1/projects/#{request_pb.project}/global/publicAdvertisedPrefixes/#{request_pb.public_advertised_prefix}"
88
+ body = request_pb.public_advertised_prefix_resource.to_json
89
+ query_string_params = {}
90
+
91
+ [uri, body, query_string_params]
92
+ end
93
+ extend self
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,44 @@
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/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/public_delegated_prefixes/credentials"
25
+ require "google/cloud/compute/v1/public_delegated_prefixes/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ # To load this service and instantiate a REST client:
32
+ #
33
+ # require "google/cloud/compute/v1/public_delegated_prefixes"
34
+ # client = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client.new
35
+ #
36
+ module PublicDelegatedPrefixes
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ helper_path = ::File.join __dir__, "public_delegated_prefixes", "helpers.rb"
44
+ require "google/cloud/compute/v1/public_delegated_prefixes/helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
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 Compute
24
+ module V1
25
+ module PublicDelegatedPrefixes
26
+ # Credentials for the PublicDelegatedPrefixes API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/compute",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "COMPUTE_CREDENTIALS",
34
+ "COMPUTE_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "COMPUTE_CREDENTIALS_JSON",
39
+ "COMPUTE_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,35 @@
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/rest"
20
+ require "google/cloud/compute/v1/public_delegated_prefixes/rest/grpc_transcoding"
21
+ require "google/cloud/compute/v1/public_delegated_prefixes/rest/client"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module PublicDelegatedPrefixes
28
+ # Client for the REST transport
29
+ module Rest
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,671 @@
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
+
22
+ module Google
23
+ module Cloud
24
+ module Compute
25
+ module V1
26
+ module PublicDelegatedPrefixes
27
+ module Rest
28
+ ##
29
+ # REST client for the PublicDelegatedPrefixes service.
30
+ #
31
+ # The PublicDelegatedPrefixes API.
32
+ #
33
+ class Client
34
+ include GrpcTranscoding
35
+
36
+ # @private
37
+ attr_reader :public_delegated_prefixes_stub
38
+
39
+ ##
40
+ # Configure the PublicDelegatedPrefixes Client class.
41
+ #
42
+ # See {::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all PublicDelegatedPrefixes clients:
48
+ #
49
+ # ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Compute", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the PublicDelegatedPrefixes Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new PublicDelegatedPrefixes REST client object.
97
+ #
98
+ # ## Examples
99
+ #
100
+ # To create a new PublicDelegatedPrefixes REST client with the default
101
+ # configuration:
102
+ #
103
+ # client = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client.new
104
+ #
105
+ # To create a new PublicDelegatedPrefixes REST client with a custom
106
+ # configuration:
107
+ #
108
+ # client = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the PublicDelegatedPrefixes client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the REST modules only when it's required.
118
+ require "gapic/rest"
119
+
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ credentials ||= Credentials.default scope: @config.scope
129
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
134
+ end
135
+
136
+ # Service calls
137
+
138
+ ##
139
+ # Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes.
140
+ #
141
+ # @overload aggregated_list(request, options = nil)
142
+ # Pass arguments to `aggregated_list` via a request object, either of type
143
+ # {::Google::Cloud::Compute::V1::AggregatedListPublicDelegatedPrefixesRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListPublicDelegatedPrefixesRequest, ::Hash]
146
+ # A request object representing the call parameters. Required. To specify no
147
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
148
+ # @param options [::Gapic::CallOptions, ::Hash]
149
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
150
+ # Note: currently retry functionality is not implemented. While it is possible
151
+ # to set it using ::Gapic::CallOptions, it will not be applied
152
+ #
153
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
154
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
155
+ # least one keyword argument is required. To specify no parameters, or to keep all
156
+ # the default parameter values, pass an empty Hash as a request object (see above).
157
+ #
158
+ # @param filter [::String]
159
+ # 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 `<`.
160
+ #
161
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
162
+ #
163
+ # 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.
164
+ #
165
+ # 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) ```
166
+ # @param include_all_scopes [::Boolean]
167
+ # 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.
168
+ # @param max_results [::Integer]
169
+ # 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`)
170
+ # @param order_by [::String]
171
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
172
+ #
173
+ # 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.
174
+ #
175
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
176
+ # @param page_token [::String]
177
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
178
+ # @param project [::String]
179
+ # Name of the project scoping this request.
180
+ # @param return_partial_success [::Boolean]
181
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
182
+ # @yield [result, env] Access the result along with the Faraday environment object
183
+ # @yieldparam result [::Google::Cloud::Compute::V1::PublicDelegatedPrefixAggregatedList]
184
+ # @yieldparam response [::Faraday::Response]
185
+ #
186
+ # @return [::Google::Cloud::Compute::V1::PublicDelegatedPrefixAggregatedList]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
189
+ def aggregated_list request, options = nil
190
+ raise ::ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListPublicDelegatedPrefixesRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ call_metadata = {}
199
+
200
+ # Set x-goog-api-client header
201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
204
+
205
+ options.apply_defaults timeout: @config.timeout,
206
+ metadata: call_metadata
207
+
208
+ uri, _body, query_string_params = transcode_aggregated_list request
209
+ response = @client_stub.make_get_request(
210
+ uri: uri,
211
+ params: query_string_params,
212
+ options: options
213
+ )
214
+ result = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixAggregatedList.decode_json response.body, ignore_unknown_fields: true
215
+
216
+ yield result, response if block_given?
217
+ result
218
+ rescue ::Faraday::Error => e
219
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
220
+ raise ::Google::Cloud::Error.from_error(gapic_error)
221
+ end
222
+
223
+ ##
224
+ # Deletes the specified PublicDelegatedPrefix in the given region.
225
+ #
226
+ # @overload delete(request, options = nil)
227
+ # Pass arguments to `delete` via a request object, either of type
228
+ # {::Google::Cloud::Compute::V1::DeletePublicDelegatedPrefixeRequest} or an equivalent Hash.
229
+ #
230
+ # @param request [::Google::Cloud::Compute::V1::DeletePublicDelegatedPrefixeRequest, ::Hash]
231
+ # A request object representing the call parameters. Required. To specify no
232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
233
+ # @param options [::Gapic::CallOptions, ::Hash]
234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
235
+ # Note: currently retry functionality is not implemented. While it is possible
236
+ # to set it using ::Gapic::CallOptions, it will not be applied
237
+ #
238
+ # @overload delete(project: nil, public_delegated_prefix: nil, region: nil, request_id: nil)
239
+ # Pass arguments to `delete` via keyword arguments. Note that at
240
+ # least one keyword argument is required. To specify no parameters, or to keep all
241
+ # the default parameter values, pass an empty Hash as a request object (see above).
242
+ #
243
+ # @param project [::String]
244
+ # Project ID for this request.
245
+ # @param public_delegated_prefix [::String]
246
+ # Name of the PublicDelegatedPrefix resource to delete.
247
+ # @param region [::String]
248
+ # Name of the region of this request.
249
+ # @param request_id [::String]
250
+ # 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.
251
+ #
252
+ # 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.
253
+ #
254
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
255
+ # @yield [result, env] Access the result along with the Faraday environment object
256
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
257
+ # @yieldparam response [::Faraday::Response]
258
+ #
259
+ # @return [::Google::Cloud::Compute::V1::Operation]
260
+ #
261
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
262
+ def delete request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeletePublicDelegatedPrefixeRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ call_metadata = {}
272
+
273
+ # Set x-goog-api-client header
274
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: call_metadata
280
+
281
+ uri, _body, query_string_params = transcode_delete request
282
+ response = @client_stub.make_delete_request(
283
+ uri: uri,
284
+ params: query_string_params,
285
+ options: options
286
+ )
287
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
288
+
289
+ yield result, response if block_given?
290
+ result
291
+ rescue ::Faraday::Error => e
292
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
293
+ raise ::Google::Cloud::Error.from_error(gapic_error)
294
+ end
295
+
296
+ ##
297
+ # Returns the specified PublicDelegatedPrefix resource in the given region.
298
+ #
299
+ # @overload get(request, options = nil)
300
+ # Pass arguments to `get` via a request object, either of type
301
+ # {::Google::Cloud::Compute::V1::GetPublicDelegatedPrefixeRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Compute::V1::GetPublicDelegatedPrefixeRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ # Note: currently retry functionality is not implemented. While it is possible
309
+ # to set it using ::Gapic::CallOptions, it will not be applied
310
+ #
311
+ # @overload get(project: nil, public_delegated_prefix: nil, region: nil)
312
+ # Pass arguments to `get` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param project [::String]
317
+ # Project ID for this request.
318
+ # @param public_delegated_prefix [::String]
319
+ # Name of the PublicDelegatedPrefix resource to return.
320
+ # @param region [::String]
321
+ # Name of the region of this request.
322
+ # @yield [result, env] Access the result along with the Faraday environment object
323
+ # @yieldparam result [::Google::Cloud::Compute::V1::PublicDelegatedPrefix]
324
+ # @yieldparam response [::Faraday::Response]
325
+ #
326
+ # @return [::Google::Cloud::Compute::V1::PublicDelegatedPrefix]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
329
+ def get request, options = nil
330
+ raise ::ArgumentError, "request must be provided" if request.nil?
331
+
332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetPublicDelegatedPrefixeRequest
333
+
334
+ # Converts hash and nil to an options object
335
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
336
+
337
+ # Customize the options with defaults
338
+ call_metadata = {}
339
+
340
+ # Set x-goog-api-client header
341
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
342
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
343
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
344
+
345
+ options.apply_defaults timeout: @config.timeout,
346
+ metadata: call_metadata
347
+
348
+ uri, _body, _query_string_params = transcode_get request
349
+ response = @client_stub.make_get_request(
350
+ uri: uri,
351
+ options: options
352
+ )
353
+ result = ::Google::Cloud::Compute::V1::PublicDelegatedPrefix.decode_json response.body, ignore_unknown_fields: true
354
+
355
+ yield result, response if block_given?
356
+ result
357
+ rescue ::Faraday::Error => e
358
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
359
+ raise ::Google::Cloud::Error.from_error(gapic_error)
360
+ end
361
+
362
+ ##
363
+ # Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request.
364
+ #
365
+ # @overload insert(request, options = nil)
366
+ # Pass arguments to `insert` via a request object, either of type
367
+ # {::Google::Cloud::Compute::V1::InsertPublicDelegatedPrefixeRequest} or an equivalent Hash.
368
+ #
369
+ # @param request [::Google::Cloud::Compute::V1::InsertPublicDelegatedPrefixeRequest, ::Hash]
370
+ # A request object representing the call parameters. Required. To specify no
371
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
372
+ # @param options [::Gapic::CallOptions, ::Hash]
373
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
374
+ # Note: currently retry functionality is not implemented. While it is possible
375
+ # to set it using ::Gapic::CallOptions, it will not be applied
376
+ #
377
+ # @overload insert(project: nil, public_delegated_prefix_resource: nil, region: nil, request_id: nil)
378
+ # Pass arguments to `insert` via keyword arguments. Note that at
379
+ # least one keyword argument is required. To specify no parameters, or to keep all
380
+ # the default parameter values, pass an empty Hash as a request object (see above).
381
+ #
382
+ # @param project [::String]
383
+ # Project ID for this request.
384
+ # @param public_delegated_prefix_resource [::Google::Cloud::Compute::V1::PublicDelegatedPrefix, ::Hash]
385
+ # The body resource for this request
386
+ # @param region [::String]
387
+ # Name of the region of this request.
388
+ # @param request_id [::String]
389
+ # 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.
390
+ #
391
+ # 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.
392
+ #
393
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
394
+ # @yield [result, env] Access the result along with the Faraday environment object
395
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
396
+ # @yieldparam response [::Faraday::Response]
397
+ #
398
+ # @return [::Google::Cloud::Compute::V1::Operation]
399
+ #
400
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
401
+ def insert request, options = nil
402
+ raise ::ArgumentError, "request must be provided" if request.nil?
403
+
404
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertPublicDelegatedPrefixeRequest
405
+
406
+ # Converts hash and nil to an options object
407
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
408
+
409
+ # Customize the options with defaults
410
+ call_metadata = {}
411
+
412
+ # Set x-goog-api-client header
413
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
414
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
415
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
416
+
417
+ options.apply_defaults timeout: @config.timeout,
418
+ metadata: call_metadata
419
+
420
+ uri, body, _query_string_params = transcode_insert request
421
+ response = @client_stub.make_post_request(
422
+ uri: uri,
423
+ body: body,
424
+ options: options
425
+ )
426
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
427
+
428
+ yield result, response if block_given?
429
+ result
430
+ rescue ::Faraday::Error => e
431
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
432
+ raise ::Google::Cloud::Error.from_error(gapic_error)
433
+ end
434
+
435
+ ##
436
+ # Lists the PublicDelegatedPrefixes for a project in the given region.
437
+ #
438
+ # @overload list(request, options = nil)
439
+ # Pass arguments to `list` via a request object, either of type
440
+ # {::Google::Cloud::Compute::V1::ListPublicDelegatedPrefixesRequest} or an equivalent Hash.
441
+ #
442
+ # @param request [::Google::Cloud::Compute::V1::ListPublicDelegatedPrefixesRequest, ::Hash]
443
+ # A request object representing the call parameters. Required. To specify no
444
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
445
+ # @param options [::Gapic::CallOptions, ::Hash]
446
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
447
+ # Note: currently retry functionality is not implemented. While it is possible
448
+ # to set it using ::Gapic::CallOptions, it will not be applied
449
+ #
450
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
451
+ # Pass arguments to `list` via keyword arguments. Note that at
452
+ # least one keyword argument is required. To specify no parameters, or to keep all
453
+ # the default parameter values, pass an empty Hash as a request object (see above).
454
+ #
455
+ # @param filter [::String]
456
+ # 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 `<`.
457
+ #
458
+ # For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
459
+ #
460
+ # 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.
461
+ #
462
+ # 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) ```
463
+ # @param max_results [::Integer]
464
+ # 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`)
465
+ # @param order_by [::String]
466
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
467
+ #
468
+ # 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.
469
+ #
470
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
471
+ # @param page_token [::String]
472
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
473
+ # @param project [::String]
474
+ # Project ID for this request.
475
+ # @param region [::String]
476
+ # Name of the region of this request.
477
+ # @param return_partial_success [::Boolean]
478
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
479
+ # @yield [result, env] Access the result along with the Faraday environment object
480
+ # @yieldparam result [::Google::Cloud::Compute::V1::PublicDelegatedPrefixList]
481
+ # @yieldparam response [::Faraday::Response]
482
+ #
483
+ # @return [::Google::Cloud::Compute::V1::PublicDelegatedPrefixList]
484
+ #
485
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
486
+ def list request, options = nil
487
+ raise ::ArgumentError, "request must be provided" if request.nil?
488
+
489
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPublicDelegatedPrefixesRequest
490
+
491
+ # Converts hash and nil to an options object
492
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
493
+
494
+ # Customize the options with defaults
495
+ call_metadata = {}
496
+
497
+ # Set x-goog-api-client header
498
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
499
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
500
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
501
+
502
+ options.apply_defaults timeout: @config.timeout,
503
+ metadata: call_metadata
504
+
505
+ uri, _body, query_string_params = transcode_list request
506
+ response = @client_stub.make_get_request(
507
+ uri: uri,
508
+ params: query_string_params,
509
+ options: options
510
+ )
511
+ result = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixList.decode_json response.body, ignore_unknown_fields: true
512
+
513
+ yield result, response if block_given?
514
+ result
515
+ rescue ::Faraday::Error => e
516
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
517
+ raise ::Google::Cloud::Error.from_error(gapic_error)
518
+ end
519
+
520
+ ##
521
+ # Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
522
+ #
523
+ # @overload patch(request, options = nil)
524
+ # Pass arguments to `patch` via a request object, either of type
525
+ # {::Google::Cloud::Compute::V1::PatchPublicDelegatedPrefixeRequest} or an equivalent Hash.
526
+ #
527
+ # @param request [::Google::Cloud::Compute::V1::PatchPublicDelegatedPrefixeRequest, ::Hash]
528
+ # A request object representing the call parameters. Required. To specify no
529
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
530
+ # @param options [::Gapic::CallOptions, ::Hash]
531
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
532
+ # Note: currently retry functionality is not implemented. While it is possible
533
+ # to set it using ::Gapic::CallOptions, it will not be applied
534
+ #
535
+ # @overload patch(project: nil, public_delegated_prefix: nil, public_delegated_prefix_resource: nil, region: nil, request_id: nil)
536
+ # Pass arguments to `patch` via keyword arguments. Note that at
537
+ # least one keyword argument is required. To specify no parameters, or to keep all
538
+ # the default parameter values, pass an empty Hash as a request object (see above).
539
+ #
540
+ # @param project [::String]
541
+ # Project ID for this request.
542
+ # @param public_delegated_prefix [::String]
543
+ # Name of the PublicDelegatedPrefix resource to patch.
544
+ # @param public_delegated_prefix_resource [::Google::Cloud::Compute::V1::PublicDelegatedPrefix, ::Hash]
545
+ # The body resource for this request
546
+ # @param region [::String]
547
+ # Name of the region for this request.
548
+ # @param request_id [::String]
549
+ # 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.
550
+ #
551
+ # 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.
552
+ #
553
+ # The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
554
+ # @yield [result, env] Access the result along with the Faraday environment object
555
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
556
+ # @yieldparam response [::Faraday::Response]
557
+ #
558
+ # @return [::Google::Cloud::Compute::V1::Operation]
559
+ #
560
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
561
+ def patch request, options = nil
562
+ raise ::ArgumentError, "request must be provided" if request.nil?
563
+
564
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchPublicDelegatedPrefixeRequest
565
+
566
+ # Converts hash and nil to an options object
567
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
568
+
569
+ # Customize the options with defaults
570
+ call_metadata = {}
571
+
572
+ # Set x-goog-api-client header
573
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
574
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
575
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION
576
+
577
+ options.apply_defaults timeout: @config.timeout,
578
+ metadata: call_metadata
579
+
580
+ uri, body, _query_string_params = transcode_patch request
581
+ response = @client_stub.make_patch_request(
582
+ uri: uri,
583
+ body: body,
584
+ options: options
585
+ )
586
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
587
+
588
+ yield result, response if block_given?
589
+ result
590
+ rescue ::Faraday::Error => e
591
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
592
+ raise ::Google::Cloud::Error.from_error(gapic_error)
593
+ end
594
+
595
+ ##
596
+ # Configuration class for the PublicDelegatedPrefixes REST API.
597
+ #
598
+ # This class represents the configuration for PublicDelegatedPrefixes REST,
599
+ # providing control over credentials, timeouts, retry behavior, logging.
600
+ #
601
+ # Configuration can be applied globally to all clients, or to a single client
602
+ # on construction.
603
+ #
604
+ # # Examples
605
+ #
606
+ # To modify the global config, setting the timeout for all calls to 10 seconds:
607
+ #
608
+ # ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Client.configure do |config|
609
+ # config.timeout = 10.0
610
+ # end
611
+ #
612
+ # To apply the above configuration only to a new client:
613
+ #
614
+ # client = ::Google::Cloud::Compute::V1::PublicDelegatedPrefixes::Client.new do |config|
615
+ # config.timeout = 10.0
616
+ # end
617
+ #
618
+ # @!attribute [rw] endpoint
619
+ # The hostname or hostname:port of the service endpoint.
620
+ # Defaults to `"compute.googleapis.com"`.
621
+ # @return [::String]
622
+ # @!attribute [rw] credentials
623
+ # Credentials to send with calls. You may provide any of the following types:
624
+ # * (`String`) The path to a service account key file in JSON format
625
+ # * (`Hash`) A service account key as a Hash
626
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
627
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
628
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
629
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
630
+ # * (`nil`) indicating no credentials
631
+ # @return [::Object]
632
+ # @!attribute [rw] scope
633
+ # The OAuth scopes
634
+ # @return [::Array<::String>]
635
+ # @!attribute [rw] lib_name
636
+ # The library name as recorded in instrumentation and logging
637
+ # @return [::String]
638
+ # @!attribute [rw] lib_version
639
+ # The library version as recorded in instrumentation and logging
640
+ # @return [::String]
641
+ # @!attribute [rw] timeout
642
+ # The call timeout in seconds.
643
+ # @return [::Numeric]
644
+ #
645
+ class Configuration
646
+ extend ::Gapic::Config
647
+
648
+ config_attr :endpoint, "compute.googleapis.com", ::String
649
+ config_attr :credentials, nil do |value|
650
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
651
+ allowed.any? { |klass| klass === value }
652
+ end
653
+ config_attr :scope, nil, ::String, ::Array, nil
654
+ config_attr :lib_name, nil, ::String, nil
655
+ config_attr :lib_version, nil, ::String, nil
656
+ config_attr :timeout, nil, ::Numeric, nil
657
+
658
+ # @private
659
+ def initialize parent_config = nil
660
+ @parent_config = parent_config unless parent_config.nil?
661
+
662
+ yield self if block_given?
663
+ end
664
+ end
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end
671
+ end