google-cloud-bigtable 0.6.2 → 1.0.2

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -26
  3. data/CHANGELOG.md +85 -0
  4. data/CONTRIBUTING.md +1 -1
  5. data/OVERVIEW.md +388 -19
  6. data/lib/google-cloud-bigtable.rb +19 -22
  7. data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +1 -1
  8. data/lib/google/bigtable/v2/bigtable_pb.rb +3 -0
  9. data/lib/google/bigtable/v2/bigtable_services_pb.rb +1 -1
  10. data/lib/google/cloud/bigtable.rb +11 -17
  11. data/lib/google/cloud/bigtable/admin.rb +2 -2
  12. data/lib/google/cloud/bigtable/admin/v2.rb +2 -2
  13. data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +1 -1
  14. data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +2 -2
  15. data/lib/google/cloud/bigtable/admin/v2/credentials.rb +1 -1
  16. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_instance_admin.rb +1 -1
  17. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +1 -1
  18. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +1 -1
  19. data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +1 -1
  20. data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/iam_policy.rb +1 -1
  21. data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/options.rb +1 -1
  22. data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/policy.rb +7 -6
  23. data/lib/google/cloud/bigtable/admin/v2/doc/google/longrunning/operations.rb +2 -2
  24. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/any.rb +1 -1
  25. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/duration.rb +1 -1
  26. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/empty.rb +1 -1
  27. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/field_mask.rb +1 -1
  28. data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/timestamp.rb +1 -1
  29. data/lib/google/cloud/bigtable/admin/v2/doc/google/rpc/status.rb +7 -55
  30. data/lib/google/cloud/bigtable/admin/v2/doc/google/type/expr.rb +1 -1
  31. data/lib/google/cloud/bigtable/app_profile.rb +162 -96
  32. data/lib/google/cloud/bigtable/app_profile/job.rb +5 -8
  33. data/lib/google/cloud/bigtable/app_profile/list.rb +18 -12
  34. data/lib/google/cloud/bigtable/chunk_processor.rb +24 -36
  35. data/lib/google/cloud/bigtable/cluster.rb +45 -18
  36. data/lib/google/cloud/bigtable/cluster/job.rb +3 -7
  37. data/lib/google/cloud/bigtable/cluster/list.rb +22 -20
  38. data/lib/google/cloud/bigtable/column_family.rb +18 -231
  39. data/lib/google/cloud/bigtable/column_family_map.rb +426 -0
  40. data/lib/google/cloud/bigtable/column_range.rb +15 -7
  41. data/lib/google/cloud/bigtable/convert.rb +12 -4
  42. data/lib/google/cloud/bigtable/errors.rb +4 -1
  43. data/lib/google/cloud/bigtable/gc_rule.rb +188 -69
  44. data/lib/google/cloud/bigtable/instance.rb +209 -189
  45. data/lib/google/cloud/bigtable/instance/cluster_map.rb +17 -13
  46. data/lib/google/cloud/bigtable/instance/job.rb +6 -5
  47. data/lib/google/cloud/bigtable/instance/list.rb +18 -13
  48. data/lib/google/cloud/bigtable/longrunning_job.rb +7 -1
  49. data/lib/google/cloud/bigtable/mutation_entry.rb +36 -39
  50. data/lib/google/cloud/bigtable/mutation_operations.rb +90 -73
  51. data/lib/google/cloud/bigtable/policy.rb +9 -5
  52. data/lib/google/cloud/bigtable/project.rb +87 -196
  53. data/lib/google/cloud/bigtable/read_modify_write_rule.rb +15 -10
  54. data/lib/google/cloud/bigtable/read_operations.rb +42 -59
  55. data/lib/google/cloud/bigtable/routing_policy.rb +172 -0
  56. data/lib/google/cloud/bigtable/row.rb +32 -21
  57. data/lib/google/cloud/bigtable/row_filter.rb +80 -35
  58. data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +119 -68
  59. data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +8 -2
  60. data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +117 -66
  61. data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +24 -9
  62. data/lib/google/cloud/bigtable/row_range.rb +5 -0
  63. data/lib/google/cloud/bigtable/rows_mutator.rb +14 -21
  64. data/lib/google/cloud/bigtable/rows_reader.rb +23 -18
  65. data/lib/google/cloud/bigtable/sample_row_key.rb +6 -3
  66. data/lib/google/cloud/bigtable/service.rb +200 -253
  67. data/lib/google/cloud/bigtable/status.rb +76 -0
  68. data/lib/google/cloud/bigtable/table.rb +158 -262
  69. data/lib/google/cloud/bigtable/table/cluster_state.rb +17 -6
  70. data/lib/google/cloud/bigtable/table/list.rb +16 -9
  71. data/lib/google/cloud/bigtable/v2.rb +2 -2
  72. data/lib/google/cloud/bigtable/v2/bigtable_client.rb +13 -13
  73. data/lib/google/cloud/bigtable/v2/credentials.rb +1 -1
  74. data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/bigtable.rb +17 -14
  75. data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/data.rb +1 -1
  76. data/lib/google/cloud/bigtable/v2/doc/google/protobuf/any.rb +1 -1
  77. data/lib/google/cloud/bigtable/v2/doc/google/protobuf/wrappers.rb +1 -1
  78. data/lib/google/cloud/bigtable/v2/doc/google/rpc/status.rb +7 -55
  79. data/lib/google/cloud/bigtable/value_range.rb +19 -13
  80. data/lib/google/cloud/bigtable/version.rb +1 -1
  81. metadata +67 -25
  82. data/lib/google/cloud/bigtable/table/column_family_map.rb +0 -70
