google-cloud-storage_insights-v1 0.a → 0.1.0

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/storage_insights/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/storage_insights/v1/rest.rb +38 -0
  7. data/lib/google/cloud/storage_insights/v1/storage_insights/client.rb +1055 -0
  8. data/lib/google/cloud/storage_insights/v1/storage_insights/credentials.rb +47 -0
  9. data/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb +90 -0
  10. data/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb +872 -0
  11. data/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb +463 -0
  12. data/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb +53 -0
  13. data/lib/google/cloud/storage_insights/v1/storage_insights.rb +55 -0
  14. data/lib/google/cloud/storage_insights/v1/version.rb +7 -2
  15. data/lib/google/cloud/storage_insights/v1.rb +45 -0
  16. data/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb +164 -0
  17. data/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb +57 -0
  18. data/lib/google-cloud-storage_insights-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/client.rb +372 -0
  21. data/proto_docs/google/api/field_behavior.rb +71 -0
  22. data/proto_docs/google/api/launch_stage.rb +71 -0
  23. data/proto_docs/google/api/resource.rb +222 -0
  24. data/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb +431 -0
  25. data/proto_docs/google/protobuf/any.rb +141 -0
  26. data/proto_docs/google/protobuf/duration.rb +98 -0
  27. data/proto_docs/google/protobuf/empty.rb +34 -0
  28. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  29. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  30. data/proto_docs/google/rpc/status.rb +48 -0
  31. data/proto_docs/google/type/date.rb +53 -0
  32. data/proto_docs/google/type/datetime.rb +99 -0
  33. metadata +206 -12
