google-cloud-api_keys-v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,222 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
35
+ # type: "pubsub.googleapis.com/Topic"
36
+ # pattern: "projects/{project}/topics/{topic}"
37
+ # };
38
+ # }
39
+ #
40
+ # The ResourceDescriptor Yaml config will look like:
41
+ #
42
+ # resources:
43
+ # - type: "pubsub.googleapis.com/Topic"
44
+ # pattern: "projects/{project}/topics/{topic}"
45
+ #
46
+ # Sometimes, resources have multiple patterns, typically because they can
47
+ # live under multiple parents.
48
+ #
49
+ # Example:
50
+ #
51
+ # message LogEntry {
52
+ # option (google.api.resource) = {
53
+ # type: "logging.googleapis.com/LogEntry"
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
58
+ # };
59
+ # }
60
+ #
61
+ # The ResourceDescriptor Yaml config will look like:
62
+ #
63
+ # resources:
64
+ # - type: 'logging.googleapis.com/LogEntry'
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
69
+ # @!attribute [rw] type
70
+ # @return [::String]
71
+ # The resource type. It must be in the format of
72
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
73
+ # singular and must not include version numbers.
74
+ #
75
+ # Example: `storage.googleapis.com/Bucket`
76
+ #
77
+ # The value of the resource_type_kind must follow the regular expression
78
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
79
+ # should use PascalCase (UpperCamelCase). The maximum number of
80
+ # characters allowed for the `resource_type_kind` is 100.
81
+ # @!attribute [rw] pattern
82
+ # @return [::Array<::String>]
83
+ # Optional. The relative resource name pattern associated with this resource
84
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
85
+ #
86
+ # The path pattern must follow the syntax, which aligns with HTTP binding
87
+ # syntax:
88
+ #
89
+ # Template = Segment { "/" Segment } ;
90
+ # Segment = LITERAL | Variable ;
91
+ # Variable = "{" LITERAL "}" ;
92
+ #
93
+ # Examples:
94
+ #
95
+ # - "projects/\\{project}/topics/\\{topic}"
96
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
97
+ #
98
+ # The components in braces correspond to the IDs for each resource in the
99
+ # hierarchy. It is expected that, if multiple patterns are provided,
100
+ # the same component name (e.g. "project") refers to IDs of the same
101
+ # type of resource.
102
+ # @!attribute [rw] name_field
103
+ # @return [::String]
104
+ # Optional. The field on the resource that designates the resource name
105
+ # field. If omitted, this is assumed to be "name".
106
+ # @!attribute [rw] history
107
+ # @return [::Google::Api::ResourceDescriptor::History]
108
+ # Optional. The historical or future-looking state of the resource pattern.
109
+ #
110
+ # Example:
111
+ #
112
+ # // The InspectTemplate message originally only supported resource
113
+ # // names with organization, and project was added later.
114
+ # message InspectTemplate {
115
+ # option (google.api.resource) = {
116
+ # type: "dlp.googleapis.com/InspectTemplate"
117
+ # pattern:
118
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
119
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
120
+ # history: ORIGINALLY_SINGLE_PATTERN
121
+ # };
122
+ # }
123
+ # @!attribute [rw] plural
124
+ # @return [::String]
125
+ # The plural name used in the resource name and permission names, such as
126
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
127
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
128
+ # concept of the `plural` field in k8s CRD spec
129
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
130
+ #
131
+ # Note: The plural form is required even for singleton resources. See
132
+ # https://aip.dev/156
133
+ # @!attribute [rw] singular
134
+ # @return [::String]
135
+ # The same concept of the `singular` field in k8s CRD spec
136
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
137
+ # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
138
+ # @!attribute [rw] style
139
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
140
+ # Style flag(s) for this resource.
141
+ # These indicate that a resource is expected to conform to a given
142
+ # style. See the specific style flags for additional information.
143
+ class ResourceDescriptor
144
+ include ::Google::Protobuf::MessageExts
145
+ extend ::Google::Protobuf::MessageExts::ClassMethods
146
+
147
+ # A description of the historical or future-looking state of the
148
+ # resource pattern.
149
+ module History
150
+ # The "unset" value.
151
+ HISTORY_UNSPECIFIED = 0
152
+
153
+ # The resource originally had one pattern and launched as such, and
154
+ # additional patterns were added later.
155
+ ORIGINALLY_SINGLE_PATTERN = 1
156
+
157
+ # The resource has one pattern, but the API owner expects to add more
158
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
159
+ # that from being necessary once there are multiple patterns.)
160
+ FUTURE_MULTI_PATTERN = 2
161
+ end
162
+
163
+ # A flag representing a specific style that a resource claims to conform to.
164
+ module Style
165
+ # The unspecified value. Do not use.
166
+ STYLE_UNSPECIFIED = 0
167
+
168
+ # This resource is intended to be "declarative-friendly".
169
+ #
170
+ # Declarative-friendly resources must be more strictly consistent, and
171
+ # setting this to true communicates to tools that this resource should
172
+ # adhere to declarative-friendly expectations.
173
+ #
174
+ # Note: This is used by the API linter (linter.aip.dev) to enable
175
+ # additional checks.
176
+ DECLARATIVE_FRIENDLY = 1
177
+ end
178
+ end
179
+
180
+ # Defines a proto annotation that describes a string field that refers to
181
+ # an API resource.
182
+ # @!attribute [rw] type
183
+ # @return [::String]
184
+ # The resource type that the annotated field references.
185
+ #
186
+ # Example:
187
+ #
188
+ # message Subscription {
189
+ # string topic = 2 [(google.api.resource_reference) = {
190
+ # type: "pubsub.googleapis.com/Topic"
191
+ # }];
192
+ # }
193
+ #
194
+ # Occasionally, a field may reference an arbitrary resource. In this case,
195
+ # APIs use the special value * in their resource reference.
196
+ #
197
+ # Example:
198
+ #
199
+ # message GetIamPolicyRequest {
200
+ # string resource = 2 [(google.api.resource_reference) = {
201
+ # type: "*"
202
+ # }];
203
+ # }
204
+ # @!attribute [rw] child_type
205
+ # @return [::String]
206
+ # The resource type of a child collection that the annotated field
207
+ # references. This is useful for annotating the `parent` field that
208
+ # doesn't have a fixed resource type.
209
+ #
210
+ # Example:
211
+ #
212
+ # message ListLogEntriesRequest {
213
+ # string parent = 1 [(google.api.resource_reference) = {
214
+ # child_type: "logging.googleapis.com/LogEntry"
215
+ # };
216
+ # }
217
+ class ResourceReference
218
+ include ::Google::Protobuf::MessageExts
219
+ extend ::Google::Protobuf::MessageExts::ClassMethods
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,164 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 Longrunning
22
+ # This resource represents a long-running operation that is the result of a
23
+ # network API call.
24
+ # @!attribute [rw] name
25
+ # @return [::String]
26
+ # The server-assigned name, which is only unique within the same service that
27
+ # originally returns it. If you use the default HTTP mapping, the
28
+ # `name` should be a resource name ending with `operations/{unique_id}`.
29
+ # @!attribute [rw] metadata
30
+ # @return [::Google::Protobuf::Any]
31
+ # Service-specific metadata associated with the operation. It typically
32
+ # contains progress information and common metadata such as create time.
33
+ # Some services might not provide such metadata. Any method that returns a
34
+ # long-running operation should document the metadata type, if any.
35
+ # @!attribute [rw] done
36
+ # @return [::Boolean]
37
+ # If the value is `false`, it means the operation is still in progress.
38
+ # If `true`, the operation is completed, and either `error` or `response` is
39
+ # available.
40
+ # @!attribute [rw] error
41
+ # @return [::Google::Rpc::Status]
42
+ # The error result of the operation in case of failure or cancellation.
43
+ # @!attribute [rw] response
44
+ # @return [::Google::Protobuf::Any]
45
+ # The normal response of the operation in case of success. If the original
46
+ # method returns no data on success, such as `Delete`, the response is
47
+ # `google.protobuf.Empty`. If the original method is standard
48
+ # `Get`/`Create`/`Update`, the response should be the resource. For other
49
+ # methods, the response should have the type `XxxResponse`, where `Xxx`
50
+ # is the original method name. For example, if the original method name
51
+ # is `TakeSnapshot()`, the inferred response type is
52
+ # `TakeSnapshotResponse`.
53
+ class Operation
54
+ include ::Google::Protobuf::MessageExts
55
+ extend ::Google::Protobuf::MessageExts::ClassMethods
56
+ end
57
+
58
+ # The request message for Operations.GetOperation.
59
+ # @!attribute [rw] name
60
+ # @return [::String]
61
+ # The name of the operation resource.
62
+ class GetOperationRequest
63
+ include ::Google::Protobuf::MessageExts
64
+ extend ::Google::Protobuf::MessageExts::ClassMethods
65
+ end
66
+
67
+ # The request message for Operations.ListOperations.
68
+ # @!attribute [rw] name
69
+ # @return [::String]
70
+ # The name of the operation's parent resource.
71
+ # @!attribute [rw] filter
72
+ # @return [::String]
73
+ # The standard list filter.
74
+ # @!attribute [rw] page_size
75
+ # @return [::Integer]
76
+ # The standard list page size.
77
+ # @!attribute [rw] page_token
78
+ # @return [::String]
79
+ # The standard list page token.
80
+ class ListOperationsRequest
81
+ include ::Google::Protobuf::MessageExts
82
+ extend ::Google::Protobuf::MessageExts::ClassMethods
83
+ end
84
+
85
+ # The response message for Operations.ListOperations.
86
+ # @!attribute [rw] operations
87
+ # @return [::Array<::Google::Longrunning::Operation>]
88
+ # A list of operations that matches the specified filter in the request.
89
+ # @!attribute [rw] next_page_token
90
+ # @return [::String]
91
+ # The standard List next-page token.
92
+ class ListOperationsResponse
93
+ include ::Google::Protobuf::MessageExts
94
+ extend ::Google::Protobuf::MessageExts::ClassMethods
95
+ end
96
+
97
+ # The request message for Operations.CancelOperation.
98
+ # @!attribute [rw] name
99
+ # @return [::String]
100
+ # The name of the operation resource to be cancelled.
101
+ class CancelOperationRequest
102
+ include ::Google::Protobuf::MessageExts
103
+ extend ::Google::Protobuf::MessageExts::ClassMethods
104
+ end
105
+
106
+ # The request message for Operations.DeleteOperation.
107
+ # @!attribute [rw] name
108
+ # @return [::String]
109
+ # The name of the operation resource to be deleted.
110
+ class DeleteOperationRequest
111
+ include ::Google::Protobuf::MessageExts
112
+ extend ::Google::Protobuf::MessageExts::ClassMethods
113
+ end
114
+
115
+ # The request message for Operations.WaitOperation.
116
+ # @!attribute [rw] name
117
+ # @return [::String]
118
+ # The name of the operation resource to wait on.
119
+ # @!attribute [rw] timeout
120
+ # @return [::Google::Protobuf::Duration]
121
+ # The maximum duration to wait before timing out. If left blank, the wait
122
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
123
+ # If RPC context deadline is also specified, the shorter one will be used.
124
+ class WaitOperationRequest
125
+ include ::Google::Protobuf::MessageExts
126
+ extend ::Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
129
+ # A message representing the message types used by a long-running operation.
130
+ #
131
+ # Example:
132
+ #
133
+ # rpc LongRunningRecognize(LongRunningRecognizeRequest)
134
+ # returns (google.longrunning.Operation) {
135
+ # option (google.longrunning.operation_info) = {
136
+ # response_type: "LongRunningRecognizeResponse"
137
+ # metadata_type: "LongRunningRecognizeMetadata"
138
+ # };
139
+ # }
140
+ # @!attribute [rw] response_type
141
+ # @return [::String]
142
+ # Required. The message name of the primary return type for this
143
+ # long-running operation.
144
+ # This type will be used to deserialize the LRO's response.
145
+ #
146
+ # If the response is in a different package from the rpc, a fully-qualified
147
+ # message name must be used (e.g. `google.protobuf.Struct`).
148
+ #
149
+ # Note: Altering this value constitutes a breaking change.
150
+ # @!attribute [rw] metadata_type
151
+ # @return [::String]
152
+ # Required. The message name of the metadata type for this long-running
153
+ # operation.
154
+ #
155
+ # If the response is in a different package from the rpc, a fully-qualified
156
+ # message name must be used (e.g. `google.protobuf.Struct`).
157
+ #
158
+ # Note: Altering this value constitutes a breaking change.
159
+ class OperationInfo
160
+ include ::Google::Protobuf::MessageExts
161
+ extend ::Google::Protobuf::MessageExts::ClassMethods
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 2022 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
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 generic empty message that you can re-use to avoid defining duplicated
23
+ # empty messages in your APIs. A typical example is to use it as the request
24
+ # or the response type of an API method. For instance:
25
+ #
26
+ # service Foo {
27
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
28
+ # }
29
+ class Empty
30
+ include ::Google::Protobuf::MessageExts
31
+ extend ::Google::Protobuf::MessageExts::ClassMethods
32
+ end
33
+ end
34
+ end