google-cloud-bigtable 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +10 -0
  3. data/LICENSE +201 -0
  4. data/README.md +65 -0
  5. data/lib/google/bigtable/admin/v2/bigtable_instance_admin_pb.rb +139 -0
  6. data/lib/google/bigtable/admin/v2/bigtable_instance_admin_services_pb.rb +85 -0
  7. data/lib/google/bigtable/admin/v2/bigtable_table_admin_pb.rb +137 -0
  8. data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +117 -0
  9. data/lib/google/bigtable/admin/v2/common_pb.rb +24 -0
  10. data/lib/google/bigtable/admin/v2/instance_pb.rb +72 -0
  11. data/lib/google/bigtable/admin/v2/table_pb.rb +88 -0
  12. data/lib/google/bigtable/v2/bigtable_pb.rb +109 -0
  13. data/lib/google/bigtable/v2/bigtable_services_pb.rb +67 -0
  14. data/lib/google/bigtable/v2/data_pb.rb +155 -0
  15. data/lib/google/cloud/bigtable/admin/credentials.rb +26 -0
  16. data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +1417 -0
  17. data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client_config.json +123 -0
  18. data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +1079 -0
  19. data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +109 -0
  20. data/lib/google/cloud/bigtable/admin/v2/credentials.rb +50 -0
  21. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_instance_admin.rb +279 -0
  22. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +353 -0
  23. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +194 -0
  24. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +209 -0
  25. data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/iam_policy.rb +62 -0
  26. data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/policy.rb +127 -0
  27. data/lib/google/cloud/bigtable/admin/v2/doc/google/longrunning/operations.rb +92 -0
  28. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/any.rb +124 -0
  29. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/duration.rb +90 -0
  30. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/empty.rb +28 -0
  31. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/field_mask.rb +223 -0
  32. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/timestamp.rb +106 -0
  33. data/lib/google/cloud/bigtable/admin/v2/doc/google/rpc/status.rb +83 -0
  34. data/lib/google/cloud/bigtable/admin/v2.rb +200 -0
  35. data/lib/google/cloud/bigtable/admin.rb +196 -0
  36. data/lib/google/cloud/bigtable/app_profile/job.rb +102 -0
  37. data/lib/google/cloud/bigtable/app_profile/list.rb +159 -0
  38. data/lib/google/cloud/bigtable/app_profile.rb +373 -0
  39. data/lib/google/cloud/bigtable/chunk_processor.rb +253 -0
  40. data/lib/google/cloud/bigtable/cluster/job.rb +92 -0
  41. data/lib/google/cloud/bigtable/cluster/list.rb +169 -0
  42. data/lib/google/cloud/bigtable/cluster.rb +264 -0
  43. data/lib/google/cloud/bigtable/column_family.rb +280 -0
  44. data/lib/google/cloud/bigtable/column_range.rb +186 -0
  45. data/lib/google/cloud/bigtable/convert.rb +75 -0
  46. data/lib/google/cloud/bigtable/credentials.rb +24 -0
  47. data/lib/google/cloud/bigtable/errors.rb +35 -0
  48. data/lib/google/cloud/bigtable/gc_rule.rb +215 -0
  49. data/lib/google/cloud/bigtable/instance/cluster_map.rb +70 -0
  50. data/lib/google/cloud/bigtable/instance/job.rb +97 -0
  51. data/lib/google/cloud/bigtable/instance/list.rb +159 -0
  52. data/lib/google/cloud/bigtable/instance.rb +921 -0
  53. data/lib/google/cloud/bigtable/longrunning_job.rb +105 -0
  54. data/lib/google/cloud/bigtable/mutation_entry.rb +244 -0
  55. data/lib/google/cloud/bigtable/mutation_operations.rb +338 -0
  56. data/lib/google/cloud/bigtable/policy.rb +163 -0
  57. data/lib/google/cloud/bigtable/project.rb +580 -0
  58. data/lib/google/cloud/bigtable/read_modify_write_rule.rb +129 -0
  59. data/lib/google/cloud/bigtable/read_operations.rb +345 -0
  60. data/lib/google/cloud/bigtable/row.rb +125 -0
  61. data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +539 -0
  62. data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +108 -0
  63. data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +570 -0
  64. data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +273 -0
  65. data/lib/google/cloud/bigtable/row_filter.rb +593 -0
  66. data/lib/google/cloud/bigtable/row_range.rb +174 -0
  67. data/lib/google/cloud/bigtable/rows_mutator.rb +120 -0
  68. data/lib/google/cloud/bigtable/rows_reader.rb +196 -0
  69. data/lib/google/cloud/bigtable/sample_row_key.rb +82 -0
  70. data/lib/google/cloud/bigtable/service.rb +817 -0
  71. data/lib/google/cloud/bigtable/table/cluster_state.rb +93 -0
  72. data/lib/google/cloud/bigtable/table/column_family_map.rb +68 -0
  73. data/lib/google/cloud/bigtable/table/list.rb +147 -0
  74. data/lib/google/cloud/bigtable/table.rb +676 -0
  75. data/lib/google/cloud/bigtable/v2/bigtable_client.rb +579 -0
  76. data/lib/google/cloud/bigtable/v2/bigtable_client_config.json +65 -0
  77. data/lib/google/cloud/bigtable/v2/credentials.rb +45 -0
  78. data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/bigtable.rb +286 -0
  79. data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/data.rb +492 -0
  80. data/lib/google/cloud/bigtable/v2/doc/google/protobuf/any.rb +124 -0
  81. data/lib/google/cloud/bigtable/v2/doc/google/protobuf/wrappers.rb +89 -0
  82. data/lib/google/cloud/bigtable/v2/doc/google/rpc/status.rb +83 -0
  83. data/lib/google/cloud/bigtable/v2.rb +132 -0
  84. data/lib/google/cloud/bigtable/value_range.rb +175 -0
  85. data/lib/google/cloud/bigtable/version.rb +22 -0
  86. data/lib/google/cloud/bigtable.rb +223 -0
  87. data/lib/google-cloud-bigtable.rb +167 -0
  88. metadata +283 -0
