google-cloud-compute-v1 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -0
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +29 -4
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +38 -20
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +33 -8
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +70 -44
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +33 -8
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +70 -44
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +35 -13
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +110 -74
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +38 -17
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +142 -98
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +52 -1
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +29 -4
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +38 -20
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +41 -19
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +158 -110
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +31 -7
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +62 -38
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +38 -19
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +158 -110
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +32 -7
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +62 -38
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +34 -9
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +78 -50
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +32 -7
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +62 -38
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +33 -8
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +70 -44
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +33 -8
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +70 -44
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +29 -6
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +54 -32
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +28 -4
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +38 -20
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +31 -6
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +54 -32
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +33 -8
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +70 -44
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +27 -2
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +22 -8
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +33 -12
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +102 -68
  44. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +31 -6
  45. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +54 -32
  46. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +466 -21
  47. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +428 -120
  48. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +35 -10
  49. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +86 -56
  50. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +28 -3
  51. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +30 -14
  52. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +31 -9
  53. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +78 -50
  54. data/lib/google/cloud/compute/v1/instances/rest/client.rb +66 -50
  55. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +398 -290
  56. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +32 -10
  57. data/lib/google/cloud/compute/v1/instant_snapshots/rest/service_stub.rb +86 -56
  58. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +33 -8
  59. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +70 -44
  60. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +28 -3
  61. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +30 -14
  62. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +28 -3
  63. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +30 -14
  64. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +32 -9
  65. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +78 -50
  66. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +27 -3
  67. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +30 -14
  68. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +30 -8
  69. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +70 -44
  70. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +30 -8
  71. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +70 -44
  72. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +29 -4
  73. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +38 -20
  74. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +32 -10
  75. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +86 -56
  76. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +31 -6
  77. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +54 -32
  78. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +34 -10
  79. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +86 -56
  80. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +37 -17
  81. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +142 -98
  82. data/lib/google/cloud/compute/v1/network_profiles/credentials.rb +53 -0
  83. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +522 -0
  84. data/lib/google/cloud/compute/v1/network_profiles/rest/service_stub.rb +204 -0
  85. data/lib/google/cloud/compute/v1/network_profiles/rest.rb +51 -0
  86. data/lib/google/cloud/compute/v1/network_profiles.rb +47 -0
  87. data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -12
  88. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +102 -68
  89. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +38 -16
  90. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +134 -92
  91. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +31 -9
  92. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +78 -50
  93. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +29 -4
  94. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +38 -20
  95. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +32 -8
  96. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +70 -44
  97. data/lib/google/cloud/compute/v1/projects/rest/client.rb +39 -15
  98. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +126 -86
  99. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +33 -8
  100. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +70 -44
  101. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +34 -9
  102. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +78 -50
  103. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +32 -7
  104. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +62 -38
  105. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +34 -13
  106. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +110 -74
  107. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +31 -6
  108. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +54 -32
  109. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +28 -3
  110. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +30 -14
  111. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +40 -18
  112. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +150 -104
  113. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +31 -6
  114. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +54 -32
  115. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +32 -7
  116. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +62 -38
  117. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +465 -20
  118. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +420 -114
  119. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +30 -5
  120. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +46 -26
  121. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +30 -5
  122. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +46 -26
  123. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +28 -2
  124. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +22 -8
  125. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +31 -9
  126. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/service_stub.rb +78 -50
  127. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +33 -8
  128. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +70 -44
  129. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +37 -18
  130. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +150 -104
  131. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +30 -5
  132. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +46 -26
  133. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +28 -5
  134. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +46 -26
  135. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +139 -10
  136. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +149 -55
  137. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +30 -5
  138. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +46 -26
  139. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +31 -7
  140. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +62 -38
  141. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +31 -6
  142. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +54 -32
  143. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +33 -8
  144. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +70 -44
  145. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +30 -5
  146. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +46 -26
  147. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +32 -8
  148. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +70 -44
  149. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +28 -2
  150. data/lib/google/cloud/compute/v1/region_zones/rest/service_stub.rb +22 -8
  151. data/lib/google/cloud/compute/v1/regions/rest/client.rb +28 -3
  152. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +30 -14
  153. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +33 -11
  154. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +94 -62
  155. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +32 -10
  156. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +86 -56
  157. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  158. data/lib/google/cloud/compute/v1/routers/rest/client.rb +34 -12
  159. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +102 -68
  160. data/lib/google/cloud/compute/v1/routes/rest/client.rb +30 -5
  161. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +46 -26
  162. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +36 -13
  163. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +110 -74
  164. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +32 -10
  165. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +86 -56
  166. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +28 -3
  167. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +30 -14
  168. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +31 -9
  169. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +78 -50
  170. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +31 -6
  171. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +54 -32
  172. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +32 -8
  173. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +70 -44
  174. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +29 -4
  175. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +38 -20
  176. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +31 -11
  177. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +94 -62
  178. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +35 -13
  179. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +110 -74
  180. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +31 -6
  181. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +54 -32
  182. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +33 -8
  183. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +70 -44
  184. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +37 -12
  185. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +102 -68
  186. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +32 -7
  187. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -38
  188. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +37 -13
  189. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +110 -74
  190. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -10
  191. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +86 -56
  192. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +33 -8
  193. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +70 -44
  194. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +32 -7
  195. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +62 -38
  196. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +34 -10
  197. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +86 -56
  198. data/lib/google/cloud/compute/v1/version.rb +1 -1
  199. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +32 -9
  200. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +78 -50
  201. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +32 -7
  202. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +62 -38
  203. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +28 -5
  204. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +46 -26
  205. data/lib/google/cloud/compute/v1/zones/rest/client.rb +28 -3
  206. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +30 -14
  207. data/lib/google/cloud/compute/v1.rb +1 -0
  208. data/proto_docs/google/api/client.rb +19 -0
  209. data/proto_docs/google/cloud/compute/v1/compute.rb +889 -33
  210. metadata +10 -5