@@ -0,0 +1,431 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module StorageInsights
23
+ module V1
24
+ # Message for requesting list of ReportConfigs
25
+ # @!attribute [rw] parent
26
+ # @return [::String]
27
+ # Required. Parent value for ListReportConfigsRequest
28
+ # @!attribute [rw] page_size
29
+ # @return [::Integer]
30
+ # Requested page size. Server may return fewer items than requested.
31
+ # If unspecified, server will pick an appropriate default.
32
+ # @!attribute [rw] page_token
33
+ # @return [::String]
34
+ # A token identifying a page of results the server should return.
35
+ # @!attribute [rw] filter
36
+ # @return [::String]
37
+ # Filtering results
38
+ # @!attribute [rw] order_by
39
+ # @return [::String]
40
+ # Hint for how to order the results
41
+ class ListReportConfigsRequest
42
+ include ::Google::Protobuf::MessageExts
43
+ extend ::Google::Protobuf::MessageExts::ClassMethods
44
+ end
45
+
46
+ # Message for response to listing ReportConfigs
47
+ # @!attribute [rw] report_configs
48
+ # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportConfig>]
49
+ # The list of ReportConfig
50
+ # @!attribute [rw] next_page_token
51
+ # @return [::String]
52
+ # A token identifying a page of results the server should return.
53
+ # @!attribute [rw] unreachable
54
+ # @return [::Array<::String>]
55
+ # Locations that could not be reached.
56
+ class ListReportConfigsResponse
57
+ include ::Google::Protobuf::MessageExts
58
+ extend ::Google::Protobuf::MessageExts::ClassMethods
59
+ end
60
+
61
+ # Message for getting a ReportConfig
62
+ # @!attribute [rw] name
63
+ # @return [::String]
64
+ # Required. Name of the resource
65
+ class GetReportConfigRequest
66
+ include ::Google::Protobuf::MessageExts
67
+ extend ::Google::Protobuf::MessageExts::ClassMethods
68
+ end
69
+
70
+ # Message for creating a ReportConfig
71
+ # @!attribute [rw] parent
72
+ # @return [::String]
73
+ # Required. Value for parent.
74
+ # @!attribute [rw] report_config
75
+ # @return [::Google::Cloud::StorageInsights::V1::ReportConfig]
76
+ # Required. The resource being created
77
+ # @!attribute [rw] request_id
78
+ # @return [::String]
79
+ # Optional. An optional request ID to identify requests. Specify a unique
80
+ # request ID so that if you must retry your request, the server will know to
81
+ # ignore the request if it has already been completed. The server will
82
+ # guarantee that for at least 60 minutes since the first request.
83
+ #
84
+ # For example, consider a situation where you make an initial request and
85
+ # the request times out. If you make the request again with the same request
86
+ # ID, the server can check if original operation with the same request ID
87
+ # was received, and if so, will ignore the second request. This prevents
88
+ # clients from accidentally creating duplicate commitments.
89
+ #
90
+ # The request ID must be a valid UUID with the exception that zero UUID is
91
+ # not supported (00000000-0000-0000-0000-000000000000).
92
+ class CreateReportConfigRequest
93
+ include ::Google::Protobuf::MessageExts
94
+ extend ::Google::Protobuf::MessageExts::ClassMethods
95
+ end
96
+
97
+ # Message for updating a ReportConfig
98
+ # @!attribute [rw] update_mask
99
+ # @return [::Google::Protobuf::FieldMask]
100
+ # Required. Field mask is used to specify the fields to be overwritten in the
101
+ # ReportConfig resource by the update.
102
+ # The fields specified in the update_mask are relative to the resource, not
103
+ # the full request. A field will be overwritten if it is in the mask. If the
104
+ # user does not provide a mask then all fields will be overwritten.
105
+ # @!attribute [rw] report_config
106
+ # @return [::Google::Cloud::StorageInsights::V1::ReportConfig]
107
+ # Required. The resource being updated
108
+ # @!attribute [rw] request_id
109
+ # @return [::String]
110
+ # Optional. An optional request ID to identify requests. Specify a unique
111
+ # request ID so that if you must retry your request, the server will know to
112
+ # ignore the request if it has already been completed. The server will
113
+ # guarantee that for at least 60 minutes since the first request.
114
+ #
115
+ # For example, consider a situation where you make an initial request and
116
+ # the request times out. If you make the request again with the same request
117
+ # ID, the server can check if original operation with the same request ID
118
+ # was received, and if so, will ignore the second request. This prevents
119
+ # clients from accidentally creating duplicate commitments.
120
+ #
121
+ # The request ID must be a valid UUID with the exception that zero UUID is
122
+ # not supported (00000000-0000-0000-0000-000000000000).
123
+ class UpdateReportConfigRequest
124
+ include ::Google::Protobuf::MessageExts
125
+ extend ::Google::Protobuf::MessageExts::ClassMethods
126
+ end
127
+
128
+ # Message for deleting a ReportConfig
129
+ # @!attribute [rw] name
130
+ # @return [::String]
131
+ # Required. Name of the resource
132
+ # @!attribute [rw] force
133
+ # @return [::Boolean]
134
+ # Optional. If set, all ReportDetails for this ReportConfig will be deleted.
135
+ # @!attribute [rw] request_id
136
+ # @return [::String]
137
+ # Optional. An optional request ID to identify requests. Specify a unique
138
+ # request ID so that if you must retry your request, the server will know to
139
+ # ignore the request if it has already been completed. The server will
140
+ # guarantee that for at least 60 minutes after the first request.
141
+ #
142
+ # For example, consider a situation where you make an initial request and
143
+ # the request times out. If you make the request again with the same request
144
+ # ID, the server can check if original operation with the same request ID
145
+ # was received, and if so, will ignore the second request. This prevents
146
+ # clients from accidentally creating duplicate commitments.
147
+ #
148
+ # The request ID must be a valid UUID with the exception that zero UUID is
149
+ # not supported (00000000-0000-0000-0000-000000000000).
150
+ class DeleteReportConfigRequest
151
+ include ::Google::Protobuf::MessageExts
152
+ extend ::Google::Protobuf::MessageExts::ClassMethods
153
+ end
154
+
155
+ # Message describing ReportDetail object. ReportDetail represents metadata of
156
+ # generated reports for a ReportConfig.
157
+ # Next ID: 10
158
+ # @!attribute [rw] name
159
+ # @return [::String]
160
+ # Name of resource. It will be of form
161
+ # projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
162
+ # @!attribute [rw] snapshot_time
163
+ # @return [::Google::Protobuf::Timestamp]
164
+ # The snapshot time.
165
+ # All the report data is referenced at this point of time.
166
+ # @!attribute [rw] report_path_prefix
167
+ # @return [::String]
168
+ # Prefix of the object name of each report's shard. This will have full
169
+ # prefix except the "extension" and "shard_id".
170
+ # For example, if the `destination_path` is
171
+ # `{{report-config-id}}/dt={{datetime}}`, the shard object name would be
172
+ # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_5.csv`
173
+ # and the value of `report_path_prefix` field would be
174
+ # `gs://my-insights/1A34-F2E456-12B456-1C3D/dt=2022-05-20T06:35/1A34-F2E456-12B456-1C3D_2022-05-20T06:35_`.
175
+ # @!attribute [rw] shards_count
176
+ # @return [::Integer]
177
+ # Total shards generated for the report.
178
+ # @!attribute [rw] status
179
+ # @return [::Google::Rpc::Status]
180
+ # Status of the ReportDetail.
181
+ # @!attribute [rw] labels
182
+ # @return [::Google::Protobuf::Map{::String => ::String}]
183
+ # Labels as key value pairs
184
+ # @!attribute [rw] target_datetime
185
+ # @return [::Google::Type::DateTime]
186
+ # The date for which report is generated. The time part of target_datetime
187
+ # will be zero till we support multiple reports per day.
188
+ # @!attribute [rw] report_metrics
189
+ # @return [::Google::Cloud::StorageInsights::V1::ReportDetail::Metrics]
190
+ # Metrics of the report.
191
+ class ReportDetail
192
+ include ::Google::Protobuf::MessageExts
193
+ extend ::Google::Protobuf::MessageExts::ClassMethods
194
+
195
+ # Different metrics associated with the generated report.
196
+ # @!attribute [rw] processed_records_count
197
+ # @return [::Integer]
198
+ # Count of Cloud Storage objects which are part of the report.
199
+ class Metrics
200
+ include ::Google::Protobuf::MessageExts
201
+ extend ::Google::Protobuf::MessageExts::ClassMethods
202
+ end
203
+
204
+ # @!attribute [rw] key
205
+ # @return [::String]
206
+ # @!attribute [rw] value
207
+ # @return [::String]
208
+ class LabelsEntry
209
+ include ::Google::Protobuf::MessageExts
210
+ extend ::Google::Protobuf::MessageExts::ClassMethods
211
+ end
212
+ end
213
+
214
+ # Message for requesting list of ReportDetails
215
+ # @!attribute [rw] parent
216
+ # @return [::String]
217
+ # Required. Parent value for ListReportDetailsRequest
218
+ # @!attribute [rw] page_size
219
+ # @return [::Integer]
220
+ # Requested page size. Server may return fewer items than requested.
221
+ # If unspecified, server will pick an appropriate default.
222
+ # @!attribute [rw] page_token
223
+ # @return [::String]
224
+ # A token identifying a page of results the server should return.
225
+ # @!attribute [rw] filter
226
+ # @return [::String]
227
+ # Filtering results
228
+ # @!attribute [rw] order_by
229
+ # @return [::String]
230
+ # Hint for how to order the results
231
+ class ListReportDetailsRequest
232
+ include ::Google::Protobuf::MessageExts
233
+ extend ::Google::Protobuf::MessageExts::ClassMethods
234
+ end
235
+
236
+ # Message for response to listing ReportDetails
237
+ # @!attribute [rw] report_details
238
+ # @return [::Array<::Google::Cloud::StorageInsights::V1::ReportDetail>]
239
+ # The list of ReportDetail
240
+ # @!attribute [rw] next_page_token
241
+ # @return [::String]
242
+ # A token identifying a page of results the server should return.
243
+ # @!attribute [rw] unreachable
244
+ # @return [::Array<::String>]
245
+ # Locations that could not be reached.
246
+ class ListReportDetailsResponse
247
+ include ::Google::Protobuf::MessageExts
248
+ extend ::Google::Protobuf::MessageExts::ClassMethods
249
+ end
250
+
251
+ # Message for getting a ReportDetail
252
+ # @!attribute [rw] name
253
+ # @return [::String]
254
+ # Required. Name of the resource
255
+ class GetReportDetailRequest
256
+ include ::Google::Protobuf::MessageExts
257
+ extend ::Google::Protobuf::MessageExts::ClassMethods
258
+ end
259
+
260
+ # Represents the metadata of the long-running operation.
261
+ # @!attribute [r] create_time
262
+ # @return [::Google::Protobuf::Timestamp]
263
+ # Output only. The time the operation was created.
264
+ # @!attribute [r] end_time
265
+ # @return [::Google::Protobuf::Timestamp]
266
+ # Output only. The time the operation finished running.
267
+ # @!attribute [r] target
268
+ # @return [::String]
269
+ # Output only. Server-defined resource path for the target of the operation.
270
+ # @!attribute [r] verb
271
+ # @return [::String]
272
+ # Output only. Name of the verb executed by the operation.
273
+ # @!attribute [r] status_message
274
+ # @return [::String]
275
+ # Output only. Human-readable status of the operation, if any.
276
+ # @!attribute [r] requested_cancellation
277
+ # @return [::Boolean]
278
+ # Output only. Identifies whether the user has requested cancellation
279
+ # of the operation. Operations that have been cancelled successfully
280
+ # have [Operation.error][] value with a
281
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
282
+ # `Code.CANCELLED`.
283
+ # @!attribute [r] api_version
284
+ # @return [::String]
285
+ # Output only. API version used to start the operation.
286
+ class OperationMetadata
287
+ include ::Google::Protobuf::MessageExts
288
+ extend ::Google::Protobuf::MessageExts::ClassMethods
289
+ end
290
+
291
+ # ReportConfig Resource:
292
+ #
293
+ # Options to setup frequency of report generation.
294
+ # @!attribute [rw] frequency
295
+ # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions::Frequency]
296
+ # Frequency of report generation.
297
+ # @!attribute [rw] start_date
298
+ # @return [::Google::Type::Date]
299
+ # The date from which report generation should start.
300
+ # UTC time zone.
301
+ # @!attribute [rw] end_date
302
+ # @return [::Google::Type::Date]
303
+ # The date on which report generation should stop (Inclusive).
304
+ # UTC time zone.
305
+ class FrequencyOptions
306
+ include ::Google::Protobuf::MessageExts
307
+ extend ::Google::Protobuf::MessageExts::ClassMethods
308
+
309
+ # This ENUM specifies possible frequencies of report generation.
310
+ module Frequency
311
+ # Unspecified.
312
+ FREQUENCY_UNSPECIFIED = 0
313
+
314
+ # Report will be generated daily.
315
+ DAILY = 1
316
+
317
+ # Report will be generated weekly.
318
+ WEEKLY = 2
319
+ end
320
+ end
321
+
322
+ # Options to configure CSV formatted reports.
323
+ # @!attribute [rw] record_separator
324
+ # @return [::String]
325
+ # Record separator characters in CSV.
326
+ # @!attribute [rw] delimiter
327
+ # @return [::String]
328
+ # Delimiter characters in CSV.
329
+ # @!attribute [rw] header_required
330
+ # @return [::Boolean]
331
+ # If set, will include a header row in the CSV report.
332
+ class CSVOptions
333
+ include ::Google::Protobuf::MessageExts
334
+ extend ::Google::Protobuf::MessageExts::ClassMethods
335
+ end
336
+
337
+ # Options to configure Parquet formatted reports.
338
+ class ParquetOptions
339
+ include ::Google::Protobuf::MessageExts
340
+ extend ::Google::Protobuf::MessageExts::ClassMethods
341
+ end
342
+
343
+ # Options to filter data on storage systems.
344
+ # Next ID: 2
345
+ # @!attribute [rw] bucket
346
+ # @return [::String]
347
+ # Bucket for which the report will be generated.
348
+ class CloudStorageFilters
349
+ include ::Google::Protobuf::MessageExts
350
+ extend ::Google::Protobuf::MessageExts::ClassMethods
351
+ end
352
+
353
+ # Options to store reports in storage systems.
354
+ # Next ID: 3
355
+ # @!attribute [rw] bucket
356
+ # @return [::String]
357
+ # Destination bucket.
358
+ # @!attribute [rw] destination_path
359
+ # @return [::String]
360
+ # Destination path is the path in the bucket where the report should be
361
+ # generated.
362
+ class CloudStorageDestinationOptions
363
+ include ::Google::Protobuf::MessageExts
364
+ extend ::Google::Protobuf::MessageExts::ClassMethods
365
+ end
366
+
367
+ # Report specification for exporting object metadata.
368
+ # Next ID: 4
369
+ # @!attribute [rw] metadata_fields
370
+ # @return [::Array<::String>]
371
+ # Metadata fields to be included in the report.
372
+ # @!attribute [rw] storage_filters
373
+ # @return [::Google::Cloud::StorageInsights::V1::CloudStorageFilters]
374
+ # Cloud Storage as the storage system.
375
+ # @!attribute [rw] storage_destination_options
376
+ # @return [::Google::Cloud::StorageInsights::V1::CloudStorageDestinationOptions]
377
+ # Cloud Storage as the storage system.
378
+ class ObjectMetadataReportOptions
379
+ include ::Google::Protobuf::MessageExts
380
+ extend ::Google::Protobuf::MessageExts::ClassMethods
381
+ end
382
+
383
+ # Message describing ReportConfig object. ReportConfig is the configuration to
384
+ # generate reports.
385
+ # Next ID: 12
386
+ # @!attribute [rw] name
387
+ # @return [::String]
388
+ # name of resource. It will be of form
389
+ # projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
390
+ # @!attribute [r] create_time
391
+ # @return [::Google::Protobuf::Timestamp]
392
+ # Output only. [Output only] Create time stamp
393
+ # @!attribute [r] update_time
394
+ # @return [::Google::Protobuf::Timestamp]
395
+ # Output only. [Output only] Update time stamp
396
+ # @!attribute [rw] frequency_options
397
+ # @return [::Google::Cloud::StorageInsights::V1::FrequencyOptions]
398
+ # The frequency of report generation.
399
+ # @!attribute [rw] csv_options
400
+ # @return [::Google::Cloud::StorageInsights::V1::CSVOptions]
401
+ # Options for CSV formatted reports.
402
+ # @!attribute [rw] parquet_options
403
+ # @return [::Google::Cloud::StorageInsights::V1::ParquetOptions]
404
+ # Options for Parquet formatted reports.
405
+ # @!attribute [rw] object_metadata_report_options
406
+ # @return [::Google::Cloud::StorageInsights::V1::ObjectMetadataReportOptions]
407
+ # Report for exporting object metadata.
408
+ # @!attribute [rw] labels
409
+ # @return [::Google::Protobuf::Map{::String => ::String}]
410
+ # Labels as key value pairs
411
+ # @!attribute [rw] display_name
412
+ # @return [::String]
413
+ # User provided display name which can be empty and limited to 256 characters
414
+ # that is editable.
415
+ class ReportConfig
416
+ include ::Google::Protobuf::MessageExts
417
+ extend ::Google::Protobuf::MessageExts::ClassMethods
418
+
419
+ # @!attribute [rw] key
420
+ # @return [::String]
421
+ # @!attribute [rw] value
422
+ # @return [::String]
423
+ class LabelsEntry
424
+ include ::Google::Protobuf::MessageExts
425
+ extend ::Google::Protobuf::MessageExts::ClassMethods
426
+ end
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
@@ -0,0 +1,141 @@
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
+
20
+ module Google
21
+ module Protobuf
22
+ # `Any` contains an arbitrary serialized protocol buffer message along with a
23
+ # URL that describes the type of the serialized message.
24
+ #
25
+ # Protobuf library provides support to pack/unpack Any values in the form
26
+ # of utility functions or additional generated methods of the Any type.
27
+ #
28
+ # Example 1: Pack and unpack a message in C++.
29
+ #
30
+ # Foo foo = ...;
31
+ # Any any;
32
+ # any.PackFrom(foo);
33
+ # ...
34
+ # if (any.UnpackTo(&foo)) {
35
+ # ...
36
+ # }
37
+ #
38
+ # Example 2: Pack and unpack a message in Java.
39
+ #
40
+ # Foo foo = ...;
41
+ # Any any = Any.pack(foo);
42
+ # ...
43
+ # if (any.is(Foo.class)) {
44
+ # foo = any.unpack(Foo.class);
45
+ # }
46
+ #
47
+ # Example 3: Pack and unpack a message in Python.
48
+ #
49
+ # foo = Foo(...)
50
+ # any = Any()
51
+ # any.Pack(foo)
52
+ # ...
53
+ # if any.Is(Foo.DESCRIPTOR):
54
+ # any.Unpack(foo)
55
+ # ...
56
+ #
57
+ # Example 4: Pack and unpack a message in Go
58
+ #
59
+ # foo := &pb.Foo{...}
60
+ # any, err := anypb.New(foo)
61
+ # if err != nil {
62
+ # ...
63
+ # }
64
+ # ...
65
+ # foo := &pb.Foo{}
66
+ # if err := any.UnmarshalTo(foo); err != nil {
67
+ # ...
68
+ # }
69
+ #
70
+ # The pack methods provided by protobuf library will by default use
71
+ # 'type.googleapis.com/full.type.name' as the type URL and the unpack
72
+ # methods only use the fully qualified type name after the last '/'
73
+ # in the type URL, for example "foo.bar.com/x/y.z" will yield type
74
+ # name "y.z".
75
+ #
76
+ #
77
+ # JSON
78
+ #
79
+ # The JSON representation of an `Any` value uses the regular
80
+ # representation of the deserialized, embedded message, with an
81
+ # additional field `@type` which contains the type URL. Example:
82
+ #
83
+ # package google.profile;
84
+ # message Person {
85
+ # string first_name = 1;
86
+ # string last_name = 2;
87
+ # }
88
+ #
89
+ # {
90
+ # "@type": "type.googleapis.com/google.profile.Person",
91
+ # "firstName": <string>,
92
+ # "lastName": <string>
93
+ # }
94
+ #
95
+ # If the embedded message type is well-known and has a custom JSON
96
+ # representation, that representation will be embedded adding a field
97
+ # `value` which holds the custom JSON in addition to the `@type`
98
+ # field. Example (for message [google.protobuf.Duration][]):
99
+ #
100
+ # {
101
+ # "@type": "type.googleapis.com/google.protobuf.Duration",
102
+ # "value": "1.212s"
103
+ # }
104
+ # @!attribute [rw] type_url
105
+ # @return [::String]
106
+ # A URL/resource name that uniquely identifies the type of the serialized
107
+ # protocol buffer message. This string must contain at least
108
+ # one "/" character. The last segment of the URL's path must represent
109
+ # the fully qualified name of the type (as in
110
+ # `path/google.protobuf.Duration`). The name should be in a canonical form
111
+ # (e.g., leading "." is not accepted).
112
+ #
113
+ # In practice, teams usually precompile into the binary all types that they
114
+ # expect it to use in the context of Any. However, for URLs which use the
115
+ # scheme `http`, `https`, or no scheme, one can optionally set up a type
116
+ # server that maps type URLs to message definitions as follows:
117
+ #
118
+ # * If no scheme is provided, `https` is assumed.
119
+ # * An HTTP GET on the URL must yield a [google.protobuf.Type][]
120
+ # value in binary format, or produce an error.
121
+ # * Applications are allowed to cache lookup results based on the
122
+ # URL, or have them precompiled into a binary to avoid any
123
+ # lookup. Therefore, binary compatibility needs to be preserved
124
+ # on changes to types. (Use versioned type names to manage
125
+ # breaking changes.)
126
+ #
127
+ # Note: this functionality is not currently available in the official
128
+ # protobuf release, and it is not used for type URLs beginning with
129
+ # type.googleapis.com.
130
+ #
131
+ # Schemes other than `http`, `https` (or the empty scheme) might be
132
+ # used with implementation specific semantics.
133
+ # @!attribute [rw] value
134
+ # @return [::String]
135
+ # Must be a valid serialized protocol buffer of the above specified type.
136
+ class Any
137
+ include ::Google::Protobuf::MessageExts
138
+ extend ::Google::Protobuf::MessageExts::ClassMethods
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,98 @@
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
+
20
+ module Google
21
+ module Protobuf
22
+ # A Duration represents a signed, fixed-length span of time represented
23
+ # as a count of seconds and fractions of seconds at nanosecond
24
+ # resolution. It is independent of any calendar and concepts like "day"
25
+ # or "month". It is related to Timestamp in that the difference between
26
+ # two Timestamp values is a Duration and it can be added or subtracted
27
+ # from a Timestamp. Range is approximately +-10,000 years.
28
+ #
29
+ # # Examples
30
+ #
31
+ # Example 1: Compute Duration from two Timestamps in pseudo code.
32
+ #
33
+ # Timestamp start = ...;
34
+ # Timestamp end = ...;
35
+ # Duration duration = ...;
36
+ #
37
+ # duration.seconds = end.seconds - start.seconds;
38
+ # duration.nanos = end.nanos - start.nanos;
39
+ #
40
+ # if (duration.seconds < 0 && duration.nanos > 0) {
41
+ # duration.seconds += 1;
42
+ # duration.nanos -= 1000000000;
43
+ # } else if (duration.seconds > 0 && duration.nanos < 0) {
44
+ # duration.seconds -= 1;
45
+ # duration.nanos += 1000000000;
46
+ # }
47
+ #
48
+ # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
49
+ #
50
+ # Timestamp start = ...;
51
+ # Duration duration = ...;
52
+ # Timestamp end = ...;
53
+ #
54
+ # end.seconds = start.seconds + duration.seconds;
55
+ # end.nanos = start.nanos + duration.nanos;
56
+ #
57
+ # if (end.nanos < 0) {
58
+ # end.seconds -= 1;
59
+ # end.nanos += 1000000000;
60
+ # } else if (end.nanos >= 1000000000) {
61
+ # end.seconds += 1;
62
+ # end.nanos -= 1000000000;
63
+ # }
64
+ #
65
+ # Example 3: Compute Duration from datetime.timedelta in Python.
66
+ #
67
+ # td = datetime.timedelta(days=3, minutes=10)
68
+ # duration = Duration()
69
+ # duration.FromTimedelta(td)
70
+ #
71
+ # # JSON Mapping
72
+ #
73
+ # In JSON format, the Duration type is encoded as a string rather than an
74
+ # object, where the string ends in the suffix "s" (indicating seconds) and
75
+ # is preceded by the number of seconds, with nanoseconds expressed as
76
+ # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
77
+ # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
78
+ # be expressed in JSON format as "3.000000001s", and 3 seconds and 1
79
+ # microsecond should be expressed in JSON format as "3.000001s".
80
+ # @!attribute [rw] seconds
81
+ # @return [::Integer]
82
+ # Signed seconds of the span of time. Must be from -315,576,000,000
83
+ # to +315,576,000,000 inclusive. Note: these bounds are computed from:
84
+ # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
85
+ # @!attribute [rw] nanos
86
+ # @return [::Integer]
87
+ # Signed fractions of a second at nanosecond resolution of the span
88
+ # of time. Durations less than one second are represented with a 0
89
+ # `seconds` field and a positive or negative `nanos` field. For durations
90
+ # of one second or more, a non-zero value for the `nanos` field must be
91
+ # of the same sign as the `seconds` field. Must be from -999,999,999
92
+ # to +999,999,999 inclusive.
93
+ class Duration
94
+ include ::Google::Protobuf::MessageExts
95
+ extend ::Google::Protobuf::MessageExts::ClassMethods
96
+ end
97
+ end
98
+ end