@@ -0,0 +1,127 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Iam
17
+ module V1
18
+ # Defines an Identity and Access Management (IAM) policy. It is used to
19
+ # specify access control policies for Cloud Platform resources.
20
+ #
21
+ #
22
+ # A +Policy+ consists of a list of +bindings+. A +Binding+ binds a list of
23
+ # +members+ to a +role+, where the members can be user accounts, Google groups,
24
+ # Google domains, and service accounts. A +role+ is a named list of permissions
25
+ # defined by IAM.
26
+ #
27
+ # **Example**
28
+ #
29
+ # {
30
+ # "bindings": [
31
+ # {
32
+ # "role": "roles/owner",
33
+ # "members": [
34
+ # "user:mike@example.com",
35
+ # "group:admins@example.com",
36
+ # "domain:google.com",
37
+ # "serviceAccount:my-other-app@appspot.gserviceaccount.com",
38
+ # ]
39
+ # },
40
+ # {
41
+ # "role": "roles/viewer",
42
+ # "members": ["user:sean@example.com"]
43
+ # }
44
+ # ]
45
+ # }
46
+ #
47
+ # For a description of IAM and its features, see the
48
+ # [IAM developer's guide](https://cloud.google.com/iam).
49
+ # @!attribute [rw] version
50
+ # @return [Integer]
51
+ # Version of the +Policy+. The default version is 0.
52
+ # @!attribute [rw] bindings
53
+ # @return [Array<Google::Iam::V1::Binding>]
54
+ # Associates a list of +members+ to a +role+.
55
+ # Multiple +bindings+ must not be specified for the same +role+.
56
+ # +bindings+ with no members will result in an error.
57
+ # @!attribute [rw] etag
58
+ # @return [String]
59
+ # +etag+ is used for optimistic concurrency control as a way to help
60
+ # prevent simultaneous updates of a policy from overwriting each other.
61
+ # It is strongly suggested that systems make use of the +etag+ in the
62
+ # read-modify-write cycle to perform policy updates in order to avoid race
63
+ # conditions: An +etag+ is returned in the response to +getIamPolicy+, and
64
+ # systems are expected to put that etag in the request to +setIamPolicy+ to
65
+ # ensure that their change will be applied to the same version of the policy.
66
+ #
67
+ # If no +etag+ is provided in the call to +setIamPolicy+, then the existing
68
+ # policy is overwritten blindly.
69
+ class Policy; end
70
+
71
+ # Associates +members+ with a +role+.
72
+ # @!attribute [rw] role
73
+ # @return [String]
74
+ # Role that is assigned to +members+.
75
+ # For example, +roles/viewer+, +roles/editor+, or +roles/owner+.
76
+ # Required
77
+ # @!attribute [rw] members
78
+ # @return [Array<String>]
79
+ # Specifies the identities requesting access for a Cloud Platform resource.
80
+ # +members+ can have the following values:
81
+ #
82
+ # * +allUsers+: A special identifier that represents anyone who is
83
+ # on the internet; with or without a Google account.
84
+ #
85
+ # * +allAuthenticatedUsers+: A special identifier that represents anyone
86
+ # who is authenticated with a Google account or a service account.
87
+ #
88
+ # * +user:{emailid}+: An email address that represents a specific Google
89
+ # account. For example, +alice@gmail.com+ or +joe@example.com+.
90
+ #
91
+ #
92
+ # * +serviceAccount:{emailid}+: An email address that represents a service
93
+ # account. For example, +my-other-app@appspot.gserviceaccount.com+.
94
+ #
95
+ # * +group:{emailid}+: An email address that represents a Google group.
96
+ # For example, +admins@example.com+.
97
+ #
98
+ # * +domain:{domain}+: A Google Apps domain name that represents all the
99
+ # users of that domain. For example, +google.com+ or +example.com+.
100
+ class Binding; end
101
+
102
+ # The difference delta between two policies.
103
+ # @!attribute [rw] binding_deltas
104
+ # @return [Array<Google::Iam::V1::BindingDelta>]
105
+ # The delta for Bindings between two policies.
106
+ class PolicyDelta; end
107
+
108
+ # One delta entry for Binding. Each individual change (only one member in each
109
+ # entry) to a binding will be a separate entry.
110
+ # @!attribute [rw] action
111
+ # @return [Google::Iam::V1::BindingDelta::Action]
112
+ # The action that was performed on a Binding.
113
+ # Required
114
+ # @!attribute [rw] role
115
+ # @return [String]
116
+ # Role that is assigned to +members+.
117
+ # For example, +roles/viewer+, +roles/editor+, or +roles/owner+.
118
+ # Required
119
+ # @!attribute [rw] member
120
+ # @return [String]
121
+ # A single identity requesting access for a Cloud Platform resource.
122
+ # Follows the same format of Binding.members.
123
+ # Required
124
+ class BindingDelta; end
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,92 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Longrunning
17
+ # This resource represents a long-running operation that is the result of a
18
+ # network API call.
19
+ # @!attribute [rw] name
20
+ # @return [String]
21
+ # The server-assigned name, which is only unique within the same service that
22
+ # originally returns it. If you use the default HTTP mapping, the
23
+ # +name+ should have the format of +operations/some/unique/name+.
24
+ # @!attribute [rw] metadata
25
+ # @return [Google::Protobuf::Any]
26
+ # Service-specific metadata associated with the operation. It typically
27
+ # contains progress information and common metadata such as create time.
28
+ # Some services might not provide such metadata. Any method that returns a
29
+ # long-running operation should document the metadata type, if any.
30
+ # @!attribute [rw] done
31
+ # @return [true, false]
32
+ # If the value is +false+, it means the operation is still in progress.
33
+ # If true, the operation is completed, and either +error+ or +response+ is
34
+ # available.
35
+ # @!attribute [rw] error
36
+ # @return [Google::Rpc::Status]
37
+ # The error result of the operation in case of failure or cancellation.
38
+ # @!attribute [rw] response
39
+ # @return [Google::Protobuf::Any]
40
+ # The normal response of the operation in case of success. If the original
41
+ # method returns no data on success, such as +Delete+, the response is
42
+ # +google.protobuf.Empty+. If the original method is standard
43
+ # +Get+/+Create+/+Update+, the response should be the resource. For other
44
+ # methods, the response should have the type +XxxResponse+, where +Xxx+
45
+ # is the original method name. For example, if the original method name
46
+ # is +TakeSnapshot()+, the inferred response type is
47
+ # +TakeSnapshotResponse+.
48
+ class Operation; end
49
+
50
+ # The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
51
+ # @!attribute [rw] name
52
+ # @return [String]
53
+ # The name of the operation resource.
54
+ class GetOperationRequest; end
55
+
56
+ # The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
57
+ # @!attribute [rw] name
58
+ # @return [String]
59
+ # The name of the operation collection.
60
+ # @!attribute [rw] filter
61
+ # @return [String]
62
+ # The standard list filter.
63
+ # @!attribute [rw] page_size
64
+ # @return [Integer]
65
+ # The standard list page size.
66
+ # @!attribute [rw] page_token
67
+ # @return [String]
68
+ # The standard list page token.
69
+ class ListOperationsRequest; end
70
+
71
+ # The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
72
+ # @!attribute [rw] operations
73
+ # @return [Array<Google::Longrunning::Operation>]
74
+ # A list of operations that matches the specified filter in the request.
75
+ # @!attribute [rw] next_page_token
76
+ # @return [String]
77
+ # The standard List next-page token.
78
+ class ListOperationsResponse; end
79
+
80
+ # The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
81
+ # @!attribute [rw] name
82
+ # @return [String]
83
+ # The name of the operation resource to be cancelled.
84
+ class CancelOperationRequest; end
85
+
86
+ # The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
87
+ # @!attribute [rw] name
88
+ # @return [String]
89
+ # The name of the operation resource to be deleted.
90
+ class DeleteOperationRequest; end
91
+ end
92
+ end
@@ -0,0 +1,124 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # +Any+ contains an arbitrary serialized protocol buffer message along with a
18
+ # URL that describes the type of the serialized message.
19
+ #
20
+ # Protobuf library provides support to pack/unpack Any values in the form
21
+ # of utility functions or additional generated methods of the Any type.
22
+ #
23
+ # Example 1: Pack and unpack a message in C++.
24
+ #
25
+ # Foo foo = ...;
26
+ # Any any;
27
+ # any.PackFrom(foo);
28
+ # ...
29
+ # if (any.UnpackTo(&foo)) {
30
+ # ...
31
+ # }
32
+ #
33
+ # Example 2: Pack and unpack a message in Java.
34
+ #
35
+ # Foo foo = ...;
36
+ # Any any = Any.pack(foo);
37
+ # ...
38
+ # if (any.is(Foo.class)) {
39
+ # foo = any.unpack(Foo.class);
40
+ # }
41
+ #
42
+ # Example 3: Pack and unpack a message in Python.
43
+ #
44
+ # foo = Foo(...)
45
+ # any = Any()
46
+ # any.Pack(foo)
47
+ # ...
48
+ # if any.Is(Foo.DESCRIPTOR):
49
+ # any.Unpack(foo)
50
+ # ...
51
+ #
52
+ # Example 4: Pack and unpack a message in Go
53
+ #
54
+ # foo := &pb.Foo{...}
55
+ # any, err := ptypes.MarshalAny(foo)
56
+ # ...
57
+ # foo := &pb.Foo{}
58
+ # if err := ptypes.UnmarshalAny(any, foo); err != nil {
59
+ # ...
60
+ # }
61
+ #
62
+ # The pack methods provided by protobuf library will by default use
63
+ # 'type.googleapis.com/full.type.name' as the type URL and the unpack
64
+ # methods only use the fully qualified type name after the last '/'
65
+ # in the type URL, for example "foo.bar.com/x/y.z" will yield type
66
+ # name "y.z".
67
+ #
68
+ #
69
+ # = JSON
70
+ #
71
+ # The JSON representation of an +Any+ value uses the regular
72
+ # representation of the deserialized, embedded message, with an
73
+ # additional field +@type+ which contains the type URL. Example:
74
+ #
75
+ # package google.profile;
76
+ # message Person {
77
+ # string first_name = 1;
78
+ # string last_name = 2;
79
+ # }
80
+ #
81
+ # {
82
+ # "@type": "type.googleapis.com/google.profile.Person",
83
+ # "firstName": <string>,
84
+ # "lastName": <string>
85
+ # }
86
+ #
87
+ # If the embedded message type is well-known and has a custom JSON
88
+ # representation, that representation will be embedded adding a field
89
+ # +value+ which holds the custom JSON in addition to the +@type+
90
+ # field. Example (for message {Google::Protobuf::Duration}):
91
+ #
92
+ # {
93
+ # "@type": "type.googleapis.com/google.protobuf.Duration",
94
+ # "value": "1.212s"
95
+ # }
96
+ # @!attribute [rw] type_url
97
+ # @return [String]
98
+ # A URL/resource name whose content describes the type of the
99
+ # serialized protocol buffer message.
100
+ #
101
+ # For URLs which use the scheme +http+, +https+, or no scheme, the
102
+ # following restrictions and interpretations apply:
103
+ #
104
+ # * If no scheme is provided, +https+ is assumed.
105
+ # * The last segment of the URL's path must represent the fully
106
+ # qualified name of the type (as in +path/google.protobuf.Duration+).
107
+ # The name should be in a canonical form (e.g., leading "." is
108
+ # not accepted).
109
+ # * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
110
+ # value in binary format, or produce an error.
111
+ # * Applications are allowed to cache lookup results based on the
112
+ # URL, or have them precompiled into a binary to avoid any
113
+ # lookup. Therefore, binary compatibility needs to be preserved
114
+ # on changes to types. (Use versioned type names to manage
115
+ # breaking changes.)
116
+ #
117
+ # Schemes other than +http+, +https+ (or the empty scheme) might be
118
+ # used with implementation specific semantics.
119
+ # @!attribute [rw] value
120
+ # @return [String]
121
+ # Must be a valid serialized protocol buffer of the above specified type.
122
+ class Any; end
123
+ end
124
+ end
@@ -0,0 +1,90 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # A Duration represents a signed, fixed-length span of time represented
18
+ # as a count of seconds and fractions of seconds at nanosecond
19
+ # resolution. It is independent of any calendar and concepts like "day"
20
+ # or "month". It is related to Timestamp in that the difference between
21
+ # two Timestamp values is a Duration and it can be added or subtracted
22
+ # from a Timestamp. Range is approximately +-10,000 years.
23
+ #
24
+ # = Examples
25
+ #
26
+ # Example 1: Compute Duration from two Timestamps in pseudo code.
27
+ #
28
+ # Timestamp start = ...;
29
+ # Timestamp end = ...;
30
+ # Duration duration = ...;
31
+ #
32
+ # duration.seconds = end.seconds - start.seconds;
33
+ # duration.nanos = end.nanos - start.nanos;
34
+ #
35
+ # if (duration.seconds < 0 && duration.nanos > 0) {
36
+ # duration.seconds += 1;
37
+ # duration.nanos -= 1000000000;
38
+ # } else if (durations.seconds > 0 && duration.nanos < 0) {
39
+ # duration.seconds -= 1;
40
+ # duration.nanos += 1000000000;
41
+ # }
42
+ #
43
+ # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
44
+ #
45
+ # Timestamp start = ...;
46
+ # Duration duration = ...;
47
+ # Timestamp end = ...;
48
+ #
49
+ # end.seconds = start.seconds + duration.seconds;
50
+ # end.nanos = start.nanos + duration.nanos;
51
+ #
52
+ # if (end.nanos < 0) {
53
+ # end.seconds -= 1;
54
+ # end.nanos += 1000000000;
55
+ # } else if (end.nanos >= 1000000000) {
56
+ # end.seconds += 1;
57
+ # end.nanos -= 1000000000;
58
+ # }
59
+ #
60
+ # Example 3: Compute Duration from datetime.timedelta in Python.
61
+ #
62
+ # td = datetime.timedelta(days=3, minutes=10)
63
+ # duration = Duration()
64
+ # duration.FromTimedelta(td)
65
+ #
66
+ # = JSON Mapping
67
+ #
68
+ # In JSON format, the Duration type is encoded as a string rather than an
69
+ # object, where the string ends in the suffix "s" (indicating seconds) and
70
+ # is preceded by the number of seconds, with nanoseconds expressed as
71
+ # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
72
+ # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
73
+ # be expressed in JSON format as "3.000000001s", and 3 seconds and 1
74
+ # microsecond should be expressed in JSON format as "3.000001s".
75
+ # @!attribute [rw] seconds
76
+ # @return [Integer]
77
+ # Signed seconds of the span of time. Must be from -315,576,000,000
78
+ # to +315,576,000,000 inclusive. Note: these bounds are computed from:
79
+ # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
80
+ # @!attribute [rw] nanos
81
+ # @return [Integer]
82
+ # Signed fractions of a second at nanosecond resolution of the span
83
+ # of time. Durations less than one second are represented with a 0
84
+ # +seconds+ field and a positive or negative +nanos+ field. For durations
85
+ # of one second or more, a non-zero value for the +nanos+ field must be
86
+ # of the same sign as the +seconds+ field. Must be from -999,999,999
87
+ # to +999,999,999 inclusive.
88
+ class Duration; end
89
+ end
90
+ end
@@ -0,0 +1,28 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # A generic empty message that you can re-use to avoid defining duplicated
18
+ # empty messages in your APIs. A typical example is to use it as the request
19
+ # or the response type of an API method. For instance:
20
+ #
21
+ # service Foo {
22
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
23
+ # }
24
+ #
25
+ # The JSON representation for +Empty+ is empty JSON object +{}+.
26
+ class Empty; end
27
+ end
28
+ end