google-cloud-profiler-v2 0.3.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/README.md +5 -5
  4. data/lib/google/cloud/profiler/v2/export_service/client.rb +446 -0
  5. data/lib/google/cloud/profiler/v2/export_service/credentials.rb +53 -0
  6. data/lib/google/cloud/profiler/v2/export_service/paths.rb +47 -0
  7. data/lib/google/cloud/profiler/v2/export_service/rest/client.rb +413 -0
  8. data/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb +128 -0
  9. data/lib/google/cloud/profiler/v2/export_service/rest.rb +53 -0
  10. data/lib/google/cloud/profiler/v2/export_service.rb +56 -0
  11. data/lib/google/cloud/profiler/v2/profiler_service/client.rb +79 -23
  12. data/lib/google/cloud/profiler/v2/profiler_service/paths.rb +64 -0
  13. data/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb +622 -0
  14. data/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb +249 -0
  15. data/lib/google/cloud/profiler/v2/profiler_service/rest.rb +56 -0
  16. data/lib/google/cloud/profiler/v2/profiler_service.rb +10 -4
  17. data/lib/google/cloud/profiler/v2/rest.rb +38 -0
  18. data/lib/google/cloud/profiler/v2/version.rb +1 -1
  19. data/lib/google/cloud/profiler/v2.rb +8 -2
  20. data/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb +33 -38
  21. data/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb +39 -6
  22. data/proto_docs/google/api/client.rb +399 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb +52 -7
  26. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  27. metadata +23 -119