@@ -26,6 +26,7 @@ require "google/cloud/config"
26
26
 
27
27
  module Google
28
28
  module Cloud
29
+ ##
29
30
  # Creates a new object for connecting to the Cloud Bigtable service.
30
31
  #
31
32
  # For more information on connecting to Google Cloud Platform, see the
@@ -39,7 +40,8 @@ module Google
39
40
  # updater_proc is supplied.
40
41
  # @param timeout [Integer]
41
42
  # The default timeout, in seconds, for calls made through this client.
42
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
43
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel,
44
+ # GRPC::Core::ChannelCredentials, Proc]
43
45
  # Provides the means for authenticating requests made by the client. This parameter can
44
46
  # be one of the following types.
45
47
  # `Google::Auth::Credentials` uses the properties of its represented keyfile for
@@ -61,23 +63,23 @@ module Google
61
63
  # @return [Google::Cloud::Bigtable::Project]
62
64
  #
63
65
  # @example
64
- # require "google/cloud"
66
+ # require "google/cloud/bigtable"
65
67
  #
66
68
  # gcloud = Google::Cloud.new
67
69
  #
68
70
  # bigtable = gcloud.bigtable
69
71
  #
70
-
71
72
  def bigtable scope: nil, timeout: nil, credentials: nil, client_config: nil
72
73
  Google::Cloud.bigtable(
73
- project_id: @project,
74
- credentials: (credentials || @keyfile),
75
- scope: scope,
76
- timeout: (timeout || @timeout),
74
+ project_id: @project,
75
+ credentials: (credentials || @keyfile),
76
+ scope: scope,
77
+ timeout: (timeout || @timeout),
77
78
  client_config: client_config
78
79
  )
79
80
  end
80
81
 
82
+ ##
81
83
  # Creates a Cloud Bigtable client instance for data, table admin and instance admin
82
84
  # operations.
83
85
  #
@@ -85,7 +87,8 @@ module Google
85
87
  # Project identifier for the Bigtable service you
86
88
  # are connecting to. If not present, the default project for the
87
89
  # credentials is used.
88
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
90
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel,
91
+ # GRPC::Core::ChannelCredentials, Proc]
89
92
  # The means for authenticating requests made by the client. This parameter can
90
93
  # be one of the following types.
91
94
  # `Google::Auth::Credentials` uses the properties of its represented keyfile for
@@ -99,7 +102,6 @@ module Google
99
102
  # should already be composed with a `GRPC::Core::CallCredentials` object.
100
103
  # `Proc` will be used as an updater_proc for the gRPC channel. The proc transforms the
101
104
  # metadata for requests, generally, to give OAuth credentials.
102
- # @param timeout [Integer]
103
105
  # @param scope [Array<String>]
