google-cloud-bigquery-migration-v2 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.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_entities_pb.rb +89 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_error_details_pb.rb +39 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_metrics_pb.rb +52 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/client.rb +1016 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/credentials.rb +49 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service/paths.rb +92 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service.rb +51 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service_pb.rb +76 -0
- data/lib/google/cloud/bigquery/migration/v2/migration_service_services_pb.rb +62 -0
- data/lib/google/cloud/bigquery/migration/v2/translation_config_pb.rb +127 -0
- data/lib/google/cloud/bigquery/migration/v2/version.rb +30 -0
- data/lib/google/cloud/bigquery/migration/v2.rb +42 -0
- data/lib/google-cloud-bigquery-migration-v2.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/distribution.rb +225 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/label.rb +49 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/metric.rb +276 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_entities.rb +220 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_error_details.rb +72 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_metrics.rb +119 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/migration_service.rb +166 -0
- data/proto_docs/google/cloud/bigquery/migration/v2/translation_config.rb +275 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/error_details.rb +297 -0
- metadata +227 -0
@@ -0,0 +1,275 @@
|
|
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 Cloud
|
22
|
+
module Bigquery
|
23
|
+
module Migration
|
24
|
+
module V2
|
25
|
+
# The translation config to capture necessary settings for a translation task
|
26
|
+
# and subtask.
|
27
|
+
# @!attribute [rw] gcs_source_path
|
28
|
+
# @return [::String]
|
29
|
+
# The Cloud Storage path for a directory of files to translate in a task.
|
30
|
+
# @!attribute [rw] gcs_target_path
|
31
|
+
# @return [::String]
|
32
|
+
# The Cloud Storage path to write back the corresponding input files to.
|
33
|
+
# @!attribute [rw] source_dialect
|
34
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::Dialect]
|
35
|
+
# The dialect of the input files.
|
36
|
+
# @!attribute [rw] target_dialect
|
37
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::Dialect]
|
38
|
+
# The target dialect for the engine to translate the input to.
|
39
|
+
# @!attribute [rw] name_mapping_list
|
40
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::ObjectNameMappingList]
|
41
|
+
# The mapping of objects to their desired output names in list form.
|
42
|
+
# @!attribute [rw] source_env
|
43
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::SourceEnv]
|
44
|
+
# The default source environment values for the translation.
|
45
|
+
class TranslationConfigDetails
|
46
|
+
include ::Google::Protobuf::MessageExts
|
47
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
48
|
+
end
|
49
|
+
|
50
|
+
# The possible dialect options for translation.
|
51
|
+
# @!attribute [rw] bigquery_dialect
|
52
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::BigQueryDialect]
|
53
|
+
# The BigQuery dialect
|
54
|
+
# @!attribute [rw] hiveql_dialect
|
55
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::HiveQLDialect]
|
56
|
+
# The HiveQL dialect
|
57
|
+
# @!attribute [rw] redshift_dialect
|
58
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::RedshiftDialect]
|
59
|
+
# The Redshift dialect
|
60
|
+
# @!attribute [rw] teradata_dialect
|
61
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::TeradataDialect]
|
62
|
+
# The Teradata dialect
|
63
|
+
# @!attribute [rw] oracle_dialect
|
64
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::OracleDialect]
|
65
|
+
# The Oracle dialect
|
66
|
+
# @!attribute [rw] sparksql_dialect
|
67
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::SparkSQLDialect]
|
68
|
+
# The SparkSQL dialect
|
69
|
+
# @!attribute [rw] snowflake_dialect
|
70
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::SnowflakeDialect]
|
71
|
+
# The Snowflake dialect
|
72
|
+
# @!attribute [rw] netezza_dialect
|
73
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::NetezzaDialect]
|
74
|
+
# The Netezza dialect
|
75
|
+
# @!attribute [rw] azure_synapse_dialect
|
76
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::AzureSynapseDialect]
|
77
|
+
# The Azure Synapse dialect
|
78
|
+
# @!attribute [rw] vertica_dialect
|
79
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::VerticaDialect]
|
80
|
+
# The Vertica dialect
|
81
|
+
class Dialect
|
82
|
+
include ::Google::Protobuf::MessageExts
|
83
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
84
|
+
end
|
85
|
+
|
86
|
+
# The dialect definition for BigQuery.
|
87
|
+
class BigQueryDialect
|
88
|
+
include ::Google::Protobuf::MessageExts
|
89
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
90
|
+
end
|
91
|
+
|
92
|
+
# The dialect definition for HiveQL.
|
93
|
+
class HiveQLDialect
|
94
|
+
include ::Google::Protobuf::MessageExts
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
96
|
+
end
|
97
|
+
|
98
|
+
# The dialect definition for Redshift.
|
99
|
+
class RedshiftDialect
|
100
|
+
include ::Google::Protobuf::MessageExts
|
101
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
102
|
+
end
|
103
|
+
|
104
|
+
# The dialect definition for Teradata.
|
105
|
+
# @!attribute [rw] mode
|
106
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::TeradataDialect::Mode]
|
107
|
+
# Which Teradata sub-dialect mode the user specifies.
|
108
|
+
class TeradataDialect
|
109
|
+
include ::Google::Protobuf::MessageExts
|
110
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
111
|
+
|
112
|
+
# The sub-dialect options for Teradata.
|
113
|
+
module Mode
|
114
|
+
# Unspecified mode.
|
115
|
+
MODE_UNSPECIFIED = 0
|
116
|
+
|
117
|
+
# Teradata SQL mode.
|
118
|
+
SQL = 1
|
119
|
+
|
120
|
+
# BTEQ mode (which includes SQL).
|
121
|
+
BTEQ = 2
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
# The dialect definition for Oracle.
|
126
|
+
class OracleDialect
|
127
|
+
include ::Google::Protobuf::MessageExts
|
128
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
129
|
+
end
|
130
|
+
|
131
|
+
# The dialect definition for SparkSQL.
|
132
|
+
class SparkSQLDialect
|
133
|
+
include ::Google::Protobuf::MessageExts
|
134
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
135
|
+
end
|
136
|
+
|
137
|
+
# The dialect definition for Snowflake.
|
138
|
+
class SnowflakeDialect
|
139
|
+
include ::Google::Protobuf::MessageExts
|
140
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
141
|
+
end
|
142
|
+
|
143
|
+
# The dialect definition for Netezza.
|
144
|
+
class NetezzaDialect
|
145
|
+
include ::Google::Protobuf::MessageExts
|
146
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
147
|
+
end
|
148
|
+
|
149
|
+
# The dialect definition for Azure Synapse.
|
150
|
+
class AzureSynapseDialect
|
151
|
+
include ::Google::Protobuf::MessageExts
|
152
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
153
|
+
end
|
154
|
+
|
155
|
+
# The dialect definition for Vertica.
|
156
|
+
class VerticaDialect
|
157
|
+
include ::Google::Protobuf::MessageExts
|
158
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
159
|
+
end
|
160
|
+
|
161
|
+
# Represents a map of name mappings using a list of key:value proto messages of
|
162
|
+
# existing name to desired output name.
|
163
|
+
# @!attribute [rw] name_map
|
164
|
+
# @return [::Array<::Google::Cloud::Bigquery::Migration::V2::ObjectNameMapping>]
|
165
|
+
# The elements of the object name map.
|
166
|
+
class ObjectNameMappingList
|
167
|
+
include ::Google::Protobuf::MessageExts
|
168
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
169
|
+
end
|
170
|
+
|
171
|
+
# Represents a key-value pair of NameMappingKey to NameMappingValue to
|
172
|
+
# represent the mapping of SQL names from the input value to desired output.
|
173
|
+
# @!attribute [rw] source
|
174
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::NameMappingKey]
|
175
|
+
# The name of the object in source that is being mapped.
|
176
|
+
# @!attribute [rw] target
|
177
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::NameMappingValue]
|
178
|
+
# The desired target name of the object that is being mapped.
|
179
|
+
class ObjectNameMapping
|
180
|
+
include ::Google::Protobuf::MessageExts
|
181
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
182
|
+
end
|
183
|
+
|
184
|
+
# The potential components of a full name mapping that will be mapped
|
185
|
+
# during translation in the source data warehouse.
|
186
|
+
# @!attribute [rw] type
|
187
|
+
# @return [::Google::Cloud::Bigquery::Migration::V2::NameMappingKey::Type]
|
188
|
+
# The type of object that is being mapped.
|
189
|
+
# @!attribute [rw] database
|
190
|
+
# @return [::String]
|
191
|
+
# The database name (BigQuery project ID equivalent in the source data
|
192
|
+
# warehouse).
|
193
|
+
# @!attribute [rw] schema
|
194
|
+
# @return [::String]
|
195
|
+
# The schema name (BigQuery dataset equivalent in the source data warehouse).
|
196
|
+
# @!attribute [rw] relation
|
197
|
+
# @return [::String]
|
198
|
+
# The relation name (BigQuery table or view equivalent in the source data
|
199
|
+
# warehouse).
|
200
|
+
# @!attribute [rw] attribute
|
201
|
+
# @return [::String]
|
202
|
+
# The attribute name (BigQuery column equivalent in the source data
|
203
|
+
# warehouse).
|
204
|
+
class NameMappingKey
|
205
|
+
include ::Google::Protobuf::MessageExts
|
206
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
207
|
+
|
208
|
+
# The type of the object that is being mapped.
|
209
|
+
module Type
|
210
|
+
# Unspecified name mapping type.
|
211
|
+
TYPE_UNSPECIFIED = 0
|
212
|
+
|
213
|
+
# The object being mapped is a database.
|
214
|
+
DATABASE = 1
|
215
|
+
|
216
|
+
# The object being mapped is a schema.
|
217
|
+
SCHEMA = 2
|
218
|
+
|
219
|
+
# The object being mapped is a relation.
|
220
|
+
RELATION = 3
|
221
|
+
|
222
|
+
# The object being mapped is an attribute.
|
223
|
+
ATTRIBUTE = 4
|
224
|
+
|
225
|
+
# The object being mapped is a relation alias.
|
226
|
+
RELATION_ALIAS = 5
|
227
|
+
|
228
|
+
# The object being mapped is a an attribute alias.
|
229
|
+
ATTRIBUTE_ALIAS = 6
|
230
|
+
|
231
|
+
# The object being mapped is a function.
|
232
|
+
FUNCTION = 7
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
# The potential components of a full name mapping that will be mapped
|
237
|
+
# during translation in the target data warehouse.
|
238
|
+
# @!attribute [rw] database
|
239
|
+
# @return [::String]
|
240
|
+
# The database name (BigQuery project ID equivalent in the target data
|
241
|
+
# warehouse).
|
242
|
+
# @!attribute [rw] schema
|
243
|
+
# @return [::String]
|
244
|
+
# The schema name (BigQuery dataset equivalent in the target data warehouse).
|
245
|
+
# @!attribute [rw] relation
|
246
|
+
# @return [::String]
|
247
|
+
# The relation name (BigQuery table or view equivalent in the target data
|
248
|
+
# warehouse).
|
249
|
+
# @!attribute [rw] attribute
|
250
|
+
# @return [::String]
|
251
|
+
# The attribute name (BigQuery column equivalent in the target data
|
252
|
+
# warehouse).
|
253
|
+
class NameMappingValue
|
254
|
+
include ::Google::Protobuf::MessageExts
|
255
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
256
|
+
end
|
257
|
+
|
258
|
+
# Represents the default source environment values for the translation.
|
259
|
+
# @!attribute [rw] default_database
|
260
|
+
# @return [::String]
|
261
|
+
# The default database name to fully qualify SQL objects when their database
|
262
|
+
# name is missing.
|
263
|
+
# @!attribute [rw] schema_search_path
|
264
|
+
# @return [::Array<::String>]
|
265
|
+
# The schema search path. When SQL objects are missing schema name,
|
266
|
+
# translation engine will search through this list to find the value.
|
267
|
+
class SourceEnv
|
268
|
+
include ::Google::Protobuf::MessageExts
|
269
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
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,36 @@
|
|
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
|
+
#
|
30
|
+
# The JSON representation for `Empty` is empty JSON object `{}`.
|
31
|
+
class Empty
|
32
|
+
include ::Google::Protobuf::MessageExts
|
33
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|