gcloud 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +8 -8
  2. data/AUTHENTICATION.md +13 -9
  3. data/CHANGELOG.md +8 -3
  4. data/OVERVIEW.md +46 -8
  5. data/lib/gcloud.rb +123 -117
  6. data/lib/gcloud/backoff.rb +43 -15
  7. data/lib/gcloud/bigquery.rb +211 -195
  8. data/lib/gcloud/bigquery/connection.rb +9 -9
  9. data/lib/gcloud/bigquery/copy_job.rb +15 -16
  10. data/lib/gcloud/bigquery/credentials.rb +3 -3
  11. data/lib/gcloud/bigquery/data.rb +12 -11
  12. data/lib/gcloud/bigquery/dataset.rb +162 -216
  13. data/lib/gcloud/bigquery/dataset/access.rb +59 -43
  14. data/lib/gcloud/bigquery/dataset/list.rb +3 -3
  15. data/lib/gcloud/bigquery/errors.rb +9 -5
  16. data/lib/gcloud/bigquery/extract_job.rb +18 -18
  17. data/lib/gcloud/bigquery/insert_response.rb +7 -4
  18. data/lib/gcloud/bigquery/job.rb +48 -44
  19. data/lib/gcloud/bigquery/job/list.rb +3 -3
  20. data/lib/gcloud/bigquery/load_job.rb +24 -25
  21. data/lib/gcloud/bigquery/project.rb +145 -204
  22. data/lib/gcloud/bigquery/query_data.rb +10 -9
  23. data/lib/gcloud/bigquery/query_job.rb +23 -32
  24. data/lib/gcloud/bigquery/table.rb +238 -280
  25. data/lib/gcloud/bigquery/table/list.rb +3 -3
  26. data/lib/gcloud/bigquery/table/schema.rb +79 -87
  27. data/lib/gcloud/bigquery/view.rb +69 -82
  28. data/lib/gcloud/credentials.rb +3 -9
  29. data/lib/gcloud/datastore.rb +194 -170
  30. data/lib/gcloud/datastore/connection.rb +12 -8
  31. data/lib/gcloud/datastore/credentials.rb +6 -4
  32. data/lib/gcloud/datastore/dataset.rb +74 -141
  33. data/lib/gcloud/datastore/dataset/lookup_results.rb +6 -4
  34. data/lib/gcloud/datastore/dataset/query_results.rb +6 -4
  35. data/lib/gcloud/datastore/entity.rb +81 -76
  36. data/lib/gcloud/datastore/errors.rb +10 -8
  37. data/lib/gcloud/datastore/key.rb +41 -77
  38. data/lib/gcloud/datastore/properties.rb +3 -3
  39. data/lib/gcloud/datastore/proto.rb +7 -4
  40. data/lib/gcloud/datastore/query.rb +26 -3
  41. data/lib/gcloud/datastore/transaction.rb +12 -8
  42. data/lib/gcloud/dns.rb +180 -152
  43. data/lib/gcloud/dns/change.rb +16 -16
  44. data/lib/gcloud/dns/change/list.rb +3 -3
  45. data/lib/gcloud/dns/connection.rb +9 -10
  46. data/lib/gcloud/dns/credentials.rb +3 -3
  47. data/lib/gcloud/dns/errors.rb +9 -5
  48. data/lib/gcloud/dns/importer.rb +17 -23
  49. data/lib/gcloud/dns/project.rb +42 -64
  50. data/lib/gcloud/dns/record.rb +58 -46
  51. data/lib/gcloud/dns/record/list.rb +6 -7
  52. data/lib/gcloud/dns/zone.rb +198 -289
  53. data/lib/gcloud/dns/zone/list.rb +3 -3
  54. data/lib/gcloud/dns/zone/transaction.rb +56 -72
  55. data/lib/gcloud/errors.rb +174 -3
  56. data/lib/gcloud/gce.rb +3 -4
  57. data/lib/gcloud/grpc_utils.rb +76 -0
  58. data/lib/gcloud/logging.rb +308 -0
  59. data/lib/gcloud/logging/credentials.rb +29 -0
  60. data/lib/gcloud/logging/entry.rb +303 -0
  61. data/lib/gcloud/logging/entry/http_request.rb +141 -0
  62. data/lib/gcloud/logging/entry/list.rb +111 -0
  63. data/lib/gcloud/logging/entry/operation.rb +90 -0
  64. data/lib/gcloud/logging/logger.rb +307 -0
  65. data/lib/gcloud/logging/metric.rb +175 -0
  66. data/lib/gcloud/logging/metric/list.rb +98 -0
  67. data/lib/gcloud/logging/project.rb +650 -0
  68. data/lib/gcloud/logging/resource.rb +95 -0
  69. data/lib/gcloud/logging/resource_descriptor.rb +140 -0
  70. data/lib/gcloud/logging/resource_descriptor/list.rb +78 -0
  71. data/lib/gcloud/logging/service.rb +258 -0
  72. data/lib/gcloud/logging/sink.rb +233 -0
  73. data/lib/gcloud/logging/sink/list.rb +97 -0
  74. data/lib/gcloud/pubsub.rb +241 -199
  75. data/lib/gcloud/pubsub/credentials.rb +3 -3
  76. data/lib/gcloud/pubsub/message.rb +26 -20
  77. data/lib/gcloud/pubsub/project.rb +166 -233
  78. data/lib/gcloud/pubsub/received_message.rb +28 -38
  79. data/lib/gcloud/pubsub/service.rb +323 -0
  80. data/lib/gcloud/pubsub/subscription.rb +172 -242
  81. data/lib/gcloud/pubsub/subscription/list.rb +11 -9
  82. data/lib/gcloud/pubsub/topic.rb +152 -271
  83. data/lib/gcloud/pubsub/topic/batch.rb +66 -0
  84. data/lib/gcloud/pubsub/topic/list.rb +9 -7
  85. data/lib/gcloud/resource_manager.rb +158 -138
  86. data/lib/gcloud/resource_manager/connection.rb +6 -5
  87. data/lib/gcloud/resource_manager/credentials.rb +3 -3
  88. data/lib/gcloud/resource_manager/errors.rb +9 -5
  89. data/lib/gcloud/resource_manager/manager.rb +54 -86
  90. data/lib/gcloud/resource_manager/project.rb +69 -88
  91. data/lib/gcloud/resource_manager/project/list.rb +4 -5
  92. data/lib/gcloud/resource_manager/project/updater.rb +12 -14
  93. data/lib/gcloud/search.rb +158 -135
  94. data/lib/gcloud/search/api_client.rb +7 -7
  95. data/lib/gcloud/search/connection.rb +8 -8
  96. data/lib/gcloud/search/credentials.rb +3 -3
  97. data/lib/gcloud/search/document.rb +64 -87
  98. data/lib/gcloud/search/document/list.rb +5 -5
  99. data/lib/gcloud/search/errors.rb +9 -5
  100. data/lib/gcloud/search/field_value.rb +32 -38
  101. data/lib/gcloud/search/field_values.rb +50 -80
  102. data/lib/gcloud/search/fields.rb +44 -65
  103. data/lib/gcloud/search/index.rb +163 -204
  104. data/lib/gcloud/search/index/list.rb +5 -5
  105. data/lib/gcloud/search/project.rb +31 -47
  106. data/lib/gcloud/search/result.rb +27 -31
  107. data/lib/gcloud/search/result/list.rb +6 -6
  108. data/lib/gcloud/storage.rb +224 -190
  109. data/lib/gcloud/storage/bucket.rb +202 -227
  110. data/lib/gcloud/storage/bucket/acl.rb +83 -170
  111. data/lib/gcloud/storage/bucket/cors.rb +31 -34
  112. data/lib/gcloud/storage/bucket/list.rb +3 -3
  113. data/lib/gcloud/storage/connection.rb +11 -7
  114. data/lib/gcloud/storage/credentials.rb +3 -3
  115. data/lib/gcloud/storage/errors.rb +11 -8
  116. data/lib/gcloud/storage/file.rb +129 -171
  117. data/lib/gcloud/storage/file/acl.rb +51 -99
  118. data/lib/gcloud/storage/file/list.rb +3 -3
  119. data/lib/gcloud/storage/file/verifier.rb +3 -2
  120. data/lib/gcloud/storage/project.rb +111 -132
  121. data/lib/gcloud/upload.rb +4 -7
  122. data/lib/gcloud/version.rb +2 -4
  123. data/lib/google/api/annotations.rb +14 -0
  124. data/lib/google/api/http.rb +30 -0
  125. data/lib/google/api/label.rb +24 -0
  126. data/lib/google/api/monitored_resource.rb +25 -0
  127. data/lib/google/datastore/v1beta3/datastore.rb +115 -0
  128. data/lib/google/datastore/v1beta3/datastore_services.rb +33 -0
  129. data/lib/google/datastore/v1beta3/entity.rb +63 -0
  130. data/lib/google/datastore/v1beta3/query.rb +128 -0
  131. data/lib/google/devtools/cloudtrace/v1/trace.rb +78 -0
  132. data/lib/google/devtools/cloudtrace/v1/trace_services.rb +32 -0
  133. data/lib/google/example/library/v1/library.rb +91 -0
  134. data/lib/google/example/library/v1/library_services.rb +40 -0
  135. data/lib/google/iam/v1/iam_policy.rb +33 -0
  136. data/lib/google/iam/v1/iam_policy_services.rb +30 -0
  137. data/lib/google/iam/v1/policy.rb +25 -0
  138. data/lib/google/logging/type/http_request.rb +28 -0
  139. data/lib/google/logging/type/log_severity.rb +27 -0
  140. data/lib/google/logging/v2/log_entry.rb +44 -0
  141. data/lib/google/logging/v2/logging.rb +56 -0
  142. data/lib/google/logging/v2/logging_config.rb +59 -0
  143. data/lib/google/logging/v2/logging_config_services.rb +32 -0
  144. data/lib/google/logging/v2/logging_metrics.rb +51 -0
  145. data/lib/google/logging/v2/logging_metrics_services.rb +32 -0
  146. data/lib/google/logging/v2/logging_services.rb +31 -0
  147. data/lib/google/longrunning/operations.rb +50 -0
  148. data/lib/google/longrunning/operations_services.rb +29 -0
  149. data/lib/google/protobuf/any.rb +17 -0
  150. data/lib/google/protobuf/api.rb +31 -0
  151. data/lib/google/protobuf/descriptor.rb +0 -0
  152. data/lib/google/protobuf/duration.rb +17 -0
  153. data/lib/google/protobuf/empty.rb +15 -0
  154. data/lib/google/protobuf/field_mask.rb +16 -0
  155. data/lib/google/protobuf/source_context.rb +16 -0
  156. data/lib/google/protobuf/struct.rb +35 -0
  157. data/lib/google/protobuf/timestamp.rb +17 -0
  158. data/lib/google/protobuf/type.rb +79 -0
  159. data/lib/google/protobuf/wrappers.rb +48 -0
  160. data/lib/google/pubsub/v1/pubsub.rb +129 -0
  161. data/lib/google/pubsub/v1/pubsub_services.rb +56 -0
  162. data/lib/google/pubsub/v1beta2/pubsub.rb +126 -0
  163. data/lib/google/pubsub/v1beta2/pubsub_services.rb +56 -0
  164. data/lib/google/rpc/code.rb +32 -0
  165. data/lib/google/rpc/error_details.rb +61 -0
  166. data/lib/google/rpc/status.rb +19 -0
  167. data/lib/google/type/color.rb +20 -0
  168. data/lib/google/type/date.rb +18 -0
  169. data/lib/google/type/dayofweek.rb +23 -0
  170. data/lib/google/type/latlng.rb +17 -0
  171. data/lib/google/type/money.rb +18 -0
  172. data/lib/google/type/timeofday.rb +19 -0
  173. metadata +101 -4
  174. data/lib/gcloud/pubsub/connection.rb +0 -295
  175. data/lib/gcloud/pubsub/errors.rb +0 -93
