google-cloud-maintenance-api-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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/maintenance/api/v1/bindings_override.rb +77 -0
  6. data/lib/google/cloud/maintenance/api/v1/maintenance/client.rb +712 -0
  7. data/lib/google/cloud/maintenance/api/v1/maintenance/credentials.rb +49 -0
  8. data/lib/google/cloud/maintenance/api/v1/maintenance/paths.rb +71 -0
  9. data/lib/google/cloud/maintenance/api/v1/maintenance/rest/client.rb +656 -0
  10. data/lib/google/cloud/maintenance/api/v1/maintenance/rest/service_stub.rb +266 -0
  11. data/lib/google/cloud/maintenance/api/v1/maintenance/rest.rb +55 -0
  12. data/lib/google/cloud/maintenance/api/v1/maintenance.rb +57 -0
  13. data/lib/google/cloud/maintenance/api/v1/maintenance_service_pb.rb +66 -0
  14. data/lib/google/cloud/maintenance/api/v1/maintenance_service_services_pb.rb +51 -0
  15. data/lib/google/cloud/maintenance/api/v1/rest.rb +40 -0
  16. data/lib/google/cloud/maintenance/api/v1/version.rb +7 -2
  17. data/lib/google/cloud/maintenance/api/v1.rb +47 -0
  18. data/lib/google-cloud-maintenance-api-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/client.rb +473 -0
  21. data/proto_docs/google/api/field_behavior.rb +85 -0
  22. data/proto_docs/google/api/field_info.rb +88 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +227 -0
  25. data/proto_docs/google/cloud/maintenance/api/v1/maintenance_service.rb +411 -0
  26. data/proto_docs/google/protobuf/any.rb +145 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  29. metadata +81 -9
