google_maps_mapsplatformdatasets_v1/model.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#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// The details about the data source when it is a local file.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct LocalFileSource {
42 /// The file name of the uploaded file.
43 pub filename: std::string::String,
44
45 /// The format of the file that is being uploaded.
46 pub file_format: crate::model::FileFormat,
47
48 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
49}
50
51impl LocalFileSource {
52 /// Creates a new default instance.
53 pub fn new() -> Self {
54 std::default::Default::default()
55 }
56
57 /// Sets the value of [filename][crate::model::LocalFileSource::filename].
58 ///
59 /// # Example
60 /// ```ignore,no_run
61 /// # use google_maps_mapsplatformdatasets_v1::model::LocalFileSource;
62 /// let x = LocalFileSource::new().set_filename("example");
63 /// ```
64 pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
65 self.filename = v.into();
66 self
67 }
68
69 /// Sets the value of [file_format][crate::model::LocalFileSource::file_format].
70 ///
71 /// # Example
72 /// ```ignore,no_run
73 /// # use google_maps_mapsplatformdatasets_v1::model::LocalFileSource;
74 /// use google_maps_mapsplatformdatasets_v1::model::FileFormat;
75 /// let x0 = LocalFileSource::new().set_file_format(FileFormat::Geojson);
76 /// let x1 = LocalFileSource::new().set_file_format(FileFormat::Kml);
77 /// let x2 = LocalFileSource::new().set_file_format(FileFormat::Csv);
78 /// ```
79 pub fn set_file_format<T: std::convert::Into<crate::model::FileFormat>>(
80 mut self,
81 v: T,
82 ) -> Self {
83 self.file_format = v.into();
84 self
85 }
86}
87
88impl wkt::message::Message for LocalFileSource {
89 fn typename() -> &'static str {
90 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.LocalFileSource"
91 }
92}
93
94/// The details about the data source when it is in Google Cloud Storage.
95#[derive(Clone, Default, PartialEq)]
96#[non_exhaustive]
97pub struct GcsSource {
98 /// Source data URI. For example, `gs://my_bucket/my_object`.
99 pub input_uri: std::string::String,
100
101 /// The file format of the Google Cloud Storage object. This is used mainly for
102 /// validation.
103 pub file_format: crate::model::FileFormat,
104
105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
106}
107
108impl GcsSource {
109 /// Creates a new default instance.
110 pub fn new() -> Self {
111 std::default::Default::default()
112 }
113
114 /// Sets the value of [input_uri][crate::model::GcsSource::input_uri].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_maps_mapsplatformdatasets_v1::model::GcsSource;
119 /// let x = GcsSource::new().set_input_uri("example");
120 /// ```
121 pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
122 self.input_uri = v.into();
123 self
124 }
125
126 /// Sets the value of [file_format][crate::model::GcsSource::file_format].
127 ///
128 /// # Example
129 /// ```ignore,no_run
130 /// # use google_maps_mapsplatformdatasets_v1::model::GcsSource;
131 /// use google_maps_mapsplatformdatasets_v1::model::FileFormat;
132 /// let x0 = GcsSource::new().set_file_format(FileFormat::Geojson);
133 /// let x1 = GcsSource::new().set_file_format(FileFormat::Kml);
134 /// let x2 = GcsSource::new().set_file_format(FileFormat::Csv);
135 /// ```
136 pub fn set_file_format<T: std::convert::Into<crate::model::FileFormat>>(
137 mut self,
138 v: T,
139 ) -> Self {
140 self.file_format = v.into();
141 self
142 }
143}
144
145impl wkt::message::Message for GcsSource {
146 fn typename() -> &'static str {
147 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.GcsSource"
148 }
149}
150
151/// A representation of a dataset resource.
152#[derive(Clone, Default, PartialEq)]
153#[non_exhaustive]
154pub struct Dataset {
155 /// Resource name.
156 /// Format: projects/{project}/datasets/{dataset_id}
157 pub name: std::string::String,
158
159 /// Human readable name, shown in the console UI.
160 ///
161 /// Must be unique within a project.
162 pub display_name: std::string::String,
163
164 /// A description of this dataset.
165 pub description: std::string::String,
166
167 /// The version ID of the dataset.
168 pub version_id: std::string::String,
169
170 /// Specified use case for this dataset.
171 pub usage: std::vec::Vec<crate::model::Usage>,
172
173 /// Output only. The status of this dataset version.
174 pub status: std::option::Option<crate::model::Status>,
175
176 /// Output only. Time when the dataset was first created.
177 pub create_time: std::option::Option<wkt::Timestamp>,
178
179 /// Output only. Time when the dataset metadata was last updated.
180 pub update_time: std::option::Option<wkt::Timestamp>,
181
182 /// Output only. Time when this version was created.
183 pub version_create_time: std::option::Option<wkt::Timestamp>,
184
185 /// Output only. The description for this version of dataset. It is provided
186 /// when importing data to the dataset.
187 pub version_description: std::string::String,
188
189 /// Details about the source of the data for the dataset.
190 pub data_source: std::option::Option<crate::model::dataset::DataSource>,
191
192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
193}
194
195impl Dataset {
196 /// Creates a new default instance.
197 pub fn new() -> Self {
198 std::default::Default::default()
199 }
200
201 /// Sets the value of [name][crate::model::Dataset::name].
202 ///
203 /// # Example
204 /// ```ignore,no_run
205 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
206 /// # let project_id = "project_id";
207 /// # let dataset_id = "dataset_id";
208 /// let x = Dataset::new().set_name(format!("projects/{project_id}/datasets/{dataset_id}"));
209 /// ```
210 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
211 self.name = v.into();
212 self
213 }
214
215 /// Sets the value of [display_name][crate::model::Dataset::display_name].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
220 /// let x = Dataset::new().set_display_name("example");
221 /// ```
222 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
223 self.display_name = v.into();
224 self
225 }
226
227 /// Sets the value of [description][crate::model::Dataset::description].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
232 /// let x = Dataset::new().set_description("example");
233 /// ```
234 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
235 self.description = v.into();
236 self
237 }
238
239 /// Sets the value of [version_id][crate::model::Dataset::version_id].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
244 /// let x = Dataset::new().set_version_id("example");
245 /// ```
246 pub fn set_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
247 self.version_id = v.into();
248 self
249 }
250
251 /// Sets the value of [usage][crate::model::Dataset::usage].
252 ///
253 /// # Example
254 /// ```ignore,no_run
255 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
256 /// use google_maps_mapsplatformdatasets_v1::model::Usage;
257 /// let x = Dataset::new().set_usage([
258 /// Usage::DataDrivenStyling,
259 /// ]);
260 /// ```
261 pub fn set_usage<T, V>(mut self, v: T) -> Self
262 where
263 T: std::iter::IntoIterator<Item = V>,
264 V: std::convert::Into<crate::model::Usage>,
265 {
266 use std::iter::Iterator;
267 self.usage = v.into_iter().map(|i| i.into()).collect();
268 self
269 }
270
271 /// Sets the value of [status][crate::model::Dataset::status].
272 ///
273 /// # Example
274 /// ```ignore,no_run
275 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
276 /// use google_maps_mapsplatformdatasets_v1::model::Status;
277 /// let x = Dataset::new().set_status(Status::default()/* use setters */);
278 /// ```
279 pub fn set_status<T>(mut self, v: T) -> Self
280 where
281 T: std::convert::Into<crate::model::Status>,
282 {
283 self.status = std::option::Option::Some(v.into());
284 self
285 }
286
287 /// Sets or clears the value of [status][crate::model::Dataset::status].
288 ///
289 /// # Example
290 /// ```ignore,no_run
291 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
292 /// use google_maps_mapsplatformdatasets_v1::model::Status;
293 /// let x = Dataset::new().set_or_clear_status(Some(Status::default()/* use setters */));
294 /// let x = Dataset::new().set_or_clear_status(None::<Status>);
295 /// ```
296 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
297 where
298 T: std::convert::Into<crate::model::Status>,
299 {
300 self.status = v.map(|x| x.into());
301 self
302 }
303
304 /// Sets the value of [create_time][crate::model::Dataset::create_time].
305 ///
306 /// # Example
307 /// ```ignore,no_run
308 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
309 /// use wkt::Timestamp;
310 /// let x = Dataset::new().set_create_time(Timestamp::default()/* use setters */);
311 /// ```
312 pub fn set_create_time<T>(mut self, v: T) -> Self
313 where
314 T: std::convert::Into<wkt::Timestamp>,
315 {
316 self.create_time = std::option::Option::Some(v.into());
317 self
318 }
319
320 /// Sets or clears the value of [create_time][crate::model::Dataset::create_time].
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
325 /// use wkt::Timestamp;
326 /// let x = Dataset::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
327 /// let x = Dataset::new().set_or_clear_create_time(None::<Timestamp>);
328 /// ```
329 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
330 where
331 T: std::convert::Into<wkt::Timestamp>,
332 {
333 self.create_time = v.map(|x| x.into());
334 self
335 }
336
337 /// Sets the value of [update_time][crate::model::Dataset::update_time].
338 ///
339 /// # Example
340 /// ```ignore,no_run
341 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
342 /// use wkt::Timestamp;
343 /// let x = Dataset::new().set_update_time(Timestamp::default()/* use setters */);
344 /// ```
345 pub fn set_update_time<T>(mut self, v: T) -> Self
346 where
347 T: std::convert::Into<wkt::Timestamp>,
348 {
349 self.update_time = std::option::Option::Some(v.into());
350 self
351 }
352
353 /// Sets or clears the value of [update_time][crate::model::Dataset::update_time].
354 ///
355 /// # Example
356 /// ```ignore,no_run
357 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
358 /// use wkt::Timestamp;
359 /// let x = Dataset::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
360 /// let x = Dataset::new().set_or_clear_update_time(None::<Timestamp>);
361 /// ```
362 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
363 where
364 T: std::convert::Into<wkt::Timestamp>,
365 {
366 self.update_time = v.map(|x| x.into());
367 self
368 }
369
370 /// Sets the value of [version_create_time][crate::model::Dataset::version_create_time].
371 ///
372 /// # Example
373 /// ```ignore,no_run
374 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
375 /// use wkt::Timestamp;
376 /// let x = Dataset::new().set_version_create_time(Timestamp::default()/* use setters */);
377 /// ```
378 pub fn set_version_create_time<T>(mut self, v: T) -> Self
379 where
380 T: std::convert::Into<wkt::Timestamp>,
381 {
382 self.version_create_time = std::option::Option::Some(v.into());
383 self
384 }
385
386 /// Sets or clears the value of [version_create_time][crate::model::Dataset::version_create_time].
387 ///
388 /// # Example
389 /// ```ignore,no_run
390 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
391 /// use wkt::Timestamp;
392 /// let x = Dataset::new().set_or_clear_version_create_time(Some(Timestamp::default()/* use setters */));
393 /// let x = Dataset::new().set_or_clear_version_create_time(None::<Timestamp>);
394 /// ```
395 pub fn set_or_clear_version_create_time<T>(mut self, v: std::option::Option<T>) -> Self
396 where
397 T: std::convert::Into<wkt::Timestamp>,
398 {
399 self.version_create_time = v.map(|x| x.into());
400 self
401 }
402
403 /// Sets the value of [version_description][crate::model::Dataset::version_description].
404 ///
405 /// # Example
406 /// ```ignore,no_run
407 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
408 /// let x = Dataset::new().set_version_description("example");
409 /// ```
410 pub fn set_version_description<T: std::convert::Into<std::string::String>>(
411 mut self,
412 v: T,
413 ) -> Self {
414 self.version_description = v.into();
415 self
416 }
417
418 /// Sets the value of [data_source][crate::model::Dataset::data_source].
419 ///
420 /// Note that all the setters affecting `data_source` are mutually
421 /// exclusive.
422 ///
423 /// # Example
424 /// ```ignore,no_run
425 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
426 /// use google_maps_mapsplatformdatasets_v1::model::LocalFileSource;
427 /// let x = Dataset::new().set_data_source(Some(
428 /// google_maps_mapsplatformdatasets_v1::model::dataset::DataSource::LocalFileSource(LocalFileSource::default().into())));
429 /// ```
430 pub fn set_data_source<
431 T: std::convert::Into<std::option::Option<crate::model::dataset::DataSource>>,
432 >(
433 mut self,
434 v: T,
435 ) -> Self {
436 self.data_source = v.into();
437 self
438 }
439
440 /// The value of [data_source][crate::model::Dataset::data_source]
441 /// if it holds a `LocalFileSource`, `None` if the field is not set or
442 /// holds a different branch.
443 pub fn local_file_source(
444 &self,
445 ) -> std::option::Option<&std::boxed::Box<crate::model::LocalFileSource>> {
446 #[allow(unreachable_patterns)]
447 self.data_source.as_ref().and_then(|v| match v {
448 crate::model::dataset::DataSource::LocalFileSource(v) => std::option::Option::Some(v),
449 _ => std::option::Option::None,
450 })
451 }
452
453 /// Sets the value of [data_source][crate::model::Dataset::data_source]
454 /// to hold a `LocalFileSource`.
455 ///
456 /// Note that all the setters affecting `data_source` are
457 /// mutually exclusive.
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
462 /// use google_maps_mapsplatformdatasets_v1::model::LocalFileSource;
463 /// let x = Dataset::new().set_local_file_source(LocalFileSource::default()/* use setters */);
464 /// assert!(x.local_file_source().is_some());
465 /// assert!(x.gcs_source().is_none());
466 /// ```
467 pub fn set_local_file_source<
468 T: std::convert::Into<std::boxed::Box<crate::model::LocalFileSource>>,
469 >(
470 mut self,
471 v: T,
472 ) -> Self {
473 self.data_source =
474 std::option::Option::Some(crate::model::dataset::DataSource::LocalFileSource(v.into()));
475 self
476 }
477
478 /// The value of [data_source][crate::model::Dataset::data_source]
479 /// if it holds a `GcsSource`, `None` if the field is not set or
480 /// holds a different branch.
481 pub fn gcs_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsSource>> {
482 #[allow(unreachable_patterns)]
483 self.data_source.as_ref().and_then(|v| match v {
484 crate::model::dataset::DataSource::GcsSource(v) => std::option::Option::Some(v),
485 _ => std::option::Option::None,
486 })
487 }
488
489 /// Sets the value of [data_source][crate::model::Dataset::data_source]
490 /// to hold a `GcsSource`.
491 ///
492 /// Note that all the setters affecting `data_source` are
493 /// mutually exclusive.
494 ///
495 /// # Example
496 /// ```ignore,no_run
497 /// # use google_maps_mapsplatformdatasets_v1::model::Dataset;
498 /// use google_maps_mapsplatformdatasets_v1::model::GcsSource;
499 /// let x = Dataset::new().set_gcs_source(GcsSource::default()/* use setters */);
500 /// assert!(x.gcs_source().is_some());
501 /// assert!(x.local_file_source().is_none());
502 /// ```
503 pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSource>>>(
504 mut self,
505 v: T,
506 ) -> Self {
507 self.data_source =
508 std::option::Option::Some(crate::model::dataset::DataSource::GcsSource(v.into()));
509 self
510 }
511}
512
513impl wkt::message::Message for Dataset {
514 fn typename() -> &'static str {
515 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.Dataset"
516 }
517}
518
519/// Defines additional types related to [Dataset].
520pub mod dataset {
521 #[allow(unused_imports)]
522 use super::*;
523
524 /// Details about the source of the data for the dataset.
525 #[derive(Clone, Debug, PartialEq)]
526 #[non_exhaustive]
527 pub enum DataSource {
528 /// A local file source for the dataset for a single upload.
529 LocalFileSource(std::boxed::Box<crate::model::LocalFileSource>),
530 /// A Google Cloud Storage file source for the dataset for a single upload.
531 GcsSource(std::boxed::Box<crate::model::GcsSource>),
532 }
533}
534
535/// Status of the dataset.
536#[derive(Clone, Default, PartialEq)]
537#[non_exhaustive]
538pub struct Status {
539 /// State enum for status.
540 pub state: crate::model::status::State,
541
542 /// Error message indicating reason of failure. It is empty if the datasets is
543 /// not in a failed state.
544 pub error_message: std::string::String,
545
546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
547}
548
549impl Status {
550 /// Creates a new default instance.
551 pub fn new() -> Self {
552 std::default::Default::default()
553 }
554
555 /// Sets the value of [state][crate::model::Status::state].
556 ///
557 /// # Example
558 /// ```ignore,no_run
559 /// # use google_maps_mapsplatformdatasets_v1::model::Status;
560 /// use google_maps_mapsplatformdatasets_v1::model::status::State;
561 /// let x0 = Status::new().set_state(State::Importing);
562 /// let x1 = Status::new().set_state(State::ImportSucceeded);
563 /// let x2 = Status::new().set_state(State::ImportFailed);
564 /// ```
565 pub fn set_state<T: std::convert::Into<crate::model::status::State>>(mut self, v: T) -> Self {
566 self.state = v.into();
567 self
568 }
569
570 /// Sets the value of [error_message][crate::model::Status::error_message].
571 ///
572 /// # Example
573 /// ```ignore,no_run
574 /// # use google_maps_mapsplatformdatasets_v1::model::Status;
575 /// let x = Status::new().set_error_message("example");
576 /// ```
577 pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
578 self.error_message = v.into();
579 self
580 }
581}
582
583impl wkt::message::Message for Status {
584 fn typename() -> &'static str {
585 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.Status"
586 }
587}
588
589/// Defines additional types related to [Status].
590pub mod status {
591 #[allow(unused_imports)]
592 use super::*;
593
594 /// A list of states for the dataset.
595 ///
596 /// # Working with unknown values
597 ///
598 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
599 /// additional enum variants at any time. Adding new variants is not considered
600 /// a breaking change. Applications should write their code in anticipation of:
601 ///
602 /// - New values appearing in future releases of the client library, **and**
603 /// - New values received dynamically, without application changes.
604 ///
605 /// Please consult the [Working with enums] section in the user guide for some
606 /// guidelines.
607 ///
608 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
609 #[derive(Clone, Debug, PartialEq)]
610 #[non_exhaustive]
611 pub enum State {
612 /// The state of this dataset is not set.
613 Unspecified,
614 /// Data is being imported to a dataset.
615 Importing,
616 /// Importing data to a dataset succeeded.
617 ImportSucceeded,
618 /// Importing data to a dataset failed.
619 ImportFailed,
620 /// The dataset is in the process of getting deleted.
621 Deleting,
622 /// The deletion failed state. This state represents that dataset deletion
623 /// has failed. Deletion may be retried.
624 DeletionFailed,
625 /// Data is being processed.
626 Processing,
627 /// The processing failed state. This state represents that processing has
628 /// failed and may report errors.
629 ProcessingFailed,
630 /// This state is currently not used.
631 NeedsReview,
632 /// The publishing state. This state represents the publishing is in
633 /// progress.
634 Publishing,
635 /// The publishing failed states. This state represents that the publishing
636 /// failed. Publishing may be retried.
637 PublishingFailed,
638 /// The completed state. This state represents the dataset being available
639 /// for its specific usage.
640 Completed,
641 /// If set, the enum was initialized with an unknown value.
642 ///
643 /// Applications can examine the value using [State::value] or
644 /// [State::name].
645 UnknownValue(state::UnknownValue),
646 }
647
648 #[doc(hidden)]
649 pub mod state {
650 #[allow(unused_imports)]
651 use super::*;
652 #[derive(Clone, Debug, PartialEq)]
653 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
654 }
655
656 impl State {
657 /// Gets the enum value.
658 ///
659 /// Returns `None` if the enum contains an unknown value deserialized from
660 /// the string representation of enums.
661 pub fn value(&self) -> std::option::Option<i32> {
662 match self {
663 Self::Unspecified => std::option::Option::Some(0),
664 Self::Importing => std::option::Option::Some(1),
665 Self::ImportSucceeded => std::option::Option::Some(2),
666 Self::ImportFailed => std::option::Option::Some(3),
667 Self::Deleting => std::option::Option::Some(4),
668 Self::DeletionFailed => std::option::Option::Some(5),
669 Self::Processing => std::option::Option::Some(6),
670 Self::ProcessingFailed => std::option::Option::Some(7),
671 Self::NeedsReview => std::option::Option::Some(8),
672 Self::Publishing => std::option::Option::Some(9),
673 Self::PublishingFailed => std::option::Option::Some(10),
674 Self::Completed => std::option::Option::Some(11),
675 Self::UnknownValue(u) => u.0.value(),
676 }
677 }
678
679 /// Gets the enum value as a string.
680 ///
681 /// Returns `None` if the enum contains an unknown value deserialized from
682 /// the integer representation of enums.
683 pub fn name(&self) -> std::option::Option<&str> {
684 match self {
685 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
686 Self::Importing => std::option::Option::Some("STATE_IMPORTING"),
687 Self::ImportSucceeded => std::option::Option::Some("STATE_IMPORT_SUCCEEDED"),
688 Self::ImportFailed => std::option::Option::Some("STATE_IMPORT_FAILED"),
689 Self::Deleting => std::option::Option::Some("STATE_DELETING"),
690 Self::DeletionFailed => std::option::Option::Some("STATE_DELETION_FAILED"),
691 Self::Processing => std::option::Option::Some("STATE_PROCESSING"),
692 Self::ProcessingFailed => std::option::Option::Some("STATE_PROCESSING_FAILED"),
693 Self::NeedsReview => std::option::Option::Some("STATE_NEEDS_REVIEW"),
694 Self::Publishing => std::option::Option::Some("STATE_PUBLISHING"),
695 Self::PublishingFailed => std::option::Option::Some("STATE_PUBLISHING_FAILED"),
696 Self::Completed => std::option::Option::Some("STATE_COMPLETED"),
697 Self::UnknownValue(u) => u.0.name(),
698 }
699 }
700 }
701
702 impl std::default::Default for State {
703 fn default() -> Self {
704 use std::convert::From;
705 Self::from(0)
706 }
707 }
708
709 impl std::fmt::Display for State {
710 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
711 wkt::internal::display_enum(f, self.name(), self.value())
712 }
713 }
714
715 impl std::convert::From<i32> for State {
716 fn from(value: i32) -> Self {
717 match value {
718 0 => Self::Unspecified,
719 1 => Self::Importing,
720 2 => Self::ImportSucceeded,
721 3 => Self::ImportFailed,
722 4 => Self::Deleting,
723 5 => Self::DeletionFailed,
724 6 => Self::Processing,
725 7 => Self::ProcessingFailed,
726 8 => Self::NeedsReview,
727 9 => Self::Publishing,
728 10 => Self::PublishingFailed,
729 11 => Self::Completed,
730 _ => Self::UnknownValue(state::UnknownValue(
731 wkt::internal::UnknownEnumValue::Integer(value),
732 )),
733 }
734 }
735 }
736
737 impl std::convert::From<&str> for State {
738 fn from(value: &str) -> Self {
739 use std::string::ToString;
740 match value {
741 "STATE_UNSPECIFIED" => Self::Unspecified,
742 "STATE_IMPORTING" => Self::Importing,
743 "STATE_IMPORT_SUCCEEDED" => Self::ImportSucceeded,
744 "STATE_IMPORT_FAILED" => Self::ImportFailed,
745 "STATE_DELETING" => Self::Deleting,
746 "STATE_DELETION_FAILED" => Self::DeletionFailed,
747 "STATE_PROCESSING" => Self::Processing,
748 "STATE_PROCESSING_FAILED" => Self::ProcessingFailed,
749 "STATE_NEEDS_REVIEW" => Self::NeedsReview,
750 "STATE_PUBLISHING" => Self::Publishing,
751 "STATE_PUBLISHING_FAILED" => Self::PublishingFailed,
752 "STATE_COMPLETED" => Self::Completed,
753 _ => Self::UnknownValue(state::UnknownValue(
754 wkt::internal::UnknownEnumValue::String(value.to_string()),
755 )),
756 }
757 }
758 }
759
760 impl serde::ser::Serialize for State {
761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
762 where
763 S: serde::Serializer,
764 {
765 match self {
766 Self::Unspecified => serializer.serialize_i32(0),
767 Self::Importing => serializer.serialize_i32(1),
768 Self::ImportSucceeded => serializer.serialize_i32(2),
769 Self::ImportFailed => serializer.serialize_i32(3),
770 Self::Deleting => serializer.serialize_i32(4),
771 Self::DeletionFailed => serializer.serialize_i32(5),
772 Self::Processing => serializer.serialize_i32(6),
773 Self::ProcessingFailed => serializer.serialize_i32(7),
774 Self::NeedsReview => serializer.serialize_i32(8),
775 Self::Publishing => serializer.serialize_i32(9),
776 Self::PublishingFailed => serializer.serialize_i32(10),
777 Self::Completed => serializer.serialize_i32(11),
778 Self::UnknownValue(u) => u.0.serialize(serializer),
779 }
780 }
781 }
782
783 impl<'de> serde::de::Deserialize<'de> for State {
784 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
785 where
786 D: serde::Deserializer<'de>,
787 {
788 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
789 ".google.maps.mapsplatformdatasets.v1.Status.State",
790 ))
791 }
792 }
793}
794
795/// Request to create a maps dataset.
796#[derive(Clone, Default, PartialEq)]
797#[non_exhaustive]
798pub struct CreateDatasetRequest {
799 /// Required. Parent project that will own the dataset.
800 /// Format: projects/{project}
801 pub parent: std::string::String,
802
803 /// Required. The dataset version to create.
804 pub dataset: std::option::Option<crate::model::Dataset>,
805
806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
807}
808
809impl CreateDatasetRequest {
810 /// Creates a new default instance.
811 pub fn new() -> Self {
812 std::default::Default::default()
813 }
814
815 /// Sets the value of [parent][crate::model::CreateDatasetRequest::parent].
816 ///
817 /// # Example
818 /// ```ignore,no_run
819 /// # use google_maps_mapsplatformdatasets_v1::model::CreateDatasetRequest;
820 /// let x = CreateDatasetRequest::new().set_parent("example");
821 /// ```
822 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
823 self.parent = v.into();
824 self
825 }
826
827 /// Sets the value of [dataset][crate::model::CreateDatasetRequest::dataset].
828 ///
829 /// # Example
830 /// ```ignore,no_run
831 /// # use google_maps_mapsplatformdatasets_v1::model::CreateDatasetRequest;
832 /// use google_maps_mapsplatformdatasets_v1::model::Dataset;
833 /// let x = CreateDatasetRequest::new().set_dataset(Dataset::default()/* use setters */);
834 /// ```
835 pub fn set_dataset<T>(mut self, v: T) -> Self
836 where
837 T: std::convert::Into<crate::model::Dataset>,
838 {
839 self.dataset = std::option::Option::Some(v.into());
840 self
841 }
842
843 /// Sets or clears the value of [dataset][crate::model::CreateDatasetRequest::dataset].
844 ///
845 /// # Example
846 /// ```ignore,no_run
847 /// # use google_maps_mapsplatformdatasets_v1::model::CreateDatasetRequest;
848 /// use google_maps_mapsplatformdatasets_v1::model::Dataset;
849 /// let x = CreateDatasetRequest::new().set_or_clear_dataset(Some(Dataset::default()/* use setters */));
850 /// let x = CreateDatasetRequest::new().set_or_clear_dataset(None::<Dataset>);
851 /// ```
852 pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
853 where
854 T: std::convert::Into<crate::model::Dataset>,
855 {
856 self.dataset = v.map(|x| x.into());
857 self
858 }
859}
860
861impl wkt::message::Message for CreateDatasetRequest {
862 fn typename() -> &'static str {
863 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.CreateDatasetRequest"
864 }
865}
866
867/// Request to update the metadata fields of the dataset.
868#[derive(Clone, Default, PartialEq)]
869#[non_exhaustive]
870pub struct UpdateDatasetMetadataRequest {
871 /// Required. Resource name of the dataset to update.
872 /// Format: projects/{project}/datasets/{dataset_id}
873 pub dataset: std::option::Option<crate::model::Dataset>,
874
875 /// The list of fields to be updated.
876 ///
877 /// The value "*" is used for full replacement (default).
878 pub update_mask: std::option::Option<wkt::FieldMask>,
879
880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
881}
882
883impl UpdateDatasetMetadataRequest {
884 /// Creates a new default instance.
885 pub fn new() -> Self {
886 std::default::Default::default()
887 }
888
889 /// Sets the value of [dataset][crate::model::UpdateDatasetMetadataRequest::dataset].
890 ///
891 /// # Example
892 /// ```ignore,no_run
893 /// # use google_maps_mapsplatformdatasets_v1::model::UpdateDatasetMetadataRequest;
894 /// use google_maps_mapsplatformdatasets_v1::model::Dataset;
895 /// let x = UpdateDatasetMetadataRequest::new().set_dataset(Dataset::default()/* use setters */);
896 /// ```
897 pub fn set_dataset<T>(mut self, v: T) -> Self
898 where
899 T: std::convert::Into<crate::model::Dataset>,
900 {
901 self.dataset = std::option::Option::Some(v.into());
902 self
903 }
904
905 /// Sets or clears the value of [dataset][crate::model::UpdateDatasetMetadataRequest::dataset].
906 ///
907 /// # Example
908 /// ```ignore,no_run
909 /// # use google_maps_mapsplatformdatasets_v1::model::UpdateDatasetMetadataRequest;
910 /// use google_maps_mapsplatformdatasets_v1::model::Dataset;
911 /// let x = UpdateDatasetMetadataRequest::new().set_or_clear_dataset(Some(Dataset::default()/* use setters */));
912 /// let x = UpdateDatasetMetadataRequest::new().set_or_clear_dataset(None::<Dataset>);
913 /// ```
914 pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
915 where
916 T: std::convert::Into<crate::model::Dataset>,
917 {
918 self.dataset = v.map(|x| x.into());
919 self
920 }
921
922 /// Sets the value of [update_mask][crate::model::UpdateDatasetMetadataRequest::update_mask].
923 ///
924 /// # Example
925 /// ```ignore,no_run
926 /// # use google_maps_mapsplatformdatasets_v1::model::UpdateDatasetMetadataRequest;
927 /// use wkt::FieldMask;
928 /// let x = UpdateDatasetMetadataRequest::new().set_update_mask(FieldMask::default()/* use setters */);
929 /// ```
930 pub fn set_update_mask<T>(mut self, v: T) -> Self
931 where
932 T: std::convert::Into<wkt::FieldMask>,
933 {
934 self.update_mask = std::option::Option::Some(v.into());
935 self
936 }
937
938 /// Sets or clears the value of [update_mask][crate::model::UpdateDatasetMetadataRequest::update_mask].
939 ///
940 /// # Example
941 /// ```ignore,no_run
942 /// # use google_maps_mapsplatformdatasets_v1::model::UpdateDatasetMetadataRequest;
943 /// use wkt::FieldMask;
944 /// let x = UpdateDatasetMetadataRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
945 /// let x = UpdateDatasetMetadataRequest::new().set_or_clear_update_mask(None::<FieldMask>);
946 /// ```
947 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
948 where
949 T: std::convert::Into<wkt::FieldMask>,
950 {
951 self.update_mask = v.map(|x| x.into());
952 self
953 }
954}
955
956impl wkt::message::Message for UpdateDatasetMetadataRequest {
957 fn typename() -> &'static str {
958 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.UpdateDatasetMetadataRequest"
959 }
960}
961
962/// Request to get the specified dataset.
963#[derive(Clone, Default, PartialEq)]
964#[non_exhaustive]
965pub struct GetDatasetRequest {
966 /// Required. Resource name.
967 /// Format: projects/{project}/datasets/{dataset_id}
968 ///
969 /// Can also fetch some special versions by appending "@" and a tag.
970 /// Format: projects/{project}/datasets/{dataset_id}@{tag}
971 ///
972 /// Tag "active": The info of the latest completed version will be included,
973 /// and NOT_FOUND if the dataset does not have one.
974 pub name: std::string::String,
975
976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
977}
978
979impl GetDatasetRequest {
980 /// Creates a new default instance.
981 pub fn new() -> Self {
982 std::default::Default::default()
983 }
984
985 /// Sets the value of [name][crate::model::GetDatasetRequest::name].
986 ///
987 /// # Example
988 /// ```ignore,no_run
989 /// # use google_maps_mapsplatformdatasets_v1::model::GetDatasetRequest;
990 /// # let project_id = "project_id";
991 /// # let dataset_id = "dataset_id";
992 /// let x = GetDatasetRequest::new().set_name(format!("projects/{project_id}/datasets/{dataset_id}"));
993 /// ```
994 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
995 self.name = v.into();
996 self
997 }
998}
999
1000impl wkt::message::Message for GetDatasetRequest {
1001 fn typename() -> &'static str {
1002 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.GetDatasetRequest"
1003 }
1004}
1005
1006/// Request to list datasets for the project.
1007#[derive(Clone, Default, PartialEq)]
1008#[non_exhaustive]
1009pub struct ListDatasetsRequest {
1010 /// Required. The name of the project to list all the datasets for.
1011 /// Format: projects/{project}
1012 pub parent: std::string::String,
1013
1014 /// The maximum number of datasets to return per page.
1015 ///
1016 /// If unspecified (or zero), all datasets will be returned.
1017 pub page_size: i32,
1018
1019 /// The page token, received from a previous ListDatasets call.
1020 /// Provide this to retrieve the subsequent page.
1021 pub page_token: std::string::String,
1022
1023 /// The tag that specifies the desired version for each dataset.
1024 ///
1025 /// Note that when pagination is also specified, some filtering can happen
1026 /// after pagination, which may cause the response to contain fewer datasets
1027 /// than the page size, even if it's not the last page.
1028 ///
1029 /// Tag "active": Each dataset in the response will include the info of its
1030 /// latest completed version, and the dataset will be skipped if it does not
1031 /// have one.
1032 pub tag: std::string::String,
1033
1034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1035}
1036
1037impl ListDatasetsRequest {
1038 /// Creates a new default instance.
1039 pub fn new() -> Self {
1040 std::default::Default::default()
1041 }
1042
1043 /// Sets the value of [parent][crate::model::ListDatasetsRequest::parent].
1044 ///
1045 /// # Example
1046 /// ```ignore,no_run
1047 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsRequest;
1048 /// let x = ListDatasetsRequest::new().set_parent("example");
1049 /// ```
1050 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.parent = v.into();
1052 self
1053 }
1054
1055 /// Sets the value of [page_size][crate::model::ListDatasetsRequest::page_size].
1056 ///
1057 /// # Example
1058 /// ```ignore,no_run
1059 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsRequest;
1060 /// let x = ListDatasetsRequest::new().set_page_size(42);
1061 /// ```
1062 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1063 self.page_size = v.into();
1064 self
1065 }
1066
1067 /// Sets the value of [page_token][crate::model::ListDatasetsRequest::page_token].
1068 ///
1069 /// # Example
1070 /// ```ignore,no_run
1071 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsRequest;
1072 /// let x = ListDatasetsRequest::new().set_page_token("example");
1073 /// ```
1074 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1075 self.page_token = v.into();
1076 self
1077 }
1078
1079 /// Sets the value of [tag][crate::model::ListDatasetsRequest::tag].
1080 ///
1081 /// # Example
1082 /// ```ignore,no_run
1083 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsRequest;
1084 /// let x = ListDatasetsRequest::new().set_tag("example");
1085 /// ```
1086 pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1087 self.tag = v.into();
1088 self
1089 }
1090}
1091
1092impl wkt::message::Message for ListDatasetsRequest {
1093 fn typename() -> &'static str {
1094 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.ListDatasetsRequest"
1095 }
1096}
1097
1098/// Response object of ListDatasets.
1099#[derive(Clone, Default, PartialEq)]
1100#[non_exhaustive]
1101pub struct ListDatasetsResponse {
1102 /// All the datasets for the project.
1103 pub datasets: std::vec::Vec<crate::model::Dataset>,
1104
1105 /// A token that can be sent as `page_token` to retrieve the next page.
1106 ///
1107 /// If this field is omitted, there are no subsequent pages.
1108 pub next_page_token: std::string::String,
1109
1110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1111}
1112
1113impl ListDatasetsResponse {
1114 /// Creates a new default instance.
1115 pub fn new() -> Self {
1116 std::default::Default::default()
1117 }
1118
1119 /// Sets the value of [datasets][crate::model::ListDatasetsResponse::datasets].
1120 ///
1121 /// # Example
1122 /// ```ignore,no_run
1123 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsResponse;
1124 /// use google_maps_mapsplatformdatasets_v1::model::Dataset;
1125 /// let x = ListDatasetsResponse::new()
1126 /// .set_datasets([
1127 /// Dataset::default()/* use setters */,
1128 /// Dataset::default()/* use (different) setters */,
1129 /// ]);
1130 /// ```
1131 pub fn set_datasets<T, V>(mut self, v: T) -> Self
1132 where
1133 T: std::iter::IntoIterator<Item = V>,
1134 V: std::convert::Into<crate::model::Dataset>,
1135 {
1136 use std::iter::Iterator;
1137 self.datasets = v.into_iter().map(|i| i.into()).collect();
1138 self
1139 }
1140
1141 /// Sets the value of [next_page_token][crate::model::ListDatasetsResponse::next_page_token].
1142 ///
1143 /// # Example
1144 /// ```ignore,no_run
1145 /// # use google_maps_mapsplatformdatasets_v1::model::ListDatasetsResponse;
1146 /// let x = ListDatasetsResponse::new().set_next_page_token("example");
1147 /// ```
1148 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.next_page_token = v.into();
1150 self
1151 }
1152}
1153
1154impl wkt::message::Message for ListDatasetsResponse {
1155 fn typename() -> &'static str {
1156 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.ListDatasetsResponse"
1157 }
1158}
1159
1160#[doc(hidden)]
1161impl google_cloud_gax::paginator::internal::PageableResponse for ListDatasetsResponse {
1162 type PageItem = crate::model::Dataset;
1163
1164 fn items(self) -> std::vec::Vec<Self::PageItem> {
1165 self.datasets
1166 }
1167
1168 fn next_page_token(&self) -> std::string::String {
1169 use std::clone::Clone;
1170 self.next_page_token.clone()
1171 }
1172}
1173
1174/// Request to list detailed errors belonging to a dataset.
1175#[derive(Clone, Default, PartialEq)]
1176#[non_exhaustive]
1177pub struct FetchDatasetErrorsRequest {
1178 /// Required. The name of the dataset to list all the errors for.
1179 /// Format: projects/{project}/datasets/{dataset_id}
1180 pub dataset: std::string::String,
1181
1182 /// The maximum number of errors to return per page.
1183 ///
1184 /// The maximum value is 500; values above 500 will be capped to 500.
1185 ///
1186 /// If unspecified, at most 50 errors will be returned.
1187 pub page_size: i32,
1188
1189 /// The page token, received from a previous ListDatasetErrors call.
1190 /// Provide this to retrieve the subsequent page.
1191 pub page_token: std::string::String,
1192
1193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1194}
1195
1196impl FetchDatasetErrorsRequest {
1197 /// Creates a new default instance.
1198 pub fn new() -> Self {
1199 std::default::Default::default()
1200 }
1201
1202 /// Sets the value of [dataset][crate::model::FetchDatasetErrorsRequest::dataset].
1203 ///
1204 /// # Example
1205 /// ```ignore,no_run
1206 /// # use google_maps_mapsplatformdatasets_v1::model::FetchDatasetErrorsRequest;
1207 /// # let project_id = "project_id";
1208 /// # let dataset_id = "dataset_id";
1209 /// let x = FetchDatasetErrorsRequest::new().set_dataset(format!("projects/{project_id}/datasets/{dataset_id}"));
1210 /// ```
1211 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1212 self.dataset = v.into();
1213 self
1214 }
1215
1216 /// Sets the value of [page_size][crate::model::FetchDatasetErrorsRequest::page_size].
1217 ///
1218 /// # Example
1219 /// ```ignore,no_run
1220 /// # use google_maps_mapsplatformdatasets_v1::model::FetchDatasetErrorsRequest;
1221 /// let x = FetchDatasetErrorsRequest::new().set_page_size(42);
1222 /// ```
1223 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1224 self.page_size = v.into();
1225 self
1226 }
1227
1228 /// Sets the value of [page_token][crate::model::FetchDatasetErrorsRequest::page_token].
1229 ///
1230 /// # Example
1231 /// ```ignore,no_run
1232 /// # use google_maps_mapsplatformdatasets_v1::model::FetchDatasetErrorsRequest;
1233 /// let x = FetchDatasetErrorsRequest::new().set_page_token("example");
1234 /// ```
1235 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1236 self.page_token = v.into();
1237 self
1238 }
1239}
1240
1241impl wkt::message::Message for FetchDatasetErrorsRequest {
1242 fn typename() -> &'static str {
1243 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest"
1244 }
1245}
1246
1247/// Response object of FetchDatasetErrors.
1248#[derive(Clone, Default, PartialEq)]
1249#[non_exhaustive]
1250pub struct FetchDatasetErrorsResponse {
1251 /// A token that can be sent as `page_token` to retrieve the next page.
1252 ///
1253 /// If this field is omitted, there are no subsequent pages.
1254 pub next_page_token: std::string::String,
1255
1256 /// The errors associated with a dataset.
1257 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
1258
1259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1260}
1261
1262impl FetchDatasetErrorsResponse {
1263 /// Creates a new default instance.
1264 pub fn new() -> Self {
1265 std::default::Default::default()
1266 }
1267
1268 /// Sets the value of [next_page_token][crate::model::FetchDatasetErrorsResponse::next_page_token].
1269 ///
1270 /// # Example
1271 /// ```ignore,no_run
1272 /// # use google_maps_mapsplatformdatasets_v1::model::FetchDatasetErrorsResponse;
1273 /// let x = FetchDatasetErrorsResponse::new().set_next_page_token("example");
1274 /// ```
1275 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276 self.next_page_token = v.into();
1277 self
1278 }
1279
1280 /// Sets the value of [errors][crate::model::FetchDatasetErrorsResponse::errors].
1281 ///
1282 /// # Example
1283 /// ```ignore,no_run
1284 /// # use google_maps_mapsplatformdatasets_v1::model::FetchDatasetErrorsResponse;
1285 /// use google_cloud_rpc::model::Status;
1286 /// let x = FetchDatasetErrorsResponse::new()
1287 /// .set_errors([
1288 /// Status::default()/* use setters */,
1289 /// Status::default()/* use (different) setters */,
1290 /// ]);
1291 /// ```
1292 pub fn set_errors<T, V>(mut self, v: T) -> Self
1293 where
1294 T: std::iter::IntoIterator<Item = V>,
1295 V: std::convert::Into<google_cloud_rpc::model::Status>,
1296 {
1297 use std::iter::Iterator;
1298 self.errors = v.into_iter().map(|i| i.into()).collect();
1299 self
1300 }
1301}
1302
1303impl wkt::message::Message for FetchDatasetErrorsResponse {
1304 fn typename() -> &'static str {
1305 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse"
1306 }
1307}
1308
1309#[doc(hidden)]
1310impl google_cloud_gax::paginator::internal::PageableResponse for FetchDatasetErrorsResponse {
1311 type PageItem = google_cloud_rpc::model::Status;
1312
1313 fn items(self) -> std::vec::Vec<Self::PageItem> {
1314 self.errors
1315 }
1316
1317 fn next_page_token(&self) -> std::string::String {
1318 use std::clone::Clone;
1319 self.next_page_token.clone()
1320 }
1321}
1322
1323/// Request to delete a dataset.
1324#[derive(Clone, Default, PartialEq)]
1325#[non_exhaustive]
1326pub struct DeleteDatasetRequest {
1327 /// Required. The name of the dataset to delete.
1328 /// Format: projects/{project}/datasets/{dataset_id}
1329 pub name: std::string::String,
1330
1331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1332}
1333
1334impl DeleteDatasetRequest {
1335 /// Creates a new default instance.
1336 pub fn new() -> Self {
1337 std::default::Default::default()
1338 }
1339
1340 /// Sets the value of [name][crate::model::DeleteDatasetRequest::name].
1341 ///
1342 /// # Example
1343 /// ```ignore,no_run
1344 /// # use google_maps_mapsplatformdatasets_v1::model::DeleteDatasetRequest;
1345 /// # let project_id = "project_id";
1346 /// # let dataset_id = "dataset_id";
1347 /// let x = DeleteDatasetRequest::new().set_name(format!("projects/{project_id}/datasets/{dataset_id}"));
1348 /// ```
1349 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1350 self.name = v.into();
1351 self
1352 }
1353}
1354
1355impl wkt::message::Message for DeleteDatasetRequest {
1356 fn typename() -> &'static str {
1357 "type.googleapis.com/google.maps.mapsplatformdatasets.v1.DeleteDatasetRequest"
1358 }
1359}
1360
1361/// The format of the file being uploaded.
1362///
1363/// # Working with unknown values
1364///
1365/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1366/// additional enum variants at any time. Adding new variants is not considered
1367/// a breaking change. Applications should write their code in anticipation of:
1368///
1369/// - New values appearing in future releases of the client library, **and**
1370/// - New values received dynamically, without application changes.
1371///
1372/// Please consult the [Working with enums] section in the user guide for some
1373/// guidelines.
1374///
1375/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1376#[derive(Clone, Debug, PartialEq)]
1377#[non_exhaustive]
1378pub enum FileFormat {
1379 /// Unspecified file format.
1380 Unspecified,
1381 /// GeoJson file.
1382 Geojson,
1383 /// KML file.
1384 Kml,
1385 /// CSV file.
1386 Csv,
1387 /// If set, the enum was initialized with an unknown value.
1388 ///
1389 /// Applications can examine the value using [FileFormat::value] or
1390 /// [FileFormat::name].
1391 UnknownValue(file_format::UnknownValue),
1392}
1393
1394#[doc(hidden)]
1395pub mod file_format {
1396 #[allow(unused_imports)]
1397 use super::*;
1398 #[derive(Clone, Debug, PartialEq)]
1399 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1400}
1401
1402impl FileFormat {
1403 /// Gets the enum value.
1404 ///
1405 /// Returns `None` if the enum contains an unknown value deserialized from
1406 /// the string representation of enums.
1407 pub fn value(&self) -> std::option::Option<i32> {
1408 match self {
1409 Self::Unspecified => std::option::Option::Some(0),
1410 Self::Geojson => std::option::Option::Some(1),
1411 Self::Kml => std::option::Option::Some(2),
1412 Self::Csv => std::option::Option::Some(3),
1413 Self::UnknownValue(u) => u.0.value(),
1414 }
1415 }
1416
1417 /// Gets the enum value as a string.
1418 ///
1419 /// Returns `None` if the enum contains an unknown value deserialized from
1420 /// the integer representation of enums.
1421 pub fn name(&self) -> std::option::Option<&str> {
1422 match self {
1423 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
1424 Self::Geojson => std::option::Option::Some("FILE_FORMAT_GEOJSON"),
1425 Self::Kml => std::option::Option::Some("FILE_FORMAT_KML"),
1426 Self::Csv => std::option::Option::Some("FILE_FORMAT_CSV"),
1427 Self::UnknownValue(u) => u.0.name(),
1428 }
1429 }
1430}
1431
1432impl std::default::Default for FileFormat {
1433 fn default() -> Self {
1434 use std::convert::From;
1435 Self::from(0)
1436 }
1437}
1438
1439impl std::fmt::Display for FileFormat {
1440 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1441 wkt::internal::display_enum(f, self.name(), self.value())
1442 }
1443}
1444
1445impl std::convert::From<i32> for FileFormat {
1446 fn from(value: i32) -> Self {
1447 match value {
1448 0 => Self::Unspecified,
1449 1 => Self::Geojson,
1450 2 => Self::Kml,
1451 3 => Self::Csv,
1452 _ => Self::UnknownValue(file_format::UnknownValue(
1453 wkt::internal::UnknownEnumValue::Integer(value),
1454 )),
1455 }
1456 }
1457}
1458
1459impl std::convert::From<&str> for FileFormat {
1460 fn from(value: &str) -> Self {
1461 use std::string::ToString;
1462 match value {
1463 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
1464 "FILE_FORMAT_GEOJSON" => Self::Geojson,
1465 "FILE_FORMAT_KML" => Self::Kml,
1466 "FILE_FORMAT_CSV" => Self::Csv,
1467 _ => Self::UnknownValue(file_format::UnknownValue(
1468 wkt::internal::UnknownEnumValue::String(value.to_string()),
1469 )),
1470 }
1471 }
1472}
1473
1474impl serde::ser::Serialize for FileFormat {
1475 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1476 where
1477 S: serde::Serializer,
1478 {
1479 match self {
1480 Self::Unspecified => serializer.serialize_i32(0),
1481 Self::Geojson => serializer.serialize_i32(1),
1482 Self::Kml => serializer.serialize_i32(2),
1483 Self::Csv => serializer.serialize_i32(3),
1484 Self::UnknownValue(u) => u.0.serialize(serializer),
1485 }
1486 }
1487}
1488
1489impl<'de> serde::de::Deserialize<'de> for FileFormat {
1490 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1491 where
1492 D: serde::Deserializer<'de>,
1493 {
1494 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
1495 ".google.maps.mapsplatformdatasets.v1.FileFormat",
1496 ))
1497 }
1498}
1499
1500/// Usage specifies where the data is intended to be used to inform how to
1501/// process the data.
1502///
1503/// # Working with unknown values
1504///
1505/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1506/// additional enum variants at any time. Adding new variants is not considered
1507/// a breaking change. Applications should write their code in anticipation of:
1508///
1509/// - New values appearing in future releases of the client library, **and**
1510/// - New values received dynamically, without application changes.
1511///
1512/// Please consult the [Working with enums] section in the user guide for some
1513/// guidelines.
1514///
1515/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1516#[derive(Clone, Debug, PartialEq)]
1517#[non_exhaustive]
1518pub enum Usage {
1519 /// The usage of this dataset is not set.
1520 Unspecified,
1521 /// This dataset will be used for data driven styling.
1522 DataDrivenStyling,
1523 /// If set, the enum was initialized with an unknown value.
1524 ///
1525 /// Applications can examine the value using [Usage::value] or
1526 /// [Usage::name].
1527 UnknownValue(usage::UnknownValue),
1528}
1529
1530#[doc(hidden)]
1531pub mod usage {
1532 #[allow(unused_imports)]
1533 use super::*;
1534 #[derive(Clone, Debug, PartialEq)]
1535 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1536}
1537
1538impl Usage {
1539 /// Gets the enum value.
1540 ///
1541 /// Returns `None` if the enum contains an unknown value deserialized from
1542 /// the string representation of enums.
1543 pub fn value(&self) -> std::option::Option<i32> {
1544 match self {
1545 Self::Unspecified => std::option::Option::Some(0),
1546 Self::DataDrivenStyling => std::option::Option::Some(1),
1547 Self::UnknownValue(u) => u.0.value(),
1548 }
1549 }
1550
1551 /// Gets the enum value as a string.
1552 ///
1553 /// Returns `None` if the enum contains an unknown value deserialized from
1554 /// the integer representation of enums.
1555 pub fn name(&self) -> std::option::Option<&str> {
1556 match self {
1557 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
1558 Self::DataDrivenStyling => std::option::Option::Some("USAGE_DATA_DRIVEN_STYLING"),
1559 Self::UnknownValue(u) => u.0.name(),
1560 }
1561 }
1562}
1563
1564impl std::default::Default for Usage {
1565 fn default() -> Self {
1566 use std::convert::From;
1567 Self::from(0)
1568 }
1569}
1570
1571impl std::fmt::Display for Usage {
1572 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1573 wkt::internal::display_enum(f, self.name(), self.value())
1574 }
1575}
1576
1577impl std::convert::From<i32> for Usage {
1578 fn from(value: i32) -> Self {
1579 match value {
1580 0 => Self::Unspecified,
1581 1 => Self::DataDrivenStyling,
1582 _ => Self::UnknownValue(usage::UnknownValue(
1583 wkt::internal::UnknownEnumValue::Integer(value),
1584 )),
1585 }
1586 }
1587}
1588
1589impl std::convert::From<&str> for Usage {
1590 fn from(value: &str) -> Self {
1591 use std::string::ToString;
1592 match value {
1593 "USAGE_UNSPECIFIED" => Self::Unspecified,
1594 "USAGE_DATA_DRIVEN_STYLING" => Self::DataDrivenStyling,
1595 _ => Self::UnknownValue(usage::UnknownValue(
1596 wkt::internal::UnknownEnumValue::String(value.to_string()),
1597 )),
1598 }
1599 }
1600}
1601
1602impl serde::ser::Serialize for Usage {
1603 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1604 where
1605 S: serde::Serializer,
1606 {
1607 match self {
1608 Self::Unspecified => serializer.serialize_i32(0),
1609 Self::DataDrivenStyling => serializer.serialize_i32(1),
1610 Self::UnknownValue(u) => u.0.serialize(serializer),
1611 }
1612 }
1613}
1614
1615impl<'de> serde::de::Deserialize<'de> for Usage {
1616 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1617 where
1618 D: serde::Deserializer<'de>,
1619 {
1620 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
1621 ".google.maps.mapsplatformdatasets.v1.Usage",
1622 ))
1623 }
1624}