@@ -1,4 +1,3 @@
1
- #--
2
1
  # Copyright 2015 Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,12 +12,14 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
15
+
16
16
  module Gcloud
17
17
  module Bigquery
18
18
  ##
19
19
  # InsertResponse
20
20
  class InsertResponse
21
- def initialize rows, gapi #:nodoc:
21
+ # @private
22
+ def initialize rows, gapi
22
23
  @rows = rows
23
24
  @gapi = gapi
24
25
  end
@@ -59,7 +60,8 @@ module Gcloud
59
60
  []
60
61
  end
61
62
 
62
- def self.from_gapi rows, gapi #:nodoc:
63
+ # @private
64
+ def self.from_gapi rows, gapi
63
65
  gapi = gapi.to_hash if gapi.respond_to? :to_hash
64
66
  new rows, gapi
65
67
  end
@@ -70,7 +72,8 @@ module Gcloud
70
72
  attr_reader :row
71
73
  attr_reader :errors
72
74
 
73
- def initialize row, errors #:nodoc:
75
+ # @private
76
+ def initialize row, errors
74
77
  @row = row
75
78
  @errors = errors
76
79
  end
@@ -1,4 +1,3 @@
1
- #--
2
1
  # Copyright 2015 Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +12,7 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
15
+
16
16
  require "gcloud/bigquery/query_data"
