Skip to main content

google_cloud_bigquery/generated/
complete_query_metadata.rs

1// Copyright 2026 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// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21
22#[allow(missing_docs)]
23#[derive(Clone, Default, PartialEq)]
24#[non_exhaustive]
25pub struct CompleteQueryMetadata {
26    /// Whether the query result was fetched from the query cache.
27    pub cache_hit: std::option::Option<wkt::BoolValue>,
28
29    /// Output only. Creation time of this query, in milliseconds since the epoch.
30    /// This field will be present on all queries.
31    pub creation_time: std::option::Option<i64>,
32
33    /// Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE,
34    /// MERGE or TRUNCATE.
35    pub dml_stats: std::option::Option<google_cloud_bigquery_v2::model::DmlStats>,
36
37    /// Output only. End time of this query, in milliseconds since the epoch. This
38    /// field will be present whenever a query job is in the DONE state.
39    pub end_time: std::option::Option<i64>,
40
41    /// Output only. The first errors or warnings encountered during the running
42    /// of the job. The final message includes the number of errors that caused the
43    /// process to stop. Errors here do not necessarily mean that the job has
44    /// completed or was unsuccessful. For more information about error messages,
45    /// see [Error
46    /// messages](https://cloud.google.com/bigquery/docs/error-messages).
47    pub errors: std::vec::Vec<google_cloud_bigquery_v2::model::ErrorProto>,
48
49    /// A hash of this response.
50    pub etag: std::string::String,
51
52    /// Whether the query has completed or not. If rows or totalRows are present,
53    /// this will always be true. If this is false, totalRows will not be
54    /// available.
55    pub job_complete: std::option::Option<wkt::BoolValue>,
56
57    /// Optional. The reason why a Job was created.
58    ///
59    /// Only relevant when a job_reference is present in the response.
60    /// If job_reference is not present it will always be unset.
61    pub job_creation_reason:
62        std::option::Option<google_cloud_bigquery_v2::model::JobCreationReason>,
63
64    /// Reference to the BigQuery Job that was created to run the query. This field
65    /// will be present even if the original request timed out, in which case
66    /// GetQueryResults can be used to read the results once the query has
67    /// completed. Since this API only returns the first page of results,
68    /// subsequent pages can be fetched via the same mechanism (GetQueryResults).
69    pub job_reference: std::option::Option<google_cloud_bigquery_v2::model::JobReference>,
70
71    /// The resource type of the response.
72    pub kind: std::string::String,
73
74    /// Output only. The geographic location of the query.
75    ///
76    /// For more information about BigQuery locations, see:
77    /// <https://cloud.google.com/bigquery/docs/locations>
78    pub location: std::string::String,
79
80    /// Output only. The number of rows affected by a DML statement. Present only
81    /// for DML statements INSERT, UPDATE or DELETE.
82    pub num_dml_affected_rows: std::option::Option<wkt::Int64Value>,
83
84    /// Output only. The number of rows out of `total_rows` returned in this
85    /// response.
86    ///
87    /// This feature is not yet available.
88    pub page_row_count: i64,
89
90    /// A token used for paging results.  When this token is non-empty, it
91    /// indicates additional results are available.
92    pub page_token: std::string::String,
93
94    /// Auto-generated ID for the query.
95    pub query_id: std::string::String,
96
97    /// The schema of the results. Present only when the query completes
98    /// successfully.
99    pub schema: std::option::Option<google_cloud_bigquery_v2::model::TableSchema>,
100
101    /// Output only. Information of the session if this job is part of one.
102    pub session_info: std::option::Option<google_cloud_bigquery_v2::model::SessionInfo>,
103
104    /// Output only. Start time of this query, in milliseconds since the epoch.
105    /// This field will be present when the query job transitions from the PENDING
106    /// state to either RUNNING or DONE.
107    pub start_time: std::option::Option<i64>,
108
109    /// Output only. The type of query statement, if valid.
110    /// Possible values:
111    ///
112    /// * `SELECT`:
113    ///   [`SELECT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select_list)
114    ///   statement.
115    /// * `ASSERT`:
116    ///   [`ASSERT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements#assert)
117    ///   statement.
118    /// * `INSERT`:
119    ///   [`INSERT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#insert_statement)
120    ///   statement.
121    /// * `UPDATE`:
122    ///   [`UPDATE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#update_statement)
123    ///   statement.
124    /// * `DELETE`:
125    ///   [`DELETE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language)
126    ///   statement.
127    /// * `MERGE`:
128    ///   [`MERGE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language)
129    ///   statement.
130    /// * `CREATE_TABLE`: [`CREATE
131    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement)
132    ///   statement, without `AS SELECT`.
133    /// * `CREATE_TABLE_AS_SELECT`: [`CREATE TABLE AS
134    ///   SELECT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement)
135    ///   statement.
136    /// * `CREATE_VIEW`: [`CREATE
137    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_view_statement)
138    ///   statement.
139    /// * `CREATE_MODEL`: [`CREATE
140    ///   MODEL`](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-create#create_model_statement)
141    ///   statement.
142    /// * `CREATE_MATERIALIZED_VIEW`: [`CREATE MATERIALIZED
143    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_materialized_view_statement)
144    ///   statement.
145    /// * `CREATE_FUNCTION`: [`CREATE
146    ///   FUNCTION`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_function_statement)
147    ///   statement.
148    /// * `CREATE_TABLE_FUNCTION`: [`CREATE TABLE
149    ///   FUNCTION`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_function_statement)
150    ///   statement.
151    /// * `CREATE_PROCEDURE`: [`CREATE
152    ///   PROCEDURE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_procedure)
153    ///   statement.
154    /// * `CREATE_ROW_ACCESS_POLICY`: [`CREATE ROW ACCESS
155    ///   POLICY`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_row_access_policy_statement)
156    ///   statement.
157    /// * `CREATE_SCHEMA`: [`CREATE
158    ///   SCHEMA`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_schema_statement)
159    ///   statement.
160    /// * `CREATE_SNAPSHOT_TABLE`: [`CREATE SNAPSHOT
161    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_snapshot_table_statement)
162    ///   statement.
163    /// * `CREATE_SEARCH_INDEX`: [`CREATE SEARCH
164    ///   INDEX`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_search_index_statement)
165    ///   statement.
166    /// * `DROP_TABLE`: [`DROP
167    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_statement)
168    ///   statement.
169    /// * `DROP_EXTERNAL_TABLE`: [`DROP EXTERNAL
170    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_external_table_statement)
171    ///   statement.
172    /// * `DROP_VIEW`: [`DROP
173    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_view_statement)
174    ///   statement.
175    /// * `DROP_MODEL`: [`DROP
176    ///   MODEL`](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-drop-model)
177    ///   statement.
178    /// * `DROP_MATERIALIZED_VIEW`: [`DROP MATERIALIZED
179    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_materialized_view_statement)
180    ///   statement.
181    /// * `DROP_FUNCTION` : [`DROP
182    ///   FUNCTION`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_function_statement)
183    ///   statement.
184    /// * `DROP_TABLE_FUNCTION` : [`DROP TABLE
185    ///   FUNCTION`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_function)
186    ///   statement.
187    /// * `DROP_PROCEDURE`: [`DROP
188    ///   PROCEDURE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_procedure_statement)
189    ///   statement.
190    /// * `DROP_SEARCH_INDEX`: [`DROP SEARCH
191    ///   INDEX`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_search_index)
192    ///   statement.
193    /// * `DROP_SCHEMA`: [`DROP
194    ///   SCHEMA`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_schema_statement)
195    ///   statement.
196    /// * `DROP_SNAPSHOT_TABLE`: [`DROP SNAPSHOT
197    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_snapshot_table_statement)
198    ///   statement.
199    /// * `DROP_ROW_ACCESS_POLICY`: [`DROP [ALL] ROW ACCESS
200    ///   POLICY|POLICIES`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_row_access_policy_statement)
201    ///   statement.
202    /// * `ALTER_TABLE`: [`ALTER
203    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_table_set_options_statement)
204    ///   statement.
205    /// * `ALTER_VIEW`: [`ALTER
206    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_view_set_options_statement)
207    ///   statement.
208    /// * `ALTER_MATERIALIZED_VIEW`: [`ALTER MATERIALIZED
209    ///   VIEW`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_materialized_view_set_options_statement)
210    ///   statement.
211    /// * `ALTER_SCHEMA`: [`ALTER
212    ///   SCHEMA`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_schema_set_options_statement)
213    ///   statement.
214    /// * `SCRIPT`:
215    ///   [`SCRIPT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language).
216    /// * `TRUNCATE_TABLE`: [`TRUNCATE
217    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#truncate_table_statement)
218    ///   statement.
219    /// * `CREATE_EXTERNAL_TABLE`: [`CREATE EXTERNAL
220    ///   TABLE`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_external_table_statement)
221    ///   statement.
222    /// * `EXPORT_DATA`: [`EXPORT
223    ///   DATA`](https://cloud.google.com/bigquery/docs/reference/standard-sql/other-statements#export_data_statement)
224    ///   statement.
225    /// * `EXPORT_MODEL`: [`EXPORT
226    ///   MODEL`](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-export-model)
227    ///   statement.
228    /// * `LOAD_DATA`: [`LOAD
229    ///   DATA`](https://cloud.google.com/bigquery/docs/reference/standard-sql/other-statements#load_data_statement)
230    ///   statement.
231    /// * `CALL`:
232    ///   [`CALL`](https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#call)
233    ///   statement.
234    pub statement_type: std::string::String,
235
236    /// Output only. If the project is configured to use on-demand pricing,
237    /// then this field contains the total bytes billed for the job.
238    /// If the project is configured to use flat-rate pricing, then you are
239    /// not billed for bytes and this field is informational only.
240    pub total_bytes_billed: std::option::Option<i64>,
241
242    /// The total number of bytes processed for this query.
243    pub total_bytes_processed: std::option::Option<wkt::Int64Value>,
244
245    /// The total number of rows in the complete query result set, which can be
246    /// more than the number of rows in this single page of results. Present only
247    /// when the query completes successfully.
248    pub total_rows: std::option::Option<wkt::UInt64Value>,
249
250    /// Output only. Number of slot ms the user is actually billed for.
251    pub total_slot_ms: std::option::Option<i64>,
252
253    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
254}
255
256impl CompleteQueryMetadata {
257    /// Creates a new default instance.
258    pub fn new() -> Self {
259        std::default::Default::default()
260    }
261
262    /// Sets the value of [cache_hit][crate::model_ext::CompleteQueryMetadata::cache_hit].
263    pub fn set_cache_hit<T>(mut self, v: T) -> Self
264    where
265        T: std::convert::Into<wkt::BoolValue>,
266    {
267        self.cache_hit = std::option::Option::Some(v.into());
268        self
269    }
270
271    /// Sets or clears the value of [cache_hit][crate::model_ext::CompleteQueryMetadata::cache_hit].
272    pub fn set_or_clear_cache_hit<T>(mut self, v: std::option::Option<T>) -> Self
273    where
274        T: std::convert::Into<wkt::BoolValue>,
275    {
276        self.cache_hit = v.map(|x| x.into());
277        self
278    }
279
280    /// Sets the value of [creation_time][crate::model_ext::CompleteQueryMetadata::creation_time].
281    pub fn set_creation_time<T>(mut self, v: T) -> Self
282    where
283        T: std::convert::Into<i64>,
284    {
285        self.creation_time = std::option::Option::Some(v.into());
286        self
287    }
288
289    /// Sets or clears the value of [creation_time][crate::model_ext::CompleteQueryMetadata::creation_time].
290    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
291    where
292        T: std::convert::Into<i64>,
293    {
294        self.creation_time = v.map(|x| x.into());
295        self
296    }
297
298    /// Sets the value of [dml_stats][crate::model_ext::CompleteQueryMetadata::dml_stats].
299    pub fn set_dml_stats<T>(mut self, v: T) -> Self
300    where
301        T: std::convert::Into<google_cloud_bigquery_v2::model::DmlStats>,
302    {
303        self.dml_stats = std::option::Option::Some(v.into());
304        self
305    }
306
307    /// Sets or clears the value of [dml_stats][crate::model_ext::CompleteQueryMetadata::dml_stats].
308    pub fn set_or_clear_dml_stats<T>(mut self, v: std::option::Option<T>) -> Self
309    where
310        T: std::convert::Into<google_cloud_bigquery_v2::model::DmlStats>,
311    {
312        self.dml_stats = v.map(|x| x.into());
313        self
314    }
315
316    /// Sets the value of [end_time][crate::model_ext::CompleteQueryMetadata::end_time].
317    pub fn set_end_time<T>(mut self, v: T) -> Self
318    where
319        T: std::convert::Into<i64>,
320    {
321        self.end_time = std::option::Option::Some(v.into());
322        self
323    }
324
325    /// Sets or clears the value of [end_time][crate::model_ext::CompleteQueryMetadata::end_time].
326    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
327    where
328        T: std::convert::Into<i64>,
329    {
330        self.end_time = v.map(|x| x.into());
331        self
332    }
333
334    /// Sets the value of [errors][crate::model_ext::CompleteQueryMetadata::errors].
335    pub fn set_errors<T, V>(mut self, v: T) -> Self
336    where
337        T: std::iter::IntoIterator<Item = V>,
338        V: std::convert::Into<google_cloud_bigquery_v2::model::ErrorProto>,
339    {
340        use std::iter::Iterator;
341        self.errors = v.into_iter().map(|i| i.into()).collect();
342        self
343    }
344
345    /// Sets the value of [etag][crate::model_ext::CompleteQueryMetadata::etag].
346    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
347        self.etag = v.into();
348        self
349    }
350
351    /// Sets the value of [job_complete][crate::model_ext::CompleteQueryMetadata::job_complete].
352    pub fn set_job_complete<T>(mut self, v: T) -> Self
353    where
354        T: std::convert::Into<wkt::BoolValue>,
355    {
356        self.job_complete = std::option::Option::Some(v.into());
357        self
358    }
359
360    /// Sets or clears the value of [job_complete][crate::model_ext::CompleteQueryMetadata::job_complete].
361    pub fn set_or_clear_job_complete<T>(mut self, v: std::option::Option<T>) -> Self
362    where
363        T: std::convert::Into<wkt::BoolValue>,
364    {
365        self.job_complete = v.map(|x| x.into());
366        self
367    }
368
369    /// Sets the value of [job_creation_reason][crate::model_ext::CompleteQueryMetadata::job_creation_reason].
370    pub fn set_job_creation_reason<T>(mut self, v: T) -> Self
371    where
372        T: std::convert::Into<google_cloud_bigquery_v2::model::JobCreationReason>,
373    {
374        self.job_creation_reason = std::option::Option::Some(v.into());
375        self
376    }
377
378    /// Sets or clears the value of [job_creation_reason][crate::model_ext::CompleteQueryMetadata::job_creation_reason].
379    pub fn set_or_clear_job_creation_reason<T>(mut self, v: std::option::Option<T>) -> Self
380    where
381        T: std::convert::Into<google_cloud_bigquery_v2::model::JobCreationReason>,
382    {
383        self.job_creation_reason = v.map(|x| x.into());
384        self
385    }
386
387    /// Sets the value of [job_reference][crate::model_ext::CompleteQueryMetadata::job_reference].
388    pub fn set_job_reference<T>(mut self, v: T) -> Self
389    where
390        T: std::convert::Into<google_cloud_bigquery_v2::model::JobReference>,
391    {
392        self.job_reference = std::option::Option::Some(v.into());
393        self
394    }
395
396    /// Sets or clears the value of [job_reference][crate::model_ext::CompleteQueryMetadata::job_reference].
397    pub fn set_or_clear_job_reference<T>(mut self, v: std::option::Option<T>) -> Self
398    where
399        T: std::convert::Into<google_cloud_bigquery_v2::model::JobReference>,
400    {
401        self.job_reference = v.map(|x| x.into());
402        self
403    }
404
405    /// Sets the value of [kind][crate::model_ext::CompleteQueryMetadata::kind].
406    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
407        self.kind = v.into();
408        self
409    }
410
411    /// Sets the value of [location][crate::model_ext::CompleteQueryMetadata::location].
412    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
413        self.location = v.into();
414        self
415    }
416
417    /// Sets the value of [num_dml_affected_rows][crate::model_ext::CompleteQueryMetadata::num_dml_affected_rows].
418    pub fn set_num_dml_affected_rows<T>(mut self, v: T) -> Self
419    where
420        T: std::convert::Into<wkt::Int64Value>,
421    {
422        self.num_dml_affected_rows = std::option::Option::Some(v.into());
423        self
424    }
425
426    /// Sets or clears the value of [num_dml_affected_rows][crate::model_ext::CompleteQueryMetadata::num_dml_affected_rows].
427    pub fn set_or_clear_num_dml_affected_rows<T>(mut self, v: std::option::Option<T>) -> Self
428    where
429        T: std::convert::Into<wkt::Int64Value>,
430    {
431        self.num_dml_affected_rows = v.map(|x| x.into());
432        self
433    }
434
435    /// Sets the value of [page_row_count][crate::model_ext::CompleteQueryMetadata::page_row_count].
436    pub fn set_page_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
437        self.page_row_count = v.into();
438        self
439    }
440
441    /// Sets the value of [page_token][crate::model_ext::CompleteQueryMetadata::page_token].
442    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
443        self.page_token = v.into();
444        self
445    }
446
447    /// Sets the value of [query_id][crate::model_ext::CompleteQueryMetadata::query_id].
448    pub fn set_query_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449        self.query_id = v.into();
450        self
451    }
452
453    /// Sets the value of [schema][crate::model_ext::CompleteQueryMetadata::schema].
454    pub fn set_schema<T>(mut self, v: T) -> Self
455    where
456        T: std::convert::Into<google_cloud_bigquery_v2::model::TableSchema>,
457    {
458        self.schema = std::option::Option::Some(v.into());
459        self
460    }
461
462    /// Sets or clears the value of [schema][crate::model_ext::CompleteQueryMetadata::schema].
463    pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
464    where
465        T: std::convert::Into<google_cloud_bigquery_v2::model::TableSchema>,
466    {
467        self.schema = v.map(|x| x.into());
468        self
469    }
470
471    /// Sets the value of [session_info][crate::model_ext::CompleteQueryMetadata::session_info].
472    pub fn set_session_info<T>(mut self, v: T) -> Self
473    where
474        T: std::convert::Into<google_cloud_bigquery_v2::model::SessionInfo>,
475    {
476        self.session_info = std::option::Option::Some(v.into());
477        self
478    }
479
480    /// Sets or clears the value of [session_info][crate::model_ext::CompleteQueryMetadata::session_info].
481    pub fn set_or_clear_session_info<T>(mut self, v: std::option::Option<T>) -> Self
482    where
483        T: std::convert::Into<google_cloud_bigquery_v2::model::SessionInfo>,
484    {
485        self.session_info = v.map(|x| x.into());
486        self
487    }
488
489    /// Sets the value of [start_time][crate::model_ext::CompleteQueryMetadata::start_time].
490    pub fn set_start_time<T>(mut self, v: T) -> Self
491    where
492        T: std::convert::Into<i64>,
493    {
494        self.start_time = std::option::Option::Some(v.into());
495        self
496    }
497
498    /// Sets or clears the value of [start_time][crate::model_ext::CompleteQueryMetadata::start_time].
499    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
500    where
501        T: std::convert::Into<i64>,
502    {
503        self.start_time = v.map(|x| x.into());
504        self
505    }
506
507    /// Sets the value of [statement_type][crate::model_ext::CompleteQueryMetadata::statement_type].
508    pub fn set_statement_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
509        self.statement_type = v.into();
510        self
511    }
512
513    /// Sets the value of [total_bytes_billed][crate::model_ext::CompleteQueryMetadata::total_bytes_billed].
514    pub fn set_total_bytes_billed<T>(mut self, v: T) -> Self
515    where
516        T: std::convert::Into<i64>,
517    {
518        self.total_bytes_billed = std::option::Option::Some(v.into());
519        self
520    }
521
522    /// Sets or clears the value of [total_bytes_billed][crate::model_ext::CompleteQueryMetadata::total_bytes_billed].
523    pub fn set_or_clear_total_bytes_billed<T>(mut self, v: std::option::Option<T>) -> Self
524    where
525        T: std::convert::Into<i64>,
526    {
527        self.total_bytes_billed = v.map(|x| x.into());
528        self
529    }
530
531    /// Sets the value of [total_bytes_processed][crate::model_ext::CompleteQueryMetadata::total_bytes_processed].
532    pub fn set_total_bytes_processed<T>(mut self, v: T) -> Self
533    where
534        T: std::convert::Into<wkt::Int64Value>,
535    {
536        self.total_bytes_processed = std::option::Option::Some(v.into());
537        self
538    }
539
540    /// Sets or clears the value of [total_bytes_processed][crate::model_ext::CompleteQueryMetadata::total_bytes_processed].
541    pub fn set_or_clear_total_bytes_processed<T>(mut self, v: std::option::Option<T>) -> Self
542    where
543        T: std::convert::Into<wkt::Int64Value>,
544    {
545        self.total_bytes_processed = v.map(|x| x.into());
546        self
547    }
548
549    /// Sets the value of [total_rows][crate::model_ext::CompleteQueryMetadata::total_rows].
550    pub fn set_total_rows<T>(mut self, v: T) -> Self
551    where
552        T: std::convert::Into<wkt::UInt64Value>,
553    {
554        self.total_rows = std::option::Option::Some(v.into());
555        self
556    }
557
558    /// Sets or clears the value of [total_rows][crate::model_ext::CompleteQueryMetadata::total_rows].
559    pub fn set_or_clear_total_rows<T>(mut self, v: std::option::Option<T>) -> Self
560    where
561        T: std::convert::Into<wkt::UInt64Value>,
562    {
563        self.total_rows = v.map(|x| x.into());
564        self
565    }
566
567    /// Sets the value of [total_slot_ms][crate::model_ext::CompleteQueryMetadata::total_slot_ms].
568    pub fn set_total_slot_ms<T>(mut self, v: T) -> Self
569    where
570        T: std::convert::Into<i64>,
571    {
572        self.total_slot_ms = std::option::Option::Some(v.into());
573        self
574    }
575
576    /// Sets or clears the value of [total_slot_ms][crate::model_ext::CompleteQueryMetadata::total_slot_ms].
577    pub fn set_or_clear_total_slot_ms<T>(mut self, v: std::option::Option<T>) -> Self
578    where
579        T: std::convert::Into<i64>,
580    {
581        self.total_slot_ms = v.map(|x| x.into());
582        self
583    }
584}
585
586mod debug {
587
588    impl std::fmt::Debug for super::CompleteQueryMetadata {
589        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
590            let mut debug_struct = f.debug_struct("CompleteQueryMetadata");
591            debug_struct.field("cache_hit", &self.cache_hit);
592            debug_struct.field("creation_time", &self.creation_time);
593            debug_struct.field("dml_stats", &self.dml_stats);
594            debug_struct.field("end_time", &self.end_time);
595            debug_struct.field("errors", &self.errors);
596            debug_struct.field("etag", &self.etag);
597            debug_struct.field("job_complete", &self.job_complete);
598            debug_struct.field("job_creation_reason", &self.job_creation_reason);
599            debug_struct.field("job_reference", &self.job_reference);
600            debug_struct.field("kind", &self.kind);
601            debug_struct.field("location", &self.location);
602            debug_struct.field("num_dml_affected_rows", &self.num_dml_affected_rows);
603            debug_struct.field("page_row_count", &self.page_row_count);
604            debug_struct.field("page_token", &self.page_token);
605            debug_struct.field("query_id", &self.query_id);
606            debug_struct.field("schema", &self.schema);
607            debug_struct.field("session_info", &self.session_info);
608            debug_struct.field("start_time", &self.start_time);
609            debug_struct.field("statement_type", &self.statement_type);
610            debug_struct.field("total_bytes_billed", &self.total_bytes_billed);
611            debug_struct.field("total_bytes_processed", &self.total_bytes_processed);
612            debug_struct.field("total_rows", &self.total_rows);
613            debug_struct.field("total_slot_ms", &self.total_slot_ms);
614            if !self._unknown_fields.is_empty() {
615                debug_struct.field("_unknown_fields", &self._unknown_fields);
616            }
617            debug_struct.finish()
618        }
619    }
620}
621
622impl std::convert::From<google_cloud_bigquery_v2::model::GetQueryResultsResponse>
623    for CompleteQueryMetadata
624{
625    fn from(resp: google_cloud_bigquery_v2::model::GetQueryResultsResponse) -> Self {
626        Self {
627            cache_hit: resp.cache_hit,
628            errors: resp.errors,
629            etag: resp.etag,
630            job_complete: resp.job_complete,
631            job_reference: resp.job_reference,
632            kind: resp.kind,
633            num_dml_affected_rows: resp.num_dml_affected_rows,
634            page_token: resp.page_token,
635            schema: resp.schema,
636            total_bytes_processed: resp.total_bytes_processed,
637            total_rows: resp.total_rows,
638            ..Default::default()
639        }
640    }
641}
642
643impl std::convert::From<google_cloud_bigquery_v2::model::QueryResponse> for CompleteQueryMetadata {
644    fn from(resp: google_cloud_bigquery_v2::model::QueryResponse) -> Self {
645        Self {
646            cache_hit: resp.cache_hit,
647            creation_time: resp.creation_time,
648            dml_stats: resp.dml_stats,
649            end_time: resp.end_time,
650            errors: resp.errors,
651            job_complete: resp.job_complete,
652            job_creation_reason: resp.job_creation_reason,
653            job_reference: resp.job_reference,
654            kind: resp.kind,
655            location: resp.location,
656            num_dml_affected_rows: resp.num_dml_affected_rows,
657            page_row_count: resp.page_row_count,
658            page_token: resp.page_token,
659            query_id: resp.query_id,
660            schema: resp.schema,
661            session_info: resp.session_info,
662            start_time: resp.start_time,
663            statement_type: resp.statement_type,
664            total_bytes_billed: resp.total_bytes_billed,
665            total_bytes_processed: resp.total_bytes_processed,
666            total_rows: resp.total_rows,
667            total_slot_ms: resp.total_slot_ms,
668            ..Default::default()
669        }
670    }
671}