@@ -0,0 +1,522 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/network_profiles/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module NetworkProfiles
28
+ module Rest
29
+ ##
30
+ # REST client for the NetworkProfiles service.
31
+ #
32
+ # The NetworkProfiles API.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
40
+
41
+ # @private
42
+ attr_reader :network_profiles_stub
43
+
44
+ ##
45
+ # Configure the NetworkProfiles Client class.
46
+ #
47
+ # See {::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all NetworkProfiles clients
53
+ # ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "Compute", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.get.timeout = 600.0
74
+ default_config.rpcs.get.retry_policy = {
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config.rpcs.list.timeout = 600.0
79
+ default_config.rpcs.list.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the NetworkProfiles Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @network_profiles_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new NetworkProfiles REST client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the NetworkProfiles client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @network_profiles_stub = ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @network_profiles_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+ end
175
+
176
+ ##
177
+ # The logger used for request/response debug logging.
178
+ #
179
+ # @return [Logger]
180
+ #
181
+ def logger
182
+ @network_profiles_stub.logger
183
+ end
184
+
185
+ # Service calls
186
+
187
+ ##
188
+ # Returns the specified network profile.
189
+ #
190
+ # @overload get(request, options = nil)
191
+ # Pass arguments to `get` via a request object, either of type
192
+ # {::Google::Cloud::Compute::V1::GetNetworkProfileRequest} or an equivalent Hash.
193
+ #
194
+ # @param request [::Google::Cloud::Compute::V1::GetNetworkProfileRequest, ::Hash]
195
+ # A request object representing the call parameters. Required. To specify no
196
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
197
+ # @param options [::Gapic::CallOptions, ::Hash]
198
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
199
+ #
200
+ # @overload get(network_profile: nil, project: nil)
201
+ # Pass arguments to `get` via keyword arguments. Note that at
202
+ # least one keyword argument is required. To specify no parameters, or to keep all
203
+ # the default parameter values, pass an empty Hash as a request object (see above).
204
+ #
205
+ # @param network_profile [::String]
206
+ # Name of the network profile to return.
207
+ # @param project [::String]
208
+ # Project ID for this request.
209
+ # @yield [result, operation] Access the result along with the TransportOperation object
210
+ # @yieldparam result [::Google::Cloud::Compute::V1::NetworkProfile]
211
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
212
+ #
213
+ # @return [::Google::Cloud::Compute::V1::NetworkProfile]
214
+ #
215
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
216
+ #
217
+ # @example Basic example
218
+ # require "google/cloud/compute/v1"
219
+ #
220
+ # # Create a client object. The client can be reused for multiple calls.
221
+ # client = Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.new
222
+ #
223
+ # # Create a request. To set request fields, pass in keyword arguments.
224
+ # request = Google::Cloud::Compute::V1::GetNetworkProfileRequest.new
225
+ #
226
+ # # Call the get method.
227
+ # result = client.get request
228
+ #
229
+ # # The returned object is of type Google::Cloud::Compute::V1::NetworkProfile.
230
+ # p result
231
+ #
232
+ def get request, options = nil
233
+ raise ::ArgumentError, "request must be provided" if request.nil?
234
+
235
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetNetworkProfileRequest
236
+
237
+ # Converts hash and nil to an options object
238
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
239
+
240
+ # Customize the options with defaults
241
+ call_metadata = @config.rpcs.get.metadata.to_h
242
+
243
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
244
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
245
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
246
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
247
+ transports_version_send: [:rest]
248
+
249
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
250
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
251
+
252
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
253
+ metadata: call_metadata,
254
+ retry_policy: @config.rpcs.get.retry_policy
255
+
256
+ options.apply_defaults timeout: @config.timeout,
257
+ metadata: @config.metadata,
258
+ retry_policy: @config.retry_policy
259
+
260
+ @network_profiles_stub.get request, options do |result, operation|
261
+ yield result, operation if block_given?
262
+ end
263
+ rescue ::Gapic::Rest::Error => e
264
+ raise ::Google::Cloud::Error.from_error(e)
265
+ end
266
+
267
+ ##
268
+ # Retrieves a list of network profiles available to the specified project.
269
+ #
270
+ # @overload list(request, options = nil)
271
+ # Pass arguments to `list` via a request object, either of type
272
+ # {::Google::Cloud::Compute::V1::ListNetworkProfilesRequest} or an equivalent Hash.
273
+ #
274
+ # @param request [::Google::Cloud::Compute::V1::ListNetworkProfilesRequest, ::Hash]
275
+ # A request object representing the call parameters. Required. To specify no
276
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
277
+ # @param options [::Gapic::CallOptions, ::Hash]
278
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
279
+ #
280
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
281
+ # Pass arguments to `list` via keyword arguments. Note that at
282
+ # least one keyword argument is required. To specify no parameters, or to keep all
283
+ # the default parameter values, pass an empty Hash as a request object (see above).
284
+ #
285
+ # @param filter [::String]
286
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The 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`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` 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) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
287
+ # @param max_results [::Integer]
288
+ # 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`)
289
+ # @param order_by [::String]
290
+ # 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.
291
+ # @param page_token [::String]
292
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
293
+ # @param project [::String]
294
+ # Project ID for this request.
295
+ # @param return_partial_success [::Boolean]
296
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
297
+ # @yield [result, operation] Access the result along with the TransportOperation object
298
+ # @yieldparam result [::Google::Cloud::Compute::V1::NetworkProfilesListResponse]
299
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
300
+ #
301
+ # @return [::Google::Cloud::Compute::V1::NetworkProfilesListResponse]
302
+ #
303
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
304
+ #
305
+ # @example Basic example
306
+ # require "google/cloud/compute/v1"
307
+ #
308
+ # # Create a client object. The client can be reused for multiple calls.
309
+ # client = Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.new
310
+ #
311
+ # # Create a request. To set request fields, pass in keyword arguments.
312
+ # request = Google::Cloud::Compute::V1::ListNetworkProfilesRequest.new
313
+ #
314
+ # # Call the list method.
315
+ # result = client.list request
316
+ #
317
+ # # The returned object is of type Google::Cloud::Compute::V1::NetworkProfilesListResponse.
318
+ # p result
319
+ #
320
+ def list request, options = nil
321
+ raise ::ArgumentError, "request must be provided" if request.nil?
322
+
323
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListNetworkProfilesRequest
324
+
325
+ # Converts hash and nil to an options object
326
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
327
+
328
+ # Customize the options with defaults
329
+ call_metadata = @config.rpcs.list.metadata.to_h
330
+
331
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
332
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
333
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
334
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
335
+ transports_version_send: [:rest]
336
+
337
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
338
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
339
+
340
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
341
+ metadata: call_metadata,
342
+ retry_policy: @config.rpcs.list.retry_policy
343
+
344
+ options.apply_defaults timeout: @config.timeout,
345
+ metadata: @config.metadata,
346
+ retry_policy: @config.retry_policy
347
+
348
+ @network_profiles_stub.list request, options do |result, operation|
349
+ yield result, operation if block_given?
350
+ end
351
+ rescue ::Gapic::Rest::Error => e
352
+ raise ::Google::Cloud::Error.from_error(e)
353
+ end
354
+
355
+ ##
356
+ # Configuration class for the NetworkProfiles REST API.
357
+ #
358
+ # This class represents the configuration for NetworkProfiles REST,
359
+ # providing control over timeouts, retry behavior, logging, transport
360
+ # parameters, and other low-level controls. Certain parameters can also be
361
+ # applied individually to specific RPCs. See
362
+ # {::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client::Configuration::Rpcs}
363
+ # for a list of RPCs that can be configured independently.
364
+ #
365
+ # Configuration can be applied globally to all clients, or to a single client
366
+ # on construction.
367
+ #
368
+ # @example
369
+ #
370
+ # # Modify the global config, setting the timeout for
371
+ # # get to 20 seconds,
372
+ # # and all remaining timeouts to 10 seconds.
373
+ # ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.configure do |config|
374
+ # config.timeout = 10.0
375
+ # config.rpcs.get.timeout = 20.0
376
+ # end
377
+ #
378
+ # # Apply the above configuration only to a new client.
379
+ # client = ::Google::Cloud::Compute::V1::NetworkProfiles::Rest::Client.new do |config|
380
+ # config.timeout = 10.0
381
+ # config.rpcs.get.timeout = 20.0
382
+ # end
383
+ #
384
+ # @!attribute [rw] endpoint
385
+ # A custom service endpoint, as a hostname or hostname:port. The default is
386
+ # nil, indicating to use the default endpoint in the current universe domain.
387
+ # @return [::String,nil]
388
+ # @!attribute [rw] credentials
389
+ # Credentials to send with calls. You may provide any of the following types:
390
+ # * (`String`) The path to a service account key file in JSON format
391
+ # * (`Hash`) A service account key as a Hash
392
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
393
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
394
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
395
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
396
+ # * (`nil`) indicating no credentials
397
+ # @return [::Object]
398
+ # @!attribute [rw] scope
399
+ # The OAuth scopes
400
+ # @return [::Array<::String>]
401
+ # @!attribute [rw] lib_name
402
+ # The library name as recorded in instrumentation and logging
403
+ # @return [::String]
404
+ # @!attribute [rw] lib_version
405
+ # The library version as recorded in instrumentation and logging
406
+ # @return [::String]
407
+ # @!attribute [rw] timeout
408
+ # The call timeout in seconds.
409
+ # @return [::Numeric]
410
+ # @!attribute [rw] metadata
411
+ # Additional headers to be sent with the call.
412
+ # @return [::Hash{::Symbol=>::String}]
413
+ # @!attribute [rw] retry_policy
414
+ # The retry policy. The value is a hash with the following keys:
415
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
416
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
417
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
418
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
419
+ # trigger a retry.
420
+ # @return [::Hash]
421
+ # @!attribute [rw] quota_project
422
+ # A separate project against which to charge quota.
423
+ # @return [::String]
424
+ # @!attribute [rw] universe_domain
425
+ # The universe domain within which to make requests. This determines the
426
+ # default endpoint URL. The default value of nil uses the environment
427
+ # universe (usually the default "googleapis.com" universe).
428
+ # @return [::String,nil]
429
+ # @!attribute [rw] logger
430
+ # A custom logger to use for request/response debug logging, or the value
431
+ # `:default` (the default) to construct a default logger, or `nil` to
432
+ # explicitly disable logging.
433
+ # @return [::Logger,:default,nil]
434
+ #
435
+ class Configuration
436
+ extend ::Gapic::Config
437
+
438
+ # @private
439
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
440
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
441
+
442
+ config_attr :endpoint, nil, ::String, nil
443
+ config_attr :credentials, nil do |value|
444
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
445
+ allowed.any? { |klass| klass === value }
446
+ end
447
+ config_attr :scope, nil, ::String, ::Array, nil
448
+ config_attr :lib_name, nil, ::String, nil
449
+ config_attr :lib_version, nil, ::String, nil
450
+ config_attr :timeout, nil, ::Numeric, nil
451
+ config_attr :metadata, nil, ::Hash, nil
452
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
453
+ config_attr :quota_project, nil, ::String, nil
454
+ config_attr :universe_domain, nil, ::String, nil
455
+ config_attr :logger, :default, ::Logger, nil, :default
456
+
457
+ # @private
458
+ def initialize parent_config = nil
459
+ @parent_config = parent_config unless parent_config.nil?
460
+
461
+ yield self if block_given?
462
+ end
463
+
464
+ ##
465
+ # Configurations for individual RPCs
466
+ # @return [Rpcs]
467
+ #
468
+ def rpcs
469
+ @rpcs ||= begin
470
+ parent_rpcs = nil
471
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
472
+ Rpcs.new parent_rpcs
473
+ end
474
+ end
475
+
476
+ ##
477
+ # Configuration RPC class for the NetworkProfiles API.
478
+ #
479
+ # Includes fields providing the configuration for each RPC in this service.
480
+ # Each configuration object is of type `Gapic::Config::Method` and includes
481
+ # the following configuration fields:
482
+ #
483
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
484
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
485
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
486
+ # include the following keys:
487
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
488
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
489
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
490
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
491
+ # trigger a retry.
492
+ #
493
+ class Rpcs
494
+ ##
495
+ # RPC-specific configuration for `get`
496
+ # @return [::Gapic::Config::Method]
497
+ #
498
+ attr_reader :get
499
+ ##
500
+ # RPC-specific configuration for `list`
501
+ # @return [::Gapic::Config::Method]
502
+ #
503
+ attr_reader :list
504
+
505
+ # @private
506
+ def initialize parent_rpcs = nil
507
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
508
+ @get = ::Gapic::Config::Method.new get_config
509
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
510
+ @list = ::Gapic::Config::Method.new list_config
511
+
512
+ yield self if block_given?
513
+ end
514
+ end
515
+ end
516
+ end
517
+ end
518
+ end
519
+ end
520
+ end
521
+ end
522
+ end