17
17
  require "gcloud/bigquery/job/list"
18
18
  require "gcloud/bigquery/errors"
@@ -20,22 +20,23 @@ require "gcloud/bigquery/errors"
20
20
  module Gcloud
21
21
  module Bigquery
22
22
  ##
23
- # = Job
23
+ # # Job
24
24
  #
25
- # Represents a generic Job that may be performed on a Table.
25
+ # Represents a generic Job that may be performed on a {Table}.
26
26
  #
27
- # See {Managing Jobs, Datasets, and Projects
28
- # }[https://cloud.google.com/bigquery/docs/managing_jobs_datasets_projects]
29
- # for an overview of BigQuery jobs, and the {Jobs API
30
- # reference}[https://cloud.google.com/bigquery/docs/reference/v2/jobs]
31
- # for details.
27
+ # The subclasses of Job represent the specific BigQuery job types:
28
+ # {CopyJob}, {ExtractJob}, {LoadJob}, and {QueryJob}.
32
29
  #
33
- # The subclasses of Job represent the specific BigQuery job types: CopyJob,
34
- # ExtractJob, LoadJob, and QueryJob.
30
+ # A job instance is created when you call {Project#query_job},
31
+ # {Dataset#query_job}, {Table#copy}, {Table#extract}, {Table#load}, or
32
+ # {View#data}.
35
33
  #
36
- # A job instance is created when you call Project#query_job,
37
- # Dataset#query_job, Table#copy, Table#extract, Table#load, or View#data.
34
+ # @see https://cloud.google.com/bigquery/docs/managing_jobs_datasets_projects
35
+ # Managing Jobs, Datasets, and Projects
36
+ # @see https://cloud.google.com/bigquery/docs/reference/v2/jobs Jobs API
37
+ # reference
38
38
  #
39
+ # @example
39
40
  # require "gcloud"
40
41
  #
41
42
  # gcloud = Gcloud.new
@@ -54,16 +55,16 @@ module Gcloud
54
55
  #
55
56
  class Job
56
57
  ##
57
- # The Connection object.
58
- attr_accessor :connection #:nodoc:
58
+ # @private The Connection object.
59
+ attr_accessor :connection
59
60
 
60
61
  ##
61
- # The Google API Client object.
62
- attr_accessor :gapi #:nodoc:
62
+ # @private The Google API Client object.
63
+ attr_accessor :gapi
63
64
 
64
65
  ##
65
- # Create an empty Job object.
66
- def initialize #:nodoc:
66
+ # @private Create an empty Job object.
67
+ def initialize
67
68
  @connection = nil
68
69
  @gapi = {}
69
70
  end
@@ -81,9 +82,9 @@ module Gcloud
81
82
  end
82
83
 
83
84
  ##
84
- # The current state of the job. The possible values are +PENDING+,
85
- # +RUNNING+, and +DONE+. A +DONE+ state does not mean that the job
86
- # completed successfully. Use #failed? to discover if an error occurred
85
+ # The current state of the job. The possible values are `PENDING`,
86
+ # `RUNNING`, and `DONE`. A `DONE` state does not mean that the job
87
+ # completed successfully. Use {#failed?} to discover if an error occurred
87
88
  # or if the job was successful.
88
89
  def state
89
90
  return nil if @gapi["status"].nil?
@@ -91,23 +92,23 @@ module Gcloud
91
92
  end
92
93
 
93
94
  ##
94
- # Checks if the job's state is +RUNNING+.
95
+ # Checks if the job's state is `RUNNING`.
95
96
  def running?
96
97
  return false if state.nil?
97
98
  "running".casecmp(state).zero?
98
99
  end
99
100
 
100
101
  ##
101
- # Checks if the job's state is +PENDING+.
102
+ # Checks if the job's state is `PENDING`.
102
103
  def pending?
103
104
  return false if state.nil?
104
105
  "pending".casecmp(state).zero?
105
106
  end
106
107
 
107
108
  ##
108
- # Checks if the job's state is +DONE+. When +true+, the job has stopped
109
- # running. However, a +DONE+ state does not mean that the job completed
110
- # successfully. Use #failed? to detect if an error occurred or if the
109
+ # Checks if the job's state is `DONE`. When `true`, the job has stopped
110
+ # running. However, a `DONE` state does not mean that the job completed
111
+ # successfully. Use {#failed?} to detect if an error occurred or if the
111
112
  # job was successful.
112
113
  def done?
113
114
  return false if state.nil?
@@ -130,8 +131,8 @@ module Gcloud
130
131
 
131
132
  ##
132
133
  # The time when the job was started.
133
- # This field is present after the job's state changes from +PENDING+
134
- # to either +RUNNING+ or +DONE+.
134
+ # This field is present after the job's state changes from `PENDING`
135
+ # to either `RUNNING` or `DONE`.
135
136
  def started_at
136
137
  return nil if @gapi["statistics"].nil?
137
138
  return nil if @gapi["statistics"]["startTime"].nil?
@@ -140,7 +141,7 @@ module Gcloud
140
141
 
141
142
  ##
142
143
  # The time when the job ended.
143
- # This field is present when the job's state is +DONE+.
144
+ # This field is present when the job's state is `DONE`.
144
145
  def ended_at
145
146
  return nil if @gapi["statistics"].nil?
146
147
  return nil if @gapi["statistics"]["endTime"].nil?
@@ -148,8 +149,10 @@ module Gcloud
148
149
  end
149
150
 
150
151
  ##
151
- # The configuration for the job. Returns a hash. See the {Jobs API
152
- # reference}[https://cloud.google.com/bigquery/docs/reference/v2/jobs].
152
+ # The configuration for the job. Returns a hash.
153
+ #
154
+ # @see https://cloud.google.com/bigquery/docs/reference/v2/jobs Jobs API
155
+ # reference
153
156
  def configuration