104
106
  # The OAuth 2.0 scopes controlling the set of resources and operations
105
107
  # that the connection can access. See [Using OAuth 2.0 to Access Google
@@ -116,22 +118,17 @@ module Google
116
118
  # @return [Google::Cloud::Bigtable::Project]
117
119
  #
118
120
  # @example
119
- # require "google/cloud"
121
+ # require "google/cloud/bigtable"
120
122
  #
121
123
  # bigtable = Google::Cloud.bigtable
122
-
123
- def self.bigtable \
124
- project_id: nil,
125
- credentials: nil,
126
- scope: nil,
127
- timeout: nil,
128
- client_config: nil
124
+ #
125
+ def self.bigtable project_id: nil, credentials: nil, scope: nil, timeout: nil, client_config: nil
129
126
  require "google/cloud/bigtable"
130
127
  Google::Cloud::Bigtable.new(
131
- project_id: project_id,
132
- credentials: credentials,
133
- scope: scope,
134
- timeout: timeout,
128
+ project_id: project_id,
129
+ credentials: credentials,
130
+ scope: scope,
131
+ timeout: timeout,
135
132
  client_config: client_config
136
133
  )
137
134
  end
@@ -156,7 +153,7 @@ Google::Cloud.configure.add_config! :bigtable do |config|
156
153
  config.add_field! :project_id, default_project, match: String, allow_nil: true
157
154
  config.add_alias! :project, :project_id
158
155
  config.add_field! :credentials, default_creds,