@@ -0,0 +1,411 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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 Maintenance
23
+ module Api
24
+ module V1
25
+ # Request message for SummarizeMaintenances custom method.
26
+ # @!attribute [rw] parent
27
+ # @return [::String]
28
+ # Required. The parent of the resource maintenance.
29
+ # eg. `projects/123/locations/*`
30
+ # @!attribute [rw] page_size
31
+ # @return [::Integer]
32
+ # The maximum number of resource maintenances to send per page. The default
33
+ # page size is 20 and the maximum is 1000.
34
+ # @!attribute [rw] page_token
35
+ # @return [::String]
36
+ # The page token: If the next_page_token from a previous response
37
+ # is provided, this request will send the subsequent page.
38
+ # @!attribute [rw] filter
39
+ # @return [::String]
40
+ # Filter the list as specified in https://google.aip.dev/160.
41
+ # Supported fields include:
42
+ # - `maintenance.maintenanceName`
43
+ # Examples:
44
+ # - `maintenance.maintenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1"`
45
+ # @!attribute [rw] order_by
46
+ # @return [::String]
47
+ # Order results as specified in https://google.aip.dev/132.
48
+ class SummarizeMaintenancesRequest
49
+ include ::Google::Protobuf::MessageExts
50
+ extend ::Google::Protobuf::MessageExts::ClassMethods
51
+ end
52
+
53
+ # Request message for SummarizeMaintenances custom method.
54
+ # @!attribute [rw] maintenances
55
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary>]
56
+ # The resulting summaries.
57
+ # @!attribute [rw] next_page_token
58
+ # @return [::String]
59
+ # If present, the next page token can be provided to a subsequent
60
+ # SummarizeMaintenances call to list the next page.
61
+ # If empty, there are no more pages.
62
+ # @!attribute [rw] unreachable
63
+ # @return [::Array<::String>]
64
+ # Unordered list. Locations that could not be reached.
65
+ class SummarizeMaintenancesResponse
66
+ include ::Google::Protobuf::MessageExts
67
+ extend ::Google::Protobuf::MessageExts::ClassMethods
68
+ end
69
+
70
+ # MaintenanceSummary contains maintenance statistics calculated based on
71
+ # ResourceMaintenances within the scope: project and location.
72
+ # @!attribute [r] maintenance_name
73
+ # @return [::String]
74
+ # Output only. The name of the maintenance.
75
+ # @!attribute [r] title
76
+ # @return [::String]
77
+ # Output only. The title of the maintenance.
78
+ # @!attribute [r] description
79
+ # @return [::String]
80
+ # Output only. The description of the maintenance.
81
+ # @!attribute [r] category
82
+ # @return [::Google::Cloud::Maintenance::Api::V1::MaintenanceCategory]
83
+ # Output only. The category of the maintenance event.
84
+ # @!attribute [r] maintenance_scheduled_start_time
85
+ # @return [::Google::Protobuf::Timestamp]
86
+ # Output only. Scheduled start time of the maintenance. The maintenance will
87
+ # start at `maintenanceScheduledStartTime` or later, with best effort to
88
+ # finish before `maintenanceScheduledEndTime`.
89
+ # @!attribute [r] maintenance_scheduled_end_time
90
+ # @return [::Google::Protobuf::Timestamp]
91
+ # Output only. An estimated (best effort, not guaranteed) end time of the
92
+ # scheduled maintenance.
93
+ # @!attribute [r] maintenance_start_time
94
+ # @return [::Google::Protobuf::Timestamp]
95
+ # Output only. Actual date when the maintenance started. Field present only
96
+ # after the state changed to `RUNNING`.
97
+ # @!attribute [r] maintenance_end_time
98
+ # @return [::Google::Protobuf::Timestamp]
99
+ # Output only. Actual date when the maintenance successfully completed. Field
100
+ # present only after the state changed to `SUCCEEDED`.
101
+ # @!attribute [r] user_controllable
102
+ # @return [::Boolean]
103
+ # Output only. Indicates whether the user has some control over that
104
+ # maintenance, either proactively before maintenance was scheduled with
105
+ # maintenance policy or with reactive controls after it was scheduled (see
106
+ # controls field).
107
+ # @!attribute [r] controls
108
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::MaintenanceControl>]
109
+ # Output only. Control available for that Maintenance (might not be available
110
+ # for every resource that maintenance is applied to).
111
+ # @!attribute [r] stats
112
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary::Stats>]
113
+ # Output only. Stats is a field of ResourceMaintenance used to aggregate the
114
+ # stats.
115
+ class MaintenanceSummary
116
+ include ::Google::Protobuf::MessageExts
117
+ extend ::Google::Protobuf::MessageExts::ClassMethods
118
+
119
+ # Stats indicates the type of aggregate and the corresponding aggregates.
120
+ # @!attribute [rw] group_by
121
+ # @return [::String]
122
+ # groupBy specifies the type of aggregate.
123
+ # For example a group_by might be `"state"`
124
+ # @!attribute [rw] aggregates
125
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::MaintenanceSummary::Aggregate>]
126
+ # Aggregates is a list <group, count> pairs. For example, if the
127
+ # group_by is `"state"` a possible tuple in the aggregates list could be
128
+ # "SCHEDULED" : `11`,
129
+ class Stats
130
+ include ::Google::Protobuf::MessageExts
131
+ extend ::Google::Protobuf::MessageExts::ClassMethods
132
+ end
133
+
134
+ # Aggregate is a <group, count> pair.
135
+ # @!attribute [rw] group
136
+ # @return [::String]
137
+ # Specifies what specific value of the group_by the count represents. For
138
+ # example if group_by is `"state"` its corresponding group could be
139
+ # `"SCHEDULED"`.
140
+ # @!attribute [rw] count
141
+ # @return [::Integer]
142
+ # The count of the group.
143
+ class Aggregate
144
+ include ::Google::Protobuf::MessageExts
145
+ extend ::Google::Protobuf::MessageExts::ClassMethods
146
+ end
147
+ end
148
+
149
+ # ResourceMaintenance is a resource that represents a maintenance operation
150
+ # on a resource.
151
+ # @!attribute [rw] name
152
+ # @return [::String]
153
+ # Identifier. The name of the resource_maintenance resource.
154
+ # Format:
155
+ # `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`
156
+ # @!attribute [r] resource
157
+ # @return [::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance::Resource]
158
+ # Output only. The resource spec of the resource maintenance.
159
+ # @!attribute [r] maintenance
160
+ # @return [::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance::Maintenance]
161
+ # Output only. The details of the maintenance.
162
+ # @!attribute [r] state
163
+ # @return [::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance::State]
164
+ # Output only. The state of the resource maintenance.
165
+ # @!attribute [r] create_time
166
+ # @return [::Google::Protobuf::Timestamp]
167
+ # Output only. The create time of the resource maintenance.
168
+ # @!attribute [r] update_time
169
+ # @return [::Google::Protobuf::Timestamp]
170
+ # Output only. The update time of the resource maintenance.
171
+ # @!attribute [r] maintenance_start_time
172
+ # @return [::Google::Protobuf::Timestamp]
173
+ # Output only. The time when the resource maintenance has started.
174
+ # @!attribute [r] maintenance_end_time
175
+ # @return [::Google::Protobuf::Timestamp]
176
+ # Output only. The time when the resource maintenance has completed.
177
+ # @!attribute [r] maintenance_cancel_time
178
+ # @return [::Google::Protobuf::Timestamp]
179
+ # Output only. The time when the resource maintenance was cancelled.
180
+ # @!attribute [r] maintenance_scheduled_start_time
181
+ # @return [::Google::Protobuf::Timestamp]
182
+ # Output only. The time when the maintenance on the resource was scheduled to
183
+ # start.
184
+ # @!attribute [r] maintenance_scheduled_end_time
185
+ # @return [::Google::Protobuf::Timestamp]
186
+ # Output only. The time when the maintenance on the resource was scheduled to
187
+ # end.
188
+ # @!attribute [r] user_controllable
189
+ # @return [::Boolean]
190
+ # Output only. Indicates whether the user has some control over that
191
+ # maintenance, either proactively before maintenance was scheduled with
192
+ # maintenance policy or with reactive controls after it was scheduled (see
193
+ # controls field)
194
+ # @!attribute [r] controls
195
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::MaintenanceControl>]
196
+ # Output only. The controls of the maintenance.
197
+ # @!attribute [rw] labels
198
+ # @return [::Google::Protobuf::Map{::String => ::String}]
199
+ # Optional. The labels on the resource, which can be used for categorization.
200
+ # similar to Kubernetes resource labels.
201
+ # @!attribute [rw] annotations
202
+ # @return [::Google::Protobuf::Map{::String => ::String}]
203
+ # Optional. Annotations is an unstructured key-value map stored with a
204
+ # resource that may be set by external tools to store and retrieve arbitrary
205
+ # metadata. They are not queryable and should be preserved when modifying
206
+ # objects.
207
+ #
208
+ # More info: https://kubernetes.io/docs/user-guide/annotations
209
+ # @!attribute [r] uid
210
+ # @return [::String]
211
+ # Output only. The unique identifier of the resource. UID is unique in the
212
+ # time and space for this resource within the scope of the service. It is
213
+ # typically generated by the server on successful creation of a resource
214
+ # and must not be changed. UID is used to uniquely identify resources
215
+ # with resource name reuses. This should be a UUID4.
216
+ # @!attribute [r] etag
217
+ # @return [::String]
218
+ # Output only. An opaque value that uniquely identifies a version or
219
+ # generation of a resource. It can be used to confirm that the client
220
+ # and server agree on the ordering of a resource being written.
221
+ class ResourceMaintenance
222
+ include ::Google::Protobuf::MessageExts
223
+ extend ::Google::Protobuf::MessageExts::ClassMethods
224
+
225
+ # Resource contains information about the resource affected by maintenance.
226
+ # @!attribute [r] resource_name
227
+ # @return [::String]
228
+ # Output only. Name is the reference to the consumer resource affected by
229
+ # the maintenance. Available values can be found here:
230
+ # https://cloud.google.com/asset-inventory/docs/asset-names
231
+ # @!attribute [r] location
232
+ # @return [::String]
233
+ # Output only. The location of the resource.
234
+ # Format:
235
+ # `us-central1`
236
+ # @!attribute [r] type
237
+ # @return [::String]
238
+ # Output only. The type of the resource.
239
+ # Available values can be found here:
240
+ # https://cloud.google.com/asset-inventory/docs/asset-types#supported_resource_types
241
+ # Please note that not all the resource types will have their maintenances
242
+ # reported.
243
+ class Resource
244
+ include ::Google::Protobuf::MessageExts
245
+ extend ::Google::Protobuf::MessageExts::ClassMethods
246
+ end
247
+
248
+ # Maintenance is the maintenance details of a resource's maintenance.
249
+ # @!attribute [rw] maintenance_name
250
+ # @return [::String]
251
+ # Maintenance is the name of the corresponding maintenance resource
252
+ # following the standard naming scheme: `"{maintenance-id}"`
253
+ # @!attribute [r] title
254
+ # @return [::String]
255
+ # Output only. The title of the maintenance.
256
+ # @!attribute [r] description
257
+ # @return [::String]
258
+ # Output only. The description of the maintenance.
259
+ # @!attribute [r] category
260
+ # @return [::Google::Cloud::Maintenance::Api::V1::MaintenanceCategory]
261
+ # Output only. The category of the maintenance.
262
+ class Maintenance
263
+ include ::Google::Protobuf::MessageExts
264
+ extend ::Google::Protobuf::MessageExts::ClassMethods
265
+ end
266
+
267
+ # @!attribute [rw] key
268
+ # @return [::String]
269
+ # @!attribute [rw] value
270
+ # @return [::String]
271
+ class LabelsEntry
272
+ include ::Google::Protobuf::MessageExts
273
+ extend ::Google::Protobuf::MessageExts::ClassMethods
274
+ end
275
+
276
+ # @!attribute [rw] key
277
+ # @return [::String]
278
+ # @!attribute [rw] value
279
+ # @return [::String]
280
+ class AnnotationsEntry
281
+ include ::Google::Protobuf::MessageExts
282
+ extend ::Google::Protobuf::MessageExts::ClassMethods
283
+ end
284
+
285
+ # State is the state of a resource maintenance.
286
+ module State
287
+ # Unspecified state.
288
+ STATE_UNSPECIFIED = 0
289
+
290
+ # Scheduled for a particular window. For disruptive maintenance it should
291
+ # respect maintenance policy, i.e. its available windows, exclusions and
292
+ # notification period.
293
+ SCHEDULED = 1
294
+
295
+ # Maintenance is ongoing.
296
+ RUNNING = 2
297
+
298
+ # No longer planned, typically when other maintenance (e.g. upgrade to
299
+ # newer version) already happened, or the user skipped the maintenance.
300
+ CANCELLED = 3
301
+
302
+ # Successfully completed.
303
+ SUCCEEDED = 4
304
+ end
305
+ end
306
+
307
+ # The control of the maintenance.
308
+ # @!attribute [rw] control
309
+ # @return [::Google::Cloud::Maintenance::Api::V1::MaintenanceControl::Control]
310
+ # The control of the resource maintenance.
311
+ # @!attribute [rw] is_custom
312
+ # @return [::Boolean]
313
+ # Indicates whether the control is available only in Service Producer API
314
+ # (not through Unified Maintenance).
315
+ # @!attribute [rw] documentation
316
+ # @return [::String]
317
+ # Link to Service Producer documentation about maintenance control. Provided
318
+ # only when `isCustom` is `true`.
319
+ class MaintenanceControl
320
+ include ::Google::Protobuf::MessageExts
321
+ extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # Sets the type of control supported. comment (as in logs).
324
+ module Control
325
+ # Unspecified control.
326
+ CONTROL_UNSPECIFIED = 0
327
+
328
+ # Apply control.
329
+ APPLY = 1
330
+
331
+ # Manage policy control.
332
+ MANAGE_POLICY = 2
333
+
334
+ # Reschedule control.
335
+ RESCHEDULE = 3
336
+ end
337
+ end
338
+
339
+ # The request structure for the ListResourceMaintenances method.
340
+ # @!attribute [rw] parent
341
+ # @return [::String]
342
+ # Required. The parent of the resource maintenance.
343
+ # @!attribute [rw] page_size
344
+ # @return [::Integer]
345
+ # The maximum number of resource maintenances to send per page.
346
+ # @!attribute [rw] page_token
347
+ # @return [::String]
348
+ # The page token: If the next_page_token from a previous response
349
+ # is provided, this request will send the subsequent page.
350
+ # @!attribute [rw] filter
351
+ # @return [::String]
352
+ # Filter the list as specified in https://google.aip.dev/160.
353
+ # @!attribute [rw] order_by
354
+ # @return [::String]
355
+ # Order results as specified in https://google.aip.dev/132.
356
+ class ListResourceMaintenancesRequest
357
+ include ::Google::Protobuf::MessageExts
358
+ extend ::Google::Protobuf::MessageExts::ClassMethods
359
+ end
360
+
361
+ # The response structure for the ListResourceMaintenances method.
362
+ # @!attribute [rw] resource_maintenances
363
+ # @return [::Array<::Google::Cloud::Maintenance::Api::V1::ResourceMaintenance>]
364
+ # The resulting resource maintenances.
365
+ # @!attribute [rw] next_page_token
366
+ # @return [::String]
367
+ # If present, the next page token can be provided to a subsequent
368
+ # ListResourceMaintenances call to list the next page.
369
+ # If empty, there are no more pages.
370
+ # @!attribute [rw] unreachable
371
+ # @return [::Array<::String>]
372
+ # Locations that could not be reached.
373
+ class ListResourceMaintenancesResponse
374
+ include ::Google::Protobuf::MessageExts
375
+ extend ::Google::Protobuf::MessageExts::ClassMethods
376
+ end
377
+
378
+ # The request structure for the GetResourceMaintenance method.
379
+ # @!attribute [rw] name
380
+ # @return [::String]
381
+ # Required. The resource name of the resource within a service.
382
+ class GetResourceMaintenanceRequest
383
+ include ::Google::Protobuf::MessageExts
384
+ extend ::Google::Protobuf::MessageExts::ClassMethods
385
+ end
386
+
387
+ # The Category of the maintenance.
388
+ module MaintenanceCategory
389
+ # Unspecified category.
390
+ MAINTENANCE_CATEGORY_UNSPECIFIED = 0
391
+
392
+ # Infrastructure maintenance events are times that Google Cloud performs
393
+ # regular maintenance on network equipment e.g. Google Cloud Interconnect
394
+ # These events are usually scheduled in advance and we provide
395
+ # notification, when possible, so that users can plan for the
396
+ # infrastructure maintenance event and prevent downtime. Infrastructure
397
+ # maintenance events don't have a set interval between occurrences, but
398
+ # generally occur several times a year.
399
+ INFRASTRUCTURE = 1
400
+
401
+ # Updates that can include bug fixes, changes, or new features that are
402
+ # backward compatible with existing versions (including patches).
403
+ # Some SPs allow users to control the scheduling of these maintenance
404
+ # events using maintenance windows and/or deny maintenance features.
405
+ SERVICE_UPDATE = 3
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
@@ -0,0 +1,145 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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
+ # // or ...
47
+ # if (any.isSameTypeAs(Foo.getDefaultInstance())) {
48
+ # foo = any.unpack(Foo.getDefaultInstance());
49
+ # }
50
+ #
51
+ # Example 3: Pack and unpack a message in Python.
52
+ #
53
+ # foo = Foo(...)
54
+ # any = Any()
55
+ # any.Pack(foo)
56
+ # ...
57
+ # if any.Is(Foo.DESCRIPTOR):
58
+ # any.Unpack(foo)
59
+ # ...
60
+ #
61
+ # Example 4: Pack and unpack a message in Go
62
+ #
63
+ # foo := &pb.Foo{...}
64
+ # any, err := anypb.New(foo)
65
+ # if err != nil {
66
+ # ...
67
+ # }
68
+ # ...
69
+ # foo := &pb.Foo{}
70
+ # if err := any.UnmarshalTo(foo); err != nil {
71
+ # ...
72
+ # }
73
+ #
74
+ # The pack methods provided by protobuf library will by default use
75
+ # 'type.googleapis.com/full.type.name' as the type URL and the unpack
76
+ # methods only use the fully qualified type name after the last '/'
77
+ # in the type URL, for example "foo.bar.com/x/y.z" will yield type
78
+ # name "y.z".
79
+ #
80
+ # JSON
81
+ # ====
82
+ # The JSON representation of an `Any` value uses the regular
83
+ # representation of the deserialized, embedded message, with an
84
+ # additional field `@type` which contains the type URL. Example:
85
+ #
86
+ # package google.profile;
87
+ # message Person {
88
+ # string first_name = 1;
89
+ # string last_name = 2;
90
+ # }
91
+ #
92
+ # {
93
+ # "@type": "type.googleapis.com/google.profile.Person",
94
+ # "firstName": <string>,
95
+ # "lastName": <string>
96
+ # }
97
+ #
98
+ # If the embedded message type is well-known and has a custom JSON
99
+ # representation, that representation will be embedded adding a field
100
+ # `value` which holds the custom JSON in addition to the `@type`
101
+ # field. Example (for message [google.protobuf.Duration][]):
102
+ #
103
+ # {
104
+ # "@type": "type.googleapis.com/google.protobuf.Duration",
105
+ # "value": "1.212s"
106
+ # }
107
+ # @!attribute [rw] type_url
108
+ # @return [::String]
109
+ # A URL/resource name that uniquely identifies the type of the serialized
110
+ # protocol buffer message. This string must contain at least
111
+ # one "/" character. The last segment of the URL's path must represent
112
+ # the fully qualified name of the type (as in
113
+ # `path/google.protobuf.Duration`). The name should be in a canonical form
114
+ # (e.g., leading "." is not accepted).
115
+ #
116
+ # In practice, teams usually precompile into the binary all types that they
117
+ # expect it to use in the context of Any. However, for URLs which use the
118
+ # scheme `http`, `https`, or no scheme, one can optionally set up a type
119
+ # server that maps type URLs to message definitions as follows:
120
+ #
121
+ # * If no scheme is provided, `https` is assumed.
122
+ # * An HTTP GET on the URL must yield a [google.protobuf.Type][]
123
+ # value in binary format, or produce an error.
124
+ # * Applications are allowed to cache lookup results based on the
125
+ # URL, or have them precompiled into a binary to avoid any
126
+ # lookup. Therefore, binary compatibility needs to be preserved
127
+ # on changes to types. (Use versioned type names to manage
128
+ # breaking changes.)
129
+ #
130
+ # Note: this functionality is not currently available in the official
131
+ # protobuf release, and it is not used for type URLs beginning with
132
+ # type.googleapis.com. As of May 2023, there are no widely used type server
133
+ # implementations and no plans to implement one.
134
+ #
135
+ # Schemes other than `http`, `https` (or the empty scheme) might be
136
+ # used with implementation specific semantics.
137
+ # @!attribute [rw] value
138
+ # @return [::String]
139
+ # Must be a valid serialized protocol buffer of the above specified type.
140
+ class Any
141
+ include ::Google::Protobuf::MessageExts
142
+ extend ::Google::Protobuf::MessageExts::ClassMethods
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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