154
157
  hash = @gapi["configuration"] || {}
155
158
  hash = hash.to_hash if hash.respond_to? :to_hash
@@ -158,8 +161,10 @@ module Gcloud
158
161
  alias_method :config, :configuration
159
162
 
160
163
  ##
161
- # The statistics for the job. Returns a hash. See the {Jobs API
162
- # reference}[https://cloud.google.com/bigquery/docs/reference/v2/jobs].
164
+ # The statistics for the job. Returns a hash.
165
+ #
166
+ # @see https://cloud.google.com/bigquery/docs/reference/v2/jobs Jobs API
167
+ # reference
163
168
  def statistics
164
169
  hash = @gapi["statistics"] || {}
165
170
  hash = hash.to_hash if hash.respond_to? :to_hash
@@ -169,7 +174,7 @@ module Gcloud
169
174
 
170
175
  ##
171
176
  # The job's status. Returns a hash. The values contained in the hash are
172
- # also exposed by #state, #error, and #errors.
177
+ # also exposed by {#state}, {#error}, and {#errors}.
173
178
  def status
174
179
  hash = @gapi["status"] || {}
175
180
  hash = hash.to_hash if hash.respond_to? :to_hash
@@ -178,12 +183,12 @@ module Gcloud
178
183
 
179
184
  ##
180
185
  # The last error for the job, if any errors have occurred. Returns a
181
- # hash. See the {Jobs API
182
- # reference}[https://cloud.google.com/bigquery/docs/reference/v2/jobs].
186
+ # hash.
183
187
  #
184
- # === Returns
188
+ # @see https://cloud.google.com/bigquery/docs/reference/v2/jobs Jobs API
189
+ # reference
185
190
  #
186
- # +Hash+
191
+ # @return [Hash] Returns a hash containing `reason` and `message` keys:
187
192
  #
188
193
  # {
189
194
  # "reason"=>"notFound",
@@ -196,7 +201,7 @@ module Gcloud
196
201
 
197
202
  ##
198
203
  # The errors for the job, if any errors have occurred. Returns an array
199
- # of hash objects. See #error.
204
+ # of hash objects. See {#error}.
200
205
  def errors
201
206
  Array status["errors"]
202
207
  end
@@ -227,11 +232,10 @@ module Gcloud
227
232
  alias_method :refresh!, :reload!
228
233
 
229
234
  ##
230
- # Refreshes the job until the job is +DONE+.
235
+ # Refreshes the job until the job is `DONE`.
231
236
  # The delay between refreshes will incrementally increase.
232
237
  #
233
- # === Example
234
- #
238
+ # @example
235
239
  # require "gcloud"
236
240
  #
237
241
  # gcloud = Gcloud.new
@@ -254,8 +258,8 @@ module Gcloud
254
258
  end
255
259
 
256
260
  ##
257
- # New Job from a Google API Client object.
258
- def self.from_gapi gapi, conn #:nodoc:
261
+ # @private New Job from a Google API Client object.
262
+ def self.from_gapi gapi, conn
259
263
  klass = klass_for gapi
260
264
  klass.new.tap do |f|
261
265
  f.gapi = gapi
@@ -1,4 +1,3 @@
1
- #--
2
1
  # Copyright 2015 Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +12,7 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
15
+
16
16
  require "delegate"
17
17
 
18
18
  module Gcloud
@@ -39,8 +39,8 @@ module Gcloud
39
39
  end
40
40
 
41
41
  ##
42
- # New Job::List from a response object.
43
- def self.from_response resp, conn #:nodoc:
42
+ # @private New Job::List from a response object.
43
+ def self.from_response resp, conn
44
44
  jobs = List.new(Array(resp.data["jobs"]).map do |gapi_object|
45
45
  Job.from_gapi gapi_object, conn
46
46
  end)
@@ -1,4 +1,3 @@
1
- #--
2
1
  # Copyright 2015 Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,19 +12,19 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
15
+
16
16
  module Gcloud
17
17
  module Bigquery
18
18
  ##
19
- # = LoadJob
19
+ # # LoadJob
20
20
  #
21
- # A Job subclass representing a load operation that may be performed
22
- # on a Table. A LoadJob instance is created when you call Table#load.
21
+ # A {Job} subclass representing a load operation that may be performed
22
+ # on a {Table}. A LoadJob instance is created when you call {Table#load}.
23
23
  #
24
- # See {Loading Data Into
25
- # BigQuery}[https://cloud.google.com/bigquery/loading-data-into-bigquery]
26
- # and the {Jobs API
27
- # reference}[https://cloud.google.com/bigquery/docs/reference/v2/jobs]
28
- # for details.
24
+ # @see https://cloud.google.com/bigquery/loading-data-into-bigquery Loading
25
+ # Data Into BigQuery
26
+ # @see https://cloud.google.com/bigquery/docs/reference/v2/jobs Jobs API
27
+ # reference
29
28
  #
30
29
  class LoadJob < Job
31
30
  ##
@@ -37,7 +36,7 @@ module Gcloud
37
36
 
38
37
  ##
39
38
  # The table into which the operation loads data. This is the table on
40
- # which Table#load was invoked. Returns a Table instance.
39
+ # which {Table#load} was invoked. Returns a {Table} instance.
41
40
  def destination
42
41
  table = config["load"]["destinationTable"]
43
42
  return nil unless table
@@ -55,7 +54,7 @@ module Gcloud
55
54
 
56
55
  ##
57
56
  # The number of header rows at the top of a CSV file to skip. The default
58
- # value is +0+.
57
+ # value is `0`.
59
58
  def skip_leading_rows
60
59
  config["load"]["skipLeadingRows"] || 0
61
60
  end
@@ -78,10 +77,10 @@ module Gcloud
78
77
 
79
78
  ##
80
79
  # The value that is used to quote data sections in a CSV file.
81
- # The default value is a double-quote (+"+). If your data does not contain
80
+ # The default value is a double-quote (`"`). If your data does not contain
82
81
  # quoted sections, the value should be an empty string. If your data
83
- # contains quoted newline characters, #quoted_newlines? should return
84
- # +true+.
82
+ # contains quoted newline characters, {#quoted_newlines?} should return
83
+ # `true`.
85
84
  def quote
86
85
  val = config["load"]["quote"]
87
86
  val = "\"" if val.nil?