@@ -0,0 +1,413 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/devtools/cloudprofiler/v2/profiler_pb"
21
+ require "google/cloud/profiler/v2/export_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Profiler
26
+ module V2
27
+ module ExportService
28
+ module Rest
29
+ ##
30
+ # REST client for the ExportService service.
31
+ #
32
+ # Service allows existing Cloud Profiler customers to export their profile data
33
+ # out of Google Cloud.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :export_service_stub
46
+
47
+ ##
48
+ # Configure the ExportService Client class.
49
+ #
50
+ # See {::Google::Cloud::Profiler::V2::ExportService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all ExportService clients
56
+ # ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "Profiler", "V2"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 130.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the ExportService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::Profiler::V2::ExportService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @export_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new ExportService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the ExportService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @export_service_stub = ::Google::Cloud::Profiler::V2::ExportService::Rest::ServiceStub.new(
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ credentials: credentials
160
+ )
161
+ end
162
+
163
+ # Service calls
164
+
165
+ ##
166
+ # Lists profiles which have been collected so far and for which the caller
167
+ # has permission to view.
168
+ #
169
+ # @overload list_profiles(request, options = nil)
170
+ # Pass arguments to `list_profiles` via a request object, either of type
171
+ # {::Google::Cloud::Profiler::V2::ListProfilesRequest} or an equivalent Hash.
172
+ #
173
+ # @param request [::Google::Cloud::Profiler::V2::ListProfilesRequest, ::Hash]
174
+ # A request object representing the call parameters. Required. To specify no
175
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
176
+ # @param options [::Gapic::CallOptions, ::Hash]
177
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
178
+ #
179
+ # @overload list_profiles(parent: nil, page_size: nil, page_token: nil)
180
+ # Pass arguments to `list_profiles` via keyword arguments. Note that at
181
+ # least one keyword argument is required. To specify no parameters, or to keep all
182
+ # the default parameter values, pass an empty Hash as a request object (see above).
183
+ #
184
+ # @param parent [::String]
185
+ # Required. The parent, which owns this collection of profiles.
186
+ # Format: projects/\\{user_project_id}
187
+ # @param page_size [::Integer]
188
+ # The maximum number of items to return.
189
+ # Default page_size is 1000.
190
+ # Max limit is 1000.
191
+ # @param page_token [::String]
192
+ # The token to continue pagination and get profiles from a particular page.
193
+ # When paginating, all other parameters provided to `ListProfiles` must match
194
+ # the call that provided the page token.
195
+ # @yield [result, operation] Access the result along with the TransportOperation object
196
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>]
197
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
198
+ #
199
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Profiler::V2::Profile>]
200
+ #
201
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
202
+ #
203
+ # @example Basic example
204
+ # require "google/cloud/profiler/v2"
205
+ #
206
+ # # Create a client object. The client can be reused for multiple calls.
207
+ # client = Google::Cloud::Profiler::V2::ExportService::Rest::Client.new
208
+ #
209
+ # # Create a request. To set request fields, pass in keyword arguments.
210
+ # request = Google::Cloud::Profiler::V2::ListProfilesRequest.new
211
+ #
212
+ # # Call the list_profiles method.
213
+ # result = client.list_profiles request
214
+ #
215
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
216
+ # # over elements, and API calls will be issued to fetch pages as needed.
217
+ # result.each do |item|
218
+ # # Each element is of type ::Google::Cloud::Profiler::V2::Profile.
219
+ # p item
220
+ # end
221
+ #
222
+ def list_profiles request, options = nil
223
+ raise ::ArgumentError, "request must be provided" if request.nil?
224
+
225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::ListProfilesRequest
226
+
227
+ # Converts hash and nil to an options object
228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
229
+
230
+ # Customize the options with defaults
231
+ call_metadata = @config.rpcs.list_profiles.metadata.to_h
232
+
233
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
234
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
235
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
236
+ gapic_version: ::Google::Cloud::Profiler::V2::VERSION,
237
+ transports_version_send: [:rest]
238
+
239
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
240
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
241
+
242
+ options.apply_defaults timeout: @config.rpcs.list_profiles.timeout,
243
+ metadata: call_metadata,
244
+ retry_policy: @config.rpcs.list_profiles.retry_policy
245
+
246
+ options.apply_defaults timeout: @config.timeout,
247
+ metadata: @config.metadata,
248
+ retry_policy: @config.retry_policy
249
+
250
+ @export_service_stub.list_profiles request, options do |result, operation|
251
+ result = ::Gapic::Rest::PagedEnumerable.new @export_service_stub, :list_profiles, "profiles", request, result, options
252
+ yield result, operation if block_given?
253
+ return result
254
+ end
255
+ rescue ::Gapic::Rest::Error => e
256
+ raise ::Google::Cloud::Error.from_error(e)
257
+ end
258
+
259
+ ##
260
+ # Configuration class for the ExportService REST API.
261
+ #
262
+ # This class represents the configuration for ExportService REST,
263
+ # providing control over timeouts, retry behavior, logging, transport
264
+ # parameters, and other low-level controls. Certain parameters can also be
265
+ # applied individually to specific RPCs. See
266
+ # {::Google::Cloud::Profiler::V2::ExportService::Rest::Client::Configuration::Rpcs}
267
+ # for a list of RPCs that can be configured independently.
268
+ #
269
+ # Configuration can be applied globally to all clients, or to a single client
270
+ # on construction.
271
+ #
272
+ # @example
273
+ #
274
+ # # Modify the global config, setting the timeout for
275
+ # # list_profiles to 20 seconds,
276
+ # # and all remaining timeouts to 10 seconds.
277
+ # ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.configure do |config|
278
+ # config.timeout = 10.0
279
+ # config.rpcs.list_profiles.timeout = 20.0
280
+ # end
281
+ #
282
+ # # Apply the above configuration only to a new client.
283
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new do |config|
284
+ # config.timeout = 10.0
285
+ # config.rpcs.list_profiles.timeout = 20.0
286
+ # end
287
+ #
288
+ # @!attribute [rw] endpoint
289
+ # A custom service endpoint, as a hostname or hostname:port. The default is
290
+ # nil, indicating to use the default endpoint in the current universe domain.
291
+ # @return [::String,nil]
292
+ # @!attribute [rw] credentials
293
+ # Credentials to send with calls. You may provide any of the following types:
294
+ # * (`String`) The path to a service account key file in JSON format
295
+ # * (`Hash`) A service account key as a Hash
296
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
297
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
298
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
299
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
300
+ # * (`nil`) indicating no credentials
301
+ # @return [::Object]
302
+ # @!attribute [rw] scope
303
+ # The OAuth scopes
304
+ # @return [::Array<::String>]
305
+ # @!attribute [rw] lib_name
306
+ # The library name as recorded in instrumentation and logging
307
+ # @return [::String]
308
+ # @!attribute [rw] lib_version
309
+ # The library version as recorded in instrumentation and logging
310
+ # @return [::String]
311
+ # @!attribute [rw] timeout
312
+ # The call timeout in seconds.
313
+ # @return [::Numeric]
314
+ # @!attribute [rw] metadata
315
+ # Additional headers to be sent with the call.
316
+ # @return [::Hash{::Symbol=>::String}]
317
+ # @!attribute [rw] retry_policy
318
+ # The retry policy. The value is a hash with the following keys:
319
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
320
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
321
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
322
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
323
+ # trigger a retry.
324
+ # @return [::Hash]
325
+ # @!attribute [rw] quota_project
326
+ # A separate project against which to charge quota.
327
+ # @return [::String]
328
+ # @!attribute [rw] universe_domain
329
+ # The universe domain within which to make requests. This determines the
330
+ # default endpoint URL. The default value of nil uses the environment
331
+ # universe (usually the default "googleapis.com" universe).
332
+ # @return [::String,nil]
333
+ #
334
+ class Configuration
335
+ extend ::Gapic::Config
336
+
337
+ # @private
338
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
339
+ DEFAULT_ENDPOINT = "cloudprofiler.googleapis.com"
340
+
341
+ config_attr :endpoint, nil, ::String, nil
342
+ config_attr :credentials, nil do |value|
343
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
344
+ allowed.any? { |klass| klass === value }
345
+ end
346
+ config_attr :scope, nil, ::String, ::Array, nil
347
+ config_attr :lib_name, nil, ::String, nil
348
+ config_attr :lib_version, nil, ::String, nil
349
+ config_attr :timeout, nil, ::Numeric, nil
350
+ config_attr :metadata, nil, ::Hash, nil
351
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
352
+ config_attr :quota_project, nil, ::String, nil
353
+ config_attr :universe_domain, nil, ::String, nil
354
+
355
+ # @private
356
+ def initialize parent_config = nil
357
+ @parent_config = parent_config unless parent_config.nil?
358
+
359
+ yield self if block_given?
360
+ end
361
+
362
+ ##
363
+ # Configurations for individual RPCs
364
+ # @return [Rpcs]
365
+ #
366
+ def rpcs
367
+ @rpcs ||= begin
368
+ parent_rpcs = nil
369
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
370
+ Rpcs.new parent_rpcs
371
+ end
372
+ end
373
+
374
+ ##
375
+ # Configuration RPC class for the ExportService API.
376
+ #
377
+ # Includes fields providing the configuration for each RPC in this service.
378
+ # Each configuration object is of type `Gapic::Config::Method` and includes
379
+ # the following configuration fields:
380
+ #
381
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
382
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
383
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
384
+ # include the following keys:
385
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
386
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
387
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
388
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
389
+ # trigger a retry.
390
+ #
391
+ class Rpcs
392
+ ##
393
+ # RPC-specific configuration for `list_profiles`
394
+ # @return [::Gapic::Config::Method]
395
+ #
396
+ attr_reader :list_profiles
397
+
398
+ # @private
399
+ def initialize parent_rpcs = nil
400
+ list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles
401
+ @list_profiles = ::Gapic::Config::Method.new list_profiles_config
402
+
403
+ yield self if block_given?
404
+ end
405
+ end
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
@@ -0,0 +1,128 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/devtools/cloudprofiler/v2/profiler_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Profiler
24
+ module V2
25
+ module ExportService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the ExportService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: true,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the list_profiles REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Cloud::Profiler::V2::ListProfilesResponse]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Cloud::Profiler::V2::ListProfilesResponse]
77
+ # A result object deserialized from the server's reply
78
+ def list_profiles request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_profiles_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Cloud::Profiler::V2::ListProfilesResponse.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # @private
104
+ #
105
+ # GRPC transcoding helper method for the list_profiles REST call
106
+ #
107
+ # @param request_pb [::Google::Cloud::Profiler::V2::ListProfilesRequest]
108
+ # A request object representing the call parameters. Required.
109
+ # @return [Array(String, [String, nil], Hash{String => String})]
110
+ # Uri, Body, Query string parameters
111
+ def self.transcode_list_profiles_request request_pb
112
+ transcoder = Gapic::Rest::GrpcTranscoder.new
113
+ .with_bindings(
114
+ uri_method: :get,
115
+ uri_template: "/v2/{parent}/profiles",
116
+ matches: [
117
+ ["parent", %r{^projects/[^/]+/?$}, false]
118
+ ]
119
+ )
120
+ transcoder.transcode request_pb
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/profiler/v2/version"
24
+
25
+ require "google/cloud/profiler/v2/export_service/credentials"
26
+ require "google/cloud/profiler/v2/export_service/paths"
27
+ require "google/cloud/profiler/v2/export_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Profiler
32
+ module V2
33
+ ##
34
+ # Service allows existing Cloud Profiler customers to export their profile data
35
+ # out of Google Cloud.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/profiler/v2/export_service/rest"
40
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new
41
+ #
42
+ module ExportService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/profiler/v2/export_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/profiler/v2/version"
24
+
25
+ require "google/cloud/profiler/v2/export_service/credentials"
26
+ require "google/cloud/profiler/v2/export_service/paths"
27
+ require "google/cloud/profiler/v2/export_service/client"
28
+ require "google/cloud/profiler/v2/export_service/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Profiler
33
+ module V2
34
+ ##
35
+ # Service allows existing Cloud Profiler customers to export their profile data
36
+ # out of Google Cloud.
37
+ #
38
+ # @example Load this service and instantiate a gRPC client
39
+ #
40
+ # require "google/cloud/profiler/v2/export_service"
41
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Client.new
42
+ #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/profiler/v2/export_service/rest"
46
+ # client = ::Google::Cloud::Profiler::V2::ExportService::Rest::Client.new
47
+ #
48
+ module ExportService
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "export_service", "helpers.rb"
56
+ require "google/cloud/profiler/v2/export_service/helpers" if ::File.file? helper_path