159
- match: [
156
+ match: [
160
157
  String,
161
158
  Hash,
162
159
  Google::Auth::Credentials,
@@ -109,7 +109,7 @@ module Google
109
109
  # recommended for production use. It is not subject to any SLA or deprecation
110
110
  # policy.
111
111
  rpc :DeleteSnapshot, DeleteSnapshotRequest, Google::Protobuf::Empty
112
- # Gets the access control policy for an instance resource. Returns an empty
112
+ # Gets the access control policy for a table resource. Returns an empty
113
113
  # policy if an table exists but does not have a policy set.
114
114
  rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
115
115
  # Sets the access control policy on a table resource. Replaces any existing
@@ -5,6 +5,9 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
+ require 'google/api/client_pb'
9
+ require 'google/api/field_behavior_pb'
10
+ require 'google/api/resource_pb'
8
11
  require 'google/bigtable/v2/data_pb'
9
12
  require 'google/protobuf/wrappers_pb'
10
13
  require 'google/rpc/status_pb'
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/bigtable/v2/bigtable.proto for package 'google.bigtable.v2'
3
3
  # Original file comments:
4
- # Copyright 2018 Google Inc.
4
+ # Copyright 2019 Google LLC.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -21,18 +21,21 @@ require "google/cloud/bigtable/project"
21
21
 
22
22
  module Google
23
23
  module Cloud
24
+ ##
24
25
  # Cloud Bigtable
25
26
  #
26
27
  # See {file:OVERVIEW.md Bigtable Overview}.
27
28
  #
28
29
  module Bigtable
30
+ ##
29
31
  # Service for managing Cloud Bigtable instances and tables and for reading from and
30
32
  # writing to Bigtable tables.
31
33
  #
32
34
  # @param project_id [String]
33
35
  # Project identifier for the Bigtable service you are connecting to.
34
36
  # If not present, the default project for the credentials is used.
35
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
37
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel,
38
+ # GRPC::Core::ChannelCredentials, Proc]
36
39
  # Provides the means for authenticating requests made by the client. This parameter can
37
40
  # be one of the following types:
38
41
  # `Google::Auth::Credentials` uses the properties of its represented keyfile for
@@ -70,14 +73,8 @@ module Google
70
73
  #
71
74
  # client = Google::Cloud::Bigtable.new
72
75
  #
73
- def self.new \
74
- project_id: nil,
75
- credentials: nil,
76
- emulator_host: nil,
77
- scope: nil,
78
- client_config: nil,
79
- endpoint: nil,
80
- timeout: nil
76
+ def self.new project_id: nil, credentials: nil, emulator_host: nil, scope: nil, client_config: nil, endpoint: nil,
77
+ timeout: nil
81
78
  project_id ||= default_project_id
82
79
  scope ||= configure.scope
83
80
  timeout ||= configure.timeout
@@ -98,9 +95,10 @@ module Google
98
95
  project_id, credentials,
99
96
  host: endpoint, timeout: timeout, client_config: client_config
100
97
  )
101
- Bigtable::Project.new(service)
98
+ Bigtable::Project.new service
102
99
  end
103
100
 
101
+ ##
104
102
  # Configure the Google Cloud Bigtable library.
105
103
  #
106
104
  # The following Bigtable configuration parameters are supported:
@@ -151,10 +149,8 @@ module Google
151
149
  #
152
150
  def self.resolve_credentials given_credentials, scope
153
151
  credentials = given_credentials || default_credentials(scope: scope)
154
- unless credentials.is_a? Google::Auth::Credentials
155
- credentials = Bigtable::Credentials.new credentials, scope: scope
156
- end
157
- credentials
152
+ return credentials if credentials.is_a? Google::Auth::Credentials
153
+ Bigtable::Credentials.new credentials, scope: scope
158
154
  end
159
155
 
160
156
  # @private
@@ -162,9 +158,7 @@ module Google
162
158
  #
163
159
  def self.resolve_project_id given_project_id, credentials
164
160
  project_id = given_project_id || default_project_id
165
- if credentials.respond_to? :project_id
166
- project_id ||= credentials.project_id
167
- end
161
+ project_id ||= credentials.project_id if credentials.respond_to? :project_id
168
162
  project_id.to_s # Always cast to a string
169
163
  end
170
164
 
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ module Google
22
22
  # rubocop:disable LineLength
23
23
 
24
24
  ##
25
- # # Ruby Client for Cloud Bigtable Admin API ([Beta](https://github.com/googleapis/google-cloud-ruby#versioning))
25
+ # # Ruby Client for Cloud Bigtable Admin API ([GA](https://github.com/googleapis/google-cloud-ruby#versioning))
26
26
  #
27
27
  # [Cloud Bigtable Admin API][Product Documentation]:
28
28
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ module Google
25
25
  # rubocop:disable LineLength
26
26
 
27
27
  ##
28
- # # Ruby Client for Cloud Bigtable Admin API ([Beta](https://github.com/googleapis/google-cloud-ruby#versioning))
28
+ # # Ruby Client for Cloud Bigtable Admin API ([GA](https://github.com/googleapis/google-cloud-ruby#versioning))
29
29
  #
30
30
  # [Cloud Bigtable Admin API][Product Documentation]:
31
31
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -870,7 +870,7 @@ module Google
870
870
  @check_consistency.call(req, options, &block)
871
871
  end
872
872
 
873
- # Gets the access control policy for an instance resource. Returns an empty
873
+ # Gets the access control policy for a table resource. Returns an empty
874
874
  # policy if an table exists but does not have a policy set.
875
875
  #
876
876
  # @param resource [String]
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -82,12 +82,13 @@ module Google
82
82
  #
83
83
  # Operations affecting conditional bindings must specify version 3. This can
84
84
  # be either setting a conditional policy, modifying a conditional binding,
85
- # or removing a conditional binding from the stored conditional policy.
85
+ # or removing a binding (conditional or unconditional) from the stored
86
+ # conditional policy.
86
87
  # Operations on non-conditional policies may specify any valid value or
87
88
  # leave the field unset.
88
89
  #
89
- # If no etag is provided in the call to `setIamPolicy`, any version
90
- # compliance checks on the incoming and/or stored policy is skipped.
90
+ # If no etag is provided in the call to `setIamPolicy`, version compliance
91
+ # checks against the stored policy is skipped.
91
92
  # @!attribute [rw] bindings
92
93
  # @return [Array<Google::Iam::V1::Binding>]
93
94
  # Associates a list of `members` to a `role`. Optionally may specify a
@@ -105,8 +106,8 @@ module Google
105
106
  #
106
107
  # If no `etag` is provided in the call to `setIamPolicy`, then the existing
107
108
  # policy is overwritten. Due to blind-set semantics of an etag-less policy,
108
- # 'setIamPolicy' will not fail even if either of incoming or stored policy
109
- # does not meet the version requirements.
109
+ # 'setIamPolicy' will not fail even if the incoming policy version does not
110
+ # meet the requirements for modifying the stored policy.
110
111
  class Policy; end
111
112
 
112
113
  # Associates `members` with a `role`.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ module Google
21
21
  # @return [String]
22
22
  # The server-assigned name, which is only unique within the same service that
23
23
  # originally returns it. If you use the default HTTP mapping, the
24
- # `name` should have the format of `operations/some/unique/name`.
24
+ # `name` should be a resource name ending with `operations/{unique_id}`.
25
25
  # @!attribute [rw] metadata
26
26
  # @return [Google::Protobuf::Any]
27
27
  # Service-specific metadata associated with the operation. It typically
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2019 Google LLC
1
+ # Copyright 2020 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -17,67 +17,19 @@ module Google
17
17
  module Rpc
18
18
  # The `Status` type defines a logical error model that is suitable for
19
19
  # different programming environments, including REST APIs and RPC APIs. It is
20
- # used by [gRPC](https://github.com/grpc). The error model is designed to be:
20
+ # used by [gRPC](https://github.com/grpc). Each `Status` message contains
21
+ # three pieces of data: error code, error message, and error details.
21
22
  #
22
- # * Simple to use and understand for most users
23
- # * Flexible enough to meet unexpected needs
24
- #
25
- # = Overview
26
- #
27
- # The `Status` message contains three pieces of data: error code, error
28
- # message, and error details. The error code should be an enum value of
29
- # {Google::Rpc::Code}, but it may accept additional error codes
30
- # if needed. The error message should be a developer-facing English message
31
- # that helps developers *understand* and *resolve* the error. If a localized
32
- # user-facing error message is needed, put the localized message in the error
33
- # details or localize it in the client. The optional error details may contain
34
- # arbitrary information about the error. There is a predefined set of error
35
- # detail types in the package `google.rpc` that can be used for common error
36
- # conditions.
37
- #
38
- # = Language mapping
39
- #
40
- # The `Status` message is the logical representation of the error model, but it
41
- # is not necessarily the actual wire format. When the `Status` message is
42
- # exposed in different client libraries and different wire protocols, it can be
43
- # mapped differently. For example, it will likely be mapped to some exceptions
44
- # in Java, but more likely mapped to some error codes in C.
45
- #
46
- # = Other uses
47
- #
48
- # The error model and the `Status` message can be used in a variety of
49
- # environments, either with or without APIs, to provide a
50
- # consistent developer experience across different environments.
51
- #
52
- # Example uses of this error model include:
53
- #
54
- # * Partial errors. If a service needs to return partial errors to the client,
55
- # it may embed the `Status` in the normal response to indicate the partial
56
- # errors.
57
- #
58
- # * Workflow errors. A typical workflow has multiple steps. Each step may
59
- # have a `Status` message for error reporting.
60
- #
61
- # * Batch operations. If a client uses batch request and batch response, the
62
- # `Status` message should be used directly inside batch response, one for
63
- # each error sub-response.
64
- #
65
- # * Asynchronous operations. If an API call embeds asynchronous operation
66
- # results in its response, the status of those operations should be
67
- # represented directly using the `Status` message.
68
- #
69
- # * Logging. If some API errors are stored in logs, the message `Status` could
70
- # be used directly after any stripping needed for security/privacy reasons.
23
+ # You can find out more about this error model and how to work with it in the
24
+ # [API Design Guide](https://cloud.google.com/apis/design/errors).
71
25
  # @!attribute [rw] code
72
26
  # @return [Integer]
73
- # The status code, which should be an enum value of
74
- # {Google::Rpc::Code}.
27
+ # The status code, which should be an enum value of {Google::Rpc::Code}.
75
28
  # @!attribute [rw] message
76
29
  # @return [String]
77
30
  # A developer-facing error message, which should be in English. Any
78
31
  # user-facing error message should be localized and sent in the
79
- # {Google::Rpc::Status#details} field, or localized
80
- # by the client.
32
+ # {Google::Rpc::Status#details} field, or localized by the client.
81
33
  # @!attribute [rw] details
82
34
  # @return [Array<Google::Protobuf::Any>]
83
35
  # A list of messages that carry the error details. There is a common set of