@@ -91,7 +90,7 @@ module Gcloud
91
90
  ##
92
91
  # The maximum number of bad records that the load operation can ignore. If
93
92
  # the number of bad records exceeds this value, an error is
94
- # returned. The default value is +0+, which requires that all records be
93
+ # returned. The default value is `0`, which requires that all records be
95
94
  # valid.
96
95
  def max_bad_records
97
96
  val = config["load"]["maxBadRecords"]
@@ -101,7 +100,7 @@ module Gcloud
101
100
 
102
101
  ##
103
102
  # Checks if quoted data sections may contain newline characters in a CSV
104
- # file. The default is +false+.
103
+ # file. The default is `false`.
105
104
  def quoted_newlines?
106
105
  val = config["load"]["allowQuotedNewlines"]
107
106
  val = true if val.nil?
@@ -110,14 +109,14 @@ module Gcloud
110
109
 
111
110
  ##
112
111
  # Checks if the format of the source data is
113
- # {newline-delimited JSON}[http://jsonlines.org/]. The default is +false+.
112
+ # [newline-delimited JSON](http://jsonlines.org/). The default is `false`.
114
113
  def json?
115
114
  val = config["load"]["sourceFormat"]
116
115
  val == "NEWLINE_DELIMITED_JSON"
117
116
  end
118
117
 
119
118
  ##
120
- # Checks if the format of the source data is CSV. The default is +true+.
119
+ # Checks if the format of the source data is CSV. The default is `true`.
121
120
  def csv?
122
121
  val = config["load"]["sourceFormat"]
123
122
  return true if val.nil?
@@ -133,10 +132,10 @@ module Gcloud
133
132
 
134
133
  ##
135
134
  # Checks if the load operation accepts rows that are missing trailing
136
- # optional columns. The missing values are treated as nulls. If +false+,
135
+ # optional columns. The missing values are treated as nulls. If `false`,
137
136
  # records with missing trailing columns are treated as bad records, and
138
137
  # if there are too many bad records, an error is returned. The default
139
- # value is +false+. Only applicable to CSV, ignored for other formats.
138
+ # value is `false`. Only applicable to CSV, ignored for other formats.
140
139
  def allow_jagged_rows?
141
140
  val = config["load"]["allowJaggedRows"]
142
141
  val = false if val.nil?
@@ -145,10 +144,10 @@ module Gcloud
145
144
 
146
145
  ##
147
146
  # Checks if the load operation allows extra values that are not
148
- # represented in the table schema. If +true+, the extra values are
149
- # ignored. If +false+, records with extra columns are treated as bad
147
+ # represented in the table schema. If `true`, the extra values are
148
+ # ignored. If `false`, records with extra columns are treated as bad
150
149
  # records, and if there are too many bad records, an invalid error is
151
- # returned. The default is +false+.
150
+ # returned. The default is `false`.
152
151
  def ignore_unknown_values?
153
152
  val = config["load"]["ignoreUnknownValues"]
154
153
  val = false if val.nil?
@@ -157,8 +156,8 @@ module Gcloud
157
156
 
158
157
  ##
159
158
  # The schema for the data. Returns a hash. Can be empty if the table
160
- # has already has the correct schema (see Table#schema= and Table#schema),
161
- # or if the schema can be inferred from the loaded data.
159
+ # has already has the correct schema (see {Table#schema=} and
160
+ # {Table#schema}), or if the schema can be inferred from the loaded data.
162
161
  def schema
163
162
  val = config["load"]["schema"]
164
163
  val = {} if val.nil?
@@ -1,4 +1,3 @@
1
- #--
2
1
  # Copyright 2015 Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +12,7 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
15
+
16
16
  require "gcloud/gce"
17
17
  require "gcloud/bigquery/connection"
18
18
  require "gcloud/bigquery/credentials"
@@ -24,16 +24,19 @@ require "gcloud/bigquery/query_data"
24
24
  module Gcloud
25
25
  module Bigquery
26
26
  ##
27
- # = Project
27
+ # # Project
28
28
  #
29
29
  # Projects are top-level containers in Google Cloud Platform. They store
30
30
  # information about billing and authorized users, and they contain BigQuery
31
31
  # data. Each project has a friendly name and a unique ID.
32
32
  #
33
33
  # Gcloud::Bigquery::Project is the main object for interacting with
34
- # Google BigQuery. Gcloud::Bigquery::Dataset objects are created,
34
+ # Google BigQuery. {Gcloud::Bigquery::Dataset} objects are created,
35
35
  # accessed, and deleted by Gcloud::Bigquery::Project.
36
36
  #
37
+ # See {Gcloud#bigquery}
38
+ #
39
+ # @example
37
40
  # require "gcloud"
38
41
  #
39
42
  # gcloud = Gcloud.new
@@ -41,16 +44,15 @@ module Gcloud
41
44
  # dataset = bigquery.dataset "my_dataset"
42
45
  # table = dataset.table "my_table"
43
46
  #
44
- # See Gcloud#bigquery
45
47
  class Project
46
48
  ##
47
- # The Connection object.
48
- attr_accessor :connection #:nodoc:
49
+ # @private The Connection object.
50
+ attr_accessor :connection
49
51
 
50
52
  ##
51
53
  # Creates a new Connection instance.
52
54
  #
53
- # See Gcloud.bigquery
55
+ # See {Gcloud.bigquery}
54
56
  def initialize project, credentials
55
57
  project = project.to_s # Always cast to a string
56
58
  fail ArgumentError, "project is missing" if project.empty?
@@ -60,8 +62,7 @@ module Gcloud
60
62
  ##
61
63
  # The BigQuery project connected to.
62
64
  #
63
- # === Example
64
- #
65
+ # @example
65
66
  # require "gcloud"
66
67
  #
67
68
  # gcloud = Gcloud.new "my-todo-project", "/path/to/keyfile.json"
@@ -74,8 +75,8 @@ module Gcloud
74
75
  end
75
76
 
76
77
  ##
77
- # Default project.
78
- def self.default_project #:nodoc:
78
+ # @private Default project.
79
+ def self.default_project
79
80
  ENV["BIGQUERY_PROJECT"] ||
80
81
  ENV["GCLOUD_PROJECT"] ||
81
82
  ENV["GOOGLE_CLOUD_PROJECT"] ||
@@ -83,61 +84,53 @@ module Gcloud
83
84
  end
84
85
 
85
86
  ##
86
- # Queries data using the {asynchronous
87
- # method}[https://cloud.google.com/bigquery/querying-data].
88
- #
89
- # === Parameters
87
+ # Queries data using the [asynchronous
88
+ # method](https://cloud.google.com/bigquery/querying-data).
90
89
  #
91
- # +query+::
92
- # A query string, following the BigQuery {query
93
- # syntax}[https://cloud.google.com/bigquery/query-reference], of the
90
+ # @param [String] query A query string, following the BigQuery [query
91
+ # syntax](https://cloud.google.com/bigquery/query-reference), of the
94
92
  # query to execute. Example: "SELECT count(f1) FROM
95
- # [myProjectId:myDatasetId.myTableId]". (+String+)
96
- # +priority+::
97
- # Specifies a priority for the query. Possible values include
98
- # +INTERACTIVE+ and +BATCH+. The default value is +INTERACTIVE+.
99
- # (+String+)
100
- # +cache+::
101
- # Whether to look for the result in the query cache. The query cache is
102
- # a best-effort cache that will be flushed whenever tables in the query
103
- # are modified. The default value is +true+. (+Boolean+)
104
- # +table+::
105
- # The destination table where the query results should be stored. If not
106
- # present, a new table will be created to store the results. (+Table+)
107
- # +create+::
108
- # Specifies whether the job is allowed to create new tables. (+String+)
93
+ # [myProjectId:myDatasetId.myTableId]".
94
+ # @param [String] priority Specifies a priority for the query. Possible
95
+ # values include `INTERACTIVE` and `BATCH`. The default value is
96
+ # `INTERACTIVE`.
97
+ # @param [Boolean] cache Whether to look for the result in the query
98
+ # cache. The query cache is a best-effort cache that will be flushed
99
+ # whenever tables in the query are modified. The default value is true.
100
+ # For more information, see [query
101
+ # caching](https://developers.google.com/bigquery/querying-data).
102
+ # @param [Table] table The destination table where the query results
103
+ # should be stored. If not present, a new table will be created to store
104
+ # the results.
105
+ # @param [String] create Specifies whether the job is allowed to create
106
+ # new tables.
109
107
  #
110
108
  # The following values are supported:
111
- # * +needed+ - Create the table if it does not exist.
112
- # * +never+ - The table must already exist. A 'notFound' error is
109
+ #
110
+ # * `needed` - Create the table if it does not exist.
111
+ # * `never` - The table must already exist. A 'notFound' error is
113
112
  # raised if the table does not exist.
114
- # +write+::
115
- # Specifies the action that occurs if the destination table already
116
- # exists. (+String+)
113
+ # @param [String] write Specifies the action that occurs if the
114
+ # destination table already exists.
117
115
  #
118
116
  # The following values are supported:
119
- # * +truncate+ - BigQuery overwrites the table data.
120
- # * +append+ - BigQuery appends the data to the table.
121
- # * +empty+ - A 'duplicate' error is returned in the job result if the
122
- # table exists and contains data.
123
- # +large_results+::
124
- # If +true+, allows the query to produce arbitrarily large result tables
125
- # at a slight cost in performance. Requires +table+ parameter to be set.
126
- # (+Boolean+)
127
- # +flatten+::
128
- # Flattens all nested and repeated fields in the query results. The
129
- # default value is +true+. +large_results+ parameter must be +true+ if
130
- # this is set to +false+. (+Boolean+)
131
- # +dataset+::
132
- # Specifies the default dataset to use for unqualified table names in
133
- # the query. (+Dataset+ or +String+)
134
- #
135
- # === Returns
136
- #
137
- # Gcloud::Bigquery::QueryJob
138
- #
139
- # === Example
140
117
  #
118
+ # * `truncate` - BigQuery overwrites the table data.
119
+ # * `append` - BigQuery appends the data to the table.
120
+ # * `empty` - A 'duplicate' error is returned in the job result if the
121
+ # table exists and contains data.
122
+ # @param [Boolean] large_results If `true`, allows the query to produce
123
+ # arbitrarily large result tables at a slight cost in performance.
124
+ # Requires `table` parameter to be set.
125
+ # @param [Boolean] flatten Flattens all nested and repeated fields in the
126
+ # query results. The default value is `true`. `large_results` parameter
127
+ # must be `true` if this is set to `false`.
128
+ # @param [Dataset, String] dataset Specifies the default dataset to use
129
+ # for unqualified table names in the query.
130
+ #
131
+ # @return [Gcloud::Bigquery::QueryJob]
132
+ #
133
+ # @example
141
134
  # require "gcloud"
142
135
  #
143
136
  # gcloud = Gcloud.new
@@ -168,56 +161,45 @@ module Gcloud
168
161
  end
169
162
 
170
163
  ##
171
- # Queries data using the {synchronous
172
- # method}[https://cloud.google.com/bigquery/querying-data].
164
+ # Queries data using the [synchronous
165
+ # method](https://cloud.google.com/bigquery/querying-data).
173
166
  #
174
- # === Parameters
175
- #
176
- # +query+::
177
- # A query string, following the BigQuery {query
178
- # syntax}[https://cloud.google.com/bigquery/query-reference], of the
167
+ # @param [String] query A query string, following the BigQuery [query
168
+ # syntax](https://cloud.google.com/bigquery/query-reference), of the
179
169
  # query to execute. Example: "SELECT count(f1) FROM
180
- # [myProjectId:myDatasetId.myTableId]". (+String+)
181
- # +max+::
182
- # The maximum number of rows of data to return per page of results.
183
- # Setting this flag to a small value such as 1000 and then paging
184
- # through results might improve reliability when the query result set is
185
- # large. In addition to this limit, responses are also limited to 10 MB.
186
- # By default, there is no maximum row count, and only the byte limit
187
- # applies. (+Integer+)
188
- # +timeout+::
189
- # How long to wait for the query to complete, in milliseconds, before
190
- # the request times out and returns. Note that this is only a timeout
191
- # for the request, not the query. If the query takes longer to run than
192
- # the timeout value, the call returns without any results and with
193
- # QueryData#complete? set to false. The default value is 10000
194
- # milliseconds (10 seconds). (+Integer+)
195
- # +dryrun+::
196
- # If set to +true+, BigQuery doesn't run the job. Instead, if the query
197
- # is valid, BigQuery returns statistics about the job such as how many
198
- # bytes would be processed. If the query is invalid, an error returns.
199
- # The default value is +false+. (+Boolean+)
200
- # +cache+::
201
- # Whether to look for the result in the query cache. The query cache is
202
- # a best-effort cache that will be flushed whenever tables in the query
203
- # are modified. The default value is true. For more information, see
204
- # {query caching}[https://developers.google.com/bigquery/querying-data].
205
- # (+Boolean+)
206
- # +dataset+::
207
- # Specifies the default datasetId and projectId to assume for any
208
- # unqualified table names in the query. If not set, all table names in
209
- # the query string must be qualified in the format 'datasetId.tableId'.
210
- # (+String+)
211
- # +project+::
212
- # Specifies the default projectId to assume for any unqualified table
213
- # names in the query. Only used if +dataset+ option is set. (+String+)
214
- #
215
- # === Returns
216
- #
217
- # Gcloud::Bigquery::QueryData
218
- #
219
- # === Example
220
- #
170
+ # [myProjectId:myDatasetId.myTableId]".
171
+ # @param [Integer] max The maximum number of rows of data to return per
172
+ # page of results. Setting this flag to a small value such as 1000 and
173
+ # then paging through results might improve reliability when the query
174
+ # result set is large. In addition to this limit, responses are also
175
+ # limited to 10 MB. By default, there is no maximum row count, and only
176
+ # the byte limit applies.
177
+ # @param [Integer] timeout How long to wait for the query to complete, in
178
+ # milliseconds, before the request times out and returns. Note that this
179
+ # is only a timeout for the request, not the query. If the query takes
180
+ # longer to run than the timeout value, the call returns without any
181
+ # results and with QueryData#complete? set to false. The default value
182
+ # is 10000 milliseconds (10 seconds).
183
+ # @param [Boolean] dryrun If set to `true`, BigQuery doesn't run the job.
184
+ # Instead, if the query is valid, BigQuery returns statistics about the
185
+ # job such as how many bytes would be processed. If the query is
186
+ # invalid, an error returns. The default value is `false`.
187
+ # @param [Boolean] cache Whether to look for the result in the query
188
+ # cache. The query cache is a best-effort cache that will be flushed
189
+ # whenever tables in the query are modified. The default value is true.
190
+ # For more information, see [query
191
+ # caching](https://developers.google.com/bigquery/querying-data).
192
+ # @param [String] dataset Specifies the default datasetId and projectId to
193
+ # assume for any unqualified table names in the query. If not set, all
194
+ # table names in the query string must be qualified in the format
195
+ # 'datasetId.tableId'.
196
+ # @param [String] project Specifies the default projectId to assume for
197
+ # any unqualified table names in the query. Only used if `dataset`
198
+ # option is set.
199
+ #
200
+ # @return [Gcloud::Bigquery::QueryData]
201
+ #
202
+ # @example
221
203
  # require "gcloud"
222
204
  #
223
205
  # gcloud = Gcloud.new
@@ -244,17 +226,12 @@ module Gcloud
244
226
  ##
245
227
  # Retrieves an existing dataset by ID.
246
228
  #
247
- # === Parameters
229
+ # @param [String] dataset_id The ID of a dataset.
248
230
  #
249
- # +dataset_id+::
250
- # The ID of a dataset. (+String+)
251
- #
252
- # === Returns
253
- #
254
- # Gcloud::Bigquery::Dataset or nil if dataset does not exist
255
- #
256
- # === Example
231
+ # @return [Gcloud::Bigquery::Dataset, nil] Returns `nil` if the dataset
232
+ # does not exist.
257
233
  #
234
+ # @example
258
235
  # require "gcloud"
259
236
  #
260
237
  # gcloud = Gcloud.new
@@ -277,34 +254,28 @@ module Gcloud
277
254
  ##
278
255
  # Creates a new dataset.
279
256
  #
280
- # === Parameters
281
- #
282
- # +dataset_id+::
283
- # A unique ID for this dataset, without the project name.
284
- # The ID must contain only letters (a-z, A-Z), numbers (0-9), or
285
- # underscores (_). The maximum length is 1,024 characters. (+String+)
286
- # +name+::
287
- # A descriptive name for the dataset. (+String+)
288
- # +description+::
289
- # A user-friendly description of the dataset. (+String+)
290
- # +expiration+::
291
- # The default lifetime of all tables in the dataset, in milliseconds.
292
- # The minimum value is 3600000 milliseconds (one hour). (+Integer+)
293
- # +access+::
294
- # The access rules for a Dataset using the Google Cloud Datastore API
295
- # data structure of an array of hashes. See {BigQuery Access
296
- # Control}[https://cloud.google.com/bigquery/access-control] for more
297
- # information. (+Array of Hashes+)
298
- # +location+::
299
- # The geographic location where the dataset should reside. Possible
300
- # values include +EU+ and +US+. The default value is +US+.
301
- #
302
- # === Returns
303
- #
304
- # Gcloud::Bigquery::Dataset
305
- #
306
- # === Examples
307
- #
257
+ # @param [String] dataset_id A unique ID for this dataset, without the
258
+ # project name. The ID must contain only letters (a-z, A-Z), numbers
259
+ # (0-9), or underscores (_). The maximum length is 1,024 characters.
260
+ # @param [String] name A descriptive name for the dataset.
261
+ # @param [String] description A user-friendly description of the dataset.
262
+ # @param [Integer] expiration The default lifetime of all tables in the
263
+ # dataset, in milliseconds. The minimum value is 3600000 milliseconds
264
+ # (one hour).
265
+ # @param [Array<Hash>] access The access rules for a Dataset using the
266
+ # Google Cloud Datastore API data structure of an array of hashes. See
267
+ # [BigQuery Access
268
+ # Control](https://cloud.google.com/bigquery/access-control) for more
269
+ # information.
270
+ # @param [String] location The geographic location where the dataset
271
+ # should reside. Possible values include `EU` and `US`. The default
272
+ # value is `US`.
273
+ # @yield [access] a block for setting rules
274
+ # @yieldparam [Dataset::Access] access the object accepting rules
275
+ #
276
+ # @return [Gcloud::Bigquery::Dataset]
277
+ #
278
+ # @example
308
279
  # require "gcloud"
309
280
  #
310
281
  # gcloud = Gcloud.new
@@ -312,8 +283,7 @@ module Gcloud
312
283
  #
313
284
  # dataset = bigquery.create_dataset "my_dataset"
314
285
  #
315
- # A name and description can be provided:
316
- #
286
+ # @example A name and description can be provided:
317
287
  # require "gcloud"
318
288
  #
319
289
  # gcloud = Gcloud.new
@@ -323,8 +293,7 @@ module Gcloud
323
293
  # name: "My Dataset",
324
294
  # description: "This is my Dataset"
325
295
  #
326
- # Access rules can be provided with the +access+ option:
327
- #
296
+ # @example Access rules can be provided with the `access` option:
328
297
  # require "gcloud"
329
298
  #
330
299
  # gcloud = Gcloud.new
@@ -333,9 +302,7 @@ module Gcloud
333
302
  # dataset = bigquery.create_dataset "my_dataset",
334
303
  # access: [{"role"=>"WRITER", "userByEmail"=>"writers@example.com"}]
335
304
  #
336
- # Or access rules can be configured by using the block syntax:
337
- # (See Dataset::Access)
338
- #
305
+ # @example Or, configure access with a block: (See {Dataset::Access})
339
306
  # require "gcloud"
340
307
  #
341
308
  # gcloud = Gcloud.new
@@ -365,23 +332,16 @@ module Gcloud
365
332
  ##
366
333
  # Retrieves the list of datasets belonging to the project.
367
334
  #
368
- # === Parameters
369
- #
370
- # +all+::
371
- # Whether to list all datasets, including hidden ones. The default is
372
- # +false+. (+Boolean+)
373
- # +token+::
374
- # A previously-returned page token representing part of the larger set
375
- # of results to view. (+String+)
376
- # +max+::
377
- # Maximum number of datasets to return. (+Integer+)
335
+ # @param [Boolean] all Whether to list all datasets, including hidden
336
+ # ones. The default is `false`.
337
+ # @param [String] token A previously-returned page token representing part
338
+ # of the larger set of results to view.
339
+ # @param [Integer] max Maximum number of datasets to return.
378
340
  #
379
- # === Returns
380
- #
381
- # Array of Gcloud::Bigquery::Dataset (See Gcloud::Bigquery::Dataset::List)
382
- #
383
- # === Examples
341
+ # @return [Array<Gcloud::Bigquery::Dataset>] (See
342
+ # {Gcloud::Bigquery::Dataset::List})
384
343
  #
344
+ # @example
385
345
  # require "gcloud"
386
346
  #
387
347
  # gcloud = Gcloud.new
@@ -392,9 +352,7 @@ module Gcloud
392
352
  # puts dataset.name
393
353
  # end
394
354
  #
395
- # You can also retrieve all datasets, including hidden ones, by providing
396
- # the +:all+ option:
397
- #
355
+ # @example Retrieve all datasets, including hidden ones, with `:all`:
398
356
  # require "gcloud"
399
357
  #
400
358
  # gcloud = Gcloud.new
@@ -402,9 +360,7 @@ module Gcloud
402
360
  #
403
361
  # all_datasets = bigquery.datasets, all: true
404
362
  #
405
- # If you have a significant number of datasets, you may need to paginate
406
- # through them: (See Dataset::List#token)
407
- #
363
+ # @example With pagination: (See {Dataset::List#token})
408
364
  # require "gcloud"
409
365
  #
410
366
  # gcloud = Gcloud.new
@@ -436,17 +392,12 @@ module Gcloud
436
392
  ##
437
393
  # Retrieves an existing job by ID.
438
394
  #
439
- # === Parameters
395
+ # @param [String] job_id The ID of a job.
440
396
  #
441
- # +job_id+::
442
- # The ID of a job. (+String+)
443
- #
444
- # === Returns
445
- #
446
- # Gcloud::Bigquery::Job or nil if job does not exist
447
- #
448
- # === Example
397
+ # @return [Gcloud::Bigquery::Job, nil] Returns `nil` if the job does not
398
+ # exist.
449
399
  #
400
+ # @example
450
401
  # require "gcloud"
451
402
  #
452
403
  # gcloud = Gcloud.new
@@ -468,30 +419,23 @@ module Gcloud
468
419
  ##
469
420
  # Retrieves the list of jobs belonging to the project.
470
421
  #
471
- # === Parameters
472
- #
473
- # +all+::
474
- # Whether to display jobs owned by all users in the project.
475
- # The default is +false+. (+Boolean+)
476
- # +token+::
477
- # A previously-returned page token representing part of the larger set
478
- # of results to view. (+String+)
479
- # +max+::
480
- # Maximum number of jobs to return. (+Integer+)
481
- # +filter+::
482
- # A filter for job state. (+String+)
422
+ # @param [Boolean] all Whether to display jobs owned by all users in the
423
+ # project. The default is `false`.
424
+ # @param [String] token A previously-returned page token representing part
425
+ # of the larger set of results to view.
426
+ # @param [Integer] max Maximum number of jobs to return.
427
+ # @param [String] filter A filter for job state.
483
428
  #
484
429
  # Acceptable values are:
485
- # * +done+ - Finished jobs
486
- # * +pending+ - Pending jobs
487
- # * +running+ - Running jobs
488
430
  #
489
- # === Returns
431
+ # * `done` - Finished jobs
432
+ # * `pending` - Pending jobs
433
+ # * `running` - Running jobs
490
434
  #
491
- # Array of Gcloud::Bigquery::Job (See Gcloud::Bigquery::Job::List)
492
- #
493
- # === Examples
435
+ # @return [Array<Gcloud::Bigquery::Job>] (See
436
+ # {Gcloud::Bigquery::Job::List})
494
437
  #
438
+ # @example
495
439
  # require "gcloud"
496
440
  #
497
441
  # gcloud = Gcloud.new
@@ -499,8 +443,7 @@ module Gcloud
499
443
  #
500
444
  # jobs = bigquery.jobs
501
445
  #
502
- # You can also retrieve only running jobs using the +:filter+ option:
503
- #
446
+ # @example Retrieve only running jobs using the `:filter` option:
504
447
  # require "gcloud"
505
448
  #
506
449
  # gcloud = Gcloud.new
@@ -508,9 +451,7 @@ module Gcloud
508
451
  #
509
452
  # running_jobs = bigquery.jobs filter: "running"
510
453
  #
511
- # If you have a significant number of jobs, you may need to paginate
512
- # through them: (See Job::List#token)
513
- #
454
+ # @example With pagination: (See {Job::List#token})
514
455
  # require "gcloud"
515
456
  #
516
457
  # gcloud = Gcloud.new