google_cloud_dataform_v1/model.rs
1// Copyright 2025 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::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate google_cloud_type;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Describes encryption state of a resource.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct DataEncryptionState {
45 /// Required. The KMS key version name with which data of a resource is
46 /// encrypted.
47 pub kms_key_version_name: std::string::String,
48
49 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
50}
51
52impl DataEncryptionState {
53 pub fn new() -> Self {
54 std::default::Default::default()
55 }
56
57 /// Sets the value of [kms_key_version_name][crate::model::DataEncryptionState::kms_key_version_name].
58 ///
59 /// # Example
60 /// ```ignore,no_run
61 /// # use google_cloud_dataform_v1::model::DataEncryptionState;
62 /// let x = DataEncryptionState::new().set_kms_key_version_name("example");
63 /// ```
64 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
65 mut self,
66 v: T,
67 ) -> Self {
68 self.kms_key_version_name = v.into();
69 self
70 }
71}
72
73impl wkt::message::Message for DataEncryptionState {
74 fn typename() -> &'static str {
75 "type.googleapis.com/google.cloud.dataform.v1.DataEncryptionState"
76 }
77}
78
79/// Represents a Dataform Git repository.
80#[derive(Clone, Default, PartialEq)]
81#[non_exhaustive]
82pub struct Repository {
83 /// Identifier. The repository's name.
84 pub name: std::string::String,
85
86 /// Optional. The name of the containing folder of the repository.
87 /// The field is immutable and it can be modified via a MoveRepository
88 /// operation.
89 /// Format: `projects/*/locations/*/folders/*`. or
90 /// `projects/*/locations/*/teamFolders/*`.
91 pub containing_folder: std::option::Option<std::string::String>,
92
93 /// Output only. The resource name of the TeamFolder that this Repository is
94 /// associated with. This should take the format:
95 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this
96 /// is not set, the Repository is not associated with a TeamFolder.
97 pub team_folder_name: std::option::Option<std::string::String>,
98
99 /// Output only. The timestamp of when the repository was created.
100 pub create_time: std::option::Option<wkt::Timestamp>,
101
102 /// Optional. The repository's user-friendly name.
103 pub display_name: std::string::String,
104
105 /// Optional. If set, configures this repository to be linked to a Git remote.
106 pub git_remote_settings: std::option::Option<crate::model::repository::GitRemoteSettings>,
107
108 /// Optional. The name of the Secret Manager secret version to be used to
109 /// interpolate variables into the .npmrc file for package installation
110 /// operations. Must be in the format `projects/*/secrets/*/versions/*`. The
111 /// file itself must be in a JSON format.
112 pub npmrc_environment_variables_secret_version: std::string::String,
113
114 /// Optional. If set, fields of `workspace_compilation_overrides` override the
115 /// default compilation settings that are specified in dataform.json when
116 /// creating workspace-scoped compilation results. See documentation for
117 /// `WorkspaceCompilationOverrides` for more information.
118 pub workspace_compilation_overrides:
119 std::option::Option<crate::model::repository::WorkspaceCompilationOverrides>,
120
121 /// Optional. Repository user labels.
122 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
123
124 /// Optional. Input only. If set to true, the authenticated user will be
125 /// granted the roles/dataform.admin role on the created repository.
126 pub set_authenticated_user_admin: bool,
127
128 /// Optional. The service account to run workflow invocations under.
129 pub service_account: std::string::String,
130
131 /// Optional. The reference to a KMS encryption key. If provided, it will be
132 /// used to encrypt user data in the repository and all child resources. It is
133 /// not possible to add or update the encryption key after the repository is
134 /// created. Example:
135 /// `projects/{kms_project}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}`
136 pub kms_key_name: std::string::String,
137
138 /// Output only. A data encryption state of a Git repository if this Repository
139 /// is protected by a KMS key.
140 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
141
142 /// Output only. All the metadata information that is used internally to serve
143 /// the resource. For example: timestamps, flags, status fields, etc. The
144 /// format of this field is a JSON string.
145 pub internal_metadata: std::option::Option<std::string::String>,
146
147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
148}
149
150impl Repository {
151 pub fn new() -> Self {
152 std::default::Default::default()
153 }
154
155 /// Sets the value of [name][crate::model::Repository::name].
156 ///
157 /// # Example
158 /// ```ignore,no_run
159 /// # use google_cloud_dataform_v1::model::Repository;
160 /// let x = Repository::new().set_name("example");
161 /// ```
162 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
163 self.name = v.into();
164 self
165 }
166
167 /// Sets the value of [containing_folder][crate::model::Repository::containing_folder].
168 ///
169 /// # Example
170 /// ```ignore,no_run
171 /// # use google_cloud_dataform_v1::model::Repository;
172 /// let x = Repository::new().set_containing_folder("example");
173 /// ```
174 pub fn set_containing_folder<T>(mut self, v: T) -> Self
175 where
176 T: std::convert::Into<std::string::String>,
177 {
178 self.containing_folder = std::option::Option::Some(v.into());
179 self
180 }
181
182 /// Sets or clears the value of [containing_folder][crate::model::Repository::containing_folder].
183 ///
184 /// # Example
185 /// ```ignore,no_run
186 /// # use google_cloud_dataform_v1::model::Repository;
187 /// let x = Repository::new().set_or_clear_containing_folder(Some("example"));
188 /// let x = Repository::new().set_or_clear_containing_folder(None::<String>);
189 /// ```
190 pub fn set_or_clear_containing_folder<T>(mut self, v: std::option::Option<T>) -> Self
191 where
192 T: std::convert::Into<std::string::String>,
193 {
194 self.containing_folder = v.map(|x| x.into());
195 self
196 }
197
198 /// Sets the value of [team_folder_name][crate::model::Repository::team_folder_name].
199 ///
200 /// # Example
201 /// ```ignore,no_run
202 /// # use google_cloud_dataform_v1::model::Repository;
203 /// let x = Repository::new().set_team_folder_name("example");
204 /// ```
205 pub fn set_team_folder_name<T>(mut self, v: T) -> Self
206 where
207 T: std::convert::Into<std::string::String>,
208 {
209 self.team_folder_name = std::option::Option::Some(v.into());
210 self
211 }
212
213 /// Sets or clears the value of [team_folder_name][crate::model::Repository::team_folder_name].
214 ///
215 /// # Example
216 /// ```ignore,no_run
217 /// # use google_cloud_dataform_v1::model::Repository;
218 /// let x = Repository::new().set_or_clear_team_folder_name(Some("example"));
219 /// let x = Repository::new().set_or_clear_team_folder_name(None::<String>);
220 /// ```
221 pub fn set_or_clear_team_folder_name<T>(mut self, v: std::option::Option<T>) -> Self
222 where
223 T: std::convert::Into<std::string::String>,
224 {
225 self.team_folder_name = v.map(|x| x.into());
226 self
227 }
228
229 /// Sets the value of [create_time][crate::model::Repository::create_time].
230 ///
231 /// # Example
232 /// ```ignore,no_run
233 /// # use google_cloud_dataform_v1::model::Repository;
234 /// use wkt::Timestamp;
235 /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
236 /// ```
237 pub fn set_create_time<T>(mut self, v: T) -> Self
238 where
239 T: std::convert::Into<wkt::Timestamp>,
240 {
241 self.create_time = std::option::Option::Some(v.into());
242 self
243 }
244
245 /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
246 ///
247 /// # Example
248 /// ```ignore,no_run
249 /// # use google_cloud_dataform_v1::model::Repository;
250 /// use wkt::Timestamp;
251 /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
252 /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
253 /// ```
254 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
255 where
256 T: std::convert::Into<wkt::Timestamp>,
257 {
258 self.create_time = v.map(|x| x.into());
259 self
260 }
261
262 /// Sets the value of [display_name][crate::model::Repository::display_name].
263 ///
264 /// # Example
265 /// ```ignore,no_run
266 /// # use google_cloud_dataform_v1::model::Repository;
267 /// let x = Repository::new().set_display_name("example");
268 /// ```
269 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
270 self.display_name = v.into();
271 self
272 }
273
274 /// Sets the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
275 ///
276 /// # Example
277 /// ```ignore,no_run
278 /// # use google_cloud_dataform_v1::model::Repository;
279 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
280 /// let x = Repository::new().set_git_remote_settings(GitRemoteSettings::default()/* use setters */);
281 /// ```
282 pub fn set_git_remote_settings<T>(mut self, v: T) -> Self
283 where
284 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
285 {
286 self.git_remote_settings = std::option::Option::Some(v.into());
287 self
288 }
289
290 /// Sets or clears the value of [git_remote_settings][crate::model::Repository::git_remote_settings].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_dataform_v1::model::Repository;
295 /// use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
296 /// let x = Repository::new().set_or_clear_git_remote_settings(Some(GitRemoteSettings::default()/* use setters */));
297 /// let x = Repository::new().set_or_clear_git_remote_settings(None::<GitRemoteSettings>);
298 /// ```
299 pub fn set_or_clear_git_remote_settings<T>(mut self, v: std::option::Option<T>) -> Self
300 where
301 T: std::convert::Into<crate::model::repository::GitRemoteSettings>,
302 {
303 self.git_remote_settings = v.map(|x| x.into());
304 self
305 }
306
307 /// Sets the value of [npmrc_environment_variables_secret_version][crate::model::Repository::npmrc_environment_variables_secret_version].
308 ///
309 /// # Example
310 /// ```ignore,no_run
311 /// # use google_cloud_dataform_v1::model::Repository;
312 /// let x = Repository::new().set_npmrc_environment_variables_secret_version("example");
313 /// ```
314 pub fn set_npmrc_environment_variables_secret_version<
315 T: std::convert::Into<std::string::String>,
316 >(
317 mut self,
318 v: T,
319 ) -> Self {
320 self.npmrc_environment_variables_secret_version = v.into();
321 self
322 }
323
324 /// Sets the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
325 ///
326 /// # Example
327 /// ```ignore,no_run
328 /// # use google_cloud_dataform_v1::model::Repository;
329 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
330 /// let x = Repository::new().set_workspace_compilation_overrides(WorkspaceCompilationOverrides::default()/* use setters */);
331 /// ```
332 pub fn set_workspace_compilation_overrides<T>(mut self, v: T) -> Self
333 where
334 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
335 {
336 self.workspace_compilation_overrides = std::option::Option::Some(v.into());
337 self
338 }
339
340 /// Sets or clears the value of [workspace_compilation_overrides][crate::model::Repository::workspace_compilation_overrides].
341 ///
342 /// # Example
343 /// ```ignore,no_run
344 /// # use google_cloud_dataform_v1::model::Repository;
345 /// use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
346 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(Some(WorkspaceCompilationOverrides::default()/* use setters */));
347 /// let x = Repository::new().set_or_clear_workspace_compilation_overrides(None::<WorkspaceCompilationOverrides>);
348 /// ```
349 pub fn set_or_clear_workspace_compilation_overrides<T>(
350 mut self,
351 v: std::option::Option<T>,
352 ) -> Self
353 where
354 T: std::convert::Into<crate::model::repository::WorkspaceCompilationOverrides>,
355 {
356 self.workspace_compilation_overrides = v.map(|x| x.into());
357 self
358 }
359
360 /// Sets the value of [labels][crate::model::Repository::labels].
361 ///
362 /// # Example
363 /// ```ignore,no_run
364 /// # use google_cloud_dataform_v1::model::Repository;
365 /// let x = Repository::new().set_labels([
366 /// ("key0", "abc"),
367 /// ("key1", "xyz"),
368 /// ]);
369 /// ```
370 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
371 where
372 T: std::iter::IntoIterator<Item = (K, V)>,
373 K: std::convert::Into<std::string::String>,
374 V: std::convert::Into<std::string::String>,
375 {
376 use std::iter::Iterator;
377 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
378 self
379 }
380
381 /// Sets the value of [set_authenticated_user_admin][crate::model::Repository::set_authenticated_user_admin].
382 ///
383 /// # Example
384 /// ```ignore,no_run
385 /// # use google_cloud_dataform_v1::model::Repository;
386 /// let x = Repository::new().set_set_authenticated_user_admin(true);
387 /// ```
388 pub fn set_set_authenticated_user_admin<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
389 self.set_authenticated_user_admin = v.into();
390 self
391 }
392
393 /// Sets the value of [service_account][crate::model::Repository::service_account].
394 ///
395 /// # Example
396 /// ```ignore,no_run
397 /// # use google_cloud_dataform_v1::model::Repository;
398 /// let x = Repository::new().set_service_account("example");
399 /// ```
400 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
401 self.service_account = v.into();
402 self
403 }
404
405 /// Sets the value of [kms_key_name][crate::model::Repository::kms_key_name].
406 ///
407 /// # Example
408 /// ```ignore,no_run
409 /// # use google_cloud_dataform_v1::model::Repository;
410 /// let x = Repository::new().set_kms_key_name("example");
411 /// ```
412 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
413 self.kms_key_name = v.into();
414 self
415 }
416
417 /// Sets the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_dataform_v1::model::Repository;
422 /// use google_cloud_dataform_v1::model::DataEncryptionState;
423 /// let x = Repository::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
424 /// ```
425 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
426 where
427 T: std::convert::Into<crate::model::DataEncryptionState>,
428 {
429 self.data_encryption_state = std::option::Option::Some(v.into());
430 self
431 }
432
433 /// Sets or clears the value of [data_encryption_state][crate::model::Repository::data_encryption_state].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_dataform_v1::model::Repository;
438 /// use google_cloud_dataform_v1::model::DataEncryptionState;
439 /// let x = Repository::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
440 /// let x = Repository::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
441 /// ```
442 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
443 where
444 T: std::convert::Into<crate::model::DataEncryptionState>,
445 {
446 self.data_encryption_state = v.map(|x| x.into());
447 self
448 }
449
450 /// Sets the value of [internal_metadata][crate::model::Repository::internal_metadata].
451 ///
452 /// # Example
453 /// ```ignore,no_run
454 /// # use google_cloud_dataform_v1::model::Repository;
455 /// let x = Repository::new().set_internal_metadata("example");
456 /// ```
457 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
458 where
459 T: std::convert::Into<std::string::String>,
460 {
461 self.internal_metadata = std::option::Option::Some(v.into());
462 self
463 }
464
465 /// Sets or clears the value of [internal_metadata][crate::model::Repository::internal_metadata].
466 ///
467 /// # Example
468 /// ```ignore,no_run
469 /// # use google_cloud_dataform_v1::model::Repository;
470 /// let x = Repository::new().set_or_clear_internal_metadata(Some("example"));
471 /// let x = Repository::new().set_or_clear_internal_metadata(None::<String>);
472 /// ```
473 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
474 where
475 T: std::convert::Into<std::string::String>,
476 {
477 self.internal_metadata = v.map(|x| x.into());
478 self
479 }
480}
481
482impl wkt::message::Message for Repository {
483 fn typename() -> &'static str {
484 "type.googleapis.com/google.cloud.dataform.v1.Repository"
485 }
486}
487
488/// Defines additional types related to [Repository].
489pub mod repository {
490 #[allow(unused_imports)]
491 use super::*;
492
493 /// Controls Git remote configuration for a repository.
494 #[derive(Clone, Default, PartialEq)]
495 #[non_exhaustive]
496 pub struct GitRemoteSettings {
497 /// Required. The Git remote's URL.
498 pub url: std::string::String,
499
500 /// Required. The Git remote's default branch name.
501 pub default_branch: std::string::String,
502
503 /// Optional. The name of the Secret Manager secret version to use as an
504 /// authentication token for Git operations. Must be in the format
505 /// `projects/*/secrets/*/versions/*`.
506 pub authentication_token_secret_version: std::string::String,
507
508 /// Optional. Authentication fields for remote uris using SSH protocol.
509 pub ssh_authentication_config: std::option::Option<
510 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
511 >,
512
513 /// Output only. Deprecated: The field does not contain any token status
514 /// information.
515 #[deprecated]
516 pub token_status: crate::model::repository::git_remote_settings::TokenStatus,
517
518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
519 }
520
521 impl GitRemoteSettings {
522 pub fn new() -> Self {
523 std::default::Default::default()
524 }
525
526 /// Sets the value of [url][crate::model::repository::GitRemoteSettings::url].
527 ///
528 /// # Example
529 /// ```ignore,no_run
530 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
531 /// let x = GitRemoteSettings::new().set_url("example");
532 /// ```
533 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
534 self.url = v.into();
535 self
536 }
537
538 /// Sets the value of [default_branch][crate::model::repository::GitRemoteSettings::default_branch].
539 ///
540 /// # Example
541 /// ```ignore,no_run
542 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
543 /// let x = GitRemoteSettings::new().set_default_branch("example");
544 /// ```
545 pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
546 mut self,
547 v: T,
548 ) -> Self {
549 self.default_branch = v.into();
550 self
551 }
552
553 /// Sets the value of [authentication_token_secret_version][crate::model::repository::GitRemoteSettings::authentication_token_secret_version].
554 ///
555 /// # Example
556 /// ```ignore,no_run
557 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
558 /// let x = GitRemoteSettings::new().set_authentication_token_secret_version("example");
559 /// ```
560 pub fn set_authentication_token_secret_version<
561 T: std::convert::Into<std::string::String>,
562 >(
563 mut self,
564 v: T,
565 ) -> Self {
566 self.authentication_token_secret_version = v.into();
567 self
568 }
569
570 /// Sets the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
571 ///
572 /// # Example
573 /// ```ignore,no_run
574 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
575 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
576 /// let x = GitRemoteSettings::new().set_ssh_authentication_config(SshAuthenticationConfig::default()/* use setters */);
577 /// ```
578 pub fn set_ssh_authentication_config<T>(mut self, v: T) -> Self
579 where
580 T: std::convert::Into<
581 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
582 >,
583 {
584 self.ssh_authentication_config = std::option::Option::Some(v.into());
585 self
586 }
587
588 /// Sets or clears the value of [ssh_authentication_config][crate::model::repository::GitRemoteSettings::ssh_authentication_config].
589 ///
590 /// # Example
591 /// ```ignore,no_run
592 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
593 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
594 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(Some(SshAuthenticationConfig::default()/* use setters */));
595 /// let x = GitRemoteSettings::new().set_or_clear_ssh_authentication_config(None::<SshAuthenticationConfig>);
596 /// ```
597 pub fn set_or_clear_ssh_authentication_config<T>(
598 mut self,
599 v: std::option::Option<T>,
600 ) -> Self
601 where
602 T: std::convert::Into<
603 crate::model::repository::git_remote_settings::SshAuthenticationConfig,
604 >,
605 {
606 self.ssh_authentication_config = v.map(|x| x.into());
607 self
608 }
609
610 /// Sets the value of [token_status][crate::model::repository::GitRemoteSettings::token_status].
611 ///
612 /// # Example
613 /// ```ignore,no_run
614 /// # use google_cloud_dataform_v1::model::repository::GitRemoteSettings;
615 /// use google_cloud_dataform_v1::model::repository::git_remote_settings::TokenStatus;
616 /// let x0 = GitRemoteSettings::new().set_token_status(TokenStatus::NotFound);
617 /// let x1 = GitRemoteSettings::new().set_token_status(TokenStatus::Invalid);
618 /// let x2 = GitRemoteSettings::new().set_token_status(TokenStatus::Valid);
619 /// ```
620 #[deprecated]
621 pub fn set_token_status<
622 T: std::convert::Into<crate::model::repository::git_remote_settings::TokenStatus>,
623 >(
624 mut self,
625 v: T,
626 ) -> Self {
627 self.token_status = v.into();
628 self
629 }
630 }
631
632 impl wkt::message::Message for GitRemoteSettings {
633 fn typename() -> &'static str {
634 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings"
635 }
636 }
637
638 /// Defines additional types related to [GitRemoteSettings].
639 pub mod git_remote_settings {
640 #[allow(unused_imports)]
641 use super::*;
642
643 /// Configures fields for performing SSH authentication.
644 #[derive(Clone, Default, PartialEq)]
645 #[non_exhaustive]
646 pub struct SshAuthenticationConfig {
647 /// Required. The name of the Secret Manager secret version to use as a
648 /// ssh private key for Git operations.
649 /// Must be in the format `projects/*/secrets/*/versions/*`.
650 pub user_private_key_secret_version: std::string::String,
651
652 /// Required. Content of a public SSH key to verify an identity of a remote
653 /// Git host.
654 pub host_public_key: std::string::String,
655
656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
657 }
658
659 impl SshAuthenticationConfig {
660 pub fn new() -> Self {
661 std::default::Default::default()
662 }
663
664 /// Sets the value of [user_private_key_secret_version][crate::model::repository::git_remote_settings::SshAuthenticationConfig::user_private_key_secret_version].
665 ///
666 /// # Example
667 /// ```ignore,no_run
668 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
669 /// let x = SshAuthenticationConfig::new().set_user_private_key_secret_version("example");
670 /// ```
671 pub fn set_user_private_key_secret_version<
672 T: std::convert::Into<std::string::String>,
673 >(
674 mut self,
675 v: T,
676 ) -> Self {
677 self.user_private_key_secret_version = v.into();
678 self
679 }
680
681 /// Sets the value of [host_public_key][crate::model::repository::git_remote_settings::SshAuthenticationConfig::host_public_key].
682 ///
683 /// # Example
684 /// ```ignore,no_run
685 /// # use google_cloud_dataform_v1::model::repository::git_remote_settings::SshAuthenticationConfig;
686 /// let x = SshAuthenticationConfig::new().set_host_public_key("example");
687 /// ```
688 pub fn set_host_public_key<T: std::convert::Into<std::string::String>>(
689 mut self,
690 v: T,
691 ) -> Self {
692 self.host_public_key = v.into();
693 self
694 }
695 }
696
697 impl wkt::message::Message for SshAuthenticationConfig {
698 fn typename() -> &'static str {
699 "type.googleapis.com/google.cloud.dataform.v1.Repository.GitRemoteSettings.SshAuthenticationConfig"
700 }
701 }
702
703 /// The status of the authentication token.
704 ///
705 /// # Working with unknown values
706 ///
707 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
708 /// additional enum variants at any time. Adding new variants is not considered
709 /// a breaking change. Applications should write their code in anticipation of:
710 ///
711 /// - New values appearing in future releases of the client library, **and**
712 /// - New values received dynamically, without application changes.
713 ///
714 /// Please consult the [Working with enums] section in the user guide for some
715 /// guidelines.
716 ///
717 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
718 #[derive(Clone, Debug, PartialEq)]
719 #[non_exhaustive]
720 pub enum TokenStatus {
721 /// Default value. This value is unused.
722 Unspecified,
723 /// The token could not be found in Secret Manager (or the Dataform
724 /// Service Account did not have permission to access it).
725 NotFound,
726 /// The token could not be used to authenticate against the Git remote.
727 Invalid,
728 /// The token was used successfully to authenticate against the Git remote.
729 Valid,
730 /// If set, the enum was initialized with an unknown value.
731 ///
732 /// Applications can examine the value using [TokenStatus::value] or
733 /// [TokenStatus::name].
734 UnknownValue(token_status::UnknownValue),
735 }
736
737 #[doc(hidden)]
738 pub mod token_status {
739 #[allow(unused_imports)]
740 use super::*;
741 #[derive(Clone, Debug, PartialEq)]
742 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
743 }
744
745 impl TokenStatus {
746 /// Gets the enum value.
747 ///
748 /// Returns `None` if the enum contains an unknown value deserialized from
749 /// the string representation of enums.
750 pub fn value(&self) -> std::option::Option<i32> {
751 match self {
752 Self::Unspecified => std::option::Option::Some(0),
753 Self::NotFound => std::option::Option::Some(1),
754 Self::Invalid => std::option::Option::Some(2),
755 Self::Valid => std::option::Option::Some(3),
756 Self::UnknownValue(u) => u.0.value(),
757 }
758 }
759
760 /// Gets the enum value as a string.
761 ///
762 /// Returns `None` if the enum contains an unknown value deserialized from
763 /// the integer representation of enums.
764 pub fn name(&self) -> std::option::Option<&str> {
765 match self {
766 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
767 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
768 Self::Invalid => std::option::Option::Some("INVALID"),
769 Self::Valid => std::option::Option::Some("VALID"),
770 Self::UnknownValue(u) => u.0.name(),
771 }
772 }
773 }
774
775 impl std::default::Default for TokenStatus {
776 fn default() -> Self {
777 use std::convert::From;
778 Self::from(0)
779 }
780 }
781
782 impl std::fmt::Display for TokenStatus {
783 fn fmt(
784 &self,
785 f: &mut std::fmt::Formatter<'_>,
786 ) -> std::result::Result<(), std::fmt::Error> {
787 wkt::internal::display_enum(f, self.name(), self.value())
788 }
789 }
790
791 impl std::convert::From<i32> for TokenStatus {
792 fn from(value: i32) -> Self {
793 match value {
794 0 => Self::Unspecified,
795 1 => Self::NotFound,
796 2 => Self::Invalid,
797 3 => Self::Valid,
798 _ => Self::UnknownValue(token_status::UnknownValue(
799 wkt::internal::UnknownEnumValue::Integer(value),
800 )),
801 }
802 }
803 }
804
805 impl std::convert::From<&str> for TokenStatus {
806 fn from(value: &str) -> Self {
807 use std::string::ToString;
808 match value {
809 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
810 "NOT_FOUND" => Self::NotFound,
811 "INVALID" => Self::Invalid,
812 "VALID" => Self::Valid,
813 _ => Self::UnknownValue(token_status::UnknownValue(
814 wkt::internal::UnknownEnumValue::String(value.to_string()),
815 )),
816 }
817 }
818 }
819
820 impl serde::ser::Serialize for TokenStatus {
821 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
822 where
823 S: serde::Serializer,
824 {
825 match self {
826 Self::Unspecified => serializer.serialize_i32(0),
827 Self::NotFound => serializer.serialize_i32(1),
828 Self::Invalid => serializer.serialize_i32(2),
829 Self::Valid => serializer.serialize_i32(3),
830 Self::UnknownValue(u) => u.0.serialize(serializer),
831 }
832 }
833 }
834
835 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
836 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
837 where
838 D: serde::Deserializer<'de>,
839 {
840 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
841 ".google.cloud.dataform.v1.Repository.GitRemoteSettings.TokenStatus",
842 ))
843 }
844 }
845 }
846
847 /// Configures workspace compilation overrides for a repository.
848 #[derive(Clone, Default, PartialEq)]
849 #[non_exhaustive]
850 pub struct WorkspaceCompilationOverrides {
851 /// Optional. The default database (Google Cloud project ID).
852 pub default_database: std::string::String,
853
854 /// Optional. The suffix that should be appended to all schema (BigQuery
855 /// dataset ID) names.
856 pub schema_suffix: std::string::String,
857
858 /// Optional. The prefix that should be prepended to all table names.
859 pub table_prefix: std::string::String,
860
861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
862 }
863
864 impl WorkspaceCompilationOverrides {
865 pub fn new() -> Self {
866 std::default::Default::default()
867 }
868
869 /// Sets the value of [default_database][crate::model::repository::WorkspaceCompilationOverrides::default_database].
870 ///
871 /// # Example
872 /// ```ignore,no_run
873 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
874 /// let x = WorkspaceCompilationOverrides::new().set_default_database("example");
875 /// ```
876 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
877 mut self,
878 v: T,
879 ) -> Self {
880 self.default_database = v.into();
881 self
882 }
883
884 /// Sets the value of [schema_suffix][crate::model::repository::WorkspaceCompilationOverrides::schema_suffix].
885 ///
886 /// # Example
887 /// ```ignore,no_run
888 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
889 /// let x = WorkspaceCompilationOverrides::new().set_schema_suffix("example");
890 /// ```
891 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(
892 mut self,
893 v: T,
894 ) -> Self {
895 self.schema_suffix = v.into();
896 self
897 }
898
899 /// Sets the value of [table_prefix][crate::model::repository::WorkspaceCompilationOverrides::table_prefix].
900 ///
901 /// # Example
902 /// ```ignore,no_run
903 /// # use google_cloud_dataform_v1::model::repository::WorkspaceCompilationOverrides;
904 /// let x = WorkspaceCompilationOverrides::new().set_table_prefix("example");
905 /// ```
906 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(
907 mut self,
908 v: T,
909 ) -> Self {
910 self.table_prefix = v.into();
911 self
912 }
913 }
914
915 impl wkt::message::Message for WorkspaceCompilationOverrides {
916 fn typename() -> &'static str {
917 "type.googleapis.com/google.cloud.dataform.v1.Repository.WorkspaceCompilationOverrides"
918 }
919 }
920}
921
922/// Metadata used to identify if a resource is user scoped.
923#[derive(Clone, Default, PartialEq)]
924#[non_exhaustive]
925pub struct PrivateResourceMetadata {
926 /// Output only. If true, this resource is user-scoped, meaning it is either a
927 /// workspace or sourced from a workspace.
928 pub user_scoped: bool,
929
930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
931}
932
933impl PrivateResourceMetadata {
934 pub fn new() -> Self {
935 std::default::Default::default()
936 }
937
938 /// Sets the value of [user_scoped][crate::model::PrivateResourceMetadata::user_scoped].
939 ///
940 /// # Example
941 /// ```ignore,no_run
942 /// # use google_cloud_dataform_v1::model::PrivateResourceMetadata;
943 /// let x = PrivateResourceMetadata::new().set_user_scoped(true);
944 /// ```
945 pub fn set_user_scoped<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
946 self.user_scoped = v.into();
947 self
948 }
949}
950
951impl wkt::message::Message for PrivateResourceMetadata {
952 fn typename() -> &'static str {
953 "type.googleapis.com/google.cloud.dataform.v1.PrivateResourceMetadata"
954 }
955}
956
957/// `ListRepositories` request message.
958#[derive(Clone, Default, PartialEq)]
959#[non_exhaustive]
960pub struct ListRepositoriesRequest {
961 /// Required. The location in which to list repositories. Must be in the format
962 /// `projects/*/locations/*`.
963 pub parent: std::string::String,
964
965 /// Optional. Maximum number of repositories to return. The server may return
966 /// fewer items than requested. If unspecified, the server will pick an
967 /// appropriate default.
968 pub page_size: i32,
969
970 /// Optional. Page token received from a previous `ListRepositories` call.
971 /// Provide this to retrieve the subsequent page.
972 ///
973 /// When paginating, all other parameters provided to `ListRepositories`,
974 /// with the exception of `page_size`, must match the call that provided the
975 /// page token.
976 pub page_token: std::string::String,
977
978 /// Optional. This field only supports ordering by `name`. If unspecified, the
979 /// server will choose the ordering. If specified, the default order is
980 /// ascending for the `name` field.
981 pub order_by: std::string::String,
982
983 /// Optional. Filter for the returned list.
984 pub filter: std::string::String,
985
986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
987}
988
989impl ListRepositoriesRequest {
990 pub fn new() -> Self {
991 std::default::Default::default()
992 }
993
994 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
995 ///
996 /// # Example
997 /// ```ignore,no_run
998 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
999 /// let x = ListRepositoriesRequest::new().set_parent("example");
1000 /// ```
1001 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.parent = v.into();
1003 self
1004 }
1005
1006 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
1007 ///
1008 /// # Example
1009 /// ```ignore,no_run
1010 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1011 /// let x = ListRepositoriesRequest::new().set_page_size(42);
1012 /// ```
1013 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1014 self.page_size = v.into();
1015 self
1016 }
1017
1018 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
1019 ///
1020 /// # Example
1021 /// ```ignore,no_run
1022 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1023 /// let x = ListRepositoriesRequest::new().set_page_token("example");
1024 /// ```
1025 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1026 self.page_token = v.into();
1027 self
1028 }
1029
1030 /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
1031 ///
1032 /// # Example
1033 /// ```ignore,no_run
1034 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1035 /// let x = ListRepositoriesRequest::new().set_order_by("example");
1036 /// ```
1037 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.order_by = v.into();
1039 self
1040 }
1041
1042 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
1043 ///
1044 /// # Example
1045 /// ```ignore,no_run
1046 /// # use google_cloud_dataform_v1::model::ListRepositoriesRequest;
1047 /// let x = ListRepositoriesRequest::new().set_filter("example");
1048 /// ```
1049 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1050 self.filter = v.into();
1051 self
1052 }
1053}
1054
1055impl wkt::message::Message for ListRepositoriesRequest {
1056 fn typename() -> &'static str {
1057 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesRequest"
1058 }
1059}
1060
1061/// `ListRepositories` response message.
1062#[derive(Clone, Default, PartialEq)]
1063#[non_exhaustive]
1064pub struct ListRepositoriesResponse {
1065 /// List of repositories.
1066 pub repositories: std::vec::Vec<crate::model::Repository>,
1067
1068 /// A token which can be sent as `page_token` to retrieve the next page.
1069 /// If this field is omitted, there are no subsequent pages.
1070 pub next_page_token: std::string::String,
1071
1072 /// Locations which could not be reached.
1073 pub unreachable: std::vec::Vec<std::string::String>,
1074
1075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1076}
1077
1078impl ListRepositoriesResponse {
1079 pub fn new() -> Self {
1080 std::default::Default::default()
1081 }
1082
1083 /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1088 /// use google_cloud_dataform_v1::model::Repository;
1089 /// let x = ListRepositoriesResponse::new()
1090 /// .set_repositories([
1091 /// Repository::default()/* use setters */,
1092 /// Repository::default()/* use (different) setters */,
1093 /// ]);
1094 /// ```
1095 pub fn set_repositories<T, V>(mut self, v: T) -> Self
1096 where
1097 T: std::iter::IntoIterator<Item = V>,
1098 V: std::convert::Into<crate::model::Repository>,
1099 {
1100 use std::iter::Iterator;
1101 self.repositories = v.into_iter().map(|i| i.into()).collect();
1102 self
1103 }
1104
1105 /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
1106 ///
1107 /// # Example
1108 /// ```ignore,no_run
1109 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1110 /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
1111 /// ```
1112 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.next_page_token = v.into();
1114 self
1115 }
1116
1117 /// Sets the value of [unreachable][crate::model::ListRepositoriesResponse::unreachable].
1118 ///
1119 /// # Example
1120 /// ```ignore,no_run
1121 /// # use google_cloud_dataform_v1::model::ListRepositoriesResponse;
1122 /// let x = ListRepositoriesResponse::new().set_unreachable(["a", "b", "c"]);
1123 /// ```
1124 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1125 where
1126 T: std::iter::IntoIterator<Item = V>,
1127 V: std::convert::Into<std::string::String>,
1128 {
1129 use std::iter::Iterator;
1130 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1131 self
1132 }
1133}
1134
1135impl wkt::message::Message for ListRepositoriesResponse {
1136 fn typename() -> &'static str {
1137 "type.googleapis.com/google.cloud.dataform.v1.ListRepositoriesResponse"
1138 }
1139}
1140
1141#[doc(hidden)]
1142impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
1143 type PageItem = crate::model::Repository;
1144
1145 fn items(self) -> std::vec::Vec<Self::PageItem> {
1146 self.repositories
1147 }
1148
1149 fn next_page_token(&self) -> std::string::String {
1150 use std::clone::Clone;
1151 self.next_page_token.clone()
1152 }
1153}
1154
1155/// `MoveRepository` request message.
1156#[derive(Clone, Default, PartialEq)]
1157#[non_exhaustive]
1158pub struct MoveRepositoryRequest {
1159 /// Required. The full resource name of the repository to move.
1160 pub name: std::string::String,
1161
1162 /// Optional. The name of the Folder, TeamFolder, or root location to move the
1163 /// repository to. Can be in the format of: "" to move into the root User
1164 /// folder, `projects/*/locations/*/folders/*`,
1165 /// `projects/*/locations/*/teamFolders/*`
1166 pub destination_containing_folder: std::option::Option<std::string::String>,
1167
1168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1169}
1170
1171impl MoveRepositoryRequest {
1172 pub fn new() -> Self {
1173 std::default::Default::default()
1174 }
1175
1176 /// Sets the value of [name][crate::model::MoveRepositoryRequest::name].
1177 ///
1178 /// # Example
1179 /// ```ignore,no_run
1180 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1181 /// let x = MoveRepositoryRequest::new().set_name("example");
1182 /// ```
1183 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1184 self.name = v.into();
1185 self
1186 }
1187
1188 /// Sets the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1189 ///
1190 /// # Example
1191 /// ```ignore,no_run
1192 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1193 /// let x = MoveRepositoryRequest::new().set_destination_containing_folder("example");
1194 /// ```
1195 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
1196 where
1197 T: std::convert::Into<std::string::String>,
1198 {
1199 self.destination_containing_folder = std::option::Option::Some(v.into());
1200 self
1201 }
1202
1203 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
1204 ///
1205 /// # Example
1206 /// ```ignore,no_run
1207 /// # use google_cloud_dataform_v1::model::MoveRepositoryRequest;
1208 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(Some("example"));
1209 /// let x = MoveRepositoryRequest::new().set_or_clear_destination_containing_folder(None::<String>);
1210 /// ```
1211 pub fn set_or_clear_destination_containing_folder<T>(
1212 mut self,
1213 v: std::option::Option<T>,
1214 ) -> Self
1215 where
1216 T: std::convert::Into<std::string::String>,
1217 {
1218 self.destination_containing_folder = v.map(|x| x.into());
1219 self
1220 }
1221}
1222
1223impl wkt::message::Message for MoveRepositoryRequest {
1224 fn typename() -> &'static str {
1225 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryRequest"
1226 }
1227}
1228
1229/// `GetRepository` request message.
1230#[derive(Clone, Default, PartialEq)]
1231#[non_exhaustive]
1232pub struct GetRepositoryRequest {
1233 /// Required. The repository's name.
1234 pub name: std::string::String,
1235
1236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1237}
1238
1239impl GetRepositoryRequest {
1240 pub fn new() -> Self {
1241 std::default::Default::default()
1242 }
1243
1244 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
1245 ///
1246 /// # Example
1247 /// ```ignore,no_run
1248 /// # use google_cloud_dataform_v1::model::GetRepositoryRequest;
1249 /// let x = GetRepositoryRequest::new().set_name("example");
1250 /// ```
1251 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.name = v.into();
1253 self
1254 }
1255}
1256
1257impl wkt::message::Message for GetRepositoryRequest {
1258 fn typename() -> &'static str {
1259 "type.googleapis.com/google.cloud.dataform.v1.GetRepositoryRequest"
1260 }
1261}
1262
1263/// `CreateRepository` request message.
1264#[derive(Clone, Default, PartialEq)]
1265#[non_exhaustive]
1266pub struct CreateRepositoryRequest {
1267 /// Required. The location in which to create the repository. Must be in the
1268 /// format `projects/*/locations/*`.
1269 pub parent: std::string::String,
1270
1271 /// Required. The repository to create.
1272 pub repository: std::option::Option<crate::model::Repository>,
1273
1274 /// Required. The ID to use for the repository, which will become the final
1275 /// component of the repository's resource name.
1276 pub repository_id: std::string::String,
1277
1278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1279}
1280
1281impl CreateRepositoryRequest {
1282 pub fn new() -> Self {
1283 std::default::Default::default()
1284 }
1285
1286 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
1287 ///
1288 /// # Example
1289 /// ```ignore,no_run
1290 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1291 /// let x = CreateRepositoryRequest::new().set_parent("example");
1292 /// ```
1293 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1294 self.parent = v.into();
1295 self
1296 }
1297
1298 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
1299 ///
1300 /// # Example
1301 /// ```ignore,no_run
1302 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1303 /// use google_cloud_dataform_v1::model::Repository;
1304 /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1305 /// ```
1306 pub fn set_repository<T>(mut self, v: T) -> Self
1307 where
1308 T: std::convert::Into<crate::model::Repository>,
1309 {
1310 self.repository = std::option::Option::Some(v.into());
1311 self
1312 }
1313
1314 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
1315 ///
1316 /// # Example
1317 /// ```ignore,no_run
1318 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1319 /// use google_cloud_dataform_v1::model::Repository;
1320 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1321 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1322 /// ```
1323 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1324 where
1325 T: std::convert::Into<crate::model::Repository>,
1326 {
1327 self.repository = v.map(|x| x.into());
1328 self
1329 }
1330
1331 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
1332 ///
1333 /// # Example
1334 /// ```ignore,no_run
1335 /// # use google_cloud_dataform_v1::model::CreateRepositoryRequest;
1336 /// let x = CreateRepositoryRequest::new().set_repository_id("example");
1337 /// ```
1338 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1339 self.repository_id = v.into();
1340 self
1341 }
1342}
1343
1344impl wkt::message::Message for CreateRepositoryRequest {
1345 fn typename() -> &'static str {
1346 "type.googleapis.com/google.cloud.dataform.v1.CreateRepositoryRequest"
1347 }
1348}
1349
1350/// `UpdateRepository` request message.
1351#[derive(Clone, Default, PartialEq)]
1352#[non_exhaustive]
1353pub struct UpdateRepositoryRequest {
1354 /// Optional. Specifies the fields to be updated in the repository. If left
1355 /// unset, all fields will be updated.
1356 pub update_mask: std::option::Option<wkt::FieldMask>,
1357
1358 /// Required. The repository to update.
1359 pub repository: std::option::Option<crate::model::Repository>,
1360
1361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1362}
1363
1364impl UpdateRepositoryRequest {
1365 pub fn new() -> Self {
1366 std::default::Default::default()
1367 }
1368
1369 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1370 ///
1371 /// # Example
1372 /// ```ignore,no_run
1373 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1374 /// use wkt::FieldMask;
1375 /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1376 /// ```
1377 pub fn set_update_mask<T>(mut self, v: T) -> Self
1378 where
1379 T: std::convert::Into<wkt::FieldMask>,
1380 {
1381 self.update_mask = std::option::Option::Some(v.into());
1382 self
1383 }
1384
1385 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1386 ///
1387 /// # Example
1388 /// ```ignore,no_run
1389 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1390 /// use wkt::FieldMask;
1391 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1392 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1393 /// ```
1394 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1395 where
1396 T: std::convert::Into<wkt::FieldMask>,
1397 {
1398 self.update_mask = v.map(|x| x.into());
1399 self
1400 }
1401
1402 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1403 ///
1404 /// # Example
1405 /// ```ignore,no_run
1406 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1407 /// use google_cloud_dataform_v1::model::Repository;
1408 /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
1409 /// ```
1410 pub fn set_repository<T>(mut self, v: T) -> Self
1411 where
1412 T: std::convert::Into<crate::model::Repository>,
1413 {
1414 self.repository = std::option::Option::Some(v.into());
1415 self
1416 }
1417
1418 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_dataform_v1::model::UpdateRepositoryRequest;
1423 /// use google_cloud_dataform_v1::model::Repository;
1424 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
1425 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
1426 /// ```
1427 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1428 where
1429 T: std::convert::Into<crate::model::Repository>,
1430 {
1431 self.repository = v.map(|x| x.into());
1432 self
1433 }
1434}
1435
1436impl wkt::message::Message for UpdateRepositoryRequest {
1437 fn typename() -> &'static str {
1438 "type.googleapis.com/google.cloud.dataform.v1.UpdateRepositoryRequest"
1439 }
1440}
1441
1442/// `DeleteRepository` request message.
1443#[derive(Clone, Default, PartialEq)]
1444#[non_exhaustive]
1445pub struct DeleteRepositoryRequest {
1446 /// Required. The repository's name.
1447 pub name: std::string::String,
1448
1449 /// Optional. If set to true, child resources of this repository (compilation
1450 /// results and workflow invocations) will also be deleted. Otherwise, the
1451 /// request will only succeed if the repository has no child resources.
1452 ///
1453 /// **Note:** *This flag doesn't support deletion of workspaces, release
1454 /// configs or workflow configs. If any of such resources exists in the
1455 /// repository, the request will fail.*.
1456 pub force: bool,
1457
1458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1459}
1460
1461impl DeleteRepositoryRequest {
1462 pub fn new() -> Self {
1463 std::default::Default::default()
1464 }
1465
1466 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1467 ///
1468 /// # Example
1469 /// ```ignore,no_run
1470 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1471 /// let x = DeleteRepositoryRequest::new().set_name("example");
1472 /// ```
1473 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1474 self.name = v.into();
1475 self
1476 }
1477
1478 /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
1479 ///
1480 /// # Example
1481 /// ```ignore,no_run
1482 /// # use google_cloud_dataform_v1::model::DeleteRepositoryRequest;
1483 /// let x = DeleteRepositoryRequest::new().set_force(true);
1484 /// ```
1485 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1486 self.force = v.into();
1487 self
1488 }
1489}
1490
1491impl wkt::message::Message for DeleteRepositoryRequest {
1492 fn typename() -> &'static str {
1493 "type.googleapis.com/google.cloud.dataform.v1.DeleteRepositoryRequest"
1494 }
1495}
1496
1497/// `CommitRepositoryChanges` request message.
1498#[derive(Clone, Default, PartialEq)]
1499#[non_exhaustive]
1500pub struct CommitRepositoryChangesRequest {
1501 /// Required. The repository's name.
1502 pub name: std::string::String,
1503
1504 /// Required. The changes to commit to the repository.
1505 pub commit_metadata: std::option::Option<crate::model::CommitMetadata>,
1506
1507 /// Optional. The commit SHA which must be the repository's current HEAD before
1508 /// applying this commit; otherwise this request will fail. If unset, no
1509 /// validation on the current HEAD commit SHA is performed.
1510 pub required_head_commit_sha: std::string::String,
1511
1512 /// Optional. A map to the path of the file to the operation. The path is the
1513 /// full file path including filename, from repository root.
1514 pub file_operations: std::collections::HashMap<
1515 std::string::String,
1516 crate::model::commit_repository_changes_request::FileOperation,
1517 >,
1518
1519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1520}
1521
1522impl CommitRepositoryChangesRequest {
1523 pub fn new() -> Self {
1524 std::default::Default::default()
1525 }
1526
1527 /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
1528 ///
1529 /// # Example
1530 /// ```ignore,no_run
1531 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1532 /// let x = CommitRepositoryChangesRequest::new().set_name("example");
1533 /// ```
1534 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1535 self.name = v.into();
1536 self
1537 }
1538
1539 /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1540 ///
1541 /// # Example
1542 /// ```ignore,no_run
1543 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1544 /// use google_cloud_dataform_v1::model::CommitMetadata;
1545 /// let x = CommitRepositoryChangesRequest::new().set_commit_metadata(CommitMetadata::default()/* use setters */);
1546 /// ```
1547 pub fn set_commit_metadata<T>(mut self, v: T) -> Self
1548 where
1549 T: std::convert::Into<crate::model::CommitMetadata>,
1550 {
1551 self.commit_metadata = std::option::Option::Some(v.into());
1552 self
1553 }
1554
1555 /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
1556 ///
1557 /// # Example
1558 /// ```ignore,no_run
1559 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1560 /// use google_cloud_dataform_v1::model::CommitMetadata;
1561 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(Some(CommitMetadata::default()/* use setters */));
1562 /// let x = CommitRepositoryChangesRequest::new().set_or_clear_commit_metadata(None::<CommitMetadata>);
1563 /// ```
1564 pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1565 where
1566 T: std::convert::Into<crate::model::CommitMetadata>,
1567 {
1568 self.commit_metadata = v.map(|x| x.into());
1569 self
1570 }
1571
1572 /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1577 /// let x = CommitRepositoryChangesRequest::new().set_required_head_commit_sha("example");
1578 /// ```
1579 pub fn set_required_head_commit_sha<T: std::convert::Into<std::string::String>>(
1580 mut self,
1581 v: T,
1582 ) -> Self {
1583 self.required_head_commit_sha = v.into();
1584 self
1585 }
1586
1587 /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
1588 ///
1589 /// # Example
1590 /// ```ignore,no_run
1591 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesRequest;
1592 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1593 /// let x = CommitRepositoryChangesRequest::new().set_file_operations([
1594 /// ("key0", FileOperation::default()/* use setters */),
1595 /// ("key1", FileOperation::default()/* use (different) setters */),
1596 /// ]);
1597 /// ```
1598 pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
1599 where
1600 T: std::iter::IntoIterator<Item = (K, V)>,
1601 K: std::convert::Into<std::string::String>,
1602 V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
1603 {
1604 use std::iter::Iterator;
1605 self.file_operations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1606 self
1607 }
1608}
1609
1610impl wkt::message::Message for CommitRepositoryChangesRequest {
1611 fn typename() -> &'static str {
1612 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest"
1613 }
1614}
1615
1616/// Defines additional types related to [CommitRepositoryChangesRequest].
1617pub mod commit_repository_changes_request {
1618 #[allow(unused_imports)]
1619 use super::*;
1620
1621 /// Represents a single file operation to the repository.
1622 #[derive(Clone, Default, PartialEq)]
1623 #[non_exhaustive]
1624 pub struct FileOperation {
1625 /// The operation to perform on the file.
1626 pub operation: std::option::Option<
1627 crate::model::commit_repository_changes_request::file_operation::Operation,
1628 >,
1629
1630 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1631 }
1632
1633 impl FileOperation {
1634 pub fn new() -> Self {
1635 std::default::Default::default()
1636 }
1637
1638 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation].
1639 ///
1640 /// Note that all the setters affecting `operation` are mutually
1641 /// exclusive.
1642 ///
1643 /// # Example
1644 /// ```ignore,no_run
1645 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1646 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1647 /// let x = FileOperation::new().set_operation(Some(
1648 /// google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::Operation::WriteFile(WriteFile::default().into())));
1649 /// ```
1650 pub fn set_operation<
1651 T: std::convert::Into<
1652 std::option::Option<
1653 crate::model::commit_repository_changes_request::file_operation::Operation,
1654 >,
1655 >,
1656 >(
1657 mut self,
1658 v: T,
1659 ) -> Self {
1660 self.operation = v.into();
1661 self
1662 }
1663
1664 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1665 /// if it holds a `WriteFile`, `None` if the field is not set or
1666 /// holds a different branch.
1667 pub fn write_file(
1668 &self,
1669 ) -> std::option::Option<
1670 &std::boxed::Box<
1671 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1672 >,
1673 > {
1674 #[allow(unreachable_patterns)]
1675 self.operation.as_ref().and_then(|v| match v {
1676 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(v) => std::option::Option::Some(v),
1677 _ => std::option::Option::None,
1678 })
1679 }
1680
1681 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1682 /// to hold a `WriteFile`.
1683 ///
1684 /// Note that all the setters affecting `operation` are
1685 /// mutually exclusive.
1686 ///
1687 /// # Example
1688 /// ```ignore,no_run
1689 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1690 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1691 /// let x = FileOperation::new().set_write_file(WriteFile::default()/* use setters */);
1692 /// assert!(x.write_file().is_some());
1693 /// assert!(x.delete_file().is_none());
1694 /// ```
1695 pub fn set_write_file<
1696 T: std::convert::Into<
1697 std::boxed::Box<
1698 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1699 >,
1700 >,
1701 >(
1702 mut self,
1703 v: T,
1704 ) -> Self {
1705 self.operation = std::option::Option::Some(
1706 crate::model::commit_repository_changes_request::file_operation::Operation::WriteFile(
1707 v.into()
1708 )
1709 );
1710 self
1711 }
1712
1713 /// The value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1714 /// if it holds a `DeleteFile`, `None` if the field is not set or
1715 /// holds a different branch.
1716 pub fn delete_file(
1717 &self,
1718 ) -> std::option::Option<
1719 &std::boxed::Box<
1720 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1721 >,
1722 > {
1723 #[allow(unreachable_patterns)]
1724 self.operation.as_ref().and_then(|v| match v {
1725 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(v) => std::option::Option::Some(v),
1726 _ => std::option::Option::None,
1727 })
1728 }
1729
1730 /// Sets the value of [operation][crate::model::commit_repository_changes_request::FileOperation::operation]
1731 /// to hold a `DeleteFile`.
1732 ///
1733 /// Note that all the setters affecting `operation` are
1734 /// mutually exclusive.
1735 ///
1736 /// # Example
1737 /// ```ignore,no_run
1738 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::FileOperation;
1739 /// use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::DeleteFile;
1740 /// let x = FileOperation::new().set_delete_file(DeleteFile::default()/* use setters */);
1741 /// assert!(x.delete_file().is_some());
1742 /// assert!(x.write_file().is_none());
1743 /// ```
1744 pub fn set_delete_file<
1745 T: std::convert::Into<
1746 std::boxed::Box<
1747 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1748 >,
1749 >,
1750 >(
1751 mut self,
1752 v: T,
1753 ) -> Self {
1754 self.operation = std::option::Option::Some(
1755 crate::model::commit_repository_changes_request::file_operation::Operation::DeleteFile(
1756 v.into()
1757 )
1758 );
1759 self
1760 }
1761 }
1762
1763 impl wkt::message::Message for FileOperation {
1764 fn typename() -> &'static str {
1765 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation"
1766 }
1767 }
1768
1769 /// Defines additional types related to [FileOperation].
1770 pub mod file_operation {
1771 #[allow(unused_imports)]
1772 use super::*;
1773
1774 /// Represents the write file operation (for files added or modified).
1775 #[derive(Clone, Default, PartialEq)]
1776 #[non_exhaustive]
1777 pub struct WriteFile {
1778 /// The file's contents.
1779 pub contents: ::bytes::Bytes,
1780
1781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1782 }
1783
1784 impl WriteFile {
1785 pub fn new() -> Self {
1786 std::default::Default::default()
1787 }
1788
1789 /// Sets the value of [contents][crate::model::commit_repository_changes_request::file_operation::WriteFile::contents].
1790 ///
1791 /// # Example
1792 /// ```ignore,no_run
1793 /// # use google_cloud_dataform_v1::model::commit_repository_changes_request::file_operation::WriteFile;
1794 /// let x = WriteFile::new().set_contents(bytes::Bytes::from_static(b"example"));
1795 /// ```
1796 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1797 self.contents = v.into();
1798 self
1799 }
1800 }
1801
1802 impl wkt::message::Message for WriteFile {
1803 fn typename() -> &'static str {
1804 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.WriteFile"
1805 }
1806 }
1807
1808 /// Represents the delete file operation.
1809 #[derive(Clone, Default, PartialEq)]
1810 #[non_exhaustive]
1811 pub struct DeleteFile {
1812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1813 }
1814
1815 impl DeleteFile {
1816 pub fn new() -> Self {
1817 std::default::Default::default()
1818 }
1819 }
1820
1821 impl wkt::message::Message for DeleteFile {
1822 fn typename() -> &'static str {
1823 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesRequest.FileOperation.DeleteFile"
1824 }
1825 }
1826
1827 /// The operation to perform on the file.
1828 #[derive(Clone, Debug, PartialEq)]
1829 #[non_exhaustive]
1830 pub enum Operation {
1831 /// Represents the write operation.
1832 WriteFile(
1833 std::boxed::Box<
1834 crate::model::commit_repository_changes_request::file_operation::WriteFile,
1835 >,
1836 ),
1837 /// Represents the delete operation.
1838 DeleteFile(
1839 std::boxed::Box<
1840 crate::model::commit_repository_changes_request::file_operation::DeleteFile,
1841 >,
1842 ),
1843 }
1844 }
1845}
1846
1847/// `CommitRepositoryChanges` response message.
1848#[derive(Clone, Default, PartialEq)]
1849#[non_exhaustive]
1850pub struct CommitRepositoryChangesResponse {
1851 /// The commit SHA of the current commit.
1852 pub commit_sha: std::string::String,
1853
1854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1855}
1856
1857impl CommitRepositoryChangesResponse {
1858 pub fn new() -> Self {
1859 std::default::Default::default()
1860 }
1861
1862 /// Sets the value of [commit_sha][crate::model::CommitRepositoryChangesResponse::commit_sha].
1863 ///
1864 /// # Example
1865 /// ```ignore,no_run
1866 /// # use google_cloud_dataform_v1::model::CommitRepositoryChangesResponse;
1867 /// let x = CommitRepositoryChangesResponse::new().set_commit_sha("example");
1868 /// ```
1869 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1870 self.commit_sha = v.into();
1871 self
1872 }
1873}
1874
1875impl wkt::message::Message for CommitRepositoryChangesResponse {
1876 fn typename() -> &'static str {
1877 "type.googleapis.com/google.cloud.dataform.v1.CommitRepositoryChangesResponse"
1878 }
1879}
1880
1881/// `ReadRepositoryFile` request message.
1882#[derive(Clone, Default, PartialEq)]
1883#[non_exhaustive]
1884pub struct ReadRepositoryFileRequest {
1885 /// Required. The repository's name.
1886 pub name: std::string::String,
1887
1888 /// Optional. The commit SHA for the commit to read from. If unset, the file
1889 /// will be read from HEAD.
1890 pub commit_sha: std::string::String,
1891
1892 /// Required. Full file path to read including filename, from repository root.
1893 pub path: std::string::String,
1894
1895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1896}
1897
1898impl ReadRepositoryFileRequest {
1899 pub fn new() -> Self {
1900 std::default::Default::default()
1901 }
1902
1903 /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
1904 ///
1905 /// # Example
1906 /// ```ignore,no_run
1907 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
1908 /// let x = ReadRepositoryFileRequest::new().set_name("example");
1909 /// ```
1910 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911 self.name = v.into();
1912 self
1913 }
1914
1915 /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
1916 ///
1917 /// # Example
1918 /// ```ignore,no_run
1919 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
1920 /// let x = ReadRepositoryFileRequest::new().set_commit_sha("example");
1921 /// ```
1922 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1923 self.commit_sha = v.into();
1924 self
1925 }
1926
1927 /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
1928 ///
1929 /// # Example
1930 /// ```ignore,no_run
1931 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileRequest;
1932 /// let x = ReadRepositoryFileRequest::new().set_path("example");
1933 /// ```
1934 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.path = v.into();
1936 self
1937 }
1938}
1939
1940impl wkt::message::Message for ReadRepositoryFileRequest {
1941 fn typename() -> &'static str {
1942 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileRequest"
1943 }
1944}
1945
1946/// `ReadRepositoryFile` response message.
1947#[derive(Clone, Default, PartialEq)]
1948#[non_exhaustive]
1949pub struct ReadRepositoryFileResponse {
1950 /// The file's contents.
1951 pub contents: ::bytes::Bytes,
1952
1953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1954}
1955
1956impl ReadRepositoryFileResponse {
1957 pub fn new() -> Self {
1958 std::default::Default::default()
1959 }
1960
1961 /// Sets the value of [contents][crate::model::ReadRepositoryFileResponse::contents].
1962 ///
1963 /// # Example
1964 /// ```ignore,no_run
1965 /// # use google_cloud_dataform_v1::model::ReadRepositoryFileResponse;
1966 /// let x = ReadRepositoryFileResponse::new().set_contents(bytes::Bytes::from_static(b"example"));
1967 /// ```
1968 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1969 self.contents = v.into();
1970 self
1971 }
1972}
1973
1974impl wkt::message::Message for ReadRepositoryFileResponse {
1975 fn typename() -> &'static str {
1976 "type.googleapis.com/google.cloud.dataform.v1.ReadRepositoryFileResponse"
1977 }
1978}
1979
1980/// `QueryRepositoryDirectoryContents` request message.
1981#[derive(Clone, Default, PartialEq)]
1982#[non_exhaustive]
1983pub struct QueryRepositoryDirectoryContentsRequest {
1984 /// Required. The repository's name.
1985 pub name: std::string::String,
1986
1987 /// Optional. The Commit SHA for the commit to query from. If unset, the
1988 /// directory will be queried from HEAD.
1989 pub commit_sha: std::string::String,
1990
1991 /// Optional. The directory's full path including directory name, relative to
1992 /// root. If left unset, the root is used.
1993 pub path: std::string::String,
1994
1995 /// Optional. Maximum number of paths to return. The server may return fewer
1996 /// items than requested. If unspecified, the server will pick an appropriate
1997 /// default.
1998 pub page_size: i32,
1999
2000 /// Optional. Page token received from a previous
2001 /// `QueryRepositoryDirectoryContents` call. Provide this to retrieve the
2002 /// subsequent page.
2003 ///
2004 /// When paginating, all other parameters provided to
2005 /// `QueryRepositoryDirectoryContents`, with the exception of `page_size`, must
2006 /// match the call that provided the page token.
2007 pub page_token: std::string::String,
2008
2009 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2010}
2011
2012impl QueryRepositoryDirectoryContentsRequest {
2013 pub fn new() -> Self {
2014 std::default::Default::default()
2015 }
2016
2017 /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
2018 ///
2019 /// # Example
2020 /// ```ignore,no_run
2021 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2022 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_name("example");
2023 /// ```
2024 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2025 self.name = v.into();
2026 self
2027 }
2028
2029 /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
2030 ///
2031 /// # Example
2032 /// ```ignore,no_run
2033 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2034 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_commit_sha("example");
2035 /// ```
2036 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.commit_sha = v.into();
2038 self
2039 }
2040
2041 /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
2042 ///
2043 /// # Example
2044 /// ```ignore,no_run
2045 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2046 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_path("example");
2047 /// ```
2048 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2049 self.path = v.into();
2050 self
2051 }
2052
2053 /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
2054 ///
2055 /// # Example
2056 /// ```ignore,no_run
2057 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2058 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_size(42);
2059 /// ```
2060 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2061 self.page_size = v.into();
2062 self
2063 }
2064
2065 /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
2066 ///
2067 /// # Example
2068 /// ```ignore,no_run
2069 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsRequest;
2070 /// let x = QueryRepositoryDirectoryContentsRequest::new().set_page_token("example");
2071 /// ```
2072 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2073 self.page_token = v.into();
2074 self
2075 }
2076}
2077
2078impl wkt::message::Message for QueryRepositoryDirectoryContentsRequest {
2079 fn typename() -> &'static str {
2080 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsRequest"
2081 }
2082}
2083
2084/// `QueryRepositoryDirectoryContents` response message.
2085#[derive(Clone, Default, PartialEq)]
2086#[non_exhaustive]
2087pub struct QueryRepositoryDirectoryContentsResponse {
2088 /// List of entries in the directory.
2089 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
2090
2091 /// A token, which can be sent as `page_token` to retrieve the next page.
2092 /// If this field is omitted, there are no subsequent pages.
2093 pub next_page_token: std::string::String,
2094
2095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2096}
2097
2098impl QueryRepositoryDirectoryContentsResponse {
2099 pub fn new() -> Self {
2100 std::default::Default::default()
2101 }
2102
2103 /// Sets the value of [directory_entries][crate::model::QueryRepositoryDirectoryContentsResponse::directory_entries].
2104 ///
2105 /// # Example
2106 /// ```ignore,no_run
2107 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2108 /// use google_cloud_dataform_v1::model::DirectoryEntry;
2109 /// let x = QueryRepositoryDirectoryContentsResponse::new()
2110 /// .set_directory_entries([
2111 /// DirectoryEntry::default()/* use setters */,
2112 /// DirectoryEntry::default()/* use (different) setters */,
2113 /// ]);
2114 /// ```
2115 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
2116 where
2117 T: std::iter::IntoIterator<Item = V>,
2118 V: std::convert::Into<crate::model::DirectoryEntry>,
2119 {
2120 use std::iter::Iterator;
2121 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
2122 self
2123 }
2124
2125 /// Sets the value of [next_page_token][crate::model::QueryRepositoryDirectoryContentsResponse::next_page_token].
2126 ///
2127 /// # Example
2128 /// ```ignore,no_run
2129 /// # use google_cloud_dataform_v1::model::QueryRepositoryDirectoryContentsResponse;
2130 /// let x = QueryRepositoryDirectoryContentsResponse::new().set_next_page_token("example");
2131 /// ```
2132 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2133 self.next_page_token = v.into();
2134 self
2135 }
2136}
2137
2138impl wkt::message::Message for QueryRepositoryDirectoryContentsResponse {
2139 fn typename() -> &'static str {
2140 "type.googleapis.com/google.cloud.dataform.v1.QueryRepositoryDirectoryContentsResponse"
2141 }
2142}
2143
2144#[doc(hidden)]
2145impl google_cloud_gax::paginator::internal::PageableResponse
2146 for QueryRepositoryDirectoryContentsResponse
2147{
2148 type PageItem = crate::model::DirectoryEntry;
2149
2150 fn items(self) -> std::vec::Vec<Self::PageItem> {
2151 self.directory_entries
2152 }
2153
2154 fn next_page_token(&self) -> std::string::String {
2155 use std::clone::Clone;
2156 self.next_page_token.clone()
2157 }
2158}
2159
2160/// `FetchRepositoryHistory` request message.
2161#[derive(Clone, Default, PartialEq)]
2162#[non_exhaustive]
2163pub struct FetchRepositoryHistoryRequest {
2164 /// Required. The repository's name.
2165 pub name: std::string::String,
2166
2167 /// Optional. Maximum number of commits to return. The server may return fewer
2168 /// items than requested. If unspecified, the server will pick an appropriate
2169 /// default.
2170 pub page_size: i32,
2171
2172 /// Optional. Page token received from a previous `FetchRepositoryHistory`
2173 /// call. Provide this to retrieve the subsequent page.
2174 ///
2175 /// When paginating, all other parameters provided to `FetchRepositoryHistory`,
2176 /// with the exception of `page_size`, must match the call that provided the
2177 /// page token.
2178 pub page_token: std::string::String,
2179
2180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2181}
2182
2183impl FetchRepositoryHistoryRequest {
2184 pub fn new() -> Self {
2185 std::default::Default::default()
2186 }
2187
2188 /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
2189 ///
2190 /// # Example
2191 /// ```ignore,no_run
2192 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2193 /// let x = FetchRepositoryHistoryRequest::new().set_name("example");
2194 /// ```
2195 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.name = v.into();
2197 self
2198 }
2199
2200 /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
2201 ///
2202 /// # Example
2203 /// ```ignore,no_run
2204 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2205 /// let x = FetchRepositoryHistoryRequest::new().set_page_size(42);
2206 /// ```
2207 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2208 self.page_size = v.into();
2209 self
2210 }
2211
2212 /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
2213 ///
2214 /// # Example
2215 /// ```ignore,no_run
2216 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryRequest;
2217 /// let x = FetchRepositoryHistoryRequest::new().set_page_token("example");
2218 /// ```
2219 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2220 self.page_token = v.into();
2221 self
2222 }
2223}
2224
2225impl wkt::message::Message for FetchRepositoryHistoryRequest {
2226 fn typename() -> &'static str {
2227 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryRequest"
2228 }
2229}
2230
2231/// `FetchRepositoryHistory` response message.
2232#[derive(Clone, Default, PartialEq)]
2233#[non_exhaustive]
2234pub struct FetchRepositoryHistoryResponse {
2235 /// A list of commit logs, ordered by 'git log' default order.
2236 pub commits: std::vec::Vec<crate::model::CommitLogEntry>,
2237
2238 /// A token, which can be sent as `page_token` to retrieve the next page.
2239 /// If this field is omitted, there are no subsequent pages.
2240 pub next_page_token: std::string::String,
2241
2242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2243}
2244
2245impl FetchRepositoryHistoryResponse {
2246 pub fn new() -> Self {
2247 std::default::Default::default()
2248 }
2249
2250 /// Sets the value of [commits][crate::model::FetchRepositoryHistoryResponse::commits].
2251 ///
2252 /// # Example
2253 /// ```ignore,no_run
2254 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2255 /// use google_cloud_dataform_v1::model::CommitLogEntry;
2256 /// let x = FetchRepositoryHistoryResponse::new()
2257 /// .set_commits([
2258 /// CommitLogEntry::default()/* use setters */,
2259 /// CommitLogEntry::default()/* use (different) setters */,
2260 /// ]);
2261 /// ```
2262 pub fn set_commits<T, V>(mut self, v: T) -> Self
2263 where
2264 T: std::iter::IntoIterator<Item = V>,
2265 V: std::convert::Into<crate::model::CommitLogEntry>,
2266 {
2267 use std::iter::Iterator;
2268 self.commits = v.into_iter().map(|i| i.into()).collect();
2269 self
2270 }
2271
2272 /// Sets the value of [next_page_token][crate::model::FetchRepositoryHistoryResponse::next_page_token].
2273 ///
2274 /// # Example
2275 /// ```ignore,no_run
2276 /// # use google_cloud_dataform_v1::model::FetchRepositoryHistoryResponse;
2277 /// let x = FetchRepositoryHistoryResponse::new().set_next_page_token("example");
2278 /// ```
2279 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.next_page_token = v.into();
2281 self
2282 }
2283}
2284
2285impl wkt::message::Message for FetchRepositoryHistoryResponse {
2286 fn typename() -> &'static str {
2287 "type.googleapis.com/google.cloud.dataform.v1.FetchRepositoryHistoryResponse"
2288 }
2289}
2290
2291#[doc(hidden)]
2292impl google_cloud_gax::paginator::internal::PageableResponse for FetchRepositoryHistoryResponse {
2293 type PageItem = crate::model::CommitLogEntry;
2294
2295 fn items(self) -> std::vec::Vec<Self::PageItem> {
2296 self.commits
2297 }
2298
2299 fn next_page_token(&self) -> std::string::String {
2300 use std::clone::Clone;
2301 self.next_page_token.clone()
2302 }
2303}
2304
2305/// Represents a single commit log.
2306#[derive(Clone, Default, PartialEq)]
2307#[non_exhaustive]
2308pub struct CommitLogEntry {
2309 /// Commit timestamp.
2310 pub commit_time: std::option::Option<wkt::Timestamp>,
2311
2312 /// The commit SHA for this commit log entry.
2313 pub commit_sha: std::string::String,
2314
2315 /// The commit author for this commit log entry.
2316 pub author: std::option::Option<crate::model::CommitAuthor>,
2317
2318 /// The commit message for this commit log entry.
2319 pub commit_message: std::string::String,
2320
2321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl CommitLogEntry {
2325 pub fn new() -> Self {
2326 std::default::Default::default()
2327 }
2328
2329 /// Sets the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2330 ///
2331 /// # Example
2332 /// ```ignore,no_run
2333 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2334 /// use wkt::Timestamp;
2335 /// let x = CommitLogEntry::new().set_commit_time(Timestamp::default()/* use setters */);
2336 /// ```
2337 pub fn set_commit_time<T>(mut self, v: T) -> Self
2338 where
2339 T: std::convert::Into<wkt::Timestamp>,
2340 {
2341 self.commit_time = std::option::Option::Some(v.into());
2342 self
2343 }
2344
2345 /// Sets or clears the value of [commit_time][crate::model::CommitLogEntry::commit_time].
2346 ///
2347 /// # Example
2348 /// ```ignore,no_run
2349 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2350 /// use wkt::Timestamp;
2351 /// let x = CommitLogEntry::new().set_or_clear_commit_time(Some(Timestamp::default()/* use setters */));
2352 /// let x = CommitLogEntry::new().set_or_clear_commit_time(None::<Timestamp>);
2353 /// ```
2354 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
2355 where
2356 T: std::convert::Into<wkt::Timestamp>,
2357 {
2358 self.commit_time = v.map(|x| x.into());
2359 self
2360 }
2361
2362 /// Sets the value of [commit_sha][crate::model::CommitLogEntry::commit_sha].
2363 ///
2364 /// # Example
2365 /// ```ignore,no_run
2366 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2367 /// let x = CommitLogEntry::new().set_commit_sha("example");
2368 /// ```
2369 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2370 self.commit_sha = v.into();
2371 self
2372 }
2373
2374 /// Sets the value of [author][crate::model::CommitLogEntry::author].
2375 ///
2376 /// # Example
2377 /// ```ignore,no_run
2378 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2379 /// use google_cloud_dataform_v1::model::CommitAuthor;
2380 /// let x = CommitLogEntry::new().set_author(CommitAuthor::default()/* use setters */);
2381 /// ```
2382 pub fn set_author<T>(mut self, v: T) -> Self
2383 where
2384 T: std::convert::Into<crate::model::CommitAuthor>,
2385 {
2386 self.author = std::option::Option::Some(v.into());
2387 self
2388 }
2389
2390 /// Sets or clears the value of [author][crate::model::CommitLogEntry::author].
2391 ///
2392 /// # Example
2393 /// ```ignore,no_run
2394 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2395 /// use google_cloud_dataform_v1::model::CommitAuthor;
2396 /// let x = CommitLogEntry::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2397 /// let x = CommitLogEntry::new().set_or_clear_author(None::<CommitAuthor>);
2398 /// ```
2399 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2400 where
2401 T: std::convert::Into<crate::model::CommitAuthor>,
2402 {
2403 self.author = v.map(|x| x.into());
2404 self
2405 }
2406
2407 /// Sets the value of [commit_message][crate::model::CommitLogEntry::commit_message].
2408 ///
2409 /// # Example
2410 /// ```ignore,no_run
2411 /// # use google_cloud_dataform_v1::model::CommitLogEntry;
2412 /// let x = CommitLogEntry::new().set_commit_message("example");
2413 /// ```
2414 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.commit_message = v.into();
2416 self
2417 }
2418}
2419
2420impl wkt::message::Message for CommitLogEntry {
2421 fn typename() -> &'static str {
2422 "type.googleapis.com/google.cloud.dataform.v1.CommitLogEntry"
2423 }
2424}
2425
2426/// Represents a Dataform Git commit.
2427#[derive(Clone, Default, PartialEq)]
2428#[non_exhaustive]
2429pub struct CommitMetadata {
2430 /// Required. The commit's author.
2431 pub author: std::option::Option<crate::model::CommitAuthor>,
2432
2433 /// Optional. The commit's message.
2434 pub commit_message: std::string::String,
2435
2436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2437}
2438
2439impl CommitMetadata {
2440 pub fn new() -> Self {
2441 std::default::Default::default()
2442 }
2443
2444 /// Sets the value of [author][crate::model::CommitMetadata::author].
2445 ///
2446 /// # Example
2447 /// ```ignore,no_run
2448 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2449 /// use google_cloud_dataform_v1::model::CommitAuthor;
2450 /// let x = CommitMetadata::new().set_author(CommitAuthor::default()/* use setters */);
2451 /// ```
2452 pub fn set_author<T>(mut self, v: T) -> Self
2453 where
2454 T: std::convert::Into<crate::model::CommitAuthor>,
2455 {
2456 self.author = std::option::Option::Some(v.into());
2457 self
2458 }
2459
2460 /// Sets or clears the value of [author][crate::model::CommitMetadata::author].
2461 ///
2462 /// # Example
2463 /// ```ignore,no_run
2464 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2465 /// use google_cloud_dataform_v1::model::CommitAuthor;
2466 /// let x = CommitMetadata::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
2467 /// let x = CommitMetadata::new().set_or_clear_author(None::<CommitAuthor>);
2468 /// ```
2469 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
2470 where
2471 T: std::convert::Into<crate::model::CommitAuthor>,
2472 {
2473 self.author = v.map(|x| x.into());
2474 self
2475 }
2476
2477 /// Sets the value of [commit_message][crate::model::CommitMetadata::commit_message].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_dataform_v1::model::CommitMetadata;
2482 /// let x = CommitMetadata::new().set_commit_message("example");
2483 /// ```
2484 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2485 self.commit_message = v.into();
2486 self
2487 }
2488}
2489
2490impl wkt::message::Message for CommitMetadata {
2491 fn typename() -> &'static str {
2492 "type.googleapis.com/google.cloud.dataform.v1.CommitMetadata"
2493 }
2494}
2495
2496/// `ComputeRepositoryAccessTokenStatus` request message.
2497#[derive(Clone, Default, PartialEq)]
2498#[non_exhaustive]
2499pub struct ComputeRepositoryAccessTokenStatusRequest {
2500 /// Required. The repository's name.
2501 pub name: std::string::String,
2502
2503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2504}
2505
2506impl ComputeRepositoryAccessTokenStatusRequest {
2507 pub fn new() -> Self {
2508 std::default::Default::default()
2509 }
2510
2511 /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
2512 ///
2513 /// # Example
2514 /// ```ignore,no_run
2515 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusRequest;
2516 /// let x = ComputeRepositoryAccessTokenStatusRequest::new().set_name("example");
2517 /// ```
2518 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2519 self.name = v.into();
2520 self
2521 }
2522}
2523
2524impl wkt::message::Message for ComputeRepositoryAccessTokenStatusRequest {
2525 fn typename() -> &'static str {
2526 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusRequest"
2527 }
2528}
2529
2530/// `ComputeRepositoryAccessTokenStatus` response message.
2531#[derive(Clone, Default, PartialEq)]
2532#[non_exhaustive]
2533pub struct ComputeRepositoryAccessTokenStatusResponse {
2534 /// Indicates the status of the Git access token.
2535 pub token_status: crate::model::compute_repository_access_token_status_response::TokenStatus,
2536
2537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2538}
2539
2540impl ComputeRepositoryAccessTokenStatusResponse {
2541 pub fn new() -> Self {
2542 std::default::Default::default()
2543 }
2544
2545 /// Sets the value of [token_status][crate::model::ComputeRepositoryAccessTokenStatusResponse::token_status].
2546 ///
2547 /// # Example
2548 /// ```ignore,no_run
2549 /// # use google_cloud_dataform_v1::model::ComputeRepositoryAccessTokenStatusResponse;
2550 /// use google_cloud_dataform_v1::model::compute_repository_access_token_status_response::TokenStatus;
2551 /// let x0 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::NotFound);
2552 /// let x1 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Invalid);
2553 /// let x2 = ComputeRepositoryAccessTokenStatusResponse::new().set_token_status(TokenStatus::Valid);
2554 /// ```
2555 pub fn set_token_status<
2556 T: std::convert::Into<
2557 crate::model::compute_repository_access_token_status_response::TokenStatus,
2558 >,
2559 >(
2560 mut self,
2561 v: T,
2562 ) -> Self {
2563 self.token_status = v.into();
2564 self
2565 }
2566}
2567
2568impl wkt::message::Message for ComputeRepositoryAccessTokenStatusResponse {
2569 fn typename() -> &'static str {
2570 "type.googleapis.com/google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse"
2571 }
2572}
2573
2574/// Defines additional types related to [ComputeRepositoryAccessTokenStatusResponse].
2575pub mod compute_repository_access_token_status_response {
2576 #[allow(unused_imports)]
2577 use super::*;
2578
2579 /// Indicates the status of a Git authentication token.
2580 ///
2581 /// # Working with unknown values
2582 ///
2583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2584 /// additional enum variants at any time. Adding new variants is not considered
2585 /// a breaking change. Applications should write their code in anticipation of:
2586 ///
2587 /// - New values appearing in future releases of the client library, **and**
2588 /// - New values received dynamically, without application changes.
2589 ///
2590 /// Please consult the [Working with enums] section in the user guide for some
2591 /// guidelines.
2592 ///
2593 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2594 #[derive(Clone, Debug, PartialEq)]
2595 #[non_exhaustive]
2596 pub enum TokenStatus {
2597 /// Default value. This value is unused.
2598 Unspecified,
2599 /// The token could not be found in Secret Manager (or the Dataform
2600 /// Service Account did not have permission to access it).
2601 NotFound,
2602 /// The token could not be used to authenticate against the Git remote.
2603 Invalid,
2604 /// The token was used successfully to authenticate against the Git remote.
2605 Valid,
2606 /// The token is not accessible due to permission issues.
2607 PermissionDenied,
2608 /// If set, the enum was initialized with an unknown value.
2609 ///
2610 /// Applications can examine the value using [TokenStatus::value] or
2611 /// [TokenStatus::name].
2612 UnknownValue(token_status::UnknownValue),
2613 }
2614
2615 #[doc(hidden)]
2616 pub mod token_status {
2617 #[allow(unused_imports)]
2618 use super::*;
2619 #[derive(Clone, Debug, PartialEq)]
2620 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2621 }
2622
2623 impl TokenStatus {
2624 /// Gets the enum value.
2625 ///
2626 /// Returns `None` if the enum contains an unknown value deserialized from
2627 /// the string representation of enums.
2628 pub fn value(&self) -> std::option::Option<i32> {
2629 match self {
2630 Self::Unspecified => std::option::Option::Some(0),
2631 Self::NotFound => std::option::Option::Some(1),
2632 Self::Invalid => std::option::Option::Some(2),
2633 Self::Valid => std::option::Option::Some(3),
2634 Self::PermissionDenied => std::option::Option::Some(4),
2635 Self::UnknownValue(u) => u.0.value(),
2636 }
2637 }
2638
2639 /// Gets the enum value as a string.
2640 ///
2641 /// Returns `None` if the enum contains an unknown value deserialized from
2642 /// the integer representation of enums.
2643 pub fn name(&self) -> std::option::Option<&str> {
2644 match self {
2645 Self::Unspecified => std::option::Option::Some("TOKEN_STATUS_UNSPECIFIED"),
2646 Self::NotFound => std::option::Option::Some("NOT_FOUND"),
2647 Self::Invalid => std::option::Option::Some("INVALID"),
2648 Self::Valid => std::option::Option::Some("VALID"),
2649 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2650 Self::UnknownValue(u) => u.0.name(),
2651 }
2652 }
2653 }
2654
2655 impl std::default::Default for TokenStatus {
2656 fn default() -> Self {
2657 use std::convert::From;
2658 Self::from(0)
2659 }
2660 }
2661
2662 impl std::fmt::Display for TokenStatus {
2663 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2664 wkt::internal::display_enum(f, self.name(), self.value())
2665 }
2666 }
2667
2668 impl std::convert::From<i32> for TokenStatus {
2669 fn from(value: i32) -> Self {
2670 match value {
2671 0 => Self::Unspecified,
2672 1 => Self::NotFound,
2673 2 => Self::Invalid,
2674 3 => Self::Valid,
2675 4 => Self::PermissionDenied,
2676 _ => Self::UnknownValue(token_status::UnknownValue(
2677 wkt::internal::UnknownEnumValue::Integer(value),
2678 )),
2679 }
2680 }
2681 }
2682
2683 impl std::convert::From<&str> for TokenStatus {
2684 fn from(value: &str) -> Self {
2685 use std::string::ToString;
2686 match value {
2687 "TOKEN_STATUS_UNSPECIFIED" => Self::Unspecified,
2688 "NOT_FOUND" => Self::NotFound,
2689 "INVALID" => Self::Invalid,
2690 "VALID" => Self::Valid,
2691 "PERMISSION_DENIED" => Self::PermissionDenied,
2692 _ => Self::UnknownValue(token_status::UnknownValue(
2693 wkt::internal::UnknownEnumValue::String(value.to_string()),
2694 )),
2695 }
2696 }
2697 }
2698
2699 impl serde::ser::Serialize for TokenStatus {
2700 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2701 where
2702 S: serde::Serializer,
2703 {
2704 match self {
2705 Self::Unspecified => serializer.serialize_i32(0),
2706 Self::NotFound => serializer.serialize_i32(1),
2707 Self::Invalid => serializer.serialize_i32(2),
2708 Self::Valid => serializer.serialize_i32(3),
2709 Self::PermissionDenied => serializer.serialize_i32(4),
2710 Self::UnknownValue(u) => u.0.serialize(serializer),
2711 }
2712 }
2713 }
2714
2715 impl<'de> serde::de::Deserialize<'de> for TokenStatus {
2716 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2717 where
2718 D: serde::Deserializer<'de>,
2719 {
2720 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TokenStatus>::new(
2721 ".google.cloud.dataform.v1.ComputeRepositoryAccessTokenStatusResponse.TokenStatus",
2722 ))
2723 }
2724 }
2725}
2726
2727/// `FetchRemoteBranches` request message.
2728#[derive(Clone, Default, PartialEq)]
2729#[non_exhaustive]
2730pub struct FetchRemoteBranchesRequest {
2731 /// Required. The repository's name.
2732 pub name: std::string::String,
2733
2734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2735}
2736
2737impl FetchRemoteBranchesRequest {
2738 pub fn new() -> Self {
2739 std::default::Default::default()
2740 }
2741
2742 /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
2743 ///
2744 /// # Example
2745 /// ```ignore,no_run
2746 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesRequest;
2747 /// let x = FetchRemoteBranchesRequest::new().set_name("example");
2748 /// ```
2749 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.name = v.into();
2751 self
2752 }
2753}
2754
2755impl wkt::message::Message for FetchRemoteBranchesRequest {
2756 fn typename() -> &'static str {
2757 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesRequest"
2758 }
2759}
2760
2761/// `FetchRemoteBranches` response message.
2762#[derive(Clone, Default, PartialEq)]
2763#[non_exhaustive]
2764pub struct FetchRemoteBranchesResponse {
2765 /// The remote repository's branch names.
2766 pub branches: std::vec::Vec<std::string::String>,
2767
2768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2769}
2770
2771impl FetchRemoteBranchesResponse {
2772 pub fn new() -> Self {
2773 std::default::Default::default()
2774 }
2775
2776 /// Sets the value of [branches][crate::model::FetchRemoteBranchesResponse::branches].
2777 ///
2778 /// # Example
2779 /// ```ignore,no_run
2780 /// # use google_cloud_dataform_v1::model::FetchRemoteBranchesResponse;
2781 /// let x = FetchRemoteBranchesResponse::new().set_branches(["a", "b", "c"]);
2782 /// ```
2783 pub fn set_branches<T, V>(mut self, v: T) -> Self
2784 where
2785 T: std::iter::IntoIterator<Item = V>,
2786 V: std::convert::Into<std::string::String>,
2787 {
2788 use std::iter::Iterator;
2789 self.branches = v.into_iter().map(|i| i.into()).collect();
2790 self
2791 }
2792}
2793
2794impl wkt::message::Message for FetchRemoteBranchesResponse {
2795 fn typename() -> &'static str {
2796 "type.googleapis.com/google.cloud.dataform.v1.FetchRemoteBranchesResponse"
2797 }
2798}
2799
2800/// Represents a Dataform Git workspace.
2801#[derive(Clone, Default, PartialEq)]
2802#[non_exhaustive]
2803pub struct Workspace {
2804 /// Identifier. The workspace's name.
2805 pub name: std::string::String,
2806
2807 /// Output only. The timestamp of when the workspace was created.
2808 pub create_time: std::option::Option<wkt::Timestamp>,
2809
2810 /// Output only. A data encryption state of a Git repository if this Workspace
2811 /// is protected by a KMS key.
2812 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
2813
2814 /// Output only. All the metadata information that is used internally to serve
2815 /// the resource. For example: timestamps, flags, status fields, etc. The
2816 /// format of this field is a JSON string.
2817 pub internal_metadata: std::option::Option<std::string::String>,
2818
2819 /// Optional. If set to true, workspaces will not be moved if its linked
2820 /// Repository is moved. Instead, it will be deleted.
2821 pub disable_moves: std::option::Option<bool>,
2822
2823 /// Output only. Metadata indicating whether this resource is user-scoped. For
2824 /// `Workspace` resources, the `user_scoped` field is always `true`.
2825 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
2826
2827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2828}
2829
2830impl Workspace {
2831 pub fn new() -> Self {
2832 std::default::Default::default()
2833 }
2834
2835 /// Sets the value of [name][crate::model::Workspace::name].
2836 ///
2837 /// # Example
2838 /// ```ignore,no_run
2839 /// # use google_cloud_dataform_v1::model::Workspace;
2840 /// let x = Workspace::new().set_name("example");
2841 /// ```
2842 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2843 self.name = v.into();
2844 self
2845 }
2846
2847 /// Sets the value of [create_time][crate::model::Workspace::create_time].
2848 ///
2849 /// # Example
2850 /// ```ignore,no_run
2851 /// # use google_cloud_dataform_v1::model::Workspace;
2852 /// use wkt::Timestamp;
2853 /// let x = Workspace::new().set_create_time(Timestamp::default()/* use setters */);
2854 /// ```
2855 pub fn set_create_time<T>(mut self, v: T) -> Self
2856 where
2857 T: std::convert::Into<wkt::Timestamp>,
2858 {
2859 self.create_time = std::option::Option::Some(v.into());
2860 self
2861 }
2862
2863 /// Sets or clears the value of [create_time][crate::model::Workspace::create_time].
2864 ///
2865 /// # Example
2866 /// ```ignore,no_run
2867 /// # use google_cloud_dataform_v1::model::Workspace;
2868 /// use wkt::Timestamp;
2869 /// let x = Workspace::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2870 /// let x = Workspace::new().set_or_clear_create_time(None::<Timestamp>);
2871 /// ```
2872 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2873 where
2874 T: std::convert::Into<wkt::Timestamp>,
2875 {
2876 self.create_time = v.map(|x| x.into());
2877 self
2878 }
2879
2880 /// Sets the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
2881 ///
2882 /// # Example
2883 /// ```ignore,no_run
2884 /// # use google_cloud_dataform_v1::model::Workspace;
2885 /// use google_cloud_dataform_v1::model::DataEncryptionState;
2886 /// let x = Workspace::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
2887 /// ```
2888 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
2889 where
2890 T: std::convert::Into<crate::model::DataEncryptionState>,
2891 {
2892 self.data_encryption_state = std::option::Option::Some(v.into());
2893 self
2894 }
2895
2896 /// Sets or clears the value of [data_encryption_state][crate::model::Workspace::data_encryption_state].
2897 ///
2898 /// # Example
2899 /// ```ignore,no_run
2900 /// # use google_cloud_dataform_v1::model::Workspace;
2901 /// use google_cloud_dataform_v1::model::DataEncryptionState;
2902 /// let x = Workspace::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
2903 /// let x = Workspace::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
2904 /// ```
2905 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
2906 where
2907 T: std::convert::Into<crate::model::DataEncryptionState>,
2908 {
2909 self.data_encryption_state = v.map(|x| x.into());
2910 self
2911 }
2912
2913 /// Sets the value of [internal_metadata][crate::model::Workspace::internal_metadata].
2914 ///
2915 /// # Example
2916 /// ```ignore,no_run
2917 /// # use google_cloud_dataform_v1::model::Workspace;
2918 /// let x = Workspace::new().set_internal_metadata("example");
2919 /// ```
2920 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
2921 where
2922 T: std::convert::Into<std::string::String>,
2923 {
2924 self.internal_metadata = std::option::Option::Some(v.into());
2925 self
2926 }
2927
2928 /// Sets or clears the value of [internal_metadata][crate::model::Workspace::internal_metadata].
2929 ///
2930 /// # Example
2931 /// ```ignore,no_run
2932 /// # use google_cloud_dataform_v1::model::Workspace;
2933 /// let x = Workspace::new().set_or_clear_internal_metadata(Some("example"));
2934 /// let x = Workspace::new().set_or_clear_internal_metadata(None::<String>);
2935 /// ```
2936 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2937 where
2938 T: std::convert::Into<std::string::String>,
2939 {
2940 self.internal_metadata = v.map(|x| x.into());
2941 self
2942 }
2943
2944 /// Sets the value of [disable_moves][crate::model::Workspace::disable_moves].
2945 ///
2946 /// # Example
2947 /// ```ignore,no_run
2948 /// # use google_cloud_dataform_v1::model::Workspace;
2949 /// let x = Workspace::new().set_disable_moves(true);
2950 /// ```
2951 pub fn set_disable_moves<T>(mut self, v: T) -> Self
2952 where
2953 T: std::convert::Into<bool>,
2954 {
2955 self.disable_moves = std::option::Option::Some(v.into());
2956 self
2957 }
2958
2959 /// Sets or clears the value of [disable_moves][crate::model::Workspace::disable_moves].
2960 ///
2961 /// # Example
2962 /// ```ignore,no_run
2963 /// # use google_cloud_dataform_v1::model::Workspace;
2964 /// let x = Workspace::new().set_or_clear_disable_moves(Some(false));
2965 /// let x = Workspace::new().set_or_clear_disable_moves(None::<bool>);
2966 /// ```
2967 pub fn set_or_clear_disable_moves<T>(mut self, v: std::option::Option<T>) -> Self
2968 where
2969 T: std::convert::Into<bool>,
2970 {
2971 self.disable_moves = v.map(|x| x.into());
2972 self
2973 }
2974
2975 /// Sets the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
2976 ///
2977 /// # Example
2978 /// ```ignore,no_run
2979 /// # use google_cloud_dataform_v1::model::Workspace;
2980 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
2981 /// let x = Workspace::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
2982 /// ```
2983 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
2984 where
2985 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
2986 {
2987 self.private_resource_metadata = std::option::Option::Some(v.into());
2988 self
2989 }
2990
2991 /// Sets or clears the value of [private_resource_metadata][crate::model::Workspace::private_resource_metadata].
2992 ///
2993 /// # Example
2994 /// ```ignore,no_run
2995 /// # use google_cloud_dataform_v1::model::Workspace;
2996 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
2997 /// let x = Workspace::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
2998 /// let x = Workspace::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
2999 /// ```
3000 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3001 where
3002 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
3003 {
3004 self.private_resource_metadata = v.map(|x| x.into());
3005 self
3006 }
3007}
3008
3009impl wkt::message::Message for Workspace {
3010 fn typename() -> &'static str {
3011 "type.googleapis.com/google.cloud.dataform.v1.Workspace"
3012 }
3013}
3014
3015/// `ListWorkspaces` request message.
3016#[derive(Clone, Default, PartialEq)]
3017#[non_exhaustive]
3018pub struct ListWorkspacesRequest {
3019 /// Required. The repository in which to list workspaces. Must be in the
3020 /// format `projects/*/locations/*/repositories/*`.
3021 pub parent: std::string::String,
3022
3023 /// Optional. Maximum number of workspaces to return. The server may return
3024 /// fewer items than requested. If unspecified, the server will pick an
3025 /// appropriate default.
3026 pub page_size: i32,
3027
3028 /// Optional. Page token received from a previous `ListWorkspaces` call.
3029 /// Provide this to retrieve the subsequent page.
3030 ///
3031 /// When paginating, all other parameters provided to `ListWorkspaces`, with
3032 /// the exception of `page_size`, must match the call that provided the page
3033 /// token.
3034 pub page_token: std::string::String,
3035
3036 /// Optional. This field only supports ordering by `name`. If unspecified, the
3037 /// server will choose the ordering. If specified, the default order is
3038 /// ascending for the `name` field.
3039 pub order_by: std::string::String,
3040
3041 /// Optional. Filter for the returned list.
3042 pub filter: std::string::String,
3043
3044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3045}
3046
3047impl ListWorkspacesRequest {
3048 pub fn new() -> Self {
3049 std::default::Default::default()
3050 }
3051
3052 /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
3053 ///
3054 /// # Example
3055 /// ```ignore,no_run
3056 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3057 /// let x = ListWorkspacesRequest::new().set_parent("example");
3058 /// ```
3059 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3060 self.parent = v.into();
3061 self
3062 }
3063
3064 /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
3065 ///
3066 /// # Example
3067 /// ```ignore,no_run
3068 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3069 /// let x = ListWorkspacesRequest::new().set_page_size(42);
3070 /// ```
3071 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3072 self.page_size = v.into();
3073 self
3074 }
3075
3076 /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
3077 ///
3078 /// # Example
3079 /// ```ignore,no_run
3080 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3081 /// let x = ListWorkspacesRequest::new().set_page_token("example");
3082 /// ```
3083 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3084 self.page_token = v.into();
3085 self
3086 }
3087
3088 /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
3089 ///
3090 /// # Example
3091 /// ```ignore,no_run
3092 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3093 /// let x = ListWorkspacesRequest::new().set_order_by("example");
3094 /// ```
3095 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3096 self.order_by = v.into();
3097 self
3098 }
3099
3100 /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
3101 ///
3102 /// # Example
3103 /// ```ignore,no_run
3104 /// # use google_cloud_dataform_v1::model::ListWorkspacesRequest;
3105 /// let x = ListWorkspacesRequest::new().set_filter("example");
3106 /// ```
3107 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3108 self.filter = v.into();
3109 self
3110 }
3111}
3112
3113impl wkt::message::Message for ListWorkspacesRequest {
3114 fn typename() -> &'static str {
3115 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesRequest"
3116 }
3117}
3118
3119/// `ListWorkspaces` response message.
3120#[derive(Clone, Default, PartialEq)]
3121#[non_exhaustive]
3122pub struct ListWorkspacesResponse {
3123 /// List of workspaces.
3124 pub workspaces: std::vec::Vec<crate::model::Workspace>,
3125
3126 /// A token, which can be sent as `page_token` to retrieve the next page.
3127 /// If this field is omitted, there are no subsequent pages.
3128 pub next_page_token: std::string::String,
3129
3130 /// Locations which could not be reached.
3131 pub unreachable: std::vec::Vec<std::string::String>,
3132
3133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3134}
3135
3136impl ListWorkspacesResponse {
3137 pub fn new() -> Self {
3138 std::default::Default::default()
3139 }
3140
3141 /// Sets the value of [workspaces][crate::model::ListWorkspacesResponse::workspaces].
3142 ///
3143 /// # Example
3144 /// ```ignore,no_run
3145 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3146 /// use google_cloud_dataform_v1::model::Workspace;
3147 /// let x = ListWorkspacesResponse::new()
3148 /// .set_workspaces([
3149 /// Workspace::default()/* use setters */,
3150 /// Workspace::default()/* use (different) setters */,
3151 /// ]);
3152 /// ```
3153 pub fn set_workspaces<T, V>(mut self, v: T) -> Self
3154 where
3155 T: std::iter::IntoIterator<Item = V>,
3156 V: std::convert::Into<crate::model::Workspace>,
3157 {
3158 use std::iter::Iterator;
3159 self.workspaces = v.into_iter().map(|i| i.into()).collect();
3160 self
3161 }
3162
3163 /// Sets the value of [next_page_token][crate::model::ListWorkspacesResponse::next_page_token].
3164 ///
3165 /// # Example
3166 /// ```ignore,no_run
3167 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3168 /// let x = ListWorkspacesResponse::new().set_next_page_token("example");
3169 /// ```
3170 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3171 self.next_page_token = v.into();
3172 self
3173 }
3174
3175 /// Sets the value of [unreachable][crate::model::ListWorkspacesResponse::unreachable].
3176 ///
3177 /// # Example
3178 /// ```ignore,no_run
3179 /// # use google_cloud_dataform_v1::model::ListWorkspacesResponse;
3180 /// let x = ListWorkspacesResponse::new().set_unreachable(["a", "b", "c"]);
3181 /// ```
3182 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3183 where
3184 T: std::iter::IntoIterator<Item = V>,
3185 V: std::convert::Into<std::string::String>,
3186 {
3187 use std::iter::Iterator;
3188 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3189 self
3190 }
3191}
3192
3193impl wkt::message::Message for ListWorkspacesResponse {
3194 fn typename() -> &'static str {
3195 "type.googleapis.com/google.cloud.dataform.v1.ListWorkspacesResponse"
3196 }
3197}
3198
3199#[doc(hidden)]
3200impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkspacesResponse {
3201 type PageItem = crate::model::Workspace;
3202
3203 fn items(self) -> std::vec::Vec<Self::PageItem> {
3204 self.workspaces
3205 }
3206
3207 fn next_page_token(&self) -> std::string::String {
3208 use std::clone::Clone;
3209 self.next_page_token.clone()
3210 }
3211}
3212
3213/// `GetWorkspace` request message.
3214#[derive(Clone, Default, PartialEq)]
3215#[non_exhaustive]
3216pub struct GetWorkspaceRequest {
3217 /// Required. The workspace's name.
3218 pub name: std::string::String,
3219
3220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3221}
3222
3223impl GetWorkspaceRequest {
3224 pub fn new() -> Self {
3225 std::default::Default::default()
3226 }
3227
3228 /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
3229 ///
3230 /// # Example
3231 /// ```ignore,no_run
3232 /// # use google_cloud_dataform_v1::model::GetWorkspaceRequest;
3233 /// let x = GetWorkspaceRequest::new().set_name("example");
3234 /// ```
3235 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3236 self.name = v.into();
3237 self
3238 }
3239}
3240
3241impl wkt::message::Message for GetWorkspaceRequest {
3242 fn typename() -> &'static str {
3243 "type.googleapis.com/google.cloud.dataform.v1.GetWorkspaceRequest"
3244 }
3245}
3246
3247/// `CreateWorkspace` request message.
3248#[derive(Clone, Default, PartialEq)]
3249#[non_exhaustive]
3250pub struct CreateWorkspaceRequest {
3251 /// Required. The repository in which to create the workspace. Must be in the
3252 /// format `projects/*/locations/*/repositories/*`.
3253 pub parent: std::string::String,
3254
3255 /// Required. The workspace to create.
3256 pub workspace: std::option::Option<crate::model::Workspace>,
3257
3258 /// Required. The ID to use for the workspace, which will become the final
3259 /// component of the workspace's resource name.
3260 pub workspace_id: std::string::String,
3261
3262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3263}
3264
3265impl CreateWorkspaceRequest {
3266 pub fn new() -> Self {
3267 std::default::Default::default()
3268 }
3269
3270 /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3275 /// let x = CreateWorkspaceRequest::new().set_parent("example");
3276 /// ```
3277 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.parent = v.into();
3279 self
3280 }
3281
3282 /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3283 ///
3284 /// # Example
3285 /// ```ignore,no_run
3286 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3287 /// use google_cloud_dataform_v1::model::Workspace;
3288 /// let x = CreateWorkspaceRequest::new().set_workspace(Workspace::default()/* use setters */);
3289 /// ```
3290 pub fn set_workspace<T>(mut self, v: T) -> Self
3291 where
3292 T: std::convert::Into<crate::model::Workspace>,
3293 {
3294 self.workspace = std::option::Option::Some(v.into());
3295 self
3296 }
3297
3298 /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
3299 ///
3300 /// # Example
3301 /// ```ignore,no_run
3302 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3303 /// use google_cloud_dataform_v1::model::Workspace;
3304 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(Some(Workspace::default()/* use setters */));
3305 /// let x = CreateWorkspaceRequest::new().set_or_clear_workspace(None::<Workspace>);
3306 /// ```
3307 pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
3308 where
3309 T: std::convert::Into<crate::model::Workspace>,
3310 {
3311 self.workspace = v.map(|x| x.into());
3312 self
3313 }
3314
3315 /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
3316 ///
3317 /// # Example
3318 /// ```ignore,no_run
3319 /// # use google_cloud_dataform_v1::model::CreateWorkspaceRequest;
3320 /// let x = CreateWorkspaceRequest::new().set_workspace_id("example");
3321 /// ```
3322 pub fn set_workspace_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3323 self.workspace_id = v.into();
3324 self
3325 }
3326}
3327
3328impl wkt::message::Message for CreateWorkspaceRequest {
3329 fn typename() -> &'static str {
3330 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkspaceRequest"
3331 }
3332}
3333
3334/// `DeleteWorkspace` request message.
3335#[derive(Clone, Default, PartialEq)]
3336#[non_exhaustive]
3337pub struct DeleteWorkspaceRequest {
3338 /// Required. The workspace resource's name.
3339 pub name: std::string::String,
3340
3341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3342}
3343
3344impl DeleteWorkspaceRequest {
3345 pub fn new() -> Self {
3346 std::default::Default::default()
3347 }
3348
3349 /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_dataform_v1::model::DeleteWorkspaceRequest;
3354 /// let x = DeleteWorkspaceRequest::new().set_name("example");
3355 /// ```
3356 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.name = v.into();
3358 self
3359 }
3360}
3361
3362impl wkt::message::Message for DeleteWorkspaceRequest {
3363 fn typename() -> &'static str {
3364 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkspaceRequest"
3365 }
3366}
3367
3368/// Represents the author of a Git commit.
3369#[derive(Clone, Default, PartialEq)]
3370#[non_exhaustive]
3371pub struct CommitAuthor {
3372 /// Required. The commit author's name.
3373 pub name: std::string::String,
3374
3375 /// Required. The commit author's email address.
3376 pub email_address: std::string::String,
3377
3378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl CommitAuthor {
3382 pub fn new() -> Self {
3383 std::default::Default::default()
3384 }
3385
3386 /// Sets the value of [name][crate::model::CommitAuthor::name].
3387 ///
3388 /// # Example
3389 /// ```ignore,no_run
3390 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3391 /// let x = CommitAuthor::new().set_name("example");
3392 /// ```
3393 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3394 self.name = v.into();
3395 self
3396 }
3397
3398 /// Sets the value of [email_address][crate::model::CommitAuthor::email_address].
3399 ///
3400 /// # Example
3401 /// ```ignore,no_run
3402 /// # use google_cloud_dataform_v1::model::CommitAuthor;
3403 /// let x = CommitAuthor::new().set_email_address("example");
3404 /// ```
3405 pub fn set_email_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3406 self.email_address = v.into();
3407 self
3408 }
3409}
3410
3411impl wkt::message::Message for CommitAuthor {
3412 fn typename() -> &'static str {
3413 "type.googleapis.com/google.cloud.dataform.v1.CommitAuthor"
3414 }
3415}
3416
3417/// `PullGitCommits` request message.
3418#[derive(Clone, Default, PartialEq)]
3419#[non_exhaustive]
3420pub struct PullGitCommitsRequest {
3421 /// Required. The workspace's name.
3422 pub name: std::string::String,
3423
3424 /// Optional. The name of the branch in the Git remote from which to pull
3425 /// commits. If left unset, the repository's default branch name will be used.
3426 pub remote_branch: std::string::String,
3427
3428 /// Required. The author of any merge commit which may be created as a result
3429 /// of merging fetched Git commits into this workspace.
3430 pub author: std::option::Option<crate::model::CommitAuthor>,
3431
3432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3433}
3434
3435impl PullGitCommitsRequest {
3436 pub fn new() -> Self {
3437 std::default::Default::default()
3438 }
3439
3440 /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
3441 ///
3442 /// # Example
3443 /// ```ignore,no_run
3444 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3445 /// let x = PullGitCommitsRequest::new().set_name("example");
3446 /// ```
3447 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.name = v.into();
3449 self
3450 }
3451
3452 /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
3453 ///
3454 /// # Example
3455 /// ```ignore,no_run
3456 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3457 /// let x = PullGitCommitsRequest::new().set_remote_branch("example");
3458 /// ```
3459 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.remote_branch = v.into();
3461 self
3462 }
3463
3464 /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
3465 ///
3466 /// # Example
3467 /// ```ignore,no_run
3468 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3469 /// use google_cloud_dataform_v1::model::CommitAuthor;
3470 /// let x = PullGitCommitsRequest::new().set_author(CommitAuthor::default()/* use setters */);
3471 /// ```
3472 pub fn set_author<T>(mut self, v: T) -> Self
3473 where
3474 T: std::convert::Into<crate::model::CommitAuthor>,
3475 {
3476 self.author = std::option::Option::Some(v.into());
3477 self
3478 }
3479
3480 /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_dataform_v1::model::PullGitCommitsRequest;
3485 /// use google_cloud_dataform_v1::model::CommitAuthor;
3486 /// let x = PullGitCommitsRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
3487 /// let x = PullGitCommitsRequest::new().set_or_clear_author(None::<CommitAuthor>);
3488 /// ```
3489 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
3490 where
3491 T: std::convert::Into<crate::model::CommitAuthor>,
3492 {
3493 self.author = v.map(|x| x.into());
3494 self
3495 }
3496}
3497
3498impl wkt::message::Message for PullGitCommitsRequest {
3499 fn typename() -> &'static str {
3500 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsRequest"
3501 }
3502}
3503
3504/// `PullGitCommits` response message.
3505#[derive(Clone, Default, PartialEq)]
3506#[non_exhaustive]
3507pub struct PullGitCommitsResponse {
3508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3509}
3510
3511impl PullGitCommitsResponse {
3512 pub fn new() -> Self {
3513 std::default::Default::default()
3514 }
3515}
3516
3517impl wkt::message::Message for PullGitCommitsResponse {
3518 fn typename() -> &'static str {
3519 "type.googleapis.com/google.cloud.dataform.v1.PullGitCommitsResponse"
3520 }
3521}
3522
3523/// `PushGitCommits` request message.
3524#[derive(Clone, Default, PartialEq)]
3525#[non_exhaustive]
3526pub struct PushGitCommitsRequest {
3527 /// Required. The workspace's name.
3528 pub name: std::string::String,
3529
3530 /// Optional. The name of the branch in the Git remote to which commits should
3531 /// be pushed. If left unset, the repository's default branch name will be
3532 /// used.
3533 pub remote_branch: std::string::String,
3534
3535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3536}
3537
3538impl PushGitCommitsRequest {
3539 pub fn new() -> Self {
3540 std::default::Default::default()
3541 }
3542
3543 /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
3544 ///
3545 /// # Example
3546 /// ```ignore,no_run
3547 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3548 /// let x = PushGitCommitsRequest::new().set_name("example");
3549 /// ```
3550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3551 self.name = v.into();
3552 self
3553 }
3554
3555 /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
3556 ///
3557 /// # Example
3558 /// ```ignore,no_run
3559 /// # use google_cloud_dataform_v1::model::PushGitCommitsRequest;
3560 /// let x = PushGitCommitsRequest::new().set_remote_branch("example");
3561 /// ```
3562 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3563 self.remote_branch = v.into();
3564 self
3565 }
3566}
3567
3568impl wkt::message::Message for PushGitCommitsRequest {
3569 fn typename() -> &'static str {
3570 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsRequest"
3571 }
3572}
3573
3574/// `PushGitCommits` response message.
3575#[derive(Clone, Default, PartialEq)]
3576#[non_exhaustive]
3577pub struct PushGitCommitsResponse {
3578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3579}
3580
3581impl PushGitCommitsResponse {
3582 pub fn new() -> Self {
3583 std::default::Default::default()
3584 }
3585}
3586
3587impl wkt::message::Message for PushGitCommitsResponse {
3588 fn typename() -> &'static str {
3589 "type.googleapis.com/google.cloud.dataform.v1.PushGitCommitsResponse"
3590 }
3591}
3592
3593/// `FetchFileGitStatuses` request message.
3594#[derive(Clone, Default, PartialEq)]
3595#[non_exhaustive]
3596pub struct FetchFileGitStatusesRequest {
3597 /// Required. The workspace's name.
3598 pub name: std::string::String,
3599
3600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3601}
3602
3603impl FetchFileGitStatusesRequest {
3604 pub fn new() -> Self {
3605 std::default::Default::default()
3606 }
3607
3608 /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
3609 ///
3610 /// # Example
3611 /// ```ignore,no_run
3612 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesRequest;
3613 /// let x = FetchFileGitStatusesRequest::new().set_name("example");
3614 /// ```
3615 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3616 self.name = v.into();
3617 self
3618 }
3619}
3620
3621impl wkt::message::Message for FetchFileGitStatusesRequest {
3622 fn typename() -> &'static str {
3623 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesRequest"
3624 }
3625}
3626
3627/// `FetchFileGitStatuses` response message.
3628#[derive(Clone, Default, PartialEq)]
3629#[non_exhaustive]
3630pub struct FetchFileGitStatusesResponse {
3631 /// A list of all files which have uncommitted Git changes. There will only be
3632 /// a single entry for any given file.
3633 pub uncommitted_file_changes:
3634 std::vec::Vec<crate::model::fetch_file_git_statuses_response::UncommittedFileChange>,
3635
3636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3637}
3638
3639impl FetchFileGitStatusesResponse {
3640 pub fn new() -> Self {
3641 std::default::Default::default()
3642 }
3643
3644 /// Sets the value of [uncommitted_file_changes][crate::model::FetchFileGitStatusesResponse::uncommitted_file_changes].
3645 ///
3646 /// # Example
3647 /// ```ignore,no_run
3648 /// # use google_cloud_dataform_v1::model::FetchFileGitStatusesResponse;
3649 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3650 /// let x = FetchFileGitStatusesResponse::new()
3651 /// .set_uncommitted_file_changes([
3652 /// UncommittedFileChange::default()/* use setters */,
3653 /// UncommittedFileChange::default()/* use (different) setters */,
3654 /// ]);
3655 /// ```
3656 pub fn set_uncommitted_file_changes<T, V>(mut self, v: T) -> Self
3657 where
3658 T: std::iter::IntoIterator<Item = V>,
3659 V: std::convert::Into<
3660 crate::model::fetch_file_git_statuses_response::UncommittedFileChange,
3661 >,
3662 {
3663 use std::iter::Iterator;
3664 self.uncommitted_file_changes = v.into_iter().map(|i| i.into()).collect();
3665 self
3666 }
3667}
3668
3669impl wkt::message::Message for FetchFileGitStatusesResponse {
3670 fn typename() -> &'static str {
3671 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse"
3672 }
3673}
3674
3675/// Defines additional types related to [FetchFileGitStatusesResponse].
3676pub mod fetch_file_git_statuses_response {
3677 #[allow(unused_imports)]
3678 use super::*;
3679
3680 /// Represents the Git state of a file with uncommitted changes.
3681 #[derive(Clone, Default, PartialEq)]
3682 #[non_exhaustive]
3683 pub struct UncommittedFileChange {
3684 /// The file's full path including filename, relative to the workspace root.
3685 pub path: std::string::String,
3686
3687 /// Output only. Indicates the status of the file.
3688 pub state: crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
3689
3690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3691 }
3692
3693 impl UncommittedFileChange {
3694 pub fn new() -> Self {
3695 std::default::Default::default()
3696 }
3697
3698 /// Sets the value of [path][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::path].
3699 ///
3700 /// # Example
3701 /// ```ignore,no_run
3702 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3703 /// let x = UncommittedFileChange::new().set_path("example");
3704 /// ```
3705 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3706 self.path = v.into();
3707 self
3708 }
3709
3710 /// Sets the value of [state][crate::model::fetch_file_git_statuses_response::UncommittedFileChange::state].
3711 ///
3712 /// # Example
3713 /// ```ignore,no_run
3714 /// # use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::UncommittedFileChange;
3715 /// use google_cloud_dataform_v1::model::fetch_file_git_statuses_response::uncommitted_file_change::State;
3716 /// let x0 = UncommittedFileChange::new().set_state(State::Added);
3717 /// let x1 = UncommittedFileChange::new().set_state(State::Deleted);
3718 /// let x2 = UncommittedFileChange::new().set_state(State::Modified);
3719 /// ```
3720 pub fn set_state<
3721 T: std::convert::Into<
3722 crate::model::fetch_file_git_statuses_response::uncommitted_file_change::State,
3723 >,
3724 >(
3725 mut self,
3726 v: T,
3727 ) -> Self {
3728 self.state = v.into();
3729 self
3730 }
3731 }
3732
3733 impl wkt::message::Message for UncommittedFileChange {
3734 fn typename() -> &'static str {
3735 "type.googleapis.com/google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange"
3736 }
3737 }
3738
3739 /// Defines additional types related to [UncommittedFileChange].
3740 pub mod uncommitted_file_change {
3741 #[allow(unused_imports)]
3742 use super::*;
3743
3744 /// Indicates the status of an uncommitted file change.
3745 ///
3746 /// # Working with unknown values
3747 ///
3748 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3749 /// additional enum variants at any time. Adding new variants is not considered
3750 /// a breaking change. Applications should write their code in anticipation of:
3751 ///
3752 /// - New values appearing in future releases of the client library, **and**
3753 /// - New values received dynamically, without application changes.
3754 ///
3755 /// Please consult the [Working with enums] section in the user guide for some
3756 /// guidelines.
3757 ///
3758 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3759 #[derive(Clone, Debug, PartialEq)]
3760 #[non_exhaustive]
3761 pub enum State {
3762 /// Default value. This value is unused.
3763 Unspecified,
3764 /// The file has been newly added.
3765 Added,
3766 /// The file has been deleted.
3767 Deleted,
3768 /// The file has been modified.
3769 Modified,
3770 /// The file contains merge conflicts.
3771 HasConflicts,
3772 /// If set, the enum was initialized with an unknown value.
3773 ///
3774 /// Applications can examine the value using [State::value] or
3775 /// [State::name].
3776 UnknownValue(state::UnknownValue),
3777 }
3778
3779 #[doc(hidden)]
3780 pub mod state {
3781 #[allow(unused_imports)]
3782 use super::*;
3783 #[derive(Clone, Debug, PartialEq)]
3784 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3785 }
3786
3787 impl State {
3788 /// Gets the enum value.
3789 ///
3790 /// Returns `None` if the enum contains an unknown value deserialized from
3791 /// the string representation of enums.
3792 pub fn value(&self) -> std::option::Option<i32> {
3793 match self {
3794 Self::Unspecified => std::option::Option::Some(0),
3795 Self::Added => std::option::Option::Some(1),
3796 Self::Deleted => std::option::Option::Some(2),
3797 Self::Modified => std::option::Option::Some(3),
3798 Self::HasConflicts => std::option::Option::Some(4),
3799 Self::UnknownValue(u) => u.0.value(),
3800 }
3801 }
3802
3803 /// Gets the enum value as a string.
3804 ///
3805 /// Returns `None` if the enum contains an unknown value deserialized from
3806 /// the integer representation of enums.
3807 pub fn name(&self) -> std::option::Option<&str> {
3808 match self {
3809 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3810 Self::Added => std::option::Option::Some("ADDED"),
3811 Self::Deleted => std::option::Option::Some("DELETED"),
3812 Self::Modified => std::option::Option::Some("MODIFIED"),
3813 Self::HasConflicts => std::option::Option::Some("HAS_CONFLICTS"),
3814 Self::UnknownValue(u) => u.0.name(),
3815 }
3816 }
3817 }
3818
3819 impl std::default::Default for State {
3820 fn default() -> Self {
3821 use std::convert::From;
3822 Self::from(0)
3823 }
3824 }
3825
3826 impl std::fmt::Display for State {
3827 fn fmt(
3828 &self,
3829 f: &mut std::fmt::Formatter<'_>,
3830 ) -> std::result::Result<(), std::fmt::Error> {
3831 wkt::internal::display_enum(f, self.name(), self.value())
3832 }
3833 }
3834
3835 impl std::convert::From<i32> for State {
3836 fn from(value: i32) -> Self {
3837 match value {
3838 0 => Self::Unspecified,
3839 1 => Self::Added,
3840 2 => Self::Deleted,
3841 3 => Self::Modified,
3842 4 => Self::HasConflicts,
3843 _ => Self::UnknownValue(state::UnknownValue(
3844 wkt::internal::UnknownEnumValue::Integer(value),
3845 )),
3846 }
3847 }
3848 }
3849
3850 impl std::convert::From<&str> for State {
3851 fn from(value: &str) -> Self {
3852 use std::string::ToString;
3853 match value {
3854 "STATE_UNSPECIFIED" => Self::Unspecified,
3855 "ADDED" => Self::Added,
3856 "DELETED" => Self::Deleted,
3857 "MODIFIED" => Self::Modified,
3858 "HAS_CONFLICTS" => Self::HasConflicts,
3859 _ => Self::UnknownValue(state::UnknownValue(
3860 wkt::internal::UnknownEnumValue::String(value.to_string()),
3861 )),
3862 }
3863 }
3864 }
3865
3866 impl serde::ser::Serialize for State {
3867 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3868 where
3869 S: serde::Serializer,
3870 {
3871 match self {
3872 Self::Unspecified => serializer.serialize_i32(0),
3873 Self::Added => serializer.serialize_i32(1),
3874 Self::Deleted => serializer.serialize_i32(2),
3875 Self::Modified => serializer.serialize_i32(3),
3876 Self::HasConflicts => serializer.serialize_i32(4),
3877 Self::UnknownValue(u) => u.0.serialize(serializer),
3878 }
3879 }
3880 }
3881
3882 impl<'de> serde::de::Deserialize<'de> for State {
3883 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3884 where
3885 D: serde::Deserializer<'de>,
3886 {
3887 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3888 ".google.cloud.dataform.v1.FetchFileGitStatusesResponse.UncommittedFileChange.State"))
3889 }
3890 }
3891 }
3892}
3893
3894/// `FetchGitAheadBehind` request message.
3895#[derive(Clone, Default, PartialEq)]
3896#[non_exhaustive]
3897pub struct FetchGitAheadBehindRequest {
3898 /// Required. The workspace's name.
3899 pub name: std::string::String,
3900
3901 /// Optional. The name of the branch in the Git remote against which this
3902 /// workspace should be compared. If left unset, the repository's default
3903 /// branch name will be used.
3904 pub remote_branch: std::string::String,
3905
3906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3907}
3908
3909impl FetchGitAheadBehindRequest {
3910 pub fn new() -> Self {
3911 std::default::Default::default()
3912 }
3913
3914 /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
3915 ///
3916 /// # Example
3917 /// ```ignore,no_run
3918 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
3919 /// let x = FetchGitAheadBehindRequest::new().set_name("example");
3920 /// ```
3921 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3922 self.name = v.into();
3923 self
3924 }
3925
3926 /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
3927 ///
3928 /// # Example
3929 /// ```ignore,no_run
3930 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindRequest;
3931 /// let x = FetchGitAheadBehindRequest::new().set_remote_branch("example");
3932 /// ```
3933 pub fn set_remote_branch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3934 self.remote_branch = v.into();
3935 self
3936 }
3937}
3938
3939impl wkt::message::Message for FetchGitAheadBehindRequest {
3940 fn typename() -> &'static str {
3941 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindRequest"
3942 }
3943}
3944
3945/// `FetchGitAheadBehind` response message.
3946#[derive(Clone, Default, PartialEq)]
3947#[non_exhaustive]
3948pub struct FetchGitAheadBehindResponse {
3949 /// The number of commits in the remote branch that are not in the workspace.
3950 pub commits_ahead: i32,
3951
3952 /// The number of commits in the workspace that are not in the remote branch.
3953 pub commits_behind: i32,
3954
3955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3956}
3957
3958impl FetchGitAheadBehindResponse {
3959 pub fn new() -> Self {
3960 std::default::Default::default()
3961 }
3962
3963 /// Sets the value of [commits_ahead][crate::model::FetchGitAheadBehindResponse::commits_ahead].
3964 ///
3965 /// # Example
3966 /// ```ignore,no_run
3967 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
3968 /// let x = FetchGitAheadBehindResponse::new().set_commits_ahead(42);
3969 /// ```
3970 pub fn set_commits_ahead<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3971 self.commits_ahead = v.into();
3972 self
3973 }
3974
3975 /// Sets the value of [commits_behind][crate::model::FetchGitAheadBehindResponse::commits_behind].
3976 ///
3977 /// # Example
3978 /// ```ignore,no_run
3979 /// # use google_cloud_dataform_v1::model::FetchGitAheadBehindResponse;
3980 /// let x = FetchGitAheadBehindResponse::new().set_commits_behind(42);
3981 /// ```
3982 pub fn set_commits_behind<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3983 self.commits_behind = v.into();
3984 self
3985 }
3986}
3987
3988impl wkt::message::Message for FetchGitAheadBehindResponse {
3989 fn typename() -> &'static str {
3990 "type.googleapis.com/google.cloud.dataform.v1.FetchGitAheadBehindResponse"
3991 }
3992}
3993
3994/// `CommitWorkspaceChanges` request message.
3995#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct CommitWorkspaceChangesRequest {
3998 /// Required. The workspace's name.
3999 pub name: std::string::String,
4000
4001 /// Required. The commit's author.
4002 pub author: std::option::Option<crate::model::CommitAuthor>,
4003
4004 /// Optional. The commit's message.
4005 pub commit_message: std::string::String,
4006
4007 /// Optional. Full file paths to commit including filename, rooted at workspace
4008 /// root. If left empty, all files will be committed.
4009 pub paths: std::vec::Vec<std::string::String>,
4010
4011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4012}
4013
4014impl CommitWorkspaceChangesRequest {
4015 pub fn new() -> Self {
4016 std::default::Default::default()
4017 }
4018
4019 /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
4020 ///
4021 /// # Example
4022 /// ```ignore,no_run
4023 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4024 /// let x = CommitWorkspaceChangesRequest::new().set_name("example");
4025 /// ```
4026 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4027 self.name = v.into();
4028 self
4029 }
4030
4031 /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4036 /// use google_cloud_dataform_v1::model::CommitAuthor;
4037 /// let x = CommitWorkspaceChangesRequest::new().set_author(CommitAuthor::default()/* use setters */);
4038 /// ```
4039 pub fn set_author<T>(mut self, v: T) -> Self
4040 where
4041 T: std::convert::Into<crate::model::CommitAuthor>,
4042 {
4043 self.author = std::option::Option::Some(v.into());
4044 self
4045 }
4046
4047 /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
4048 ///
4049 /// # Example
4050 /// ```ignore,no_run
4051 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4052 /// use google_cloud_dataform_v1::model::CommitAuthor;
4053 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(Some(CommitAuthor::default()/* use setters */));
4054 /// let x = CommitWorkspaceChangesRequest::new().set_or_clear_author(None::<CommitAuthor>);
4055 /// ```
4056 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
4057 where
4058 T: std::convert::Into<crate::model::CommitAuthor>,
4059 {
4060 self.author = v.map(|x| x.into());
4061 self
4062 }
4063
4064 /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
4065 ///
4066 /// # Example
4067 /// ```ignore,no_run
4068 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4069 /// let x = CommitWorkspaceChangesRequest::new().set_commit_message("example");
4070 /// ```
4071 pub fn set_commit_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4072 self.commit_message = v.into();
4073 self
4074 }
4075
4076 /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
4077 ///
4078 /// # Example
4079 /// ```ignore,no_run
4080 /// # use google_cloud_dataform_v1::model::CommitWorkspaceChangesRequest;
4081 /// let x = CommitWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4082 /// ```
4083 pub fn set_paths<T, V>(mut self, v: T) -> Self
4084 where
4085 T: std::iter::IntoIterator<Item = V>,
4086 V: std::convert::Into<std::string::String>,
4087 {
4088 use std::iter::Iterator;
4089 self.paths = v.into_iter().map(|i| i.into()).collect();
4090 self
4091 }
4092}
4093
4094impl wkt::message::Message for CommitWorkspaceChangesRequest {
4095 fn typename() -> &'static str {
4096 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesRequest"
4097 }
4098}
4099
4100/// `CommitWorkspaceChanges` response message.
4101#[derive(Clone, Default, PartialEq)]
4102#[non_exhaustive]
4103pub struct CommitWorkspaceChangesResponse {
4104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4105}
4106
4107impl CommitWorkspaceChangesResponse {
4108 pub fn new() -> Self {
4109 std::default::Default::default()
4110 }
4111}
4112
4113impl wkt::message::Message for CommitWorkspaceChangesResponse {
4114 fn typename() -> &'static str {
4115 "type.googleapis.com/google.cloud.dataform.v1.CommitWorkspaceChangesResponse"
4116 }
4117}
4118
4119/// `ResetWorkspaceChanges` request message.
4120#[derive(Clone, Default, PartialEq)]
4121#[non_exhaustive]
4122pub struct ResetWorkspaceChangesRequest {
4123 /// Required. The workspace's name.
4124 pub name: std::string::String,
4125
4126 /// Optional. Full file paths to reset back to their committed state including
4127 /// filename, rooted at workspace root. If left empty, all files will be reset.
4128 pub paths: std::vec::Vec<std::string::String>,
4129
4130 /// Optional. If set to true, untracked files will be deleted.
4131 pub clean: bool,
4132
4133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4134}
4135
4136impl ResetWorkspaceChangesRequest {
4137 pub fn new() -> Self {
4138 std::default::Default::default()
4139 }
4140
4141 /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
4142 ///
4143 /// # Example
4144 /// ```ignore,no_run
4145 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4146 /// let x = ResetWorkspaceChangesRequest::new().set_name("example");
4147 /// ```
4148 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4149 self.name = v.into();
4150 self
4151 }
4152
4153 /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
4154 ///
4155 /// # Example
4156 /// ```ignore,no_run
4157 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4158 /// let x = ResetWorkspaceChangesRequest::new().set_paths(["a", "b", "c"]);
4159 /// ```
4160 pub fn set_paths<T, V>(mut self, v: T) -> Self
4161 where
4162 T: std::iter::IntoIterator<Item = V>,
4163 V: std::convert::Into<std::string::String>,
4164 {
4165 use std::iter::Iterator;
4166 self.paths = v.into_iter().map(|i| i.into()).collect();
4167 self
4168 }
4169
4170 /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
4171 ///
4172 /// # Example
4173 /// ```ignore,no_run
4174 /// # use google_cloud_dataform_v1::model::ResetWorkspaceChangesRequest;
4175 /// let x = ResetWorkspaceChangesRequest::new().set_clean(true);
4176 /// ```
4177 pub fn set_clean<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4178 self.clean = v.into();
4179 self
4180 }
4181}
4182
4183impl wkt::message::Message for ResetWorkspaceChangesRequest {
4184 fn typename() -> &'static str {
4185 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesRequest"
4186 }
4187}
4188
4189/// `ResetWorkspaceChanges` response message.
4190#[derive(Clone, Default, PartialEq)]
4191#[non_exhaustive]
4192pub struct ResetWorkspaceChangesResponse {
4193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4194}
4195
4196impl ResetWorkspaceChangesResponse {
4197 pub fn new() -> Self {
4198 std::default::Default::default()
4199 }
4200}
4201
4202impl wkt::message::Message for ResetWorkspaceChangesResponse {
4203 fn typename() -> &'static str {
4204 "type.googleapis.com/google.cloud.dataform.v1.ResetWorkspaceChangesResponse"
4205 }
4206}
4207
4208/// `FetchFileDiff` request message.
4209#[derive(Clone, Default, PartialEq)]
4210#[non_exhaustive]
4211pub struct FetchFileDiffRequest {
4212 /// Required. The workspace's name.
4213 pub workspace: std::string::String,
4214
4215 /// Required. The file's full path including filename, relative to the
4216 /// workspace root.
4217 pub path: std::string::String,
4218
4219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4220}
4221
4222impl FetchFileDiffRequest {
4223 pub fn new() -> Self {
4224 std::default::Default::default()
4225 }
4226
4227 /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
4228 ///
4229 /// # Example
4230 /// ```ignore,no_run
4231 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4232 /// let x = FetchFileDiffRequest::new().set_workspace("example");
4233 /// ```
4234 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4235 self.workspace = v.into();
4236 self
4237 }
4238
4239 /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
4240 ///
4241 /// # Example
4242 /// ```ignore,no_run
4243 /// # use google_cloud_dataform_v1::model::FetchFileDiffRequest;
4244 /// let x = FetchFileDiffRequest::new().set_path("example");
4245 /// ```
4246 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4247 self.path = v.into();
4248 self
4249 }
4250}
4251
4252impl wkt::message::Message for FetchFileDiffRequest {
4253 fn typename() -> &'static str {
4254 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffRequest"
4255 }
4256}
4257
4258/// `FetchFileDiff` response message.
4259#[derive(Clone, Default, PartialEq)]
4260#[non_exhaustive]
4261pub struct FetchFileDiffResponse {
4262 /// The raw formatted Git diff for the file.
4263 pub formatted_diff: std::string::String,
4264
4265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4266}
4267
4268impl FetchFileDiffResponse {
4269 pub fn new() -> Self {
4270 std::default::Default::default()
4271 }
4272
4273 /// Sets the value of [formatted_diff][crate::model::FetchFileDiffResponse::formatted_diff].
4274 ///
4275 /// # Example
4276 /// ```ignore,no_run
4277 /// # use google_cloud_dataform_v1::model::FetchFileDiffResponse;
4278 /// let x = FetchFileDiffResponse::new().set_formatted_diff("example");
4279 /// ```
4280 pub fn set_formatted_diff<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4281 self.formatted_diff = v.into();
4282 self
4283 }
4284}
4285
4286impl wkt::message::Message for FetchFileDiffResponse {
4287 fn typename() -> &'static str {
4288 "type.googleapis.com/google.cloud.dataform.v1.FetchFileDiffResponse"
4289 }
4290}
4291
4292/// `QueryDirectoryContents` request message.
4293#[derive(Clone, Default, PartialEq)]
4294#[non_exhaustive]
4295pub struct QueryDirectoryContentsRequest {
4296 /// Required. The workspace's name.
4297 pub workspace: std::string::String,
4298
4299 /// Optional. The directory's full path including directory name, relative to
4300 /// the workspace root. If left unset, the workspace root is used.
4301 pub path: std::string::String,
4302
4303 /// Optional. Maximum number of paths to return. The server may return fewer
4304 /// items than requested. If unspecified, the server will pick an appropriate
4305 /// default.
4306 pub page_size: i32,
4307
4308 /// Optional. Page token received from a previous `QueryDirectoryContents`
4309 /// call. Provide this to retrieve the subsequent page.
4310 ///
4311 /// When paginating, all other parameters provided to
4312 /// `QueryDirectoryContents`, with the exception of `page_size`, must match the
4313 /// call that provided the page token.
4314 pub page_token: std::string::String,
4315
4316 /// Optional. Specifies the metadata to return for each directory entry.
4317 /// If unspecified, the default is `DIRECTORY_CONTENTS_VIEW_BASIC`.
4318 /// Currently the `DIRECTORY_CONTENTS_VIEW_METADATA` view is not supported by
4319 /// CMEK-protected workspaces.
4320 pub view: crate::model::DirectoryContentsView,
4321
4322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4323}
4324
4325impl QueryDirectoryContentsRequest {
4326 pub fn new() -> Self {
4327 std::default::Default::default()
4328 }
4329
4330 /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
4331 ///
4332 /// # Example
4333 /// ```ignore,no_run
4334 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4335 /// let x = QueryDirectoryContentsRequest::new().set_workspace("example");
4336 /// ```
4337 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4338 self.workspace = v.into();
4339 self
4340 }
4341
4342 /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
4343 ///
4344 /// # Example
4345 /// ```ignore,no_run
4346 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4347 /// let x = QueryDirectoryContentsRequest::new().set_path("example");
4348 /// ```
4349 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4350 self.path = v.into();
4351 self
4352 }
4353
4354 /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
4355 ///
4356 /// # Example
4357 /// ```ignore,no_run
4358 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4359 /// let x = QueryDirectoryContentsRequest::new().set_page_size(42);
4360 /// ```
4361 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4362 self.page_size = v.into();
4363 self
4364 }
4365
4366 /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
4367 ///
4368 /// # Example
4369 /// ```ignore,no_run
4370 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4371 /// let x = QueryDirectoryContentsRequest::new().set_page_token("example");
4372 /// ```
4373 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4374 self.page_token = v.into();
4375 self
4376 }
4377
4378 /// Sets the value of [view][crate::model::QueryDirectoryContentsRequest::view].
4379 ///
4380 /// # Example
4381 /// ```ignore,no_run
4382 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsRequest;
4383 /// use google_cloud_dataform_v1::model::DirectoryContentsView;
4384 /// let x0 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Basic);
4385 /// let x1 = QueryDirectoryContentsRequest::new().set_view(DirectoryContentsView::Metadata);
4386 /// ```
4387 pub fn set_view<T: std::convert::Into<crate::model::DirectoryContentsView>>(
4388 mut self,
4389 v: T,
4390 ) -> Self {
4391 self.view = v.into();
4392 self
4393 }
4394}
4395
4396impl wkt::message::Message for QueryDirectoryContentsRequest {
4397 fn typename() -> &'static str {
4398 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsRequest"
4399 }
4400}
4401
4402/// `QueryDirectoryContents` response message.
4403#[derive(Clone, Default, PartialEq)]
4404#[non_exhaustive]
4405pub struct QueryDirectoryContentsResponse {
4406 /// List of entries in the directory.
4407 pub directory_entries: std::vec::Vec<crate::model::DirectoryEntry>,
4408
4409 /// A token, which can be sent as `page_token` to retrieve the next page.
4410 /// If this field is omitted, there are no subsequent pages.
4411 pub next_page_token: std::string::String,
4412
4413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4414}
4415
4416impl QueryDirectoryContentsResponse {
4417 pub fn new() -> Self {
4418 std::default::Default::default()
4419 }
4420
4421 /// Sets the value of [directory_entries][crate::model::QueryDirectoryContentsResponse::directory_entries].
4422 ///
4423 /// # Example
4424 /// ```ignore,no_run
4425 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4426 /// use google_cloud_dataform_v1::model::DirectoryEntry;
4427 /// let x = QueryDirectoryContentsResponse::new()
4428 /// .set_directory_entries([
4429 /// DirectoryEntry::default()/* use setters */,
4430 /// DirectoryEntry::default()/* use (different) setters */,
4431 /// ]);
4432 /// ```
4433 pub fn set_directory_entries<T, V>(mut self, v: T) -> Self
4434 where
4435 T: std::iter::IntoIterator<Item = V>,
4436 V: std::convert::Into<crate::model::DirectoryEntry>,
4437 {
4438 use std::iter::Iterator;
4439 self.directory_entries = v.into_iter().map(|i| i.into()).collect();
4440 self
4441 }
4442
4443 /// Sets the value of [next_page_token][crate::model::QueryDirectoryContentsResponse::next_page_token].
4444 ///
4445 /// # Example
4446 /// ```ignore,no_run
4447 /// # use google_cloud_dataform_v1::model::QueryDirectoryContentsResponse;
4448 /// let x = QueryDirectoryContentsResponse::new().set_next_page_token("example");
4449 /// ```
4450 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4451 self.next_page_token = v.into();
4452 self
4453 }
4454}
4455
4456impl wkt::message::Message for QueryDirectoryContentsResponse {
4457 fn typename() -> &'static str {
4458 "type.googleapis.com/google.cloud.dataform.v1.QueryDirectoryContentsResponse"
4459 }
4460}
4461
4462#[doc(hidden)]
4463impl google_cloud_gax::paginator::internal::PageableResponse for QueryDirectoryContentsResponse {
4464 type PageItem = crate::model::DirectoryEntry;
4465
4466 fn items(self) -> std::vec::Vec<Self::PageItem> {
4467 self.directory_entries
4468 }
4469
4470 fn next_page_token(&self) -> std::string::String {
4471 use std::clone::Clone;
4472 self.next_page_token.clone()
4473 }
4474}
4475
4476/// Represents a single entry in a directory.
4477#[derive(Clone, Default, PartialEq)]
4478#[non_exhaustive]
4479pub struct DirectoryEntry {
4480 /// Entry with metadata.
4481 pub metadata: std::option::Option<crate::model::FilesystemEntryMetadata>,
4482
4483 /// The entry's contents.
4484 pub entry: std::option::Option<crate::model::directory_entry::Entry>,
4485
4486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4487}
4488
4489impl DirectoryEntry {
4490 pub fn new() -> Self {
4491 std::default::Default::default()
4492 }
4493
4494 /// Sets the value of [metadata][crate::model::DirectoryEntry::metadata].
4495 ///
4496 /// # Example
4497 /// ```ignore,no_run
4498 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4499 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4500 /// let x = DirectoryEntry::new().set_metadata(FilesystemEntryMetadata::default()/* use setters */);
4501 /// ```
4502 pub fn set_metadata<T>(mut self, v: T) -> Self
4503 where
4504 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4505 {
4506 self.metadata = std::option::Option::Some(v.into());
4507 self
4508 }
4509
4510 /// Sets or clears the value of [metadata][crate::model::DirectoryEntry::metadata].
4511 ///
4512 /// # Example
4513 /// ```ignore,no_run
4514 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4515 /// use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4516 /// let x = DirectoryEntry::new().set_or_clear_metadata(Some(FilesystemEntryMetadata::default()/* use setters */));
4517 /// let x = DirectoryEntry::new().set_or_clear_metadata(None::<FilesystemEntryMetadata>);
4518 /// ```
4519 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4520 where
4521 T: std::convert::Into<crate::model::FilesystemEntryMetadata>,
4522 {
4523 self.metadata = v.map(|x| x.into());
4524 self
4525 }
4526
4527 /// Sets the value of [entry][crate::model::DirectoryEntry::entry].
4528 ///
4529 /// Note that all the setters affecting `entry` are mutually
4530 /// exclusive.
4531 ///
4532 /// # Example
4533 /// ```ignore,no_run
4534 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4535 /// use google_cloud_dataform_v1::model::directory_entry::Entry;
4536 /// let x = DirectoryEntry::new().set_entry(Some(Entry::File("example".to_string())));
4537 /// ```
4538 pub fn set_entry<
4539 T: std::convert::Into<std::option::Option<crate::model::directory_entry::Entry>>,
4540 >(
4541 mut self,
4542 v: T,
4543 ) -> Self {
4544 self.entry = v.into();
4545 self
4546 }
4547
4548 /// The value of [entry][crate::model::DirectoryEntry::entry]
4549 /// if it holds a `File`, `None` if the field is not set or
4550 /// holds a different branch.
4551 pub fn file(&self) -> std::option::Option<&std::string::String> {
4552 #[allow(unreachable_patterns)]
4553 self.entry.as_ref().and_then(|v| match v {
4554 crate::model::directory_entry::Entry::File(v) => std::option::Option::Some(v),
4555 _ => std::option::Option::None,
4556 })
4557 }
4558
4559 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4560 /// to hold a `File`.
4561 ///
4562 /// Note that all the setters affecting `entry` are
4563 /// mutually exclusive.
4564 ///
4565 /// # Example
4566 /// ```ignore,no_run
4567 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4568 /// let x = DirectoryEntry::new().set_file("example");
4569 /// assert!(x.file().is_some());
4570 /// assert!(x.directory().is_none());
4571 /// ```
4572 pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4573 self.entry =
4574 std::option::Option::Some(crate::model::directory_entry::Entry::File(v.into()));
4575 self
4576 }
4577
4578 /// The value of [entry][crate::model::DirectoryEntry::entry]
4579 /// if it holds a `Directory`, `None` if the field is not set or
4580 /// holds a different branch.
4581 pub fn directory(&self) -> std::option::Option<&std::string::String> {
4582 #[allow(unreachable_patterns)]
4583 self.entry.as_ref().and_then(|v| match v {
4584 crate::model::directory_entry::Entry::Directory(v) => std::option::Option::Some(v),
4585 _ => std::option::Option::None,
4586 })
4587 }
4588
4589 /// Sets the value of [entry][crate::model::DirectoryEntry::entry]
4590 /// to hold a `Directory`.
4591 ///
4592 /// Note that all the setters affecting `entry` are
4593 /// mutually exclusive.
4594 ///
4595 /// # Example
4596 /// ```ignore,no_run
4597 /// # use google_cloud_dataform_v1::model::DirectoryEntry;
4598 /// let x = DirectoryEntry::new().set_directory("example");
4599 /// assert!(x.directory().is_some());
4600 /// assert!(x.file().is_none());
4601 /// ```
4602 pub fn set_directory<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4603 self.entry =
4604 std::option::Option::Some(crate::model::directory_entry::Entry::Directory(v.into()));
4605 self
4606 }
4607}
4608
4609impl wkt::message::Message for DirectoryEntry {
4610 fn typename() -> &'static str {
4611 "type.googleapis.com/google.cloud.dataform.v1.DirectoryEntry"
4612 }
4613}
4614
4615/// Defines additional types related to [DirectoryEntry].
4616pub mod directory_entry {
4617 #[allow(unused_imports)]
4618 use super::*;
4619
4620 /// The entry's contents.
4621 #[derive(Clone, Debug, PartialEq)]
4622 #[non_exhaustive]
4623 pub enum Entry {
4624 /// A file in the directory.
4625 File(std::string::String),
4626 /// A child directory in the directory.
4627 Directory(std::string::String),
4628 }
4629}
4630
4631/// Represents metadata for a single entry in a filesystem.
4632#[derive(Clone, Default, PartialEq)]
4633#[non_exhaustive]
4634pub struct FilesystemEntryMetadata {
4635 /// Output only. Provides the size of the entry in bytes. For directories, this
4636 /// will be 0.
4637 pub size_bytes: i64,
4638
4639 /// Output only. Represents the time of the last modification of the entry.
4640 pub update_time: std::option::Option<wkt::Timestamp>,
4641
4642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4643}
4644
4645impl FilesystemEntryMetadata {
4646 pub fn new() -> Self {
4647 std::default::Default::default()
4648 }
4649
4650 /// Sets the value of [size_bytes][crate::model::FilesystemEntryMetadata::size_bytes].
4651 ///
4652 /// # Example
4653 /// ```ignore,no_run
4654 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4655 /// let x = FilesystemEntryMetadata::new().set_size_bytes(42);
4656 /// ```
4657 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4658 self.size_bytes = v.into();
4659 self
4660 }
4661
4662 /// Sets the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
4663 ///
4664 /// # Example
4665 /// ```ignore,no_run
4666 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4667 /// use wkt::Timestamp;
4668 /// let x = FilesystemEntryMetadata::new().set_update_time(Timestamp::default()/* use setters */);
4669 /// ```
4670 pub fn set_update_time<T>(mut self, v: T) -> Self
4671 where
4672 T: std::convert::Into<wkt::Timestamp>,
4673 {
4674 self.update_time = std::option::Option::Some(v.into());
4675 self
4676 }
4677
4678 /// Sets or clears the value of [update_time][crate::model::FilesystemEntryMetadata::update_time].
4679 ///
4680 /// # Example
4681 /// ```ignore,no_run
4682 /// # use google_cloud_dataform_v1::model::FilesystemEntryMetadata;
4683 /// use wkt::Timestamp;
4684 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4685 /// let x = FilesystemEntryMetadata::new().set_or_clear_update_time(None::<Timestamp>);
4686 /// ```
4687 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4688 where
4689 T: std::convert::Into<wkt::Timestamp>,
4690 {
4691 self.update_time = v.map(|x| x.into());
4692 self
4693 }
4694}
4695
4696impl wkt::message::Message for FilesystemEntryMetadata {
4697 fn typename() -> &'static str {
4698 "type.googleapis.com/google.cloud.dataform.v1.FilesystemEntryMetadata"
4699 }
4700}
4701
4702/// Configuration containing file search request parameters.
4703#[derive(Clone, Default, PartialEq)]
4704#[non_exhaustive]
4705pub struct SearchFilesRequest {
4706 /// Required. The workspace's name.
4707 pub workspace: std::string::String,
4708
4709 /// Optional. Maximum number of search results to return. The server may return
4710 /// fewer items than requested. If unspecified, the server will pick an
4711 /// appropriate default.
4712 pub page_size: i32,
4713
4714 /// Optional. Page token received from a previous `SearchFilesRequest`
4715 /// call. Provide this to retrieve the subsequent page.
4716 ///
4717 /// When paginating, all other parameters provided to `SearchFilesRequest`,
4718 /// with the exception of `page_size`, must match the call that provided the
4719 /// page token.
4720 pub page_token: std::string::String,
4721
4722 /// Optional. Optional filter for the returned list in filtering format.
4723 /// Filtering is only currently supported on the `path` field.
4724 /// See <https://google.aip.dev/160> for details.
4725 pub filter: std::string::String,
4726
4727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4728}
4729
4730impl SearchFilesRequest {
4731 pub fn new() -> Self {
4732 std::default::Default::default()
4733 }
4734
4735 /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
4736 ///
4737 /// # Example
4738 /// ```ignore,no_run
4739 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4740 /// let x = SearchFilesRequest::new().set_workspace("example");
4741 /// ```
4742 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4743 self.workspace = v.into();
4744 self
4745 }
4746
4747 /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
4748 ///
4749 /// # Example
4750 /// ```ignore,no_run
4751 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4752 /// let x = SearchFilesRequest::new().set_page_size(42);
4753 /// ```
4754 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4755 self.page_size = v.into();
4756 self
4757 }
4758
4759 /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
4760 ///
4761 /// # Example
4762 /// ```ignore,no_run
4763 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4764 /// let x = SearchFilesRequest::new().set_page_token("example");
4765 /// ```
4766 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4767 self.page_token = v.into();
4768 self
4769 }
4770
4771 /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
4772 ///
4773 /// # Example
4774 /// ```ignore,no_run
4775 /// # use google_cloud_dataform_v1::model::SearchFilesRequest;
4776 /// let x = SearchFilesRequest::new().set_filter("example");
4777 /// ```
4778 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4779 self.filter = v.into();
4780 self
4781 }
4782}
4783
4784impl wkt::message::Message for SearchFilesRequest {
4785 fn typename() -> &'static str {
4786 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesRequest"
4787 }
4788}
4789
4790/// Client-facing representation of a file search response.
4791#[derive(Clone, Default, PartialEq)]
4792#[non_exhaustive]
4793pub struct SearchFilesResponse {
4794 /// List of matched results.
4795 pub search_results: std::vec::Vec<crate::model::SearchResult>,
4796
4797 /// Optional. A token, which can be sent as `page_token` to retrieve the next
4798 /// page. If this field is omitted, there are no subsequent pages.
4799 pub next_page_token: std::string::String,
4800
4801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4802}
4803
4804impl SearchFilesResponse {
4805 pub fn new() -> Self {
4806 std::default::Default::default()
4807 }
4808
4809 /// Sets the value of [search_results][crate::model::SearchFilesResponse::search_results].
4810 ///
4811 /// # Example
4812 /// ```ignore,no_run
4813 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
4814 /// use google_cloud_dataform_v1::model::SearchResult;
4815 /// let x = SearchFilesResponse::new()
4816 /// .set_search_results([
4817 /// SearchResult::default()/* use setters */,
4818 /// SearchResult::default()/* use (different) setters */,
4819 /// ]);
4820 /// ```
4821 pub fn set_search_results<T, V>(mut self, v: T) -> Self
4822 where
4823 T: std::iter::IntoIterator<Item = V>,
4824 V: std::convert::Into<crate::model::SearchResult>,
4825 {
4826 use std::iter::Iterator;
4827 self.search_results = v.into_iter().map(|i| i.into()).collect();
4828 self
4829 }
4830
4831 /// Sets the value of [next_page_token][crate::model::SearchFilesResponse::next_page_token].
4832 ///
4833 /// # Example
4834 /// ```ignore,no_run
4835 /// # use google_cloud_dataform_v1::model::SearchFilesResponse;
4836 /// let x = SearchFilesResponse::new().set_next_page_token("example");
4837 /// ```
4838 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4839 self.next_page_token = v.into();
4840 self
4841 }
4842}
4843
4844impl wkt::message::Message for SearchFilesResponse {
4845 fn typename() -> &'static str {
4846 "type.googleapis.com/google.cloud.dataform.v1.SearchFilesResponse"
4847 }
4848}
4849
4850#[doc(hidden)]
4851impl google_cloud_gax::paginator::internal::PageableResponse for SearchFilesResponse {
4852 type PageItem = crate::model::SearchResult;
4853
4854 fn items(self) -> std::vec::Vec<Self::PageItem> {
4855 self.search_results
4856 }
4857
4858 fn next_page_token(&self) -> std::string::String {
4859 use std::clone::Clone;
4860 self.next_page_token.clone()
4861 }
4862}
4863
4864/// Client-facing representation of a search result entry.
4865#[derive(Clone, Default, PartialEq)]
4866#[non_exhaustive]
4867pub struct SearchResult {
4868 /// The entry's contents.
4869 pub entry: std::option::Option<crate::model::search_result::Entry>,
4870
4871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4872}
4873
4874impl SearchResult {
4875 pub fn new() -> Self {
4876 std::default::Default::default()
4877 }
4878
4879 /// Sets the value of [entry][crate::model::SearchResult::entry].
4880 ///
4881 /// Note that all the setters affecting `entry` are mutually
4882 /// exclusive.
4883 ///
4884 /// # Example
4885 /// ```ignore,no_run
4886 /// # use google_cloud_dataform_v1::model::SearchResult;
4887 /// use google_cloud_dataform_v1::model::FileSearchResult;
4888 /// let x = SearchResult::new().set_entry(Some(
4889 /// google_cloud_dataform_v1::model::search_result::Entry::File(FileSearchResult::default().into())));
4890 /// ```
4891 pub fn set_entry<
4892 T: std::convert::Into<std::option::Option<crate::model::search_result::Entry>>,
4893 >(
4894 mut self,
4895 v: T,
4896 ) -> Self {
4897 self.entry = v.into();
4898 self
4899 }
4900
4901 /// The value of [entry][crate::model::SearchResult::entry]
4902 /// if it holds a `File`, `None` if the field is not set or
4903 /// holds a different branch.
4904 pub fn file(&self) -> std::option::Option<&std::boxed::Box<crate::model::FileSearchResult>> {
4905 #[allow(unreachable_patterns)]
4906 self.entry.as_ref().and_then(|v| match v {
4907 crate::model::search_result::Entry::File(v) => std::option::Option::Some(v),
4908 _ => std::option::Option::None,
4909 })
4910 }
4911
4912 /// Sets the value of [entry][crate::model::SearchResult::entry]
4913 /// to hold a `File`.
4914 ///
4915 /// Note that all the setters affecting `entry` are
4916 /// mutually exclusive.
4917 ///
4918 /// # Example
4919 /// ```ignore,no_run
4920 /// # use google_cloud_dataform_v1::model::SearchResult;
4921 /// use google_cloud_dataform_v1::model::FileSearchResult;
4922 /// let x = SearchResult::new().set_file(FileSearchResult::default()/* use setters */);
4923 /// assert!(x.file().is_some());
4924 /// assert!(x.directory().is_none());
4925 /// ```
4926 pub fn set_file<T: std::convert::Into<std::boxed::Box<crate::model::FileSearchResult>>>(
4927 mut self,
4928 v: T,
4929 ) -> Self {
4930 self.entry = std::option::Option::Some(crate::model::search_result::Entry::File(v.into()));
4931 self
4932 }
4933
4934 /// The value of [entry][crate::model::SearchResult::entry]
4935 /// if it holds a `Directory`, `None` if the field is not set or
4936 /// holds a different branch.
4937 pub fn directory(
4938 &self,
4939 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectorySearchResult>> {
4940 #[allow(unreachable_patterns)]
4941 self.entry.as_ref().and_then(|v| match v {
4942 crate::model::search_result::Entry::Directory(v) => std::option::Option::Some(v),
4943 _ => std::option::Option::None,
4944 })
4945 }
4946
4947 /// Sets the value of [entry][crate::model::SearchResult::entry]
4948 /// to hold a `Directory`.
4949 ///
4950 /// Note that all the setters affecting `entry` are
4951 /// mutually exclusive.
4952 ///
4953 /// # Example
4954 /// ```ignore,no_run
4955 /// # use google_cloud_dataform_v1::model::SearchResult;
4956 /// use google_cloud_dataform_v1::model::DirectorySearchResult;
4957 /// let x = SearchResult::new().set_directory(DirectorySearchResult::default()/* use setters */);
4958 /// assert!(x.directory().is_some());
4959 /// assert!(x.file().is_none());
4960 /// ```
4961 pub fn set_directory<
4962 T: std::convert::Into<std::boxed::Box<crate::model::DirectorySearchResult>>,
4963 >(
4964 mut self,
4965 v: T,
4966 ) -> Self {
4967 self.entry =
4968 std::option::Option::Some(crate::model::search_result::Entry::Directory(v.into()));
4969 self
4970 }
4971}
4972
4973impl wkt::message::Message for SearchResult {
4974 fn typename() -> &'static str {
4975 "type.googleapis.com/google.cloud.dataform.v1.SearchResult"
4976 }
4977}
4978
4979/// Defines additional types related to [SearchResult].
4980pub mod search_result {
4981 #[allow(unused_imports)]
4982 use super::*;
4983
4984 /// The entry's contents.
4985 #[derive(Clone, Debug, PartialEq)]
4986 #[non_exhaustive]
4987 pub enum Entry {
4988 /// Details when search result is a file.
4989 File(std::boxed::Box<crate::model::FileSearchResult>),
4990 /// Details when search result is a directory.
4991 Directory(std::boxed::Box<crate::model::DirectorySearchResult>),
4992 }
4993}
4994
4995/// Client-facing representation of a file entry in search results.
4996#[derive(Clone, Default, PartialEq)]
4997#[non_exhaustive]
4998pub struct FileSearchResult {
4999 /// File system path relative to the workspace root.
5000 pub path: std::string::String,
5001
5002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5003}
5004
5005impl FileSearchResult {
5006 pub fn new() -> Self {
5007 std::default::Default::default()
5008 }
5009
5010 /// Sets the value of [path][crate::model::FileSearchResult::path].
5011 ///
5012 /// # Example
5013 /// ```ignore,no_run
5014 /// # use google_cloud_dataform_v1::model::FileSearchResult;
5015 /// let x = FileSearchResult::new().set_path("example");
5016 /// ```
5017 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5018 self.path = v.into();
5019 self
5020 }
5021}
5022
5023impl wkt::message::Message for FileSearchResult {
5024 fn typename() -> &'static str {
5025 "type.googleapis.com/google.cloud.dataform.v1.FileSearchResult"
5026 }
5027}
5028
5029/// Client-facing representation of a directory entry in search results.
5030#[derive(Clone, Default, PartialEq)]
5031#[non_exhaustive]
5032pub struct DirectorySearchResult {
5033 /// File system path relative to the workspace root.
5034 pub path: std::string::String,
5035
5036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5037}
5038
5039impl DirectorySearchResult {
5040 pub fn new() -> Self {
5041 std::default::Default::default()
5042 }
5043
5044 /// Sets the value of [path][crate::model::DirectorySearchResult::path].
5045 ///
5046 /// # Example
5047 /// ```ignore,no_run
5048 /// # use google_cloud_dataform_v1::model::DirectorySearchResult;
5049 /// let x = DirectorySearchResult::new().set_path("example");
5050 /// ```
5051 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5052 self.path = v.into();
5053 self
5054 }
5055}
5056
5057impl wkt::message::Message for DirectorySearchResult {
5058 fn typename() -> &'static str {
5059 "type.googleapis.com/google.cloud.dataform.v1.DirectorySearchResult"
5060 }
5061}
5062
5063/// `MakeDirectory` request message.
5064#[derive(Clone, Default, PartialEq)]
5065#[non_exhaustive]
5066pub struct MakeDirectoryRequest {
5067 /// Required. The workspace's name.
5068 pub workspace: std::string::String,
5069
5070 /// Required. The directory's full path including directory name, relative to
5071 /// the workspace root.
5072 pub path: std::string::String,
5073
5074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5075}
5076
5077impl MakeDirectoryRequest {
5078 pub fn new() -> Self {
5079 std::default::Default::default()
5080 }
5081
5082 /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
5083 ///
5084 /// # Example
5085 /// ```ignore,no_run
5086 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5087 /// let x = MakeDirectoryRequest::new().set_workspace("example");
5088 /// ```
5089 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5090 self.workspace = v.into();
5091 self
5092 }
5093
5094 /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
5095 ///
5096 /// # Example
5097 /// ```ignore,no_run
5098 /// # use google_cloud_dataform_v1::model::MakeDirectoryRequest;
5099 /// let x = MakeDirectoryRequest::new().set_path("example");
5100 /// ```
5101 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5102 self.path = v.into();
5103 self
5104 }
5105}
5106
5107impl wkt::message::Message for MakeDirectoryRequest {
5108 fn typename() -> &'static str {
5109 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryRequest"
5110 }
5111}
5112
5113/// `MakeDirectory` response message.
5114#[derive(Clone, Default, PartialEq)]
5115#[non_exhaustive]
5116pub struct MakeDirectoryResponse {
5117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5118}
5119
5120impl MakeDirectoryResponse {
5121 pub fn new() -> Self {
5122 std::default::Default::default()
5123 }
5124}
5125
5126impl wkt::message::Message for MakeDirectoryResponse {
5127 fn typename() -> &'static str {
5128 "type.googleapis.com/google.cloud.dataform.v1.MakeDirectoryResponse"
5129 }
5130}
5131
5132/// `RemoveDirectory` request message.
5133#[derive(Clone, Default, PartialEq)]
5134#[non_exhaustive]
5135pub struct RemoveDirectoryRequest {
5136 /// Required. The workspace's name.
5137 pub workspace: std::string::String,
5138
5139 /// Required. The directory's full path including directory name, relative to
5140 /// the workspace root.
5141 pub path: std::string::String,
5142
5143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5144}
5145
5146impl RemoveDirectoryRequest {
5147 pub fn new() -> Self {
5148 std::default::Default::default()
5149 }
5150
5151 /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
5152 ///
5153 /// # Example
5154 /// ```ignore,no_run
5155 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5156 /// let x = RemoveDirectoryRequest::new().set_workspace("example");
5157 /// ```
5158 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5159 self.workspace = v.into();
5160 self
5161 }
5162
5163 /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
5164 ///
5165 /// # Example
5166 /// ```ignore,no_run
5167 /// # use google_cloud_dataform_v1::model::RemoveDirectoryRequest;
5168 /// let x = RemoveDirectoryRequest::new().set_path("example");
5169 /// ```
5170 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5171 self.path = v.into();
5172 self
5173 }
5174}
5175
5176impl wkt::message::Message for RemoveDirectoryRequest {
5177 fn typename() -> &'static str {
5178 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryRequest"
5179 }
5180}
5181
5182/// `RemoveDirectory` response message.
5183#[derive(Clone, Default, PartialEq)]
5184#[non_exhaustive]
5185pub struct RemoveDirectoryResponse {
5186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5187}
5188
5189impl RemoveDirectoryResponse {
5190 pub fn new() -> Self {
5191 std::default::Default::default()
5192 }
5193}
5194
5195impl wkt::message::Message for RemoveDirectoryResponse {
5196 fn typename() -> &'static str {
5197 "type.googleapis.com/google.cloud.dataform.v1.RemoveDirectoryResponse"
5198 }
5199}
5200
5201/// `MoveDirectory` request message.
5202#[derive(Clone, Default, PartialEq)]
5203#[non_exhaustive]
5204pub struct MoveDirectoryRequest {
5205 /// Required. The workspace's name.
5206 pub workspace: std::string::String,
5207
5208 /// Required. The directory's full path including directory name, relative to
5209 /// the workspace root.
5210 pub path: std::string::String,
5211
5212 /// Required. The new path for the directory including directory name, rooted
5213 /// at workspace root.
5214 pub new_path: std::string::String,
5215
5216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5217}
5218
5219impl MoveDirectoryRequest {
5220 pub fn new() -> Self {
5221 std::default::Default::default()
5222 }
5223
5224 /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
5225 ///
5226 /// # Example
5227 /// ```ignore,no_run
5228 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5229 /// let x = MoveDirectoryRequest::new().set_workspace("example");
5230 /// ```
5231 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5232 self.workspace = v.into();
5233 self
5234 }
5235
5236 /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
5237 ///
5238 /// # Example
5239 /// ```ignore,no_run
5240 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5241 /// let x = MoveDirectoryRequest::new().set_path("example");
5242 /// ```
5243 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5244 self.path = v.into();
5245 self
5246 }
5247
5248 /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
5249 ///
5250 /// # Example
5251 /// ```ignore,no_run
5252 /// # use google_cloud_dataform_v1::model::MoveDirectoryRequest;
5253 /// let x = MoveDirectoryRequest::new().set_new_path("example");
5254 /// ```
5255 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5256 self.new_path = v.into();
5257 self
5258 }
5259}
5260
5261impl wkt::message::Message for MoveDirectoryRequest {
5262 fn typename() -> &'static str {
5263 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryRequest"
5264 }
5265}
5266
5267/// `MoveDirectory` response message.
5268#[derive(Clone, Default, PartialEq)]
5269#[non_exhaustive]
5270pub struct MoveDirectoryResponse {
5271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5272}
5273
5274impl MoveDirectoryResponse {
5275 pub fn new() -> Self {
5276 std::default::Default::default()
5277 }
5278}
5279
5280impl wkt::message::Message for MoveDirectoryResponse {
5281 fn typename() -> &'static str {
5282 "type.googleapis.com/google.cloud.dataform.v1.MoveDirectoryResponse"
5283 }
5284}
5285
5286/// `ReadFile` request message.
5287#[derive(Clone, Default, PartialEq)]
5288#[non_exhaustive]
5289pub struct ReadFileRequest {
5290 /// Required. The workspace's name.
5291 pub workspace: std::string::String,
5292
5293 /// Required. The file's full path including filename, relative to the
5294 /// workspace root.
5295 pub path: std::string::String,
5296
5297 /// Optional. The Git revision of the file to return. If left empty, the
5298 /// current contents of `path` will be returned.
5299 pub revision: std::string::String,
5300
5301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5302}
5303
5304impl ReadFileRequest {
5305 pub fn new() -> Self {
5306 std::default::Default::default()
5307 }
5308
5309 /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
5310 ///
5311 /// # Example
5312 /// ```ignore,no_run
5313 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5314 /// let x = ReadFileRequest::new().set_workspace("example");
5315 /// ```
5316 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.workspace = v.into();
5318 self
5319 }
5320
5321 /// Sets the value of [path][crate::model::ReadFileRequest::path].
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5326 /// let x = ReadFileRequest::new().set_path("example");
5327 /// ```
5328 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5329 self.path = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_dataform_v1::model::ReadFileRequest;
5338 /// let x = ReadFileRequest::new().set_revision("example");
5339 /// ```
5340 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.revision = v.into();
5342 self
5343 }
5344}
5345
5346impl wkt::message::Message for ReadFileRequest {
5347 fn typename() -> &'static str {
5348 "type.googleapis.com/google.cloud.dataform.v1.ReadFileRequest"
5349 }
5350}
5351
5352/// `ReadFile` response message.
5353#[derive(Clone, Default, PartialEq)]
5354#[non_exhaustive]
5355pub struct ReadFileResponse {
5356 /// The file's contents.
5357 pub file_contents: ::bytes::Bytes,
5358
5359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5360}
5361
5362impl ReadFileResponse {
5363 pub fn new() -> Self {
5364 std::default::Default::default()
5365 }
5366
5367 /// Sets the value of [file_contents][crate::model::ReadFileResponse::file_contents].
5368 ///
5369 /// # Example
5370 /// ```ignore,no_run
5371 /// # use google_cloud_dataform_v1::model::ReadFileResponse;
5372 /// let x = ReadFileResponse::new().set_file_contents(bytes::Bytes::from_static(b"example"));
5373 /// ```
5374 pub fn set_file_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5375 self.file_contents = v.into();
5376 self
5377 }
5378}
5379
5380impl wkt::message::Message for ReadFileResponse {
5381 fn typename() -> &'static str {
5382 "type.googleapis.com/google.cloud.dataform.v1.ReadFileResponse"
5383 }
5384}
5385
5386/// `RemoveFile` request message.
5387#[derive(Clone, Default, PartialEq)]
5388#[non_exhaustive]
5389pub struct RemoveFileRequest {
5390 /// Required. The workspace's name.
5391 pub workspace: std::string::String,
5392
5393 /// Required. The file's full path including filename, relative to the
5394 /// workspace root.
5395 pub path: std::string::String,
5396
5397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5398}
5399
5400impl RemoveFileRequest {
5401 pub fn new() -> Self {
5402 std::default::Default::default()
5403 }
5404
5405 /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
5406 ///
5407 /// # Example
5408 /// ```ignore,no_run
5409 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5410 /// let x = RemoveFileRequest::new().set_workspace("example");
5411 /// ```
5412 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.workspace = v.into();
5414 self
5415 }
5416
5417 /// Sets the value of [path][crate::model::RemoveFileRequest::path].
5418 ///
5419 /// # Example
5420 /// ```ignore,no_run
5421 /// # use google_cloud_dataform_v1::model::RemoveFileRequest;
5422 /// let x = RemoveFileRequest::new().set_path("example");
5423 /// ```
5424 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5425 self.path = v.into();
5426 self
5427 }
5428}
5429
5430impl wkt::message::Message for RemoveFileRequest {
5431 fn typename() -> &'static str {
5432 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileRequest"
5433 }
5434}
5435
5436/// `RemoveFile` response message.
5437#[derive(Clone, Default, PartialEq)]
5438#[non_exhaustive]
5439pub struct RemoveFileResponse {
5440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5441}
5442
5443impl RemoveFileResponse {
5444 pub fn new() -> Self {
5445 std::default::Default::default()
5446 }
5447}
5448
5449impl wkt::message::Message for RemoveFileResponse {
5450 fn typename() -> &'static str {
5451 "type.googleapis.com/google.cloud.dataform.v1.RemoveFileResponse"
5452 }
5453}
5454
5455/// `MoveFile` request message.
5456#[derive(Clone, Default, PartialEq)]
5457#[non_exhaustive]
5458pub struct MoveFileRequest {
5459 /// Required. The workspace's name.
5460 pub workspace: std::string::String,
5461
5462 /// Required. The file's full path including filename, relative to the
5463 /// workspace root.
5464 pub path: std::string::String,
5465
5466 /// Required. The file's new path including filename, relative to the workspace
5467 /// root.
5468 pub new_path: std::string::String,
5469
5470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5471}
5472
5473impl MoveFileRequest {
5474 pub fn new() -> Self {
5475 std::default::Default::default()
5476 }
5477
5478 /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
5479 ///
5480 /// # Example
5481 /// ```ignore,no_run
5482 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5483 /// let x = MoveFileRequest::new().set_workspace("example");
5484 /// ```
5485 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5486 self.workspace = v.into();
5487 self
5488 }
5489
5490 /// Sets the value of [path][crate::model::MoveFileRequest::path].
5491 ///
5492 /// # Example
5493 /// ```ignore,no_run
5494 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5495 /// let x = MoveFileRequest::new().set_path("example");
5496 /// ```
5497 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5498 self.path = v.into();
5499 self
5500 }
5501
5502 /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
5503 ///
5504 /// # Example
5505 /// ```ignore,no_run
5506 /// # use google_cloud_dataform_v1::model::MoveFileRequest;
5507 /// let x = MoveFileRequest::new().set_new_path("example");
5508 /// ```
5509 pub fn set_new_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5510 self.new_path = v.into();
5511 self
5512 }
5513}
5514
5515impl wkt::message::Message for MoveFileRequest {
5516 fn typename() -> &'static str {
5517 "type.googleapis.com/google.cloud.dataform.v1.MoveFileRequest"
5518 }
5519}
5520
5521/// `MoveFile` response message.
5522#[derive(Clone, Default, PartialEq)]
5523#[non_exhaustive]
5524pub struct MoveFileResponse {
5525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5526}
5527
5528impl MoveFileResponse {
5529 pub fn new() -> Self {
5530 std::default::Default::default()
5531 }
5532}
5533
5534impl wkt::message::Message for MoveFileResponse {
5535 fn typename() -> &'static str {
5536 "type.googleapis.com/google.cloud.dataform.v1.MoveFileResponse"
5537 }
5538}
5539
5540/// `WriteFile` request message.
5541#[derive(Clone, Default, PartialEq)]
5542#[non_exhaustive]
5543pub struct WriteFileRequest {
5544 /// Required. The workspace's name.
5545 pub workspace: std::string::String,
5546
5547 /// Required. The file.
5548 pub path: std::string::String,
5549
5550 /// Required. The file's contents.
5551 pub contents: ::bytes::Bytes,
5552
5553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5554}
5555
5556impl WriteFileRequest {
5557 pub fn new() -> Self {
5558 std::default::Default::default()
5559 }
5560
5561 /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
5562 ///
5563 /// # Example
5564 /// ```ignore,no_run
5565 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5566 /// let x = WriteFileRequest::new().set_workspace("example");
5567 /// ```
5568 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5569 self.workspace = v.into();
5570 self
5571 }
5572
5573 /// Sets the value of [path][crate::model::WriteFileRequest::path].
5574 ///
5575 /// # Example
5576 /// ```ignore,no_run
5577 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5578 /// let x = WriteFileRequest::new().set_path("example");
5579 /// ```
5580 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5581 self.path = v.into();
5582 self
5583 }
5584
5585 /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
5586 ///
5587 /// # Example
5588 /// ```ignore,no_run
5589 /// # use google_cloud_dataform_v1::model::WriteFileRequest;
5590 /// let x = WriteFileRequest::new().set_contents(bytes::Bytes::from_static(b"example"));
5591 /// ```
5592 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5593 self.contents = v.into();
5594 self
5595 }
5596}
5597
5598impl wkt::message::Message for WriteFileRequest {
5599 fn typename() -> &'static str {
5600 "type.googleapis.com/google.cloud.dataform.v1.WriteFileRequest"
5601 }
5602}
5603
5604/// `WriteFile` response message.
5605#[derive(Clone, Default, PartialEq)]
5606#[non_exhaustive]
5607pub struct WriteFileResponse {
5608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5609}
5610
5611impl WriteFileResponse {
5612 pub fn new() -> Self {
5613 std::default::Default::default()
5614 }
5615}
5616
5617impl wkt::message::Message for WriteFileResponse {
5618 fn typename() -> &'static str {
5619 "type.googleapis.com/google.cloud.dataform.v1.WriteFileResponse"
5620 }
5621}
5622
5623/// `InstallNpmPackages` request message.
5624#[derive(Clone, Default, PartialEq)]
5625#[non_exhaustive]
5626pub struct InstallNpmPackagesRequest {
5627 /// Required. The workspace's name.
5628 pub workspace: std::string::String,
5629
5630 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5631}
5632
5633impl InstallNpmPackagesRequest {
5634 pub fn new() -> Self {
5635 std::default::Default::default()
5636 }
5637
5638 /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
5639 ///
5640 /// # Example
5641 /// ```ignore,no_run
5642 /// # use google_cloud_dataform_v1::model::InstallNpmPackagesRequest;
5643 /// let x = InstallNpmPackagesRequest::new().set_workspace("example");
5644 /// ```
5645 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5646 self.workspace = v.into();
5647 self
5648 }
5649}
5650
5651impl wkt::message::Message for InstallNpmPackagesRequest {
5652 fn typename() -> &'static str {
5653 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesRequest"
5654 }
5655}
5656
5657/// `InstallNpmPackages` response message.
5658#[derive(Clone, Default, PartialEq)]
5659#[non_exhaustive]
5660pub struct InstallNpmPackagesResponse {
5661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5662}
5663
5664impl InstallNpmPackagesResponse {
5665 pub fn new() -> Self {
5666 std::default::Default::default()
5667 }
5668}
5669
5670impl wkt::message::Message for InstallNpmPackagesResponse {
5671 fn typename() -> &'static str {
5672 "type.googleapis.com/google.cloud.dataform.v1.InstallNpmPackagesResponse"
5673 }
5674}
5675
5676/// Represents a Dataform release configuration.
5677#[derive(Clone, Default, PartialEq)]
5678#[non_exhaustive]
5679pub struct ReleaseConfig {
5680 /// Identifier. The release config's name.
5681 pub name: std::string::String,
5682
5683 /// Required. Git commit/tag/branch name at which the repository should be
5684 /// compiled. Must exist in the remote repository. Examples:
5685 ///
5686 /// - a commit SHA: `12ade345`
5687 /// - a tag: `tag1`
5688 /// - a branch name: `branch1`
5689 pub git_commitish: std::string::String,
5690
5691 /// Optional. If set, fields of `code_compilation_config` override the default
5692 /// compilation settings that are specified in dataform.json.
5693 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
5694
5695 /// Optional. Optional schedule (in cron format) for automatic creation of
5696 /// compilation results.
5697 pub cron_schedule: std::string::String,
5698
5699 /// Optional. Specifies the time zone to be used when interpreting
5700 /// cron_schedule. Must be a time zone name from the time zone database
5701 /// (<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>). If left
5702 /// unspecified, the default is UTC.
5703 pub time_zone: std::string::String,
5704
5705 /// Output only. Records of the 10 most recent scheduled release attempts,
5706 /// ordered in descending order of `release_time`. Updated whenever automatic
5707 /// creation of a compilation result is triggered by cron_schedule.
5708 pub recent_scheduled_release_records:
5709 std::vec::Vec<crate::model::release_config::ScheduledReleaseRecord>,
5710
5711 /// Optional. The name of the currently released compilation result for this
5712 /// release config. This value is updated when a compilation result is
5713 /// automatically created from this release config (using cron_schedule), or
5714 /// when this resource is updated by API call (perhaps to roll back to an
5715 /// earlier release). The compilation result must have been created using this
5716 /// release config. Must be in the format
5717 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
5718 pub release_compilation_result: std::string::String,
5719
5720 /// Optional. Disables automatic creation of compilation results.
5721 pub disabled: bool,
5722
5723 /// Output only. All the metadata information that is used internally to serve
5724 /// the resource. For example: timestamps, flags, status fields, etc. The
5725 /// format of this field is a JSON string.
5726 pub internal_metadata: std::option::Option<std::string::String>,
5727
5728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5729}
5730
5731impl ReleaseConfig {
5732 pub fn new() -> Self {
5733 std::default::Default::default()
5734 }
5735
5736 /// Sets the value of [name][crate::model::ReleaseConfig::name].
5737 ///
5738 /// # Example
5739 /// ```ignore,no_run
5740 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5741 /// let x = ReleaseConfig::new().set_name("example");
5742 /// ```
5743 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5744 self.name = v.into();
5745 self
5746 }
5747
5748 /// Sets the value of [git_commitish][crate::model::ReleaseConfig::git_commitish].
5749 ///
5750 /// # Example
5751 /// ```ignore,no_run
5752 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5753 /// let x = ReleaseConfig::new().set_git_commitish("example");
5754 /// ```
5755 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5756 self.git_commitish = v.into();
5757 self
5758 }
5759
5760 /// Sets the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
5761 ///
5762 /// # Example
5763 /// ```ignore,no_run
5764 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5765 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
5766 /// let x = ReleaseConfig::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
5767 /// ```
5768 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
5769 where
5770 T: std::convert::Into<crate::model::CodeCompilationConfig>,
5771 {
5772 self.code_compilation_config = std::option::Option::Some(v.into());
5773 self
5774 }
5775
5776 /// Sets or clears the value of [code_compilation_config][crate::model::ReleaseConfig::code_compilation_config].
5777 ///
5778 /// # Example
5779 /// ```ignore,no_run
5780 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5781 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
5782 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
5783 /// let x = ReleaseConfig::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
5784 /// ```
5785 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
5786 where
5787 T: std::convert::Into<crate::model::CodeCompilationConfig>,
5788 {
5789 self.code_compilation_config = v.map(|x| x.into());
5790 self
5791 }
5792
5793 /// Sets the value of [cron_schedule][crate::model::ReleaseConfig::cron_schedule].
5794 ///
5795 /// # Example
5796 /// ```ignore,no_run
5797 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5798 /// let x = ReleaseConfig::new().set_cron_schedule("example");
5799 /// ```
5800 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5801 self.cron_schedule = v.into();
5802 self
5803 }
5804
5805 /// Sets the value of [time_zone][crate::model::ReleaseConfig::time_zone].
5806 ///
5807 /// # Example
5808 /// ```ignore,no_run
5809 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5810 /// let x = ReleaseConfig::new().set_time_zone("example");
5811 /// ```
5812 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5813 self.time_zone = v.into();
5814 self
5815 }
5816
5817 /// Sets the value of [recent_scheduled_release_records][crate::model::ReleaseConfig::recent_scheduled_release_records].
5818 ///
5819 /// # Example
5820 /// ```ignore,no_run
5821 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5822 /// use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
5823 /// let x = ReleaseConfig::new()
5824 /// .set_recent_scheduled_release_records([
5825 /// ScheduledReleaseRecord::default()/* use setters */,
5826 /// ScheduledReleaseRecord::default()/* use (different) setters */,
5827 /// ]);
5828 /// ```
5829 pub fn set_recent_scheduled_release_records<T, V>(mut self, v: T) -> Self
5830 where
5831 T: std::iter::IntoIterator<Item = V>,
5832 V: std::convert::Into<crate::model::release_config::ScheduledReleaseRecord>,
5833 {
5834 use std::iter::Iterator;
5835 self.recent_scheduled_release_records = v.into_iter().map(|i| i.into()).collect();
5836 self
5837 }
5838
5839 /// Sets the value of [release_compilation_result][crate::model::ReleaseConfig::release_compilation_result].
5840 ///
5841 /// # Example
5842 /// ```ignore,no_run
5843 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5844 /// let x = ReleaseConfig::new().set_release_compilation_result("example");
5845 /// ```
5846 pub fn set_release_compilation_result<T: std::convert::Into<std::string::String>>(
5847 mut self,
5848 v: T,
5849 ) -> Self {
5850 self.release_compilation_result = v.into();
5851 self
5852 }
5853
5854 /// Sets the value of [disabled][crate::model::ReleaseConfig::disabled].
5855 ///
5856 /// # Example
5857 /// ```ignore,no_run
5858 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5859 /// let x = ReleaseConfig::new().set_disabled(true);
5860 /// ```
5861 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5862 self.disabled = v.into();
5863 self
5864 }
5865
5866 /// Sets the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
5867 ///
5868 /// # Example
5869 /// ```ignore,no_run
5870 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5871 /// let x = ReleaseConfig::new().set_internal_metadata("example");
5872 /// ```
5873 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
5874 where
5875 T: std::convert::Into<std::string::String>,
5876 {
5877 self.internal_metadata = std::option::Option::Some(v.into());
5878 self
5879 }
5880
5881 /// Sets or clears the value of [internal_metadata][crate::model::ReleaseConfig::internal_metadata].
5882 ///
5883 /// # Example
5884 /// ```ignore,no_run
5885 /// # use google_cloud_dataform_v1::model::ReleaseConfig;
5886 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(Some("example"));
5887 /// let x = ReleaseConfig::new().set_or_clear_internal_metadata(None::<String>);
5888 /// ```
5889 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
5890 where
5891 T: std::convert::Into<std::string::String>,
5892 {
5893 self.internal_metadata = v.map(|x| x.into());
5894 self
5895 }
5896}
5897
5898impl wkt::message::Message for ReleaseConfig {
5899 fn typename() -> &'static str {
5900 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig"
5901 }
5902}
5903
5904/// Defines additional types related to [ReleaseConfig].
5905pub mod release_config {
5906 #[allow(unused_imports)]
5907 use super::*;
5908
5909 /// A record of an attempt to create a compilation result for this release
5910 /// config.
5911 #[derive(Clone, Default, PartialEq)]
5912 #[non_exhaustive]
5913 pub struct ScheduledReleaseRecord {
5914 /// Output only. The timestamp of this release attempt.
5915 pub release_time: std::option::Option<wkt::Timestamp>,
5916
5917 /// The result of this release attempt.
5918 pub result:
5919 std::option::Option<crate::model::release_config::scheduled_release_record::Result>,
5920
5921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5922 }
5923
5924 impl ScheduledReleaseRecord {
5925 pub fn new() -> Self {
5926 std::default::Default::default()
5927 }
5928
5929 /// Sets the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
5930 ///
5931 /// # Example
5932 /// ```ignore,no_run
5933 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
5934 /// use wkt::Timestamp;
5935 /// let x = ScheduledReleaseRecord::new().set_release_time(Timestamp::default()/* use setters */);
5936 /// ```
5937 pub fn set_release_time<T>(mut self, v: T) -> Self
5938 where
5939 T: std::convert::Into<wkt::Timestamp>,
5940 {
5941 self.release_time = std::option::Option::Some(v.into());
5942 self
5943 }
5944
5945 /// Sets or clears the value of [release_time][crate::model::release_config::ScheduledReleaseRecord::release_time].
5946 ///
5947 /// # Example
5948 /// ```ignore,no_run
5949 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
5950 /// use wkt::Timestamp;
5951 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(Some(Timestamp::default()/* use setters */));
5952 /// let x = ScheduledReleaseRecord::new().set_or_clear_release_time(None::<Timestamp>);
5953 /// ```
5954 pub fn set_or_clear_release_time<T>(mut self, v: std::option::Option<T>) -> Self
5955 where
5956 T: std::convert::Into<wkt::Timestamp>,
5957 {
5958 self.release_time = v.map(|x| x.into());
5959 self
5960 }
5961
5962 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result].
5963 ///
5964 /// Note that all the setters affecting `result` are mutually
5965 /// exclusive.
5966 ///
5967 /// # Example
5968 /// ```ignore,no_run
5969 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
5970 /// use google_cloud_dataform_v1::model::release_config::scheduled_release_record::Result;
5971 /// let x = ScheduledReleaseRecord::new().set_result(Some(Result::CompilationResult("example".to_string())));
5972 /// ```
5973 pub fn set_result<
5974 T: std::convert::Into<
5975 std::option::Option<
5976 crate::model::release_config::scheduled_release_record::Result,
5977 >,
5978 >,
5979 >(
5980 mut self,
5981 v: T,
5982 ) -> Self {
5983 self.result = v.into();
5984 self
5985 }
5986
5987 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
5988 /// if it holds a `CompilationResult`, `None` if the field is not set or
5989 /// holds a different branch.
5990 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
5991 #[allow(unreachable_patterns)]
5992 self.result.as_ref().and_then(|v| match v {
5993 crate::model::release_config::scheduled_release_record::Result::CompilationResult(v) => std::option::Option::Some(v),
5994 _ => std::option::Option::None,
5995 })
5996 }
5997
5998 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
5999 /// to hold a `CompilationResult`.
6000 ///
6001 /// Note that all the setters affecting `result` are
6002 /// mutually exclusive.
6003 ///
6004 /// # Example
6005 /// ```ignore,no_run
6006 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6007 /// let x = ScheduledReleaseRecord::new().set_compilation_result("example");
6008 /// assert!(x.compilation_result().is_some());
6009 /// assert!(x.error_status().is_none());
6010 /// ```
6011 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
6012 mut self,
6013 v: T,
6014 ) -> Self {
6015 self.result = std::option::Option::Some(
6016 crate::model::release_config::scheduled_release_record::Result::CompilationResult(
6017 v.into(),
6018 ),
6019 );
6020 self
6021 }
6022
6023 /// The value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6024 /// if it holds a `ErrorStatus`, `None` if the field is not set or
6025 /// holds a different branch.
6026 pub fn error_status(
6027 &self,
6028 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
6029 #[allow(unreachable_patterns)]
6030 self.result.as_ref().and_then(|v| match v {
6031 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(v) => {
6032 std::option::Option::Some(v)
6033 }
6034 _ => std::option::Option::None,
6035 })
6036 }
6037
6038 /// Sets the value of [result][crate::model::release_config::ScheduledReleaseRecord::result]
6039 /// to hold a `ErrorStatus`.
6040 ///
6041 /// Note that all the setters affecting `result` are
6042 /// mutually exclusive.
6043 ///
6044 /// # Example
6045 /// ```ignore,no_run
6046 /// # use google_cloud_dataform_v1::model::release_config::ScheduledReleaseRecord;
6047 /// use google_cloud_rpc::model::Status;
6048 /// let x = ScheduledReleaseRecord::new().set_error_status(Status::default()/* use setters */);
6049 /// assert!(x.error_status().is_some());
6050 /// assert!(x.compilation_result().is_none());
6051 /// ```
6052 pub fn set_error_status<
6053 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6054 >(
6055 mut self,
6056 v: T,
6057 ) -> Self {
6058 self.result = std::option::Option::Some(
6059 crate::model::release_config::scheduled_release_record::Result::ErrorStatus(
6060 v.into(),
6061 ),
6062 );
6063 self
6064 }
6065 }
6066
6067 impl wkt::message::Message for ScheduledReleaseRecord {
6068 fn typename() -> &'static str {
6069 "type.googleapis.com/google.cloud.dataform.v1.ReleaseConfig.ScheduledReleaseRecord"
6070 }
6071 }
6072
6073 /// Defines additional types related to [ScheduledReleaseRecord].
6074 pub mod scheduled_release_record {
6075 #[allow(unused_imports)]
6076 use super::*;
6077
6078 /// The result of this release attempt.
6079 #[derive(Clone, Debug, PartialEq)]
6080 #[non_exhaustive]
6081 pub enum Result {
6082 /// The name of the created compilation result, if one was successfully
6083 /// created. Must be in the format
6084 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
6085 CompilationResult(std::string::String),
6086 /// The error status encountered upon this attempt to create the
6087 /// compilation result, if the attempt was unsuccessful.
6088 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
6089 }
6090 }
6091}
6092
6093/// `ListReleaseConfigs` request message.
6094#[derive(Clone, Default, PartialEq)]
6095#[non_exhaustive]
6096pub struct ListReleaseConfigsRequest {
6097 /// Required. The repository in which to list release configs. Must be in the
6098 /// format `projects/*/locations/*/repositories/*`.
6099 pub parent: std::string::String,
6100
6101 /// Optional. Maximum number of release configs to return. The server may
6102 /// return fewer items than requested. If unspecified, the server will pick an
6103 /// appropriate default.
6104 pub page_size: i32,
6105
6106 /// Optional. Page token received from a previous `ListReleaseConfigs` call.
6107 /// Provide this to retrieve the subsequent page.
6108 ///
6109 /// When paginating, all other parameters provided to `ListReleaseConfigs`,
6110 /// with the exception of `page_size`, must match the call that provided the
6111 /// page token.
6112 pub page_token: std::string::String,
6113
6114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6115}
6116
6117impl ListReleaseConfigsRequest {
6118 pub fn new() -> Self {
6119 std::default::Default::default()
6120 }
6121
6122 /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
6123 ///
6124 /// # Example
6125 /// ```ignore,no_run
6126 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6127 /// let x = ListReleaseConfigsRequest::new().set_parent("example");
6128 /// ```
6129 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6130 self.parent = v.into();
6131 self
6132 }
6133
6134 /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
6135 ///
6136 /// # Example
6137 /// ```ignore,no_run
6138 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6139 /// let x = ListReleaseConfigsRequest::new().set_page_size(42);
6140 /// ```
6141 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6142 self.page_size = v.into();
6143 self
6144 }
6145
6146 /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsRequest;
6151 /// let x = ListReleaseConfigsRequest::new().set_page_token("example");
6152 /// ```
6153 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6154 self.page_token = v.into();
6155 self
6156 }
6157}
6158
6159impl wkt::message::Message for ListReleaseConfigsRequest {
6160 fn typename() -> &'static str {
6161 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsRequest"
6162 }
6163}
6164
6165/// `ListReleaseConfigs` response message.
6166#[derive(Clone, Default, PartialEq)]
6167#[non_exhaustive]
6168pub struct ListReleaseConfigsResponse {
6169 /// List of release configs.
6170 pub release_configs: std::vec::Vec<crate::model::ReleaseConfig>,
6171
6172 /// A token, which can be sent as `page_token` to retrieve the next page.
6173 /// If this field is omitted, there are no subsequent pages.
6174 pub next_page_token: std::string::String,
6175
6176 /// Locations which could not be reached.
6177 pub unreachable: std::vec::Vec<std::string::String>,
6178
6179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6180}
6181
6182impl ListReleaseConfigsResponse {
6183 pub fn new() -> Self {
6184 std::default::Default::default()
6185 }
6186
6187 /// Sets the value of [release_configs][crate::model::ListReleaseConfigsResponse::release_configs].
6188 ///
6189 /// # Example
6190 /// ```ignore,no_run
6191 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6192 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6193 /// let x = ListReleaseConfigsResponse::new()
6194 /// .set_release_configs([
6195 /// ReleaseConfig::default()/* use setters */,
6196 /// ReleaseConfig::default()/* use (different) setters */,
6197 /// ]);
6198 /// ```
6199 pub fn set_release_configs<T, V>(mut self, v: T) -> Self
6200 where
6201 T: std::iter::IntoIterator<Item = V>,
6202 V: std::convert::Into<crate::model::ReleaseConfig>,
6203 {
6204 use std::iter::Iterator;
6205 self.release_configs = v.into_iter().map(|i| i.into()).collect();
6206 self
6207 }
6208
6209 /// Sets the value of [next_page_token][crate::model::ListReleaseConfigsResponse::next_page_token].
6210 ///
6211 /// # Example
6212 /// ```ignore,no_run
6213 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6214 /// let x = ListReleaseConfigsResponse::new().set_next_page_token("example");
6215 /// ```
6216 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6217 self.next_page_token = v.into();
6218 self
6219 }
6220
6221 /// Sets the value of [unreachable][crate::model::ListReleaseConfigsResponse::unreachable].
6222 ///
6223 /// # Example
6224 /// ```ignore,no_run
6225 /// # use google_cloud_dataform_v1::model::ListReleaseConfigsResponse;
6226 /// let x = ListReleaseConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6227 /// ```
6228 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6229 where
6230 T: std::iter::IntoIterator<Item = V>,
6231 V: std::convert::Into<std::string::String>,
6232 {
6233 use std::iter::Iterator;
6234 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6235 self
6236 }
6237}
6238
6239impl wkt::message::Message for ListReleaseConfigsResponse {
6240 fn typename() -> &'static str {
6241 "type.googleapis.com/google.cloud.dataform.v1.ListReleaseConfigsResponse"
6242 }
6243}
6244
6245#[doc(hidden)]
6246impl google_cloud_gax::paginator::internal::PageableResponse for ListReleaseConfigsResponse {
6247 type PageItem = crate::model::ReleaseConfig;
6248
6249 fn items(self) -> std::vec::Vec<Self::PageItem> {
6250 self.release_configs
6251 }
6252
6253 fn next_page_token(&self) -> std::string::String {
6254 use std::clone::Clone;
6255 self.next_page_token.clone()
6256 }
6257}
6258
6259/// `GetReleaseConfig` request message.
6260#[derive(Clone, Default, PartialEq)]
6261#[non_exhaustive]
6262pub struct GetReleaseConfigRequest {
6263 /// Required. The release config's name.
6264 pub name: std::string::String,
6265
6266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6267}
6268
6269impl GetReleaseConfigRequest {
6270 pub fn new() -> Self {
6271 std::default::Default::default()
6272 }
6273
6274 /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
6275 ///
6276 /// # Example
6277 /// ```ignore,no_run
6278 /// # use google_cloud_dataform_v1::model::GetReleaseConfigRequest;
6279 /// let x = GetReleaseConfigRequest::new().set_name("example");
6280 /// ```
6281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6282 self.name = v.into();
6283 self
6284 }
6285}
6286
6287impl wkt::message::Message for GetReleaseConfigRequest {
6288 fn typename() -> &'static str {
6289 "type.googleapis.com/google.cloud.dataform.v1.GetReleaseConfigRequest"
6290 }
6291}
6292
6293/// `CreateReleaseConfig` request message.
6294#[derive(Clone, Default, PartialEq)]
6295#[non_exhaustive]
6296pub struct CreateReleaseConfigRequest {
6297 /// Required. The repository in which to create the release config. Must be in
6298 /// the format `projects/*/locations/*/repositories/*`.
6299 pub parent: std::string::String,
6300
6301 /// Required. The release config to create.
6302 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6303
6304 /// Required. The ID to use for the release config, which will become the final
6305 /// component of the release config's resource name.
6306 pub release_config_id: std::string::String,
6307
6308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6309}
6310
6311impl CreateReleaseConfigRequest {
6312 pub fn new() -> Self {
6313 std::default::Default::default()
6314 }
6315
6316 /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
6317 ///
6318 /// # Example
6319 /// ```ignore,no_run
6320 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6321 /// let x = CreateReleaseConfigRequest::new().set_parent("example");
6322 /// ```
6323 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6324 self.parent = v.into();
6325 self
6326 }
6327
6328 /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6329 ///
6330 /// # Example
6331 /// ```ignore,no_run
6332 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6333 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6334 /// let x = CreateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6335 /// ```
6336 pub fn set_release_config<T>(mut self, v: T) -> Self
6337 where
6338 T: std::convert::Into<crate::model::ReleaseConfig>,
6339 {
6340 self.release_config = std::option::Option::Some(v.into());
6341 self
6342 }
6343
6344 /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
6345 ///
6346 /// # Example
6347 /// ```ignore,no_run
6348 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6349 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6350 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6351 /// let x = CreateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6352 /// ```
6353 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6354 where
6355 T: std::convert::Into<crate::model::ReleaseConfig>,
6356 {
6357 self.release_config = v.map(|x| x.into());
6358 self
6359 }
6360
6361 /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
6362 ///
6363 /// # Example
6364 /// ```ignore,no_run
6365 /// # use google_cloud_dataform_v1::model::CreateReleaseConfigRequest;
6366 /// let x = CreateReleaseConfigRequest::new().set_release_config_id("example");
6367 /// ```
6368 pub fn set_release_config_id<T: std::convert::Into<std::string::String>>(
6369 mut self,
6370 v: T,
6371 ) -> Self {
6372 self.release_config_id = v.into();
6373 self
6374 }
6375}
6376
6377impl wkt::message::Message for CreateReleaseConfigRequest {
6378 fn typename() -> &'static str {
6379 "type.googleapis.com/google.cloud.dataform.v1.CreateReleaseConfigRequest"
6380 }
6381}
6382
6383/// `UpdateReleaseConfig` request message.
6384#[derive(Clone, Default, PartialEq)]
6385#[non_exhaustive]
6386pub struct UpdateReleaseConfigRequest {
6387 /// Optional. Specifies the fields to be updated in the release config. If left
6388 /// unset, all fields will be updated.
6389 pub update_mask: std::option::Option<wkt::FieldMask>,
6390
6391 /// Required. The release config to update.
6392 pub release_config: std::option::Option<crate::model::ReleaseConfig>,
6393
6394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6395}
6396
6397impl UpdateReleaseConfigRequest {
6398 pub fn new() -> Self {
6399 std::default::Default::default()
6400 }
6401
6402 /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6407 /// use wkt::FieldMask;
6408 /// let x = UpdateReleaseConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6409 /// ```
6410 pub fn set_update_mask<T>(mut self, v: T) -> Self
6411 where
6412 T: std::convert::Into<wkt::FieldMask>,
6413 {
6414 self.update_mask = std::option::Option::Some(v.into());
6415 self
6416 }
6417
6418 /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
6419 ///
6420 /// # Example
6421 /// ```ignore,no_run
6422 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6423 /// use wkt::FieldMask;
6424 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6425 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6426 /// ```
6427 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6428 where
6429 T: std::convert::Into<wkt::FieldMask>,
6430 {
6431 self.update_mask = v.map(|x| x.into());
6432 self
6433 }
6434
6435 /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6436 ///
6437 /// # Example
6438 /// ```ignore,no_run
6439 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6440 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6441 /// let x = UpdateReleaseConfigRequest::new().set_release_config(ReleaseConfig::default()/* use setters */);
6442 /// ```
6443 pub fn set_release_config<T>(mut self, v: T) -> Self
6444 where
6445 T: std::convert::Into<crate::model::ReleaseConfig>,
6446 {
6447 self.release_config = std::option::Option::Some(v.into());
6448 self
6449 }
6450
6451 /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_dataform_v1::model::UpdateReleaseConfigRequest;
6456 /// use google_cloud_dataform_v1::model::ReleaseConfig;
6457 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(Some(ReleaseConfig::default()/* use setters */));
6458 /// let x = UpdateReleaseConfigRequest::new().set_or_clear_release_config(None::<ReleaseConfig>);
6459 /// ```
6460 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
6461 where
6462 T: std::convert::Into<crate::model::ReleaseConfig>,
6463 {
6464 self.release_config = v.map(|x| x.into());
6465 self
6466 }
6467}
6468
6469impl wkt::message::Message for UpdateReleaseConfigRequest {
6470 fn typename() -> &'static str {
6471 "type.googleapis.com/google.cloud.dataform.v1.UpdateReleaseConfigRequest"
6472 }
6473}
6474
6475/// `DeleteReleaseConfig` request message.
6476#[derive(Clone, Default, PartialEq)]
6477#[non_exhaustive]
6478pub struct DeleteReleaseConfigRequest {
6479 /// Required. The release config's name.
6480 pub name: std::string::String,
6481
6482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6483}
6484
6485impl DeleteReleaseConfigRequest {
6486 pub fn new() -> Self {
6487 std::default::Default::default()
6488 }
6489
6490 /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
6491 ///
6492 /// # Example
6493 /// ```ignore,no_run
6494 /// # use google_cloud_dataform_v1::model::DeleteReleaseConfigRequest;
6495 /// let x = DeleteReleaseConfigRequest::new().set_name("example");
6496 /// ```
6497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6498 self.name = v.into();
6499 self
6500 }
6501}
6502
6503impl wkt::message::Message for DeleteReleaseConfigRequest {
6504 fn typename() -> &'static str {
6505 "type.googleapis.com/google.cloud.dataform.v1.DeleteReleaseConfigRequest"
6506 }
6507}
6508
6509/// Represents the result of compiling a Dataform project.
6510#[derive(Clone, Default, PartialEq)]
6511#[non_exhaustive]
6512pub struct CompilationResult {
6513 /// Output only. The compilation result's name.
6514 pub name: std::string::String,
6515
6516 /// Immutable. If set, fields of `code_compilation_config` override the default
6517 /// compilation settings that are specified in dataform.json.
6518 pub code_compilation_config: std::option::Option<crate::model::CodeCompilationConfig>,
6519
6520 /// Output only. The fully resolved Git commit SHA of the code that was
6521 /// compiled. Not set for compilation results whose source is a workspace.
6522 pub resolved_git_commit_sha: std::string::String,
6523
6524 /// Output only. The version of `@dataform/core` that was used for compilation.
6525 pub dataform_core_version: std::string::String,
6526
6527 /// Output only. Errors encountered during project compilation.
6528 pub compilation_errors: std::vec::Vec<crate::model::compilation_result::CompilationError>,
6529
6530 /// Output only. Only set if the repository has a KMS Key.
6531 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
6532
6533 /// Output only. The timestamp of when the compilation result was created.
6534 pub create_time: std::option::Option<wkt::Timestamp>,
6535
6536 /// Output only. All the metadata information that is used internally to serve
6537 /// the resource. For example: timestamps, flags, status fields, etc. The
6538 /// format of this field is a JSON string.
6539 pub internal_metadata: std::option::Option<std::string::String>,
6540
6541 /// Output only. Metadata indicating whether this resource is user-scoped.
6542 /// `CompilationResult` resource is `user_scoped` only if it is sourced
6543 /// from a workspace.
6544 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
6545
6546 /// The source of the compilation result.
6547 pub source: std::option::Option<crate::model::compilation_result::Source>,
6548
6549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6550}
6551
6552impl CompilationResult {
6553 pub fn new() -> Self {
6554 std::default::Default::default()
6555 }
6556
6557 /// Sets the value of [name][crate::model::CompilationResult::name].
6558 ///
6559 /// # Example
6560 /// ```ignore,no_run
6561 /// # use google_cloud_dataform_v1::model::CompilationResult;
6562 /// let x = CompilationResult::new().set_name("example");
6563 /// ```
6564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6565 self.name = v.into();
6566 self
6567 }
6568
6569 /// Sets the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
6570 ///
6571 /// # Example
6572 /// ```ignore,no_run
6573 /// # use google_cloud_dataform_v1::model::CompilationResult;
6574 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6575 /// let x = CompilationResult::new().set_code_compilation_config(CodeCompilationConfig::default()/* use setters */);
6576 /// ```
6577 pub fn set_code_compilation_config<T>(mut self, v: T) -> Self
6578 where
6579 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6580 {
6581 self.code_compilation_config = std::option::Option::Some(v.into());
6582 self
6583 }
6584
6585 /// Sets or clears the value of [code_compilation_config][crate::model::CompilationResult::code_compilation_config].
6586 ///
6587 /// # Example
6588 /// ```ignore,no_run
6589 /// # use google_cloud_dataform_v1::model::CompilationResult;
6590 /// use google_cloud_dataform_v1::model::CodeCompilationConfig;
6591 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(Some(CodeCompilationConfig::default()/* use setters */));
6592 /// let x = CompilationResult::new().set_or_clear_code_compilation_config(None::<CodeCompilationConfig>);
6593 /// ```
6594 pub fn set_or_clear_code_compilation_config<T>(mut self, v: std::option::Option<T>) -> Self
6595 where
6596 T: std::convert::Into<crate::model::CodeCompilationConfig>,
6597 {
6598 self.code_compilation_config = v.map(|x| x.into());
6599 self
6600 }
6601
6602 /// Sets the value of [resolved_git_commit_sha][crate::model::CompilationResult::resolved_git_commit_sha].
6603 ///
6604 /// # Example
6605 /// ```ignore,no_run
6606 /// # use google_cloud_dataform_v1::model::CompilationResult;
6607 /// let x = CompilationResult::new().set_resolved_git_commit_sha("example");
6608 /// ```
6609 pub fn set_resolved_git_commit_sha<T: std::convert::Into<std::string::String>>(
6610 mut self,
6611 v: T,
6612 ) -> Self {
6613 self.resolved_git_commit_sha = v.into();
6614 self
6615 }
6616
6617 /// Sets the value of [dataform_core_version][crate::model::CompilationResult::dataform_core_version].
6618 ///
6619 /// # Example
6620 /// ```ignore,no_run
6621 /// # use google_cloud_dataform_v1::model::CompilationResult;
6622 /// let x = CompilationResult::new().set_dataform_core_version("example");
6623 /// ```
6624 pub fn set_dataform_core_version<T: std::convert::Into<std::string::String>>(
6625 mut self,
6626 v: T,
6627 ) -> Self {
6628 self.dataform_core_version = v.into();
6629 self
6630 }
6631
6632 /// Sets the value of [compilation_errors][crate::model::CompilationResult::compilation_errors].
6633 ///
6634 /// # Example
6635 /// ```ignore,no_run
6636 /// # use google_cloud_dataform_v1::model::CompilationResult;
6637 /// use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6638 /// let x = CompilationResult::new()
6639 /// .set_compilation_errors([
6640 /// CompilationError::default()/* use setters */,
6641 /// CompilationError::default()/* use (different) setters */,
6642 /// ]);
6643 /// ```
6644 pub fn set_compilation_errors<T, V>(mut self, v: T) -> Self
6645 where
6646 T: std::iter::IntoIterator<Item = V>,
6647 V: std::convert::Into<crate::model::compilation_result::CompilationError>,
6648 {
6649 use std::iter::Iterator;
6650 self.compilation_errors = v.into_iter().map(|i| i.into()).collect();
6651 self
6652 }
6653
6654 /// Sets the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
6655 ///
6656 /// # Example
6657 /// ```ignore,no_run
6658 /// # use google_cloud_dataform_v1::model::CompilationResult;
6659 /// use google_cloud_dataform_v1::model::DataEncryptionState;
6660 /// let x = CompilationResult::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
6661 /// ```
6662 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
6663 where
6664 T: std::convert::Into<crate::model::DataEncryptionState>,
6665 {
6666 self.data_encryption_state = std::option::Option::Some(v.into());
6667 self
6668 }
6669
6670 /// Sets or clears the value of [data_encryption_state][crate::model::CompilationResult::data_encryption_state].
6671 ///
6672 /// # Example
6673 /// ```ignore,no_run
6674 /// # use google_cloud_dataform_v1::model::CompilationResult;
6675 /// use google_cloud_dataform_v1::model::DataEncryptionState;
6676 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
6677 /// let x = CompilationResult::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
6678 /// ```
6679 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
6680 where
6681 T: std::convert::Into<crate::model::DataEncryptionState>,
6682 {
6683 self.data_encryption_state = v.map(|x| x.into());
6684 self
6685 }
6686
6687 /// Sets the value of [create_time][crate::model::CompilationResult::create_time].
6688 ///
6689 /// # Example
6690 /// ```ignore,no_run
6691 /// # use google_cloud_dataform_v1::model::CompilationResult;
6692 /// use wkt::Timestamp;
6693 /// let x = CompilationResult::new().set_create_time(Timestamp::default()/* use setters */);
6694 /// ```
6695 pub fn set_create_time<T>(mut self, v: T) -> Self
6696 where
6697 T: std::convert::Into<wkt::Timestamp>,
6698 {
6699 self.create_time = std::option::Option::Some(v.into());
6700 self
6701 }
6702
6703 /// Sets or clears the value of [create_time][crate::model::CompilationResult::create_time].
6704 ///
6705 /// # Example
6706 /// ```ignore,no_run
6707 /// # use google_cloud_dataform_v1::model::CompilationResult;
6708 /// use wkt::Timestamp;
6709 /// let x = CompilationResult::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6710 /// let x = CompilationResult::new().set_or_clear_create_time(None::<Timestamp>);
6711 /// ```
6712 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6713 where
6714 T: std::convert::Into<wkt::Timestamp>,
6715 {
6716 self.create_time = v.map(|x| x.into());
6717 self
6718 }
6719
6720 /// Sets the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
6721 ///
6722 /// # Example
6723 /// ```ignore,no_run
6724 /// # use google_cloud_dataform_v1::model::CompilationResult;
6725 /// let x = CompilationResult::new().set_internal_metadata("example");
6726 /// ```
6727 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
6728 where
6729 T: std::convert::Into<std::string::String>,
6730 {
6731 self.internal_metadata = std::option::Option::Some(v.into());
6732 self
6733 }
6734
6735 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResult::internal_metadata].
6736 ///
6737 /// # Example
6738 /// ```ignore,no_run
6739 /// # use google_cloud_dataform_v1::model::CompilationResult;
6740 /// let x = CompilationResult::new().set_or_clear_internal_metadata(Some("example"));
6741 /// let x = CompilationResult::new().set_or_clear_internal_metadata(None::<String>);
6742 /// ```
6743 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6744 where
6745 T: std::convert::Into<std::string::String>,
6746 {
6747 self.internal_metadata = v.map(|x| x.into());
6748 self
6749 }
6750
6751 /// Sets the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
6752 ///
6753 /// # Example
6754 /// ```ignore,no_run
6755 /// # use google_cloud_dataform_v1::model::CompilationResult;
6756 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
6757 /// let x = CompilationResult::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
6758 /// ```
6759 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
6760 where
6761 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
6762 {
6763 self.private_resource_metadata = std::option::Option::Some(v.into());
6764 self
6765 }
6766
6767 /// Sets or clears the value of [private_resource_metadata][crate::model::CompilationResult::private_resource_metadata].
6768 ///
6769 /// # Example
6770 /// ```ignore,no_run
6771 /// # use google_cloud_dataform_v1::model::CompilationResult;
6772 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
6773 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
6774 /// let x = CompilationResult::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
6775 /// ```
6776 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6777 where
6778 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
6779 {
6780 self.private_resource_metadata = v.map(|x| x.into());
6781 self
6782 }
6783
6784 /// Sets the value of [source][crate::model::CompilationResult::source].
6785 ///
6786 /// Note that all the setters affecting `source` are mutually
6787 /// exclusive.
6788 ///
6789 /// # Example
6790 /// ```ignore,no_run
6791 /// # use google_cloud_dataform_v1::model::CompilationResult;
6792 /// use google_cloud_dataform_v1::model::compilation_result::Source;
6793 /// let x = CompilationResult::new().set_source(Some(Source::GitCommitish("example".to_string())));
6794 /// ```
6795 pub fn set_source<
6796 T: std::convert::Into<std::option::Option<crate::model::compilation_result::Source>>,
6797 >(
6798 mut self,
6799 v: T,
6800 ) -> Self {
6801 self.source = v.into();
6802 self
6803 }
6804
6805 /// The value of [source][crate::model::CompilationResult::source]
6806 /// if it holds a `GitCommitish`, `None` if the field is not set or
6807 /// holds a different branch.
6808 pub fn git_commitish(&self) -> std::option::Option<&std::string::String> {
6809 #[allow(unreachable_patterns)]
6810 self.source.as_ref().and_then(|v| match v {
6811 crate::model::compilation_result::Source::GitCommitish(v) => {
6812 std::option::Option::Some(v)
6813 }
6814 _ => std::option::Option::None,
6815 })
6816 }
6817
6818 /// Sets the value of [source][crate::model::CompilationResult::source]
6819 /// to hold a `GitCommitish`.
6820 ///
6821 /// Note that all the setters affecting `source` are
6822 /// mutually exclusive.
6823 ///
6824 /// # Example
6825 /// ```ignore,no_run
6826 /// # use google_cloud_dataform_v1::model::CompilationResult;
6827 /// let x = CompilationResult::new().set_git_commitish("example");
6828 /// assert!(x.git_commitish().is_some());
6829 /// assert!(x.workspace().is_none());
6830 /// assert!(x.release_config().is_none());
6831 /// ```
6832 pub fn set_git_commitish<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6833 self.source = std::option::Option::Some(
6834 crate::model::compilation_result::Source::GitCommitish(v.into()),
6835 );
6836 self
6837 }
6838
6839 /// The value of [source][crate::model::CompilationResult::source]
6840 /// if it holds a `Workspace`, `None` if the field is not set or
6841 /// holds a different branch.
6842 pub fn workspace(&self) -> std::option::Option<&std::string::String> {
6843 #[allow(unreachable_patterns)]
6844 self.source.as_ref().and_then(|v| match v {
6845 crate::model::compilation_result::Source::Workspace(v) => std::option::Option::Some(v),
6846 _ => std::option::Option::None,
6847 })
6848 }
6849
6850 /// Sets the value of [source][crate::model::CompilationResult::source]
6851 /// to hold a `Workspace`.
6852 ///
6853 /// Note that all the setters affecting `source` are
6854 /// mutually exclusive.
6855 ///
6856 /// # Example
6857 /// ```ignore,no_run
6858 /// # use google_cloud_dataform_v1::model::CompilationResult;
6859 /// let x = CompilationResult::new().set_workspace("example");
6860 /// assert!(x.workspace().is_some());
6861 /// assert!(x.git_commitish().is_none());
6862 /// assert!(x.release_config().is_none());
6863 /// ```
6864 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6865 self.source = std::option::Option::Some(
6866 crate::model::compilation_result::Source::Workspace(v.into()),
6867 );
6868 self
6869 }
6870
6871 /// The value of [source][crate::model::CompilationResult::source]
6872 /// if it holds a `ReleaseConfig`, `None` if the field is not set or
6873 /// holds a different branch.
6874 pub fn release_config(&self) -> std::option::Option<&std::string::String> {
6875 #[allow(unreachable_patterns)]
6876 self.source.as_ref().and_then(|v| match v {
6877 crate::model::compilation_result::Source::ReleaseConfig(v) => {
6878 std::option::Option::Some(v)
6879 }
6880 _ => std::option::Option::None,
6881 })
6882 }
6883
6884 /// Sets the value of [source][crate::model::CompilationResult::source]
6885 /// to hold a `ReleaseConfig`.
6886 ///
6887 /// Note that all the setters affecting `source` are
6888 /// mutually exclusive.
6889 ///
6890 /// # Example
6891 /// ```ignore,no_run
6892 /// # use google_cloud_dataform_v1::model::CompilationResult;
6893 /// let x = CompilationResult::new().set_release_config("example");
6894 /// assert!(x.release_config().is_some());
6895 /// assert!(x.git_commitish().is_none());
6896 /// assert!(x.workspace().is_none());
6897 /// ```
6898 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6899 self.source = std::option::Option::Some(
6900 crate::model::compilation_result::Source::ReleaseConfig(v.into()),
6901 );
6902 self
6903 }
6904}
6905
6906impl wkt::message::Message for CompilationResult {
6907 fn typename() -> &'static str {
6908 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult"
6909 }
6910}
6911
6912/// Defines additional types related to [CompilationResult].
6913pub mod compilation_result {
6914 #[allow(unused_imports)]
6915 use super::*;
6916
6917 /// An error encountered when attempting to compile a Dataform project.
6918 #[derive(Clone, Default, PartialEq)]
6919 #[non_exhaustive]
6920 pub struct CompilationError {
6921 /// Output only. The error's top level message.
6922 pub message: std::string::String,
6923
6924 /// Output only. The error's full stack trace.
6925 pub stack: std::string::String,
6926
6927 /// Output only. The path of the file where this error occurred, if
6928 /// available, relative to the project root.
6929 pub path: std::string::String,
6930
6931 /// Output only. The identifier of the action where this error occurred, if
6932 /// available.
6933 pub action_target: std::option::Option<crate::model::Target>,
6934
6935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6936 }
6937
6938 impl CompilationError {
6939 pub fn new() -> Self {
6940 std::default::Default::default()
6941 }
6942
6943 /// Sets the value of [message][crate::model::compilation_result::CompilationError::message].
6944 ///
6945 /// # Example
6946 /// ```ignore,no_run
6947 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6948 /// let x = CompilationError::new().set_message("example");
6949 /// ```
6950 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6951 self.message = v.into();
6952 self
6953 }
6954
6955 /// Sets the value of [stack][crate::model::compilation_result::CompilationError::stack].
6956 ///
6957 /// # Example
6958 /// ```ignore,no_run
6959 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6960 /// let x = CompilationError::new().set_stack("example");
6961 /// ```
6962 pub fn set_stack<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6963 self.stack = v.into();
6964 self
6965 }
6966
6967 /// Sets the value of [path][crate::model::compilation_result::CompilationError::path].
6968 ///
6969 /// # Example
6970 /// ```ignore,no_run
6971 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6972 /// let x = CompilationError::new().set_path("example");
6973 /// ```
6974 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6975 self.path = v.into();
6976 self
6977 }
6978
6979 /// Sets the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
6980 ///
6981 /// # Example
6982 /// ```ignore,no_run
6983 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
6984 /// use google_cloud_dataform_v1::model::Target;
6985 /// let x = CompilationError::new().set_action_target(Target::default()/* use setters */);
6986 /// ```
6987 pub fn set_action_target<T>(mut self, v: T) -> Self
6988 where
6989 T: std::convert::Into<crate::model::Target>,
6990 {
6991 self.action_target = std::option::Option::Some(v.into());
6992 self
6993 }
6994
6995 /// Sets or clears the value of [action_target][crate::model::compilation_result::CompilationError::action_target].
6996 ///
6997 /// # Example
6998 /// ```ignore,no_run
6999 /// # use google_cloud_dataform_v1::model::compilation_result::CompilationError;
7000 /// use google_cloud_dataform_v1::model::Target;
7001 /// let x = CompilationError::new().set_or_clear_action_target(Some(Target::default()/* use setters */));
7002 /// let x = CompilationError::new().set_or_clear_action_target(None::<Target>);
7003 /// ```
7004 pub fn set_or_clear_action_target<T>(mut self, v: std::option::Option<T>) -> Self
7005 where
7006 T: std::convert::Into<crate::model::Target>,
7007 {
7008 self.action_target = v.map(|x| x.into());
7009 self
7010 }
7011 }
7012
7013 impl wkt::message::Message for CompilationError {
7014 fn typename() -> &'static str {
7015 "type.googleapis.com/google.cloud.dataform.v1.CompilationResult.CompilationError"
7016 }
7017 }
7018
7019 /// The source of the compilation result.
7020 #[derive(Clone, Debug, PartialEq)]
7021 #[non_exhaustive]
7022 pub enum Source {
7023 /// Immutable. Git commit/tag/branch name at which the repository should be
7024 /// compiled. Must exist in the remote repository. Examples:
7025 ///
7026 /// - a commit SHA: `12ade345`
7027 /// - a tag: `tag1`
7028 /// - a branch name: `branch1`
7029 GitCommitish(std::string::String),
7030 /// Immutable. The name of the workspace to compile. Must be in the format
7031 /// `projects/*/locations/*/repositories/*/workspaces/*`.
7032 Workspace(std::string::String),
7033 /// Immutable. The name of the release config to compile. Must be in the
7034 /// format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
7035 ReleaseConfig(std::string::String),
7036 }
7037}
7038
7039/// Configures various aspects of Dataform code compilation.
7040#[derive(Clone, Default, PartialEq)]
7041#[non_exhaustive]
7042pub struct CodeCompilationConfig {
7043 /// Optional. The default database (Google Cloud project ID).
7044 pub default_database: std::string::String,
7045
7046 /// Optional. The default schema (BigQuery dataset ID).
7047 pub default_schema: std::string::String,
7048
7049 /// Optional. The default BigQuery location to use. Defaults to "US".
7050 /// See the BigQuery docs for a full list of locations:
7051 /// <https://cloud.google.com/bigquery/docs/locations>.
7052 pub default_location: std::string::String,
7053
7054 /// Optional. The default schema (BigQuery dataset ID) for assertions.
7055 pub assertion_schema: std::string::String,
7056
7057 /// Optional. User-defined variables that are made available to project code
7058 /// during compilation.
7059 pub vars: std::collections::HashMap<std::string::String, std::string::String>,
7060
7061 /// Optional. The suffix that should be appended to all database (Google Cloud
7062 /// project ID) names.
7063 pub database_suffix: std::string::String,
7064
7065 /// Optional. The suffix that should be appended to all schema (BigQuery
7066 /// dataset ID) names.
7067 pub schema_suffix: std::string::String,
7068
7069 /// Optional. The prefix that should be prepended to all table names.
7070 pub table_prefix: std::string::String,
7071
7072 /// Optional. The prefix to prepend to built-in assertion names.
7073 pub builtin_assertion_name_prefix: std::string::String,
7074
7075 /// Optional. The default notebook runtime options.
7076 pub default_notebook_runtime_options: std::option::Option<crate::model::NotebookRuntimeOptions>,
7077
7078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7079}
7080
7081impl CodeCompilationConfig {
7082 pub fn new() -> Self {
7083 std::default::Default::default()
7084 }
7085
7086 /// Sets the value of [default_database][crate::model::CodeCompilationConfig::default_database].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7091 /// let x = CodeCompilationConfig::new().set_default_database("example");
7092 /// ```
7093 pub fn set_default_database<T: std::convert::Into<std::string::String>>(
7094 mut self,
7095 v: T,
7096 ) -> Self {
7097 self.default_database = v.into();
7098 self
7099 }
7100
7101 /// Sets the value of [default_schema][crate::model::CodeCompilationConfig::default_schema].
7102 ///
7103 /// # Example
7104 /// ```ignore,no_run
7105 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7106 /// let x = CodeCompilationConfig::new().set_default_schema("example");
7107 /// ```
7108 pub fn set_default_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7109 self.default_schema = v.into();
7110 self
7111 }
7112
7113 /// Sets the value of [default_location][crate::model::CodeCompilationConfig::default_location].
7114 ///
7115 /// # Example
7116 /// ```ignore,no_run
7117 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7118 /// let x = CodeCompilationConfig::new().set_default_location("example");
7119 /// ```
7120 pub fn set_default_location<T: std::convert::Into<std::string::String>>(
7121 mut self,
7122 v: T,
7123 ) -> Self {
7124 self.default_location = v.into();
7125 self
7126 }
7127
7128 /// Sets the value of [assertion_schema][crate::model::CodeCompilationConfig::assertion_schema].
7129 ///
7130 /// # Example
7131 /// ```ignore,no_run
7132 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7133 /// let x = CodeCompilationConfig::new().set_assertion_schema("example");
7134 /// ```
7135 pub fn set_assertion_schema<T: std::convert::Into<std::string::String>>(
7136 mut self,
7137 v: T,
7138 ) -> Self {
7139 self.assertion_schema = v.into();
7140 self
7141 }
7142
7143 /// Sets the value of [vars][crate::model::CodeCompilationConfig::vars].
7144 ///
7145 /// # Example
7146 /// ```ignore,no_run
7147 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7148 /// let x = CodeCompilationConfig::new().set_vars([
7149 /// ("key0", "abc"),
7150 /// ("key1", "xyz"),
7151 /// ]);
7152 /// ```
7153 pub fn set_vars<T, K, V>(mut self, v: T) -> Self
7154 where
7155 T: std::iter::IntoIterator<Item = (K, V)>,
7156 K: std::convert::Into<std::string::String>,
7157 V: std::convert::Into<std::string::String>,
7158 {
7159 use std::iter::Iterator;
7160 self.vars = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7161 self
7162 }
7163
7164 /// Sets the value of [database_suffix][crate::model::CodeCompilationConfig::database_suffix].
7165 ///
7166 /// # Example
7167 /// ```ignore,no_run
7168 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7169 /// let x = CodeCompilationConfig::new().set_database_suffix("example");
7170 /// ```
7171 pub fn set_database_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7172 self.database_suffix = v.into();
7173 self
7174 }
7175
7176 /// Sets the value of [schema_suffix][crate::model::CodeCompilationConfig::schema_suffix].
7177 ///
7178 /// # Example
7179 /// ```ignore,no_run
7180 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7181 /// let x = CodeCompilationConfig::new().set_schema_suffix("example");
7182 /// ```
7183 pub fn set_schema_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7184 self.schema_suffix = v.into();
7185 self
7186 }
7187
7188 /// Sets the value of [table_prefix][crate::model::CodeCompilationConfig::table_prefix].
7189 ///
7190 /// # Example
7191 /// ```ignore,no_run
7192 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7193 /// let x = CodeCompilationConfig::new().set_table_prefix("example");
7194 /// ```
7195 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7196 self.table_prefix = v.into();
7197 self
7198 }
7199
7200 /// Sets the value of [builtin_assertion_name_prefix][crate::model::CodeCompilationConfig::builtin_assertion_name_prefix].
7201 ///
7202 /// # Example
7203 /// ```ignore,no_run
7204 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7205 /// let x = CodeCompilationConfig::new().set_builtin_assertion_name_prefix("example");
7206 /// ```
7207 pub fn set_builtin_assertion_name_prefix<T: std::convert::Into<std::string::String>>(
7208 mut self,
7209 v: T,
7210 ) -> Self {
7211 self.builtin_assertion_name_prefix = v.into();
7212 self
7213 }
7214
7215 /// Sets the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7216 ///
7217 /// # Example
7218 /// ```ignore,no_run
7219 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7220 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7221 /// let x = CodeCompilationConfig::new().set_default_notebook_runtime_options(NotebookRuntimeOptions::default()/* use setters */);
7222 /// ```
7223 pub fn set_default_notebook_runtime_options<T>(mut self, v: T) -> Self
7224 where
7225 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7226 {
7227 self.default_notebook_runtime_options = std::option::Option::Some(v.into());
7228 self
7229 }
7230
7231 /// Sets or clears the value of [default_notebook_runtime_options][crate::model::CodeCompilationConfig::default_notebook_runtime_options].
7232 ///
7233 /// # Example
7234 /// ```ignore,no_run
7235 /// # use google_cloud_dataform_v1::model::CodeCompilationConfig;
7236 /// use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7237 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(Some(NotebookRuntimeOptions::default()/* use setters */));
7238 /// let x = CodeCompilationConfig::new().set_or_clear_default_notebook_runtime_options(None::<NotebookRuntimeOptions>);
7239 /// ```
7240 pub fn set_or_clear_default_notebook_runtime_options<T>(
7241 mut self,
7242 v: std::option::Option<T>,
7243 ) -> Self
7244 where
7245 T: std::convert::Into<crate::model::NotebookRuntimeOptions>,
7246 {
7247 self.default_notebook_runtime_options = v.map(|x| x.into());
7248 self
7249 }
7250}
7251
7252impl wkt::message::Message for CodeCompilationConfig {
7253 fn typename() -> &'static str {
7254 "type.googleapis.com/google.cloud.dataform.v1.CodeCompilationConfig"
7255 }
7256}
7257
7258/// Configures various aspects of Dataform notebook runtime.
7259#[derive(Clone, Default, PartialEq)]
7260#[non_exhaustive]
7261pub struct NotebookRuntimeOptions {
7262 /// Optional. The resource name of the [Colab runtime template]
7263 /// (<https://cloud.google.com/colab/docs/runtimes>), from which a runtime is
7264 /// created for notebook executions. If not specified, a runtime is created
7265 /// with Colab's default specifications.
7266 pub ai_platform_notebook_runtime_template: std::string::String,
7267
7268 /// The location to store the notebook execution result.
7269 pub execution_sink: std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
7270
7271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7272}
7273
7274impl NotebookRuntimeOptions {
7275 pub fn new() -> Self {
7276 std::default::Default::default()
7277 }
7278
7279 /// Sets the value of [ai_platform_notebook_runtime_template][crate::model::NotebookRuntimeOptions::ai_platform_notebook_runtime_template].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7284 /// let x = NotebookRuntimeOptions::new().set_ai_platform_notebook_runtime_template("example");
7285 /// ```
7286 pub fn set_ai_platform_notebook_runtime_template<T: std::convert::Into<std::string::String>>(
7287 mut self,
7288 v: T,
7289 ) -> Self {
7290 self.ai_platform_notebook_runtime_template = v.into();
7291 self
7292 }
7293
7294 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink].
7295 ///
7296 /// Note that all the setters affecting `execution_sink` are mutually
7297 /// exclusive.
7298 ///
7299 /// # Example
7300 /// ```ignore,no_run
7301 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7302 /// use google_cloud_dataform_v1::model::notebook_runtime_options::ExecutionSink;
7303 /// let x = NotebookRuntimeOptions::new().set_execution_sink(Some(ExecutionSink::GcsOutputBucket("example".to_string())));
7304 /// ```
7305 pub fn set_execution_sink<
7306 T: std::convert::Into<
7307 std::option::Option<crate::model::notebook_runtime_options::ExecutionSink>,
7308 >,
7309 >(
7310 mut self,
7311 v: T,
7312 ) -> Self {
7313 self.execution_sink = v.into();
7314 self
7315 }
7316
7317 /// The value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
7318 /// if it holds a `GcsOutputBucket`, `None` if the field is not set or
7319 /// holds a different branch.
7320 pub fn gcs_output_bucket(&self) -> std::option::Option<&std::string::String> {
7321 #[allow(unreachable_patterns)]
7322 self.execution_sink.as_ref().and_then(|v| match v {
7323 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v) => {
7324 std::option::Option::Some(v)
7325 }
7326 _ => std::option::Option::None,
7327 })
7328 }
7329
7330 /// Sets the value of [execution_sink][crate::model::NotebookRuntimeOptions::execution_sink]
7331 /// to hold a `GcsOutputBucket`.
7332 ///
7333 /// Note that all the setters affecting `execution_sink` are
7334 /// mutually exclusive.
7335 ///
7336 /// # Example
7337 /// ```ignore,no_run
7338 /// # use google_cloud_dataform_v1::model::NotebookRuntimeOptions;
7339 /// let x = NotebookRuntimeOptions::new().set_gcs_output_bucket("example");
7340 /// assert!(x.gcs_output_bucket().is_some());
7341 /// ```
7342 pub fn set_gcs_output_bucket<T: std::convert::Into<std::string::String>>(
7343 mut self,
7344 v: T,
7345 ) -> Self {
7346 self.execution_sink = std::option::Option::Some(
7347 crate::model::notebook_runtime_options::ExecutionSink::GcsOutputBucket(v.into()),
7348 );
7349 self
7350 }
7351}
7352
7353impl wkt::message::Message for NotebookRuntimeOptions {
7354 fn typename() -> &'static str {
7355 "type.googleapis.com/google.cloud.dataform.v1.NotebookRuntimeOptions"
7356 }
7357}
7358
7359/// Defines additional types related to [NotebookRuntimeOptions].
7360pub mod notebook_runtime_options {
7361 #[allow(unused_imports)]
7362 use super::*;
7363
7364 /// The location to store the notebook execution result.
7365 #[derive(Clone, Debug, PartialEq)]
7366 #[non_exhaustive]
7367 pub enum ExecutionSink {
7368 /// Optional. The Google Cloud Storage location to upload the result to.
7369 /// Format: `gs://bucket-name`.
7370 GcsOutputBucket(std::string::String),
7371 }
7372}
7373
7374/// `ListCompilationResults` request message.
7375#[derive(Clone, Default, PartialEq)]
7376#[non_exhaustive]
7377pub struct ListCompilationResultsRequest {
7378 /// Required. The repository in which to list compilation results. Must be in
7379 /// the format `projects/*/locations/*/repositories/*`.
7380 pub parent: std::string::String,
7381
7382 /// Optional. Maximum number of compilation results to return. The server may
7383 /// return fewer items than requested. If unspecified, the server will pick an
7384 /// appropriate default.
7385 pub page_size: i32,
7386
7387 /// Optional. Page token received from a previous `ListCompilationResults`
7388 /// call. Provide this to retrieve the subsequent page.
7389 ///
7390 /// When paginating, all other parameters provided to `ListCompilationResults`,
7391 /// with the exception of `page_size`, must match the call that provided the
7392 /// page token.
7393 pub page_token: std::string::String,
7394
7395 /// Optional. This field only supports ordering by `name` and `create_time`.
7396 /// If unspecified, the server will choose the ordering.
7397 /// If specified, the default order is ascending for the `name` field.
7398 pub order_by: std::string::String,
7399
7400 /// Optional. Filter for the returned list.
7401 pub filter: std::string::String,
7402
7403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7404}
7405
7406impl ListCompilationResultsRequest {
7407 pub fn new() -> Self {
7408 std::default::Default::default()
7409 }
7410
7411 /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
7412 ///
7413 /// # Example
7414 /// ```ignore,no_run
7415 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
7416 /// let x = ListCompilationResultsRequest::new().set_parent("example");
7417 /// ```
7418 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7419 self.parent = v.into();
7420 self
7421 }
7422
7423 /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
7428 /// let x = ListCompilationResultsRequest::new().set_page_size(42);
7429 /// ```
7430 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7431 self.page_size = v.into();
7432 self
7433 }
7434
7435 /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
7440 /// let x = ListCompilationResultsRequest::new().set_page_token("example");
7441 /// ```
7442 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7443 self.page_token = v.into();
7444 self
7445 }
7446
7447 /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
7448 ///
7449 /// # Example
7450 /// ```ignore,no_run
7451 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
7452 /// let x = ListCompilationResultsRequest::new().set_order_by("example");
7453 /// ```
7454 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7455 self.order_by = v.into();
7456 self
7457 }
7458
7459 /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
7460 ///
7461 /// # Example
7462 /// ```ignore,no_run
7463 /// # use google_cloud_dataform_v1::model::ListCompilationResultsRequest;
7464 /// let x = ListCompilationResultsRequest::new().set_filter("example");
7465 /// ```
7466 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7467 self.filter = v.into();
7468 self
7469 }
7470}
7471
7472impl wkt::message::Message for ListCompilationResultsRequest {
7473 fn typename() -> &'static str {
7474 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsRequest"
7475 }
7476}
7477
7478/// `ListCompilationResults` response message.
7479#[derive(Clone, Default, PartialEq)]
7480#[non_exhaustive]
7481pub struct ListCompilationResultsResponse {
7482 /// List of compilation results.
7483 pub compilation_results: std::vec::Vec<crate::model::CompilationResult>,
7484
7485 /// A token, which can be sent as `page_token` to retrieve the next page.
7486 /// If this field is omitted, there are no subsequent pages.
7487 pub next_page_token: std::string::String,
7488
7489 /// Locations which could not be reached.
7490 pub unreachable: std::vec::Vec<std::string::String>,
7491
7492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7493}
7494
7495impl ListCompilationResultsResponse {
7496 pub fn new() -> Self {
7497 std::default::Default::default()
7498 }
7499
7500 /// Sets the value of [compilation_results][crate::model::ListCompilationResultsResponse::compilation_results].
7501 ///
7502 /// # Example
7503 /// ```ignore,no_run
7504 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
7505 /// use google_cloud_dataform_v1::model::CompilationResult;
7506 /// let x = ListCompilationResultsResponse::new()
7507 /// .set_compilation_results([
7508 /// CompilationResult::default()/* use setters */,
7509 /// CompilationResult::default()/* use (different) setters */,
7510 /// ]);
7511 /// ```
7512 pub fn set_compilation_results<T, V>(mut self, v: T) -> Self
7513 where
7514 T: std::iter::IntoIterator<Item = V>,
7515 V: std::convert::Into<crate::model::CompilationResult>,
7516 {
7517 use std::iter::Iterator;
7518 self.compilation_results = v.into_iter().map(|i| i.into()).collect();
7519 self
7520 }
7521
7522 /// Sets the value of [next_page_token][crate::model::ListCompilationResultsResponse::next_page_token].
7523 ///
7524 /// # Example
7525 /// ```ignore,no_run
7526 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
7527 /// let x = ListCompilationResultsResponse::new().set_next_page_token("example");
7528 /// ```
7529 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7530 self.next_page_token = v.into();
7531 self
7532 }
7533
7534 /// Sets the value of [unreachable][crate::model::ListCompilationResultsResponse::unreachable].
7535 ///
7536 /// # Example
7537 /// ```ignore,no_run
7538 /// # use google_cloud_dataform_v1::model::ListCompilationResultsResponse;
7539 /// let x = ListCompilationResultsResponse::new().set_unreachable(["a", "b", "c"]);
7540 /// ```
7541 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7542 where
7543 T: std::iter::IntoIterator<Item = V>,
7544 V: std::convert::Into<std::string::String>,
7545 {
7546 use std::iter::Iterator;
7547 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7548 self
7549 }
7550}
7551
7552impl wkt::message::Message for ListCompilationResultsResponse {
7553 fn typename() -> &'static str {
7554 "type.googleapis.com/google.cloud.dataform.v1.ListCompilationResultsResponse"
7555 }
7556}
7557
7558#[doc(hidden)]
7559impl google_cloud_gax::paginator::internal::PageableResponse for ListCompilationResultsResponse {
7560 type PageItem = crate::model::CompilationResult;
7561
7562 fn items(self) -> std::vec::Vec<Self::PageItem> {
7563 self.compilation_results
7564 }
7565
7566 fn next_page_token(&self) -> std::string::String {
7567 use std::clone::Clone;
7568 self.next_page_token.clone()
7569 }
7570}
7571
7572/// `GetCompilationResult` request message.
7573#[derive(Clone, Default, PartialEq)]
7574#[non_exhaustive]
7575pub struct GetCompilationResultRequest {
7576 /// Required. The compilation result's name.
7577 pub name: std::string::String,
7578
7579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7580}
7581
7582impl GetCompilationResultRequest {
7583 pub fn new() -> Self {
7584 std::default::Default::default()
7585 }
7586
7587 /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
7588 ///
7589 /// # Example
7590 /// ```ignore,no_run
7591 /// # use google_cloud_dataform_v1::model::GetCompilationResultRequest;
7592 /// let x = GetCompilationResultRequest::new().set_name("example");
7593 /// ```
7594 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7595 self.name = v.into();
7596 self
7597 }
7598}
7599
7600impl wkt::message::Message for GetCompilationResultRequest {
7601 fn typename() -> &'static str {
7602 "type.googleapis.com/google.cloud.dataform.v1.GetCompilationResultRequest"
7603 }
7604}
7605
7606/// `CreateCompilationResult` request message.
7607#[derive(Clone, Default, PartialEq)]
7608#[non_exhaustive]
7609pub struct CreateCompilationResultRequest {
7610 /// Required. The repository in which to create the compilation result. Must be
7611 /// in the format `projects/*/locations/*/repositories/*`.
7612 pub parent: std::string::String,
7613
7614 /// Required. The compilation result to create.
7615 pub compilation_result: std::option::Option<crate::model::CompilationResult>,
7616
7617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7618}
7619
7620impl CreateCompilationResultRequest {
7621 pub fn new() -> Self {
7622 std::default::Default::default()
7623 }
7624
7625 /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
7626 ///
7627 /// # Example
7628 /// ```ignore,no_run
7629 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
7630 /// let x = CreateCompilationResultRequest::new().set_parent("example");
7631 /// ```
7632 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7633 self.parent = v.into();
7634 self
7635 }
7636
7637 /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
7638 ///
7639 /// # Example
7640 /// ```ignore,no_run
7641 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
7642 /// use google_cloud_dataform_v1::model::CompilationResult;
7643 /// let x = CreateCompilationResultRequest::new().set_compilation_result(CompilationResult::default()/* use setters */);
7644 /// ```
7645 pub fn set_compilation_result<T>(mut self, v: T) -> Self
7646 where
7647 T: std::convert::Into<crate::model::CompilationResult>,
7648 {
7649 self.compilation_result = std::option::Option::Some(v.into());
7650 self
7651 }
7652
7653 /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
7654 ///
7655 /// # Example
7656 /// ```ignore,no_run
7657 /// # use google_cloud_dataform_v1::model::CreateCompilationResultRequest;
7658 /// use google_cloud_dataform_v1::model::CompilationResult;
7659 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(Some(CompilationResult::default()/* use setters */));
7660 /// let x = CreateCompilationResultRequest::new().set_or_clear_compilation_result(None::<CompilationResult>);
7661 /// ```
7662 pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
7663 where
7664 T: std::convert::Into<crate::model::CompilationResult>,
7665 {
7666 self.compilation_result = v.map(|x| x.into());
7667 self
7668 }
7669}
7670
7671impl wkt::message::Message for CreateCompilationResultRequest {
7672 fn typename() -> &'static str {
7673 "type.googleapis.com/google.cloud.dataform.v1.CreateCompilationResultRequest"
7674 }
7675}
7676
7677/// Represents an action identifier. If the action writes output, the output
7678/// will be written to the referenced database object.
7679#[derive(Clone, Default, PartialEq)]
7680#[non_exhaustive]
7681pub struct Target {
7682 /// Optional. The action's database (Google Cloud project ID) .
7683 pub database: std::string::String,
7684
7685 /// Optional. The action's schema (BigQuery dataset ID), within `database`.
7686 pub schema: std::string::String,
7687
7688 /// Optional. The action's name, within `database` and `schema`.
7689 pub name: std::string::String,
7690
7691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7692}
7693
7694impl Target {
7695 pub fn new() -> Self {
7696 std::default::Default::default()
7697 }
7698
7699 /// Sets the value of [database][crate::model::Target::database].
7700 ///
7701 /// # Example
7702 /// ```ignore,no_run
7703 /// # use google_cloud_dataform_v1::model::Target;
7704 /// let x = Target::new().set_database("example");
7705 /// ```
7706 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7707 self.database = v.into();
7708 self
7709 }
7710
7711 /// Sets the value of [schema][crate::model::Target::schema].
7712 ///
7713 /// # Example
7714 /// ```ignore,no_run
7715 /// # use google_cloud_dataform_v1::model::Target;
7716 /// let x = Target::new().set_schema("example");
7717 /// ```
7718 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7719 self.schema = v.into();
7720 self
7721 }
7722
7723 /// Sets the value of [name][crate::model::Target::name].
7724 ///
7725 /// # Example
7726 /// ```ignore,no_run
7727 /// # use google_cloud_dataform_v1::model::Target;
7728 /// let x = Target::new().set_name("example");
7729 /// ```
7730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7731 self.name = v.into();
7732 self
7733 }
7734}
7735
7736impl wkt::message::Message for Target {
7737 fn typename() -> &'static str {
7738 "type.googleapis.com/google.cloud.dataform.v1.Target"
7739 }
7740}
7741
7742/// Describes a relation and its columns.
7743#[derive(Clone, Default, PartialEq)]
7744#[non_exhaustive]
7745pub struct RelationDescriptor {
7746 /// A text description of the relation.
7747 pub description: std::string::String,
7748
7749 /// A list of descriptions of columns within the relation.
7750 pub columns: std::vec::Vec<crate::model::relation_descriptor::ColumnDescriptor>,
7751
7752 /// A set of BigQuery labels that should be applied to the relation.
7753 pub bigquery_labels: std::collections::HashMap<std::string::String, std::string::String>,
7754
7755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7756}
7757
7758impl RelationDescriptor {
7759 pub fn new() -> Self {
7760 std::default::Default::default()
7761 }
7762
7763 /// Sets the value of [description][crate::model::RelationDescriptor::description].
7764 ///
7765 /// # Example
7766 /// ```ignore,no_run
7767 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
7768 /// let x = RelationDescriptor::new().set_description("example");
7769 /// ```
7770 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7771 self.description = v.into();
7772 self
7773 }
7774
7775 /// Sets the value of [columns][crate::model::RelationDescriptor::columns].
7776 ///
7777 /// # Example
7778 /// ```ignore,no_run
7779 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
7780 /// use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
7781 /// let x = RelationDescriptor::new()
7782 /// .set_columns([
7783 /// ColumnDescriptor::default()/* use setters */,
7784 /// ColumnDescriptor::default()/* use (different) setters */,
7785 /// ]);
7786 /// ```
7787 pub fn set_columns<T, V>(mut self, v: T) -> Self
7788 where
7789 T: std::iter::IntoIterator<Item = V>,
7790 V: std::convert::Into<crate::model::relation_descriptor::ColumnDescriptor>,
7791 {
7792 use std::iter::Iterator;
7793 self.columns = v.into_iter().map(|i| i.into()).collect();
7794 self
7795 }
7796
7797 /// Sets the value of [bigquery_labels][crate::model::RelationDescriptor::bigquery_labels].
7798 ///
7799 /// # Example
7800 /// ```ignore,no_run
7801 /// # use google_cloud_dataform_v1::model::RelationDescriptor;
7802 /// let x = RelationDescriptor::new().set_bigquery_labels([
7803 /// ("key0", "abc"),
7804 /// ("key1", "xyz"),
7805 /// ]);
7806 /// ```
7807 pub fn set_bigquery_labels<T, K, V>(mut self, v: T) -> Self
7808 where
7809 T: std::iter::IntoIterator<Item = (K, V)>,
7810 K: std::convert::Into<std::string::String>,
7811 V: std::convert::Into<std::string::String>,
7812 {
7813 use std::iter::Iterator;
7814 self.bigquery_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7815 self
7816 }
7817}
7818
7819impl wkt::message::Message for RelationDescriptor {
7820 fn typename() -> &'static str {
7821 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor"
7822 }
7823}
7824
7825/// Defines additional types related to [RelationDescriptor].
7826pub mod relation_descriptor {
7827 #[allow(unused_imports)]
7828 use super::*;
7829
7830 /// Describes a column.
7831 #[derive(Clone, Default, PartialEq)]
7832 #[non_exhaustive]
7833 pub struct ColumnDescriptor {
7834 /// The identifier for the column. Each entry in `path` represents one level
7835 /// of nesting.
7836 pub path: std::vec::Vec<std::string::String>,
7837
7838 /// A textual description of the column.
7839 pub description: std::string::String,
7840
7841 /// A list of BigQuery policy tags that will be applied to the column.
7842 pub bigquery_policy_tags: std::vec::Vec<std::string::String>,
7843
7844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7845 }
7846
7847 impl ColumnDescriptor {
7848 pub fn new() -> Self {
7849 std::default::Default::default()
7850 }
7851
7852 /// Sets the value of [path][crate::model::relation_descriptor::ColumnDescriptor::path].
7853 ///
7854 /// # Example
7855 /// ```ignore,no_run
7856 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
7857 /// let x = ColumnDescriptor::new().set_path(["a", "b", "c"]);
7858 /// ```
7859 pub fn set_path<T, V>(mut self, v: T) -> Self
7860 where
7861 T: std::iter::IntoIterator<Item = V>,
7862 V: std::convert::Into<std::string::String>,
7863 {
7864 use std::iter::Iterator;
7865 self.path = v.into_iter().map(|i| i.into()).collect();
7866 self
7867 }
7868
7869 /// Sets the value of [description][crate::model::relation_descriptor::ColumnDescriptor::description].
7870 ///
7871 /// # Example
7872 /// ```ignore,no_run
7873 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
7874 /// let x = ColumnDescriptor::new().set_description("example");
7875 /// ```
7876 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7877 self.description = v.into();
7878 self
7879 }
7880
7881 /// Sets the value of [bigquery_policy_tags][crate::model::relation_descriptor::ColumnDescriptor::bigquery_policy_tags].
7882 ///
7883 /// # Example
7884 /// ```ignore,no_run
7885 /// # use google_cloud_dataform_v1::model::relation_descriptor::ColumnDescriptor;
7886 /// let x = ColumnDescriptor::new().set_bigquery_policy_tags(["a", "b", "c"]);
7887 /// ```
7888 pub fn set_bigquery_policy_tags<T, V>(mut self, v: T) -> Self
7889 where
7890 T: std::iter::IntoIterator<Item = V>,
7891 V: std::convert::Into<std::string::String>,
7892 {
7893 use std::iter::Iterator;
7894 self.bigquery_policy_tags = v.into_iter().map(|i| i.into()).collect();
7895 self
7896 }
7897 }
7898
7899 impl wkt::message::Message for ColumnDescriptor {
7900 fn typename() -> &'static str {
7901 "type.googleapis.com/google.cloud.dataform.v1.RelationDescriptor.ColumnDescriptor"
7902 }
7903 }
7904}
7905
7906/// Represents a single Dataform action in a compilation result.
7907#[derive(Clone, Default, PartialEq)]
7908#[non_exhaustive]
7909pub struct CompilationResultAction {
7910 /// This action's identifier. Unique within the compilation result.
7911 pub target: std::option::Option<crate::model::Target>,
7912
7913 /// The action's identifier if the project had been compiled without any
7914 /// overrides configured. Unique within the compilation result.
7915 pub canonical_target: std::option::Option<crate::model::Target>,
7916
7917 /// The full path including filename in which this action is located, relative
7918 /// to the workspace root.
7919 pub file_path: std::string::String,
7920
7921 /// Output only. All the metadata information that is used internally to serve
7922 /// the resource. For example: timestamps, flags, status fields, etc. The
7923 /// format of this field is a JSON string.
7924 pub internal_metadata: std::option::Option<std::string::String>,
7925
7926 /// The compiled object.
7927 pub compiled_object:
7928 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
7929
7930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7931}
7932
7933impl CompilationResultAction {
7934 pub fn new() -> Self {
7935 std::default::Default::default()
7936 }
7937
7938 /// Sets the value of [target][crate::model::CompilationResultAction::target].
7939 ///
7940 /// # Example
7941 /// ```ignore,no_run
7942 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
7943 /// use google_cloud_dataform_v1::model::Target;
7944 /// let x = CompilationResultAction::new().set_target(Target::default()/* use setters */);
7945 /// ```
7946 pub fn set_target<T>(mut self, v: T) -> Self
7947 where
7948 T: std::convert::Into<crate::model::Target>,
7949 {
7950 self.target = std::option::Option::Some(v.into());
7951 self
7952 }
7953
7954 /// Sets or clears the value of [target][crate::model::CompilationResultAction::target].
7955 ///
7956 /// # Example
7957 /// ```ignore,no_run
7958 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
7959 /// use google_cloud_dataform_v1::model::Target;
7960 /// let x = CompilationResultAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
7961 /// let x = CompilationResultAction::new().set_or_clear_target(None::<Target>);
7962 /// ```
7963 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7964 where
7965 T: std::convert::Into<crate::model::Target>,
7966 {
7967 self.target = v.map(|x| x.into());
7968 self
7969 }
7970
7971 /// Sets the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
7972 ///
7973 /// # Example
7974 /// ```ignore,no_run
7975 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
7976 /// use google_cloud_dataform_v1::model::Target;
7977 /// let x = CompilationResultAction::new().set_canonical_target(Target::default()/* use setters */);
7978 /// ```
7979 pub fn set_canonical_target<T>(mut self, v: T) -> Self
7980 where
7981 T: std::convert::Into<crate::model::Target>,
7982 {
7983 self.canonical_target = std::option::Option::Some(v.into());
7984 self
7985 }
7986
7987 /// Sets or clears the value of [canonical_target][crate::model::CompilationResultAction::canonical_target].
7988 ///
7989 /// # Example
7990 /// ```ignore,no_run
7991 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
7992 /// use google_cloud_dataform_v1::model::Target;
7993 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
7994 /// let x = CompilationResultAction::new().set_or_clear_canonical_target(None::<Target>);
7995 /// ```
7996 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
7997 where
7998 T: std::convert::Into<crate::model::Target>,
7999 {
8000 self.canonical_target = v.map(|x| x.into());
8001 self
8002 }
8003
8004 /// Sets the value of [file_path][crate::model::CompilationResultAction::file_path].
8005 ///
8006 /// # Example
8007 /// ```ignore,no_run
8008 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8009 /// let x = CompilationResultAction::new().set_file_path("example");
8010 /// ```
8011 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8012 self.file_path = v.into();
8013 self
8014 }
8015
8016 /// Sets the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
8017 ///
8018 /// # Example
8019 /// ```ignore,no_run
8020 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8021 /// let x = CompilationResultAction::new().set_internal_metadata("example");
8022 /// ```
8023 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
8024 where
8025 T: std::convert::Into<std::string::String>,
8026 {
8027 self.internal_metadata = std::option::Option::Some(v.into());
8028 self
8029 }
8030
8031 /// Sets or clears the value of [internal_metadata][crate::model::CompilationResultAction::internal_metadata].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8036 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(Some("example"));
8037 /// let x = CompilationResultAction::new().set_or_clear_internal_metadata(None::<String>);
8038 /// ```
8039 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8040 where
8041 T: std::convert::Into<std::string::String>,
8042 {
8043 self.internal_metadata = v.map(|x| x.into());
8044 self
8045 }
8046
8047 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object].
8048 ///
8049 /// Note that all the setters affecting `compiled_object` are mutually
8050 /// exclusive.
8051 ///
8052 /// # Example
8053 /// ```ignore,no_run
8054 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8055 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8056 /// let x = CompilationResultAction::new().set_compiled_object(Some(
8057 /// google_cloud_dataform_v1::model::compilation_result_action::CompiledObject::Relation(Relation::default().into())));
8058 /// ```
8059 pub fn set_compiled_object<
8060 T: std::convert::Into<
8061 std::option::Option<crate::model::compilation_result_action::CompiledObject>,
8062 >,
8063 >(
8064 mut self,
8065 v: T,
8066 ) -> Self {
8067 self.compiled_object = v.into();
8068 self
8069 }
8070
8071 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8072 /// if it holds a `Relation`, `None` if the field is not set or
8073 /// holds a different branch.
8074 pub fn relation(
8075 &self,
8076 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Relation>>
8077 {
8078 #[allow(unreachable_patterns)]
8079 self.compiled_object.as_ref().and_then(|v| match v {
8080 crate::model::compilation_result_action::CompiledObject::Relation(v) => {
8081 std::option::Option::Some(v)
8082 }
8083 _ => std::option::Option::None,
8084 })
8085 }
8086
8087 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8088 /// to hold a `Relation`.
8089 ///
8090 /// Note that all the setters affecting `compiled_object` are
8091 /// mutually exclusive.
8092 ///
8093 /// # Example
8094 /// ```ignore,no_run
8095 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8096 /// use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8097 /// let x = CompilationResultAction::new().set_relation(Relation::default()/* use setters */);
8098 /// assert!(x.relation().is_some());
8099 /// assert!(x.operations().is_none());
8100 /// assert!(x.assertion().is_none());
8101 /// assert!(x.declaration().is_none());
8102 /// assert!(x.notebook().is_none());
8103 /// assert!(x.data_preparation().is_none());
8104 /// ```
8105 pub fn set_relation<
8106 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Relation>>,
8107 >(
8108 mut self,
8109 v: T,
8110 ) -> Self {
8111 self.compiled_object = std::option::Option::Some(
8112 crate::model::compilation_result_action::CompiledObject::Relation(v.into()),
8113 );
8114 self
8115 }
8116
8117 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8118 /// if it holds a `Operations`, `None` if the field is not set or
8119 /// holds a different branch.
8120 pub fn operations(
8121 &self,
8122 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Operations>>
8123 {
8124 #[allow(unreachable_patterns)]
8125 self.compiled_object.as_ref().and_then(|v| match v {
8126 crate::model::compilation_result_action::CompiledObject::Operations(v) => {
8127 std::option::Option::Some(v)
8128 }
8129 _ => std::option::Option::None,
8130 })
8131 }
8132
8133 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8134 /// to hold a `Operations`.
8135 ///
8136 /// Note that all the setters affecting `compiled_object` are
8137 /// mutually exclusive.
8138 ///
8139 /// # Example
8140 /// ```ignore,no_run
8141 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8142 /// use google_cloud_dataform_v1::model::compilation_result_action::Operations;
8143 /// let x = CompilationResultAction::new().set_operations(Operations::default()/* use setters */);
8144 /// assert!(x.operations().is_some());
8145 /// assert!(x.relation().is_none());
8146 /// assert!(x.assertion().is_none());
8147 /// assert!(x.declaration().is_none());
8148 /// assert!(x.notebook().is_none());
8149 /// assert!(x.data_preparation().is_none());
8150 /// ```
8151 pub fn set_operations<
8152 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Operations>>,
8153 >(
8154 mut self,
8155 v: T,
8156 ) -> Self {
8157 self.compiled_object = std::option::Option::Some(
8158 crate::model::compilation_result_action::CompiledObject::Operations(v.into()),
8159 );
8160 self
8161 }
8162
8163 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8164 /// if it holds a `Assertion`, `None` if the field is not set or
8165 /// holds a different branch.
8166 pub fn assertion(
8167 &self,
8168 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Assertion>>
8169 {
8170 #[allow(unreachable_patterns)]
8171 self.compiled_object.as_ref().and_then(|v| match v {
8172 crate::model::compilation_result_action::CompiledObject::Assertion(v) => {
8173 std::option::Option::Some(v)
8174 }
8175 _ => std::option::Option::None,
8176 })
8177 }
8178
8179 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8180 /// to hold a `Assertion`.
8181 ///
8182 /// Note that all the setters affecting `compiled_object` are
8183 /// mutually exclusive.
8184 ///
8185 /// # Example
8186 /// ```ignore,no_run
8187 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8188 /// use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
8189 /// let x = CompilationResultAction::new().set_assertion(Assertion::default()/* use setters */);
8190 /// assert!(x.assertion().is_some());
8191 /// assert!(x.relation().is_none());
8192 /// assert!(x.operations().is_none());
8193 /// assert!(x.declaration().is_none());
8194 /// assert!(x.notebook().is_none());
8195 /// assert!(x.data_preparation().is_none());
8196 /// ```
8197 pub fn set_assertion<
8198 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Assertion>>,
8199 >(
8200 mut self,
8201 v: T,
8202 ) -> Self {
8203 self.compiled_object = std::option::Option::Some(
8204 crate::model::compilation_result_action::CompiledObject::Assertion(v.into()),
8205 );
8206 self
8207 }
8208
8209 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8210 /// if it holds a `Declaration`, `None` if the field is not set or
8211 /// holds a different branch.
8212 pub fn declaration(
8213 &self,
8214 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Declaration>>
8215 {
8216 #[allow(unreachable_patterns)]
8217 self.compiled_object.as_ref().and_then(|v| match v {
8218 crate::model::compilation_result_action::CompiledObject::Declaration(v) => {
8219 std::option::Option::Some(v)
8220 }
8221 _ => std::option::Option::None,
8222 })
8223 }
8224
8225 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8226 /// to hold a `Declaration`.
8227 ///
8228 /// Note that all the setters affecting `compiled_object` are
8229 /// mutually exclusive.
8230 ///
8231 /// # Example
8232 /// ```ignore,no_run
8233 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8234 /// use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
8235 /// let x = CompilationResultAction::new().set_declaration(Declaration::default()/* use setters */);
8236 /// assert!(x.declaration().is_some());
8237 /// assert!(x.relation().is_none());
8238 /// assert!(x.operations().is_none());
8239 /// assert!(x.assertion().is_none());
8240 /// assert!(x.notebook().is_none());
8241 /// assert!(x.data_preparation().is_none());
8242 /// ```
8243 pub fn set_declaration<
8244 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Declaration>>,
8245 >(
8246 mut self,
8247 v: T,
8248 ) -> Self {
8249 self.compiled_object = std::option::Option::Some(
8250 crate::model::compilation_result_action::CompiledObject::Declaration(v.into()),
8251 );
8252 self
8253 }
8254
8255 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8256 /// if it holds a `Notebook`, `None` if the field is not set or
8257 /// holds a different branch.
8258 pub fn notebook(
8259 &self,
8260 ) -> std::option::Option<&std::boxed::Box<crate::model::compilation_result_action::Notebook>>
8261 {
8262 #[allow(unreachable_patterns)]
8263 self.compiled_object.as_ref().and_then(|v| match v {
8264 crate::model::compilation_result_action::CompiledObject::Notebook(v) => {
8265 std::option::Option::Some(v)
8266 }
8267 _ => std::option::Option::None,
8268 })
8269 }
8270
8271 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8272 /// to hold a `Notebook`.
8273 ///
8274 /// Note that all the setters affecting `compiled_object` are
8275 /// mutually exclusive.
8276 ///
8277 /// # Example
8278 /// ```ignore,no_run
8279 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8280 /// use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
8281 /// let x = CompilationResultAction::new().set_notebook(Notebook::default()/* use setters */);
8282 /// assert!(x.notebook().is_some());
8283 /// assert!(x.relation().is_none());
8284 /// assert!(x.operations().is_none());
8285 /// assert!(x.assertion().is_none());
8286 /// assert!(x.declaration().is_none());
8287 /// assert!(x.data_preparation().is_none());
8288 /// ```
8289 pub fn set_notebook<
8290 T: std::convert::Into<std::boxed::Box<crate::model::compilation_result_action::Notebook>>,
8291 >(
8292 mut self,
8293 v: T,
8294 ) -> Self {
8295 self.compiled_object = std::option::Option::Some(
8296 crate::model::compilation_result_action::CompiledObject::Notebook(v.into()),
8297 );
8298 self
8299 }
8300
8301 /// The value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8302 /// if it holds a `DataPreparation`, `None` if the field is not set or
8303 /// holds a different branch.
8304 pub fn data_preparation(
8305 &self,
8306 ) -> std::option::Option<
8307 &std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
8308 > {
8309 #[allow(unreachable_patterns)]
8310 self.compiled_object.as_ref().and_then(|v| match v {
8311 crate::model::compilation_result_action::CompiledObject::DataPreparation(v) => {
8312 std::option::Option::Some(v)
8313 }
8314 _ => std::option::Option::None,
8315 })
8316 }
8317
8318 /// Sets the value of [compiled_object][crate::model::CompilationResultAction::compiled_object]
8319 /// to hold a `DataPreparation`.
8320 ///
8321 /// Note that all the setters affecting `compiled_object` are
8322 /// mutually exclusive.
8323 ///
8324 /// # Example
8325 /// ```ignore,no_run
8326 /// # use google_cloud_dataform_v1::model::CompilationResultAction;
8327 /// use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
8328 /// let x = CompilationResultAction::new().set_data_preparation(DataPreparation::default()/* use setters */);
8329 /// assert!(x.data_preparation().is_some());
8330 /// assert!(x.relation().is_none());
8331 /// assert!(x.operations().is_none());
8332 /// assert!(x.assertion().is_none());
8333 /// assert!(x.declaration().is_none());
8334 /// assert!(x.notebook().is_none());
8335 /// ```
8336 pub fn set_data_preparation<
8337 T: std::convert::Into<
8338 std::boxed::Box<crate::model::compilation_result_action::DataPreparation>,
8339 >,
8340 >(
8341 mut self,
8342 v: T,
8343 ) -> Self {
8344 self.compiled_object = std::option::Option::Some(
8345 crate::model::compilation_result_action::CompiledObject::DataPreparation(v.into()),
8346 );
8347 self
8348 }
8349}
8350
8351impl wkt::message::Message for CompilationResultAction {
8352 fn typename() -> &'static str {
8353 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction"
8354 }
8355}
8356
8357/// Defines additional types related to [CompilationResultAction].
8358pub mod compilation_result_action {
8359 #[allow(unused_imports)]
8360 use super::*;
8361
8362 /// Represents a database relation.
8363 #[derive(Clone, Default, PartialEq)]
8364 #[non_exhaustive]
8365 pub struct Relation {
8366 /// A list of actions that this action depends on.
8367 pub dependency_targets: std::vec::Vec<crate::model::Target>,
8368
8369 /// Whether this action is disabled (i.e. should not be run).
8370 pub disabled: bool,
8371
8372 /// Arbitrary, user-defined tags on this action.
8373 pub tags: std::vec::Vec<std::string::String>,
8374
8375 /// Descriptor for the relation and its columns.
8376 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
8377
8378 /// The type of this relation.
8379 pub relation_type: crate::model::compilation_result_action::relation::RelationType,
8380
8381 /// The SELECT query which returns rows which this relation should contain.
8382 pub select_query: std::string::String,
8383
8384 /// SQL statements to be executed before creating the relation.
8385 pub pre_operations: std::vec::Vec<std::string::String>,
8386
8387 /// SQL statements to be executed after creating the relation.
8388 pub post_operations: std::vec::Vec<std::string::String>,
8389
8390 /// Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
8391 /// `relation_type` is `INCREMENTAL_TABLE`.
8392 pub incremental_table_config: std::option::Option<
8393 crate::model::compilation_result_action::relation::IncrementalTableConfig,
8394 >,
8395
8396 /// The SQL expression used to partition the relation.
8397 pub partition_expression: std::string::String,
8398
8399 /// A list of columns or SQL expressions used to cluster the table.
8400 pub cluster_expressions: std::vec::Vec<std::string::String>,
8401
8402 /// Sets the partition expiration in days.
8403 pub partition_expiration_days: i32,
8404
8405 /// Specifies whether queries on this table must include a predicate filter
8406 /// that filters on the partitioning column.
8407 pub require_partition_filter: bool,
8408
8409 /// Additional options that will be provided as key/value pairs into the
8410 /// options clause of a create table/view statement. See
8411 /// <https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language>
8412 /// for more information on which options are supported.
8413 pub additional_options: std::collections::HashMap<std::string::String, std::string::String>,
8414
8415 /// Optional. The connection specifying the credentials to be used to read
8416 /// and write to external storage, such as Cloud Storage. The connection can
8417 /// have the form `{project}.{location}.{connection_id}` or
8418 /// `projects/{project}/locations/{location}/connections/{connection_id}`,
8419 /// or be set to DEFAULT.
8420 pub connection: std::string::String,
8421
8422 /// Optional. The table format for the BigQuery table.
8423 pub table_format: crate::model::compilation_result_action::relation::TableFormat,
8424
8425 /// Optional. The file format for the BigQuery table.
8426 pub file_format: crate::model::compilation_result_action::relation::FileFormat,
8427
8428 /// Optional. The fully qualified location prefix of the external folder
8429 /// where table data is stored. The URI should be in the format
8430 /// `gs://bucket/path_to_table/`.
8431 pub storage_uri: std::string::String,
8432
8433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8434 }
8435
8436 impl Relation {
8437 pub fn new() -> Self {
8438 std::default::Default::default()
8439 }
8440
8441 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Relation::dependency_targets].
8442 ///
8443 /// # Example
8444 /// ```ignore,no_run
8445 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8446 /// use google_cloud_dataform_v1::model::Target;
8447 /// let x = Relation::new()
8448 /// .set_dependency_targets([
8449 /// Target::default()/* use setters */,
8450 /// Target::default()/* use (different) setters */,
8451 /// ]);
8452 /// ```
8453 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
8454 where
8455 T: std::iter::IntoIterator<Item = V>,
8456 V: std::convert::Into<crate::model::Target>,
8457 {
8458 use std::iter::Iterator;
8459 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
8460 self
8461 }
8462
8463 /// Sets the value of [disabled][crate::model::compilation_result_action::Relation::disabled].
8464 ///
8465 /// # Example
8466 /// ```ignore,no_run
8467 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8468 /// let x = Relation::new().set_disabled(true);
8469 /// ```
8470 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8471 self.disabled = v.into();
8472 self
8473 }
8474
8475 /// Sets the value of [tags][crate::model::compilation_result_action::Relation::tags].
8476 ///
8477 /// # Example
8478 /// ```ignore,no_run
8479 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8480 /// let x = Relation::new().set_tags(["a", "b", "c"]);
8481 /// ```
8482 pub fn set_tags<T, V>(mut self, v: T) -> Self
8483 where
8484 T: std::iter::IntoIterator<Item = V>,
8485 V: std::convert::Into<std::string::String>,
8486 {
8487 use std::iter::Iterator;
8488 self.tags = v.into_iter().map(|i| i.into()).collect();
8489 self
8490 }
8491
8492 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
8493 ///
8494 /// # Example
8495 /// ```ignore,no_run
8496 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8497 /// use google_cloud_dataform_v1::model::RelationDescriptor;
8498 /// let x = Relation::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
8499 /// ```
8500 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
8501 where
8502 T: std::convert::Into<crate::model::RelationDescriptor>,
8503 {
8504 self.relation_descriptor = std::option::Option::Some(v.into());
8505 self
8506 }
8507
8508 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Relation::relation_descriptor].
8509 ///
8510 /// # Example
8511 /// ```ignore,no_run
8512 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8513 /// use google_cloud_dataform_v1::model::RelationDescriptor;
8514 /// let x = Relation::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
8515 /// let x = Relation::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
8516 /// ```
8517 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
8518 where
8519 T: std::convert::Into<crate::model::RelationDescriptor>,
8520 {
8521 self.relation_descriptor = v.map(|x| x.into());
8522 self
8523 }
8524
8525 /// Sets the value of [relation_type][crate::model::compilation_result_action::Relation::relation_type].
8526 ///
8527 /// # Example
8528 /// ```ignore,no_run
8529 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8530 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::RelationType;
8531 /// let x0 = Relation::new().set_relation_type(RelationType::Table);
8532 /// let x1 = Relation::new().set_relation_type(RelationType::View);
8533 /// let x2 = Relation::new().set_relation_type(RelationType::IncrementalTable);
8534 /// ```
8535 pub fn set_relation_type<
8536 T: std::convert::Into<crate::model::compilation_result_action::relation::RelationType>,
8537 >(
8538 mut self,
8539 v: T,
8540 ) -> Self {
8541 self.relation_type = v.into();
8542 self
8543 }
8544
8545 /// Sets the value of [select_query][crate::model::compilation_result_action::Relation::select_query].
8546 ///
8547 /// # Example
8548 /// ```ignore,no_run
8549 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8550 /// let x = Relation::new().set_select_query("example");
8551 /// ```
8552 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
8553 mut self,
8554 v: T,
8555 ) -> Self {
8556 self.select_query = v.into();
8557 self
8558 }
8559
8560 /// Sets the value of [pre_operations][crate::model::compilation_result_action::Relation::pre_operations].
8561 ///
8562 /// # Example
8563 /// ```ignore,no_run
8564 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8565 /// let x = Relation::new().set_pre_operations(["a", "b", "c"]);
8566 /// ```
8567 pub fn set_pre_operations<T, V>(mut self, v: T) -> Self
8568 where
8569 T: std::iter::IntoIterator<Item = V>,
8570 V: std::convert::Into<std::string::String>,
8571 {
8572 use std::iter::Iterator;
8573 self.pre_operations = v.into_iter().map(|i| i.into()).collect();
8574 self
8575 }
8576
8577 /// Sets the value of [post_operations][crate::model::compilation_result_action::Relation::post_operations].
8578 ///
8579 /// # Example
8580 /// ```ignore,no_run
8581 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8582 /// let x = Relation::new().set_post_operations(["a", "b", "c"]);
8583 /// ```
8584 pub fn set_post_operations<T, V>(mut self, v: T) -> Self
8585 where
8586 T: std::iter::IntoIterator<Item = V>,
8587 V: std::convert::Into<std::string::String>,
8588 {
8589 use std::iter::Iterator;
8590 self.post_operations = v.into_iter().map(|i| i.into()).collect();
8591 self
8592 }
8593
8594 /// Sets the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
8595 ///
8596 /// # Example
8597 /// ```ignore,no_run
8598 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8599 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8600 /// let x = Relation::new().set_incremental_table_config(IncrementalTableConfig::default()/* use setters */);
8601 /// ```
8602 pub fn set_incremental_table_config<T>(mut self, v: T) -> Self
8603 where
8604 T: std::convert::Into<
8605 crate::model::compilation_result_action::relation::IncrementalTableConfig,
8606 >,
8607 {
8608 self.incremental_table_config = std::option::Option::Some(v.into());
8609 self
8610 }
8611
8612 /// Sets or clears the value of [incremental_table_config][crate::model::compilation_result_action::Relation::incremental_table_config].
8613 ///
8614 /// # Example
8615 /// ```ignore,no_run
8616 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8617 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8618 /// let x = Relation::new().set_or_clear_incremental_table_config(Some(IncrementalTableConfig::default()/* use setters */));
8619 /// let x = Relation::new().set_or_clear_incremental_table_config(None::<IncrementalTableConfig>);
8620 /// ```
8621 pub fn set_or_clear_incremental_table_config<T>(mut self, v: std::option::Option<T>) -> Self
8622 where
8623 T: std::convert::Into<
8624 crate::model::compilation_result_action::relation::IncrementalTableConfig,
8625 >,
8626 {
8627 self.incremental_table_config = v.map(|x| x.into());
8628 self
8629 }
8630
8631 /// Sets the value of [partition_expression][crate::model::compilation_result_action::Relation::partition_expression].
8632 ///
8633 /// # Example
8634 /// ```ignore,no_run
8635 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8636 /// let x = Relation::new().set_partition_expression("example");
8637 /// ```
8638 pub fn set_partition_expression<T: std::convert::Into<std::string::String>>(
8639 mut self,
8640 v: T,
8641 ) -> Self {
8642 self.partition_expression = v.into();
8643 self
8644 }
8645
8646 /// Sets the value of [cluster_expressions][crate::model::compilation_result_action::Relation::cluster_expressions].
8647 ///
8648 /// # Example
8649 /// ```ignore,no_run
8650 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8651 /// let x = Relation::new().set_cluster_expressions(["a", "b", "c"]);
8652 /// ```
8653 pub fn set_cluster_expressions<T, V>(mut self, v: T) -> Self
8654 where
8655 T: std::iter::IntoIterator<Item = V>,
8656 V: std::convert::Into<std::string::String>,
8657 {
8658 use std::iter::Iterator;
8659 self.cluster_expressions = v.into_iter().map(|i| i.into()).collect();
8660 self
8661 }
8662
8663 /// Sets the value of [partition_expiration_days][crate::model::compilation_result_action::Relation::partition_expiration_days].
8664 ///
8665 /// # Example
8666 /// ```ignore,no_run
8667 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8668 /// let x = Relation::new().set_partition_expiration_days(42);
8669 /// ```
8670 pub fn set_partition_expiration_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8671 self.partition_expiration_days = v.into();
8672 self
8673 }
8674
8675 /// Sets the value of [require_partition_filter][crate::model::compilation_result_action::Relation::require_partition_filter].
8676 ///
8677 /// # Example
8678 /// ```ignore,no_run
8679 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8680 /// let x = Relation::new().set_require_partition_filter(true);
8681 /// ```
8682 pub fn set_require_partition_filter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8683 self.require_partition_filter = v.into();
8684 self
8685 }
8686
8687 /// Sets the value of [additional_options][crate::model::compilation_result_action::Relation::additional_options].
8688 ///
8689 /// # Example
8690 /// ```ignore,no_run
8691 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8692 /// let x = Relation::new().set_additional_options([
8693 /// ("key0", "abc"),
8694 /// ("key1", "xyz"),
8695 /// ]);
8696 /// ```
8697 pub fn set_additional_options<T, K, V>(mut self, v: T) -> Self
8698 where
8699 T: std::iter::IntoIterator<Item = (K, V)>,
8700 K: std::convert::Into<std::string::String>,
8701 V: std::convert::Into<std::string::String>,
8702 {
8703 use std::iter::Iterator;
8704 self.additional_options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8705 self
8706 }
8707
8708 /// Sets the value of [connection][crate::model::compilation_result_action::Relation::connection].
8709 ///
8710 /// # Example
8711 /// ```ignore,no_run
8712 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8713 /// let x = Relation::new().set_connection("example");
8714 /// ```
8715 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8716 self.connection = v.into();
8717 self
8718 }
8719
8720 /// Sets the value of [table_format][crate::model::compilation_result_action::Relation::table_format].
8721 ///
8722 /// # Example
8723 /// ```ignore,no_run
8724 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8725 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::TableFormat;
8726 /// let x0 = Relation::new().set_table_format(TableFormat::Iceberg);
8727 /// ```
8728 pub fn set_table_format<
8729 T: std::convert::Into<crate::model::compilation_result_action::relation::TableFormat>,
8730 >(
8731 mut self,
8732 v: T,
8733 ) -> Self {
8734 self.table_format = v.into();
8735 self
8736 }
8737
8738 /// Sets the value of [file_format][crate::model::compilation_result_action::Relation::file_format].
8739 ///
8740 /// # Example
8741 /// ```ignore,no_run
8742 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8743 /// use google_cloud_dataform_v1::model::compilation_result_action::relation::FileFormat;
8744 /// let x0 = Relation::new().set_file_format(FileFormat::Parquet);
8745 /// ```
8746 pub fn set_file_format<
8747 T: std::convert::Into<crate::model::compilation_result_action::relation::FileFormat>,
8748 >(
8749 mut self,
8750 v: T,
8751 ) -> Self {
8752 self.file_format = v.into();
8753 self
8754 }
8755
8756 /// Sets the value of [storage_uri][crate::model::compilation_result_action::Relation::storage_uri].
8757 ///
8758 /// # Example
8759 /// ```ignore,no_run
8760 /// # use google_cloud_dataform_v1::model::compilation_result_action::Relation;
8761 /// let x = Relation::new().set_storage_uri("example");
8762 /// ```
8763 pub fn set_storage_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8764 self.storage_uri = v.into();
8765 self
8766 }
8767 }
8768
8769 impl wkt::message::Message for Relation {
8770 fn typename() -> &'static str {
8771 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation"
8772 }
8773 }
8774
8775 /// Defines additional types related to [Relation].
8776 pub mod relation {
8777 #[allow(unused_imports)]
8778 use super::*;
8779
8780 /// Contains settings for relations of type `INCREMENTAL_TABLE`.
8781 #[derive(Clone, Default, PartialEq)]
8782 #[non_exhaustive]
8783 pub struct IncrementalTableConfig {
8784 /// The SELECT query which returns rows which should be inserted into the
8785 /// relation if it already exists and is not being refreshed.
8786 pub incremental_select_query: std::string::String,
8787
8788 /// Whether this table should be protected from being refreshed.
8789 pub refresh_disabled: bool,
8790
8791 /// A set of columns or SQL expressions used to define row uniqueness.
8792 /// If any duplicates are discovered (as defined by `unique_key_parts`),
8793 /// only the newly selected rows (as defined by `incremental_select_query`)
8794 /// will be included in the relation.
8795 pub unique_key_parts: std::vec::Vec<std::string::String>,
8796
8797 /// A SQL expression conditional used to limit the set of existing rows
8798 /// considered for a merge operation (see `unique_key_parts` for more
8799 /// information).
8800 pub update_partition_filter: std::string::String,
8801
8802 /// SQL statements to be executed before inserting new rows into the
8803 /// relation.
8804 pub incremental_pre_operations: std::vec::Vec<std::string::String>,
8805
8806 /// SQL statements to be executed after inserting new rows into the
8807 /// relation.
8808 pub incremental_post_operations: std::vec::Vec<std::string::String>,
8809
8810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8811 }
8812
8813 impl IncrementalTableConfig {
8814 pub fn new() -> Self {
8815 std::default::Default::default()
8816 }
8817
8818 /// Sets the value of [incremental_select_query][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_select_query].
8819 ///
8820 /// # Example
8821 /// ```ignore,no_run
8822 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8823 /// let x = IncrementalTableConfig::new().set_incremental_select_query("example");
8824 /// ```
8825 pub fn set_incremental_select_query<T: std::convert::Into<std::string::String>>(
8826 mut self,
8827 v: T,
8828 ) -> Self {
8829 self.incremental_select_query = v.into();
8830 self
8831 }
8832
8833 /// Sets the value of [refresh_disabled][crate::model::compilation_result_action::relation::IncrementalTableConfig::refresh_disabled].
8834 ///
8835 /// # Example
8836 /// ```ignore,no_run
8837 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8838 /// let x = IncrementalTableConfig::new().set_refresh_disabled(true);
8839 /// ```
8840 pub fn set_refresh_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8841 self.refresh_disabled = v.into();
8842 self
8843 }
8844
8845 /// Sets the value of [unique_key_parts][crate::model::compilation_result_action::relation::IncrementalTableConfig::unique_key_parts].
8846 ///
8847 /// # Example
8848 /// ```ignore,no_run
8849 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8850 /// let x = IncrementalTableConfig::new().set_unique_key_parts(["a", "b", "c"]);
8851 /// ```
8852 pub fn set_unique_key_parts<T, V>(mut self, v: T) -> Self
8853 where
8854 T: std::iter::IntoIterator<Item = V>,
8855 V: std::convert::Into<std::string::String>,
8856 {
8857 use std::iter::Iterator;
8858 self.unique_key_parts = v.into_iter().map(|i| i.into()).collect();
8859 self
8860 }
8861
8862 /// Sets the value of [update_partition_filter][crate::model::compilation_result_action::relation::IncrementalTableConfig::update_partition_filter].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8867 /// let x = IncrementalTableConfig::new().set_update_partition_filter("example");
8868 /// ```
8869 pub fn set_update_partition_filter<T: std::convert::Into<std::string::String>>(
8870 mut self,
8871 v: T,
8872 ) -> Self {
8873 self.update_partition_filter = v.into();
8874 self
8875 }
8876
8877 /// Sets the value of [incremental_pre_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_pre_operations].
8878 ///
8879 /// # Example
8880 /// ```ignore,no_run
8881 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8882 /// let x = IncrementalTableConfig::new().set_incremental_pre_operations(["a", "b", "c"]);
8883 /// ```
8884 pub fn set_incremental_pre_operations<T, V>(mut self, v: T) -> Self
8885 where
8886 T: std::iter::IntoIterator<Item = V>,
8887 V: std::convert::Into<std::string::String>,
8888 {
8889 use std::iter::Iterator;
8890 self.incremental_pre_operations = v.into_iter().map(|i| i.into()).collect();
8891 self
8892 }
8893
8894 /// Sets the value of [incremental_post_operations][crate::model::compilation_result_action::relation::IncrementalTableConfig::incremental_post_operations].
8895 ///
8896 /// # Example
8897 /// ```ignore,no_run
8898 /// # use google_cloud_dataform_v1::model::compilation_result_action::relation::IncrementalTableConfig;
8899 /// let x = IncrementalTableConfig::new().set_incremental_post_operations(["a", "b", "c"]);
8900 /// ```
8901 pub fn set_incremental_post_operations<T, V>(mut self, v: T) -> Self
8902 where
8903 T: std::iter::IntoIterator<Item = V>,
8904 V: std::convert::Into<std::string::String>,
8905 {
8906 use std::iter::Iterator;
8907 self.incremental_post_operations = v.into_iter().map(|i| i.into()).collect();
8908 self
8909 }
8910 }
8911
8912 impl wkt::message::Message for IncrementalTableConfig {
8913 fn typename() -> &'static str {
8914 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Relation.IncrementalTableConfig"
8915 }
8916 }
8917
8918 /// Indicates the type of this relation.
8919 ///
8920 /// # Working with unknown values
8921 ///
8922 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8923 /// additional enum variants at any time. Adding new variants is not considered
8924 /// a breaking change. Applications should write their code in anticipation of:
8925 ///
8926 /// - New values appearing in future releases of the client library, **and**
8927 /// - New values received dynamically, without application changes.
8928 ///
8929 /// Please consult the [Working with enums] section in the user guide for some
8930 /// guidelines.
8931 ///
8932 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8933 #[derive(Clone, Debug, PartialEq)]
8934 #[non_exhaustive]
8935 pub enum RelationType {
8936 /// Default value. This value is unused.
8937 Unspecified,
8938 /// The relation is a table.
8939 Table,
8940 /// The relation is a view.
8941 View,
8942 /// The relation is an incrementalized table.
8943 IncrementalTable,
8944 /// The relation is a materialized view.
8945 MaterializedView,
8946 /// If set, the enum was initialized with an unknown value.
8947 ///
8948 /// Applications can examine the value using [RelationType::value] or
8949 /// [RelationType::name].
8950 UnknownValue(relation_type::UnknownValue),
8951 }
8952
8953 #[doc(hidden)]
8954 pub mod relation_type {
8955 #[allow(unused_imports)]
8956 use super::*;
8957 #[derive(Clone, Debug, PartialEq)]
8958 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8959 }
8960
8961 impl RelationType {
8962 /// Gets the enum value.
8963 ///
8964 /// Returns `None` if the enum contains an unknown value deserialized from
8965 /// the string representation of enums.
8966 pub fn value(&self) -> std::option::Option<i32> {
8967 match self {
8968 Self::Unspecified => std::option::Option::Some(0),
8969 Self::Table => std::option::Option::Some(1),
8970 Self::View => std::option::Option::Some(2),
8971 Self::IncrementalTable => std::option::Option::Some(3),
8972 Self::MaterializedView => std::option::Option::Some(4),
8973 Self::UnknownValue(u) => u.0.value(),
8974 }
8975 }
8976
8977 /// Gets the enum value as a string.
8978 ///
8979 /// Returns `None` if the enum contains an unknown value deserialized from
8980 /// the integer representation of enums.
8981 pub fn name(&self) -> std::option::Option<&str> {
8982 match self {
8983 Self::Unspecified => std::option::Option::Some("RELATION_TYPE_UNSPECIFIED"),
8984 Self::Table => std::option::Option::Some("TABLE"),
8985 Self::View => std::option::Option::Some("VIEW"),
8986 Self::IncrementalTable => std::option::Option::Some("INCREMENTAL_TABLE"),
8987 Self::MaterializedView => std::option::Option::Some("MATERIALIZED_VIEW"),
8988 Self::UnknownValue(u) => u.0.name(),
8989 }
8990 }
8991 }
8992
8993 impl std::default::Default for RelationType {
8994 fn default() -> Self {
8995 use std::convert::From;
8996 Self::from(0)
8997 }
8998 }
8999
9000 impl std::fmt::Display for RelationType {
9001 fn fmt(
9002 &self,
9003 f: &mut std::fmt::Formatter<'_>,
9004 ) -> std::result::Result<(), std::fmt::Error> {
9005 wkt::internal::display_enum(f, self.name(), self.value())
9006 }
9007 }
9008
9009 impl std::convert::From<i32> for RelationType {
9010 fn from(value: i32) -> Self {
9011 match value {
9012 0 => Self::Unspecified,
9013 1 => Self::Table,
9014 2 => Self::View,
9015 3 => Self::IncrementalTable,
9016 4 => Self::MaterializedView,
9017 _ => Self::UnknownValue(relation_type::UnknownValue(
9018 wkt::internal::UnknownEnumValue::Integer(value),
9019 )),
9020 }
9021 }
9022 }
9023
9024 impl std::convert::From<&str> for RelationType {
9025 fn from(value: &str) -> Self {
9026 use std::string::ToString;
9027 match value {
9028 "RELATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9029 "TABLE" => Self::Table,
9030 "VIEW" => Self::View,
9031 "INCREMENTAL_TABLE" => Self::IncrementalTable,
9032 "MATERIALIZED_VIEW" => Self::MaterializedView,
9033 _ => Self::UnknownValue(relation_type::UnknownValue(
9034 wkt::internal::UnknownEnumValue::String(value.to_string()),
9035 )),
9036 }
9037 }
9038 }
9039
9040 impl serde::ser::Serialize for RelationType {
9041 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9042 where
9043 S: serde::Serializer,
9044 {
9045 match self {
9046 Self::Unspecified => serializer.serialize_i32(0),
9047 Self::Table => serializer.serialize_i32(1),
9048 Self::View => serializer.serialize_i32(2),
9049 Self::IncrementalTable => serializer.serialize_i32(3),
9050 Self::MaterializedView => serializer.serialize_i32(4),
9051 Self::UnknownValue(u) => u.0.serialize(serializer),
9052 }
9053 }
9054 }
9055
9056 impl<'de> serde::de::Deserialize<'de> for RelationType {
9057 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9058 where
9059 D: serde::Deserializer<'de>,
9060 {
9061 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RelationType>::new(
9062 ".google.cloud.dataform.v1.CompilationResultAction.Relation.RelationType",
9063 ))
9064 }
9065 }
9066
9067 /// Supported table formats for BigQuery tables.
9068 ///
9069 /// # Working with unknown values
9070 ///
9071 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9072 /// additional enum variants at any time. Adding new variants is not considered
9073 /// a breaking change. Applications should write their code in anticipation of:
9074 ///
9075 /// - New values appearing in future releases of the client library, **and**
9076 /// - New values received dynamically, without application changes.
9077 ///
9078 /// Please consult the [Working with enums] section in the user guide for some
9079 /// guidelines.
9080 ///
9081 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9082 #[derive(Clone, Debug, PartialEq)]
9083 #[non_exhaustive]
9084 pub enum TableFormat {
9085 /// Default value.
9086 Unspecified,
9087 /// Apache Iceberg format.
9088 Iceberg,
9089 /// If set, the enum was initialized with an unknown value.
9090 ///
9091 /// Applications can examine the value using [TableFormat::value] or
9092 /// [TableFormat::name].
9093 UnknownValue(table_format::UnknownValue),
9094 }
9095
9096 #[doc(hidden)]
9097 pub mod table_format {
9098 #[allow(unused_imports)]
9099 use super::*;
9100 #[derive(Clone, Debug, PartialEq)]
9101 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9102 }
9103
9104 impl TableFormat {
9105 /// Gets the enum value.
9106 ///
9107 /// Returns `None` if the enum contains an unknown value deserialized from
9108 /// the string representation of enums.
9109 pub fn value(&self) -> std::option::Option<i32> {
9110 match self {
9111 Self::Unspecified => std::option::Option::Some(0),
9112 Self::Iceberg => std::option::Option::Some(1),
9113 Self::UnknownValue(u) => u.0.value(),
9114 }
9115 }
9116
9117 /// Gets the enum value as a string.
9118 ///
9119 /// Returns `None` if the enum contains an unknown value deserialized from
9120 /// the integer representation of enums.
9121 pub fn name(&self) -> std::option::Option<&str> {
9122 match self {
9123 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
9124 Self::Iceberg => std::option::Option::Some("ICEBERG"),
9125 Self::UnknownValue(u) => u.0.name(),
9126 }
9127 }
9128 }
9129
9130 impl std::default::Default for TableFormat {
9131 fn default() -> Self {
9132 use std::convert::From;
9133 Self::from(0)
9134 }
9135 }
9136
9137 impl std::fmt::Display for TableFormat {
9138 fn fmt(
9139 &self,
9140 f: &mut std::fmt::Formatter<'_>,
9141 ) -> std::result::Result<(), std::fmt::Error> {
9142 wkt::internal::display_enum(f, self.name(), self.value())
9143 }
9144 }
9145
9146 impl std::convert::From<i32> for TableFormat {
9147 fn from(value: i32) -> Self {
9148 match value {
9149 0 => Self::Unspecified,
9150 1 => Self::Iceberg,
9151 _ => Self::UnknownValue(table_format::UnknownValue(
9152 wkt::internal::UnknownEnumValue::Integer(value),
9153 )),
9154 }
9155 }
9156 }
9157
9158 impl std::convert::From<&str> for TableFormat {
9159 fn from(value: &str) -> Self {
9160 use std::string::ToString;
9161 match value {
9162 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
9163 "ICEBERG" => Self::Iceberg,
9164 _ => Self::UnknownValue(table_format::UnknownValue(
9165 wkt::internal::UnknownEnumValue::String(value.to_string()),
9166 )),
9167 }
9168 }
9169 }
9170
9171 impl serde::ser::Serialize for TableFormat {
9172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9173 where
9174 S: serde::Serializer,
9175 {
9176 match self {
9177 Self::Unspecified => serializer.serialize_i32(0),
9178 Self::Iceberg => serializer.serialize_i32(1),
9179 Self::UnknownValue(u) => u.0.serialize(serializer),
9180 }
9181 }
9182 }
9183
9184 impl<'de> serde::de::Deserialize<'de> for TableFormat {
9185 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9186 where
9187 D: serde::Deserializer<'de>,
9188 {
9189 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
9190 ".google.cloud.dataform.v1.CompilationResultAction.Relation.TableFormat",
9191 ))
9192 }
9193 }
9194
9195 /// Supported file formats for BigQuery tables.
9196 ///
9197 /// # Working with unknown values
9198 ///
9199 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9200 /// additional enum variants at any time. Adding new variants is not considered
9201 /// a breaking change. Applications should write their code in anticipation of:
9202 ///
9203 /// - New values appearing in future releases of the client library, **and**
9204 /// - New values received dynamically, without application changes.
9205 ///
9206 /// Please consult the [Working with enums] section in the user guide for some
9207 /// guidelines.
9208 ///
9209 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9210 #[derive(Clone, Debug, PartialEq)]
9211 #[non_exhaustive]
9212 pub enum FileFormat {
9213 /// Default value.
9214 Unspecified,
9215 /// Apache Parquet format.
9216 Parquet,
9217 /// If set, the enum was initialized with an unknown value.
9218 ///
9219 /// Applications can examine the value using [FileFormat::value] or
9220 /// [FileFormat::name].
9221 UnknownValue(file_format::UnknownValue),
9222 }
9223
9224 #[doc(hidden)]
9225 pub mod file_format {
9226 #[allow(unused_imports)]
9227 use super::*;
9228 #[derive(Clone, Debug, PartialEq)]
9229 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9230 }
9231
9232 impl FileFormat {
9233 /// Gets the enum value.
9234 ///
9235 /// Returns `None` if the enum contains an unknown value deserialized from
9236 /// the string representation of enums.
9237 pub fn value(&self) -> std::option::Option<i32> {
9238 match self {
9239 Self::Unspecified => std::option::Option::Some(0),
9240 Self::Parquet => std::option::Option::Some(1),
9241 Self::UnknownValue(u) => u.0.value(),
9242 }
9243 }
9244
9245 /// Gets the enum value as a string.
9246 ///
9247 /// Returns `None` if the enum contains an unknown value deserialized from
9248 /// the integer representation of enums.
9249 pub fn name(&self) -> std::option::Option<&str> {
9250 match self {
9251 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
9252 Self::Parquet => std::option::Option::Some("PARQUET"),
9253 Self::UnknownValue(u) => u.0.name(),
9254 }
9255 }
9256 }
9257
9258 impl std::default::Default for FileFormat {
9259 fn default() -> Self {
9260 use std::convert::From;
9261 Self::from(0)
9262 }
9263 }
9264
9265 impl std::fmt::Display for FileFormat {
9266 fn fmt(
9267 &self,
9268 f: &mut std::fmt::Formatter<'_>,
9269 ) -> std::result::Result<(), std::fmt::Error> {
9270 wkt::internal::display_enum(f, self.name(), self.value())
9271 }
9272 }
9273
9274 impl std::convert::From<i32> for FileFormat {
9275 fn from(value: i32) -> Self {
9276 match value {
9277 0 => Self::Unspecified,
9278 1 => Self::Parquet,
9279 _ => Self::UnknownValue(file_format::UnknownValue(
9280 wkt::internal::UnknownEnumValue::Integer(value),
9281 )),
9282 }
9283 }
9284 }
9285
9286 impl std::convert::From<&str> for FileFormat {
9287 fn from(value: &str) -> Self {
9288 use std::string::ToString;
9289 match value {
9290 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
9291 "PARQUET" => Self::Parquet,
9292 _ => Self::UnknownValue(file_format::UnknownValue(
9293 wkt::internal::UnknownEnumValue::String(value.to_string()),
9294 )),
9295 }
9296 }
9297 }
9298
9299 impl serde::ser::Serialize for FileFormat {
9300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9301 where
9302 S: serde::Serializer,
9303 {
9304 match self {
9305 Self::Unspecified => serializer.serialize_i32(0),
9306 Self::Parquet => serializer.serialize_i32(1),
9307 Self::UnknownValue(u) => u.0.serialize(serializer),
9308 }
9309 }
9310 }
9311
9312 impl<'de> serde::de::Deserialize<'de> for FileFormat {
9313 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9314 where
9315 D: serde::Deserializer<'de>,
9316 {
9317 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
9318 ".google.cloud.dataform.v1.CompilationResultAction.Relation.FileFormat",
9319 ))
9320 }
9321 }
9322 }
9323
9324 /// Represents a list of arbitrary database operations.
9325 #[derive(Clone, Default, PartialEq)]
9326 #[non_exhaustive]
9327 pub struct Operations {
9328 /// A list of actions that this action depends on.
9329 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9330
9331 /// Whether this action is disabled (i.e. should not be run).
9332 pub disabled: bool,
9333
9334 /// Arbitrary, user-defined tags on this action.
9335 pub tags: std::vec::Vec<std::string::String>,
9336
9337 /// Descriptor for any output relation and its columns. Only set if
9338 /// `has_output` is true.
9339 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
9340
9341 /// A list of arbitrary SQL statements that will be executed without
9342 /// alteration.
9343 pub queries: std::vec::Vec<std::string::String>,
9344
9345 /// Whether these operations produce an output relation.
9346 pub has_output: bool,
9347
9348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9349 }
9350
9351 impl Operations {
9352 pub fn new() -> Self {
9353 std::default::Default::default()
9354 }
9355
9356 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Operations::dependency_targets].
9357 ///
9358 /// # Example
9359 /// ```ignore,no_run
9360 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9361 /// use google_cloud_dataform_v1::model::Target;
9362 /// let x = Operations::new()
9363 /// .set_dependency_targets([
9364 /// Target::default()/* use setters */,
9365 /// Target::default()/* use (different) setters */,
9366 /// ]);
9367 /// ```
9368 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9369 where
9370 T: std::iter::IntoIterator<Item = V>,
9371 V: std::convert::Into<crate::model::Target>,
9372 {
9373 use std::iter::Iterator;
9374 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9375 self
9376 }
9377
9378 /// Sets the value of [disabled][crate::model::compilation_result_action::Operations::disabled].
9379 ///
9380 /// # Example
9381 /// ```ignore,no_run
9382 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9383 /// let x = Operations::new().set_disabled(true);
9384 /// ```
9385 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9386 self.disabled = v.into();
9387 self
9388 }
9389
9390 /// Sets the value of [tags][crate::model::compilation_result_action::Operations::tags].
9391 ///
9392 /// # Example
9393 /// ```ignore,no_run
9394 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9395 /// let x = Operations::new().set_tags(["a", "b", "c"]);
9396 /// ```
9397 pub fn set_tags<T, V>(mut self, v: T) -> Self
9398 where
9399 T: std::iter::IntoIterator<Item = V>,
9400 V: std::convert::Into<std::string::String>,
9401 {
9402 use std::iter::Iterator;
9403 self.tags = v.into_iter().map(|i| i.into()).collect();
9404 self
9405 }
9406
9407 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
9408 ///
9409 /// # Example
9410 /// ```ignore,no_run
9411 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9412 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9413 /// let x = Operations::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
9414 /// ```
9415 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
9416 where
9417 T: std::convert::Into<crate::model::RelationDescriptor>,
9418 {
9419 self.relation_descriptor = std::option::Option::Some(v.into());
9420 self
9421 }
9422
9423 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Operations::relation_descriptor].
9424 ///
9425 /// # Example
9426 /// ```ignore,no_run
9427 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9428 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9429 /// let x = Operations::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
9430 /// let x = Operations::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
9431 /// ```
9432 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
9433 where
9434 T: std::convert::Into<crate::model::RelationDescriptor>,
9435 {
9436 self.relation_descriptor = v.map(|x| x.into());
9437 self
9438 }
9439
9440 /// Sets the value of [queries][crate::model::compilation_result_action::Operations::queries].
9441 ///
9442 /// # Example
9443 /// ```ignore,no_run
9444 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9445 /// let x = Operations::new().set_queries(["a", "b", "c"]);
9446 /// ```
9447 pub fn set_queries<T, V>(mut self, v: T) -> Self
9448 where
9449 T: std::iter::IntoIterator<Item = V>,
9450 V: std::convert::Into<std::string::String>,
9451 {
9452 use std::iter::Iterator;
9453 self.queries = v.into_iter().map(|i| i.into()).collect();
9454 self
9455 }
9456
9457 /// Sets the value of [has_output][crate::model::compilation_result_action::Operations::has_output].
9458 ///
9459 /// # Example
9460 /// ```ignore,no_run
9461 /// # use google_cloud_dataform_v1::model::compilation_result_action::Operations;
9462 /// let x = Operations::new().set_has_output(true);
9463 /// ```
9464 pub fn set_has_output<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9465 self.has_output = v.into();
9466 self
9467 }
9468 }
9469
9470 impl wkt::message::Message for Operations {
9471 fn typename() -> &'static str {
9472 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Operations"
9473 }
9474 }
9475
9476 /// Represents an assertion upon a SQL query which is required return zero
9477 /// rows.
9478 #[derive(Clone, Default, PartialEq)]
9479 #[non_exhaustive]
9480 pub struct Assertion {
9481 /// A list of actions that this action depends on.
9482 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9483
9484 /// The parent action of this assertion. Only set if this assertion was
9485 /// automatically generated.
9486 pub parent_action: std::option::Option<crate::model::Target>,
9487
9488 /// Whether this action is disabled (i.e. should not be run).
9489 pub disabled: bool,
9490
9491 /// Arbitrary, user-defined tags on this action.
9492 pub tags: std::vec::Vec<std::string::String>,
9493
9494 /// The SELECT query which must return zero rows in order for this assertion
9495 /// to succeed.
9496 pub select_query: std::string::String,
9497
9498 /// Descriptor for the assertion's automatically-generated view and its
9499 /// columns.
9500 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
9501
9502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9503 }
9504
9505 impl Assertion {
9506 pub fn new() -> Self {
9507 std::default::Default::default()
9508 }
9509
9510 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Assertion::dependency_targets].
9511 ///
9512 /// # Example
9513 /// ```ignore,no_run
9514 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9515 /// use google_cloud_dataform_v1::model::Target;
9516 /// let x = Assertion::new()
9517 /// .set_dependency_targets([
9518 /// Target::default()/* use setters */,
9519 /// Target::default()/* use (different) setters */,
9520 /// ]);
9521 /// ```
9522 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9523 where
9524 T: std::iter::IntoIterator<Item = V>,
9525 V: std::convert::Into<crate::model::Target>,
9526 {
9527 use std::iter::Iterator;
9528 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9529 self
9530 }
9531
9532 /// Sets the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
9533 ///
9534 /// # Example
9535 /// ```ignore,no_run
9536 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9537 /// use google_cloud_dataform_v1::model::Target;
9538 /// let x = Assertion::new().set_parent_action(Target::default()/* use setters */);
9539 /// ```
9540 pub fn set_parent_action<T>(mut self, v: T) -> Self
9541 where
9542 T: std::convert::Into<crate::model::Target>,
9543 {
9544 self.parent_action = std::option::Option::Some(v.into());
9545 self
9546 }
9547
9548 /// Sets or clears the value of [parent_action][crate::model::compilation_result_action::Assertion::parent_action].
9549 ///
9550 /// # Example
9551 /// ```ignore,no_run
9552 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9553 /// use google_cloud_dataform_v1::model::Target;
9554 /// let x = Assertion::new().set_or_clear_parent_action(Some(Target::default()/* use setters */));
9555 /// let x = Assertion::new().set_or_clear_parent_action(None::<Target>);
9556 /// ```
9557 pub fn set_or_clear_parent_action<T>(mut self, v: std::option::Option<T>) -> Self
9558 where
9559 T: std::convert::Into<crate::model::Target>,
9560 {
9561 self.parent_action = v.map(|x| x.into());
9562 self
9563 }
9564
9565 /// Sets the value of [disabled][crate::model::compilation_result_action::Assertion::disabled].
9566 ///
9567 /// # Example
9568 /// ```ignore,no_run
9569 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9570 /// let x = Assertion::new().set_disabled(true);
9571 /// ```
9572 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9573 self.disabled = v.into();
9574 self
9575 }
9576
9577 /// Sets the value of [tags][crate::model::compilation_result_action::Assertion::tags].
9578 ///
9579 /// # Example
9580 /// ```ignore,no_run
9581 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9582 /// let x = Assertion::new().set_tags(["a", "b", "c"]);
9583 /// ```
9584 pub fn set_tags<T, V>(mut self, v: T) -> Self
9585 where
9586 T: std::iter::IntoIterator<Item = V>,
9587 V: std::convert::Into<std::string::String>,
9588 {
9589 use std::iter::Iterator;
9590 self.tags = v.into_iter().map(|i| i.into()).collect();
9591 self
9592 }
9593
9594 /// Sets the value of [select_query][crate::model::compilation_result_action::Assertion::select_query].
9595 ///
9596 /// # Example
9597 /// ```ignore,no_run
9598 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9599 /// let x = Assertion::new().set_select_query("example");
9600 /// ```
9601 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
9602 mut self,
9603 v: T,
9604 ) -> Self {
9605 self.select_query = v.into();
9606 self
9607 }
9608
9609 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
9610 ///
9611 /// # Example
9612 /// ```ignore,no_run
9613 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9614 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9615 /// let x = Assertion::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
9616 /// ```
9617 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
9618 where
9619 T: std::convert::Into<crate::model::RelationDescriptor>,
9620 {
9621 self.relation_descriptor = std::option::Option::Some(v.into());
9622 self
9623 }
9624
9625 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Assertion::relation_descriptor].
9626 ///
9627 /// # Example
9628 /// ```ignore,no_run
9629 /// # use google_cloud_dataform_v1::model::compilation_result_action::Assertion;
9630 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9631 /// let x = Assertion::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
9632 /// let x = Assertion::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
9633 /// ```
9634 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
9635 where
9636 T: std::convert::Into<crate::model::RelationDescriptor>,
9637 {
9638 self.relation_descriptor = v.map(|x| x.into());
9639 self
9640 }
9641 }
9642
9643 impl wkt::message::Message for Assertion {
9644 fn typename() -> &'static str {
9645 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Assertion"
9646 }
9647 }
9648
9649 /// Represents a relation which is not managed by Dataform but which may be
9650 /// referenced by Dataform actions.
9651 #[derive(Clone, Default, PartialEq)]
9652 #[non_exhaustive]
9653 pub struct Declaration {
9654 /// Descriptor for the relation and its columns. Used as documentation only,
9655 /// i.e. values here will result in no changes to the relation's metadata.
9656 pub relation_descriptor: std::option::Option<crate::model::RelationDescriptor>,
9657
9658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9659 }
9660
9661 impl Declaration {
9662 pub fn new() -> Self {
9663 std::default::Default::default()
9664 }
9665
9666 /// Sets the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
9667 ///
9668 /// # Example
9669 /// ```ignore,no_run
9670 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
9671 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9672 /// let x = Declaration::new().set_relation_descriptor(RelationDescriptor::default()/* use setters */);
9673 /// ```
9674 pub fn set_relation_descriptor<T>(mut self, v: T) -> Self
9675 where
9676 T: std::convert::Into<crate::model::RelationDescriptor>,
9677 {
9678 self.relation_descriptor = std::option::Option::Some(v.into());
9679 self
9680 }
9681
9682 /// Sets or clears the value of [relation_descriptor][crate::model::compilation_result_action::Declaration::relation_descriptor].
9683 ///
9684 /// # Example
9685 /// ```ignore,no_run
9686 /// # use google_cloud_dataform_v1::model::compilation_result_action::Declaration;
9687 /// use google_cloud_dataform_v1::model::RelationDescriptor;
9688 /// let x = Declaration::new().set_or_clear_relation_descriptor(Some(RelationDescriptor::default()/* use setters */));
9689 /// let x = Declaration::new().set_or_clear_relation_descriptor(None::<RelationDescriptor>);
9690 /// ```
9691 pub fn set_or_clear_relation_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
9692 where
9693 T: std::convert::Into<crate::model::RelationDescriptor>,
9694 {
9695 self.relation_descriptor = v.map(|x| x.into());
9696 self
9697 }
9698 }
9699
9700 impl wkt::message::Message for Declaration {
9701 fn typename() -> &'static str {
9702 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Declaration"
9703 }
9704 }
9705
9706 /// Represents a notebook.
9707 #[derive(Clone, Default, PartialEq)]
9708 #[non_exhaustive]
9709 pub struct Notebook {
9710 /// A list of actions that this action depends on.
9711 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9712
9713 /// Whether this action is disabled (i.e. should not be run).
9714 pub disabled: bool,
9715
9716 /// The contents of the notebook.
9717 pub contents: std::string::String,
9718
9719 /// Arbitrary, user-defined tags on this action.
9720 pub tags: std::vec::Vec<std::string::String>,
9721
9722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9723 }
9724
9725 impl Notebook {
9726 pub fn new() -> Self {
9727 std::default::Default::default()
9728 }
9729
9730 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::Notebook::dependency_targets].
9731 ///
9732 /// # Example
9733 /// ```ignore,no_run
9734 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9735 /// use google_cloud_dataform_v1::model::Target;
9736 /// let x = Notebook::new()
9737 /// .set_dependency_targets([
9738 /// Target::default()/* use setters */,
9739 /// Target::default()/* use (different) setters */,
9740 /// ]);
9741 /// ```
9742 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9743 where
9744 T: std::iter::IntoIterator<Item = V>,
9745 V: std::convert::Into<crate::model::Target>,
9746 {
9747 use std::iter::Iterator;
9748 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9749 self
9750 }
9751
9752 /// Sets the value of [disabled][crate::model::compilation_result_action::Notebook::disabled].
9753 ///
9754 /// # Example
9755 /// ```ignore,no_run
9756 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9757 /// let x = Notebook::new().set_disabled(true);
9758 /// ```
9759 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9760 self.disabled = v.into();
9761 self
9762 }
9763
9764 /// Sets the value of [contents][crate::model::compilation_result_action::Notebook::contents].
9765 ///
9766 /// # Example
9767 /// ```ignore,no_run
9768 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9769 /// let x = Notebook::new().set_contents("example");
9770 /// ```
9771 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9772 self.contents = v.into();
9773 self
9774 }
9775
9776 /// Sets the value of [tags][crate::model::compilation_result_action::Notebook::tags].
9777 ///
9778 /// # Example
9779 /// ```ignore,no_run
9780 /// # use google_cloud_dataform_v1::model::compilation_result_action::Notebook;
9781 /// let x = Notebook::new().set_tags(["a", "b", "c"]);
9782 /// ```
9783 pub fn set_tags<T, V>(mut self, v: T) -> Self
9784 where
9785 T: std::iter::IntoIterator<Item = V>,
9786 V: std::convert::Into<std::string::String>,
9787 {
9788 use std::iter::Iterator;
9789 self.tags = v.into_iter().map(|i| i.into()).collect();
9790 self
9791 }
9792 }
9793
9794 impl wkt::message::Message for Notebook {
9795 fn typename() -> &'static str {
9796 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.Notebook"
9797 }
9798 }
9799
9800 /// Defines a compiled Data Preparation entity
9801 #[derive(Clone, Default, PartialEq)]
9802 #[non_exhaustive]
9803 pub struct DataPreparation {
9804 /// A list of actions that this action depends on.
9805 pub dependency_targets: std::vec::Vec<crate::model::Target>,
9806
9807 /// Whether this action is disabled (i.e. should not be run).
9808 pub disabled: bool,
9809
9810 /// Arbitrary, user-defined tags on this action.
9811 pub tags: std::vec::Vec<std::string::String>,
9812
9813 /// The definition for the data preparation.
9814 pub definition: std::option::Option<
9815 crate::model::compilation_result_action::data_preparation::Definition,
9816 >,
9817
9818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9819 }
9820
9821 impl DataPreparation {
9822 pub fn new() -> Self {
9823 std::default::Default::default()
9824 }
9825
9826 /// Sets the value of [dependency_targets][crate::model::compilation_result_action::DataPreparation::dependency_targets].
9827 ///
9828 /// # Example
9829 /// ```ignore,no_run
9830 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9831 /// use google_cloud_dataform_v1::model::Target;
9832 /// let x = DataPreparation::new()
9833 /// .set_dependency_targets([
9834 /// Target::default()/* use setters */,
9835 /// Target::default()/* use (different) setters */,
9836 /// ]);
9837 /// ```
9838 pub fn set_dependency_targets<T, V>(mut self, v: T) -> Self
9839 where
9840 T: std::iter::IntoIterator<Item = V>,
9841 V: std::convert::Into<crate::model::Target>,
9842 {
9843 use std::iter::Iterator;
9844 self.dependency_targets = v.into_iter().map(|i| i.into()).collect();
9845 self
9846 }
9847
9848 /// Sets the value of [disabled][crate::model::compilation_result_action::DataPreparation::disabled].
9849 ///
9850 /// # Example
9851 /// ```ignore,no_run
9852 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9853 /// let x = DataPreparation::new().set_disabled(true);
9854 /// ```
9855 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9856 self.disabled = v.into();
9857 self
9858 }
9859
9860 /// Sets the value of [tags][crate::model::compilation_result_action::DataPreparation::tags].
9861 ///
9862 /// # Example
9863 /// ```ignore,no_run
9864 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9865 /// let x = DataPreparation::new().set_tags(["a", "b", "c"]);
9866 /// ```
9867 pub fn set_tags<T, V>(mut self, v: T) -> Self
9868 where
9869 T: std::iter::IntoIterator<Item = V>,
9870 V: std::convert::Into<std::string::String>,
9871 {
9872 use std::iter::Iterator;
9873 self.tags = v.into_iter().map(|i| i.into()).collect();
9874 self
9875 }
9876
9877 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition].
9878 ///
9879 /// Note that all the setters affecting `definition` are mutually
9880 /// exclusive.
9881 ///
9882 /// # Example
9883 /// ```ignore,no_run
9884 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9885 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::Definition;
9886 /// let x = DataPreparation::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
9887 /// ```
9888 pub fn set_definition<
9889 T: std::convert::Into<
9890 std::option::Option<
9891 crate::model::compilation_result_action::data_preparation::Definition,
9892 >,
9893 >,
9894 >(
9895 mut self,
9896 v: T,
9897 ) -> Self {
9898 self.definition = v.into();
9899 self
9900 }
9901
9902 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
9903 /// if it holds a `ContentsYaml`, `None` if the field is not set or
9904 /// holds a different branch.
9905 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
9906 #[allow(unreachable_patterns)]
9907 self.definition.as_ref().and_then(|v| match v {
9908 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(v) => std::option::Option::Some(v),
9909 _ => std::option::Option::None,
9910 })
9911 }
9912
9913 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
9914 /// to hold a `ContentsYaml`.
9915 ///
9916 /// Note that all the setters affecting `definition` are
9917 /// mutually exclusive.
9918 ///
9919 /// # Example
9920 /// ```ignore,no_run
9921 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9922 /// let x = DataPreparation::new().set_contents_yaml("example");
9923 /// assert!(x.contents_yaml().is_some());
9924 /// assert!(x.contents_sql().is_none());
9925 /// ```
9926 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
9927 mut self,
9928 v: T,
9929 ) -> Self {
9930 self.definition = std::option::Option::Some(
9931 crate::model::compilation_result_action::data_preparation::Definition::ContentsYaml(
9932 v.into(),
9933 ),
9934 );
9935 self
9936 }
9937
9938 /// The value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
9939 /// if it holds a `ContentsSql`, `None` if the field is not set or
9940 /// holds a different branch.
9941 pub fn contents_sql(
9942 &self,
9943 ) -> std::option::Option<
9944 &std::boxed::Box<
9945 crate::model::compilation_result_action::data_preparation::SqlDefinition,
9946 >,
9947 > {
9948 #[allow(unreachable_patterns)]
9949 self.definition.as_ref().and_then(|v| match v {
9950 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(v) => std::option::Option::Some(v),
9951 _ => std::option::Option::None,
9952 })
9953 }
9954
9955 /// Sets the value of [definition][crate::model::compilation_result_action::DataPreparation::definition]
9956 /// to hold a `ContentsSql`.
9957 ///
9958 /// Note that all the setters affecting `definition` are
9959 /// mutually exclusive.
9960 ///
9961 /// # Example
9962 /// ```ignore,no_run
9963 /// # use google_cloud_dataform_v1::model::compilation_result_action::DataPreparation;
9964 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
9965 /// let x = DataPreparation::new().set_contents_sql(SqlDefinition::default()/* use setters */);
9966 /// assert!(x.contents_sql().is_some());
9967 /// assert!(x.contents_yaml().is_none());
9968 /// ```
9969 pub fn set_contents_sql<
9970 T: std::convert::Into<
9971 std::boxed::Box<
9972 crate::model::compilation_result_action::data_preparation::SqlDefinition,
9973 >,
9974 >,
9975 >(
9976 mut self,
9977 v: T,
9978 ) -> Self {
9979 self.definition = std::option::Option::Some(
9980 crate::model::compilation_result_action::data_preparation::Definition::ContentsSql(
9981 v.into(),
9982 ),
9983 );
9984 self
9985 }
9986 }
9987
9988 impl wkt::message::Message for DataPreparation {
9989 fn typename() -> &'static str {
9990 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation"
9991 }
9992 }
9993
9994 /// Defines additional types related to [DataPreparation].
9995 pub mod data_preparation {
9996 #[allow(unused_imports)]
9997 use super::*;
9998
9999 /// Definition of a SQL Data Preparation
10000 #[derive(Clone, Default, PartialEq)]
10001 #[non_exhaustive]
10002 pub struct SqlDefinition {
10003 /// The SQL query representing the data preparation steps. Formatted as a
10004 /// Pipe SQL query statement.
10005 pub query: std::string::String,
10006
10007 /// Error table configuration,
10008 pub error_table: std::option::Option<
10009 crate::model::compilation_result_action::data_preparation::ErrorTable,
10010 >,
10011
10012 /// Load configuration.
10013 pub load: std::option::Option<crate::model::compilation_result_action::LoadConfig>,
10014
10015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10016 }
10017
10018 impl SqlDefinition {
10019 pub fn new() -> Self {
10020 std::default::Default::default()
10021 }
10022
10023 /// Sets the value of [query][crate::model::compilation_result_action::data_preparation::SqlDefinition::query].
10024 ///
10025 /// # Example
10026 /// ```ignore,no_run
10027 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10028 /// let x = SqlDefinition::new().set_query("example");
10029 /// ```
10030 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10031 self.query = v.into();
10032 self
10033 }
10034
10035 /// Sets the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
10036 ///
10037 /// # Example
10038 /// ```ignore,no_run
10039 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10040 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10041 /// let x = SqlDefinition::new().set_error_table(ErrorTable::default()/* use setters */);
10042 /// ```
10043 pub fn set_error_table<T>(mut self, v: T) -> Self
10044 where
10045 T: std::convert::Into<
10046 crate::model::compilation_result_action::data_preparation::ErrorTable,
10047 >,
10048 {
10049 self.error_table = std::option::Option::Some(v.into());
10050 self
10051 }
10052
10053 /// Sets or clears the value of [error_table][crate::model::compilation_result_action::data_preparation::SqlDefinition::error_table].
10054 ///
10055 /// # Example
10056 /// ```ignore,no_run
10057 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10058 /// use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10059 /// let x = SqlDefinition::new().set_or_clear_error_table(Some(ErrorTable::default()/* use setters */));
10060 /// let x = SqlDefinition::new().set_or_clear_error_table(None::<ErrorTable>);
10061 /// ```
10062 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
10063 where
10064 T: std::convert::Into<
10065 crate::model::compilation_result_action::data_preparation::ErrorTable,
10066 >,
10067 {
10068 self.error_table = v.map(|x| x.into());
10069 self
10070 }
10071
10072 /// Sets the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
10073 ///
10074 /// # Example
10075 /// ```ignore,no_run
10076 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10077 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10078 /// let x = SqlDefinition::new().set_load(LoadConfig::default()/* use setters */);
10079 /// ```
10080 pub fn set_load<T>(mut self, v: T) -> Self
10081 where
10082 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
10083 {
10084 self.load = std::option::Option::Some(v.into());
10085 self
10086 }
10087
10088 /// Sets or clears the value of [load][crate::model::compilation_result_action::data_preparation::SqlDefinition::load].
10089 ///
10090 /// # Example
10091 /// ```ignore,no_run
10092 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::SqlDefinition;
10093 /// use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10094 /// let x = SqlDefinition::new().set_or_clear_load(Some(LoadConfig::default()/* use setters */));
10095 /// let x = SqlDefinition::new().set_or_clear_load(None::<LoadConfig>);
10096 /// ```
10097 pub fn set_or_clear_load<T>(mut self, v: std::option::Option<T>) -> Self
10098 where
10099 T: std::convert::Into<crate::model::compilation_result_action::LoadConfig>,
10100 {
10101 self.load = v.map(|x| x.into());
10102 self
10103 }
10104 }
10105
10106 impl wkt::message::Message for SqlDefinition {
10107 fn typename() -> &'static str {
10108 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.SqlDefinition"
10109 }
10110 }
10111
10112 /// Error table information, used to write error data into a BigQuery
10113 /// table.
10114 #[derive(Clone, Default, PartialEq)]
10115 #[non_exhaustive]
10116 pub struct ErrorTable {
10117 /// Error Table target.
10118 pub target: std::option::Option<crate::model::Target>,
10119
10120 /// Error table partition expiration in days. Only positive values are
10121 /// allowed.
10122 pub retention_days: i32,
10123
10124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10125 }
10126
10127 impl ErrorTable {
10128 pub fn new() -> Self {
10129 std::default::Default::default()
10130 }
10131
10132 /// Sets the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
10133 ///
10134 /// # Example
10135 /// ```ignore,no_run
10136 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10137 /// use google_cloud_dataform_v1::model::Target;
10138 /// let x = ErrorTable::new().set_target(Target::default()/* use setters */);
10139 /// ```
10140 pub fn set_target<T>(mut self, v: T) -> Self
10141 where
10142 T: std::convert::Into<crate::model::Target>,
10143 {
10144 self.target = std::option::Option::Some(v.into());
10145 self
10146 }
10147
10148 /// Sets or clears the value of [target][crate::model::compilation_result_action::data_preparation::ErrorTable::target].
10149 ///
10150 /// # Example
10151 /// ```ignore,no_run
10152 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10153 /// use google_cloud_dataform_v1::model::Target;
10154 /// let x = ErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
10155 /// let x = ErrorTable::new().set_or_clear_target(None::<Target>);
10156 /// ```
10157 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
10158 where
10159 T: std::convert::Into<crate::model::Target>,
10160 {
10161 self.target = v.map(|x| x.into());
10162 self
10163 }
10164
10165 /// Sets the value of [retention_days][crate::model::compilation_result_action::data_preparation::ErrorTable::retention_days].
10166 ///
10167 /// # Example
10168 /// ```ignore,no_run
10169 /// # use google_cloud_dataform_v1::model::compilation_result_action::data_preparation::ErrorTable;
10170 /// let x = ErrorTable::new().set_retention_days(42);
10171 /// ```
10172 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10173 self.retention_days = v.into();
10174 self
10175 }
10176 }
10177
10178 impl wkt::message::Message for ErrorTable {
10179 fn typename() -> &'static str {
10180 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.DataPreparation.ErrorTable"
10181 }
10182 }
10183
10184 /// The definition for the data preparation.
10185 #[derive(Clone, Debug, PartialEq)]
10186 #[non_exhaustive]
10187 pub enum Definition {
10188 /// The data preparation definition, stored as a YAML string.
10189 ContentsYaml(std::string::String),
10190 /// SQL definition for a Data Preparation. Contains a SQL query and
10191 /// additional context information.
10192 ContentsSql(
10193 std::boxed::Box<
10194 crate::model::compilation_result_action::data_preparation::SqlDefinition,
10195 >,
10196 ),
10197 }
10198 }
10199
10200 /// Simplified load configuration for actions
10201 #[derive(Clone, Default, PartialEq)]
10202 #[non_exhaustive]
10203 pub struct LoadConfig {
10204 /// Load mode
10205 pub mode: std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
10206
10207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10208 }
10209
10210 impl LoadConfig {
10211 pub fn new() -> Self {
10212 std::default::Default::default()
10213 }
10214
10215 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode].
10216 ///
10217 /// Note that all the setters affecting `mode` are mutually
10218 /// exclusive.
10219 ///
10220 /// # Example
10221 /// ```ignore,no_run
10222 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10223 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
10224 /// let x = LoadConfig::new().set_mode(Some(
10225 /// google_cloud_dataform_v1::model::compilation_result_action::load_config::Mode::Replace(SimpleLoadMode::default().into())));
10226 /// ```
10227 pub fn set_mode<
10228 T: std::convert::Into<
10229 std::option::Option<crate::model::compilation_result_action::load_config::Mode>,
10230 >,
10231 >(
10232 mut self,
10233 v: T,
10234 ) -> Self {
10235 self.mode = v.into();
10236 self
10237 }
10238
10239 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10240 /// if it holds a `Replace`, `None` if the field is not set or
10241 /// holds a different branch.
10242 pub fn replace(
10243 &self,
10244 ) -> std::option::Option<
10245 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
10246 > {
10247 #[allow(unreachable_patterns)]
10248 self.mode.as_ref().and_then(|v| match v {
10249 crate::model::compilation_result_action::load_config::Mode::Replace(v) => {
10250 std::option::Option::Some(v)
10251 }
10252 _ => std::option::Option::None,
10253 })
10254 }
10255
10256 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10257 /// to hold a `Replace`.
10258 ///
10259 /// Note that all the setters affecting `mode` are
10260 /// mutually exclusive.
10261 ///
10262 /// # Example
10263 /// ```ignore,no_run
10264 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10265 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
10266 /// let x = LoadConfig::new().set_replace(SimpleLoadMode::default()/* use setters */);
10267 /// assert!(x.replace().is_some());
10268 /// assert!(x.append().is_none());
10269 /// assert!(x.maximum().is_none());
10270 /// assert!(x.unique().is_none());
10271 /// ```
10272 pub fn set_replace<
10273 T: std::convert::Into<
10274 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
10275 >,
10276 >(
10277 mut self,
10278 v: T,
10279 ) -> Self {
10280 self.mode = std::option::Option::Some(
10281 crate::model::compilation_result_action::load_config::Mode::Replace(v.into()),
10282 );
10283 self
10284 }
10285
10286 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10287 /// if it holds a `Append`, `None` if the field is not set or
10288 /// holds a different branch.
10289 pub fn append(
10290 &self,
10291 ) -> std::option::Option<
10292 &std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
10293 > {
10294 #[allow(unreachable_patterns)]
10295 self.mode.as_ref().and_then(|v| match v {
10296 crate::model::compilation_result_action::load_config::Mode::Append(v) => {
10297 std::option::Option::Some(v)
10298 }
10299 _ => std::option::Option::None,
10300 })
10301 }
10302
10303 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10304 /// to hold a `Append`.
10305 ///
10306 /// Note that all the setters affecting `mode` are
10307 /// mutually exclusive.
10308 ///
10309 /// # Example
10310 /// ```ignore,no_run
10311 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10312 /// use google_cloud_dataform_v1::model::compilation_result_action::SimpleLoadMode;
10313 /// let x = LoadConfig::new().set_append(SimpleLoadMode::default()/* use setters */);
10314 /// assert!(x.append().is_some());
10315 /// assert!(x.replace().is_none());
10316 /// assert!(x.maximum().is_none());
10317 /// assert!(x.unique().is_none());
10318 /// ```
10319 pub fn set_append<
10320 T: std::convert::Into<
10321 std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>,
10322 >,
10323 >(
10324 mut self,
10325 v: T,
10326 ) -> Self {
10327 self.mode = std::option::Option::Some(
10328 crate::model::compilation_result_action::load_config::Mode::Append(v.into()),
10329 );
10330 self
10331 }
10332
10333 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10334 /// if it holds a `Maximum`, `None` if the field is not set or
10335 /// holds a different branch.
10336 pub fn maximum(
10337 &self,
10338 ) -> std::option::Option<
10339 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
10340 > {
10341 #[allow(unreachable_patterns)]
10342 self.mode.as_ref().and_then(|v| match v {
10343 crate::model::compilation_result_action::load_config::Mode::Maximum(v) => {
10344 std::option::Option::Some(v)
10345 }
10346 _ => std::option::Option::None,
10347 })
10348 }
10349
10350 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10351 /// to hold a `Maximum`.
10352 ///
10353 /// Note that all the setters affecting `mode` are
10354 /// mutually exclusive.
10355 ///
10356 /// # Example
10357 /// ```ignore,no_run
10358 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10359 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
10360 /// let x = LoadConfig::new().set_maximum(IncrementalLoadMode::default()/* use setters */);
10361 /// assert!(x.maximum().is_some());
10362 /// assert!(x.replace().is_none());
10363 /// assert!(x.append().is_none());
10364 /// assert!(x.unique().is_none());
10365 /// ```
10366 pub fn set_maximum<
10367 T: std::convert::Into<
10368 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
10369 >,
10370 >(
10371 mut self,
10372 v: T,
10373 ) -> Self {
10374 self.mode = std::option::Option::Some(
10375 crate::model::compilation_result_action::load_config::Mode::Maximum(v.into()),
10376 );
10377 self
10378 }
10379
10380 /// The value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10381 /// if it holds a `Unique`, `None` if the field is not set or
10382 /// holds a different branch.
10383 pub fn unique(
10384 &self,
10385 ) -> std::option::Option<
10386 &std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
10387 > {
10388 #[allow(unreachable_patterns)]
10389 self.mode.as_ref().and_then(|v| match v {
10390 crate::model::compilation_result_action::load_config::Mode::Unique(v) => {
10391 std::option::Option::Some(v)
10392 }
10393 _ => std::option::Option::None,
10394 })
10395 }
10396
10397 /// Sets the value of [mode][crate::model::compilation_result_action::LoadConfig::mode]
10398 /// to hold a `Unique`.
10399 ///
10400 /// Note that all the setters affecting `mode` are
10401 /// mutually exclusive.
10402 ///
10403 /// # Example
10404 /// ```ignore,no_run
10405 /// # use google_cloud_dataform_v1::model::compilation_result_action::LoadConfig;
10406 /// use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
10407 /// let x = LoadConfig::new().set_unique(IncrementalLoadMode::default()/* use setters */);
10408 /// assert!(x.unique().is_some());
10409 /// assert!(x.replace().is_none());
10410 /// assert!(x.append().is_none());
10411 /// assert!(x.maximum().is_none());
10412 /// ```
10413 pub fn set_unique<
10414 T: std::convert::Into<
10415 std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>,
10416 >,
10417 >(
10418 mut self,
10419 v: T,
10420 ) -> Self {
10421 self.mode = std::option::Option::Some(
10422 crate::model::compilation_result_action::load_config::Mode::Unique(v.into()),
10423 );
10424 self
10425 }
10426 }
10427
10428 impl wkt::message::Message for LoadConfig {
10429 fn typename() -> &'static str {
10430 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.LoadConfig"
10431 }
10432 }
10433
10434 /// Defines additional types related to [LoadConfig].
10435 pub mod load_config {
10436 #[allow(unused_imports)]
10437 use super::*;
10438
10439 /// Load mode
10440 #[derive(Clone, Debug, PartialEq)]
10441 #[non_exhaustive]
10442 pub enum Mode {
10443 /// Replace destination table
10444 Replace(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
10445 /// Append into destination table
10446 Append(std::boxed::Box<crate::model::compilation_result_action::SimpleLoadMode>),
10447 /// Insert records where the value exceeds the previous maximum value for a
10448 /// column in the destination table
10449 Maximum(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
10450 /// Insert records where the value of a column is not already present in
10451 /// the destination table
10452 Unique(std::boxed::Box<crate::model::compilation_result_action::IncrementalLoadMode>),
10453 }
10454 }
10455
10456 /// Simple load definition
10457 #[derive(Clone, Default, PartialEq)]
10458 #[non_exhaustive]
10459 pub struct SimpleLoadMode {
10460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10461 }
10462
10463 impl SimpleLoadMode {
10464 pub fn new() -> Self {
10465 std::default::Default::default()
10466 }
10467 }
10468
10469 impl wkt::message::Message for SimpleLoadMode {
10470 fn typename() -> &'static str {
10471 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.SimpleLoadMode"
10472 }
10473 }
10474
10475 /// Load definition for incremental load modes
10476 #[derive(Clone, Default, PartialEq)]
10477 #[non_exhaustive]
10478 pub struct IncrementalLoadMode {
10479 /// Column name for incremental load modes
10480 pub column: std::string::String,
10481
10482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10483 }
10484
10485 impl IncrementalLoadMode {
10486 pub fn new() -> Self {
10487 std::default::Default::default()
10488 }
10489
10490 /// Sets the value of [column][crate::model::compilation_result_action::IncrementalLoadMode::column].
10491 ///
10492 /// # Example
10493 /// ```ignore,no_run
10494 /// # use google_cloud_dataform_v1::model::compilation_result_action::IncrementalLoadMode;
10495 /// let x = IncrementalLoadMode::new().set_column("example");
10496 /// ```
10497 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10498 self.column = v.into();
10499 self
10500 }
10501 }
10502
10503 impl wkt::message::Message for IncrementalLoadMode {
10504 fn typename() -> &'static str {
10505 "type.googleapis.com/google.cloud.dataform.v1.CompilationResultAction.IncrementalLoadMode"
10506 }
10507 }
10508
10509 /// The compiled object.
10510 #[derive(Clone, Debug, PartialEq)]
10511 #[non_exhaustive]
10512 pub enum CompiledObject {
10513 /// The database relation created/updated by this action.
10514 Relation(std::boxed::Box<crate::model::compilation_result_action::Relation>),
10515 /// The database operations executed by this action.
10516 Operations(std::boxed::Box<crate::model::compilation_result_action::Operations>),
10517 /// The assertion executed by this action.
10518 Assertion(std::boxed::Box<crate::model::compilation_result_action::Assertion>),
10519 /// The declaration declared by this action.
10520 Declaration(std::boxed::Box<crate::model::compilation_result_action::Declaration>),
10521 /// The notebook executed by this action.
10522 Notebook(std::boxed::Box<crate::model::compilation_result_action::Notebook>),
10523 /// The data preparation executed by this action.
10524 DataPreparation(std::boxed::Box<crate::model::compilation_result_action::DataPreparation>),
10525 }
10526}
10527
10528/// `QueryCompilationResultActions` request message.
10529#[derive(Clone, Default, PartialEq)]
10530#[non_exhaustive]
10531pub struct QueryCompilationResultActionsRequest {
10532 /// Required. The compilation result's name.
10533 pub name: std::string::String,
10534
10535 /// Optional. Maximum number of compilation results to return. The server may
10536 /// return fewer items than requested. If unspecified, the server will pick an
10537 /// appropriate default.
10538 pub page_size: i32,
10539
10540 /// Optional. Page token received from a previous
10541 /// `QueryCompilationResultActions` call. Provide this to retrieve the
10542 /// subsequent page.
10543 ///
10544 /// When paginating, all other parameters provided to
10545 /// `QueryCompilationResultActions`, with the exception of `page_size`, must
10546 /// match the call that provided the page token.
10547 pub page_token: std::string::String,
10548
10549 /// Optional. Optional filter for the returned list. Filtering is only
10550 /// currently supported on the `file_path` field.
10551 pub filter: std::string::String,
10552
10553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10554}
10555
10556impl QueryCompilationResultActionsRequest {
10557 pub fn new() -> Self {
10558 std::default::Default::default()
10559 }
10560
10561 /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
10562 ///
10563 /// # Example
10564 /// ```ignore,no_run
10565 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
10566 /// let x = QueryCompilationResultActionsRequest::new().set_name("example");
10567 /// ```
10568 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10569 self.name = v.into();
10570 self
10571 }
10572
10573 /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
10574 ///
10575 /// # Example
10576 /// ```ignore,no_run
10577 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
10578 /// let x = QueryCompilationResultActionsRequest::new().set_page_size(42);
10579 /// ```
10580 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10581 self.page_size = v.into();
10582 self
10583 }
10584
10585 /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
10586 ///
10587 /// # Example
10588 /// ```ignore,no_run
10589 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
10590 /// let x = QueryCompilationResultActionsRequest::new().set_page_token("example");
10591 /// ```
10592 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10593 self.page_token = v.into();
10594 self
10595 }
10596
10597 /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
10598 ///
10599 /// # Example
10600 /// ```ignore,no_run
10601 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsRequest;
10602 /// let x = QueryCompilationResultActionsRequest::new().set_filter("example");
10603 /// ```
10604 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10605 self.filter = v.into();
10606 self
10607 }
10608}
10609
10610impl wkt::message::Message for QueryCompilationResultActionsRequest {
10611 fn typename() -> &'static str {
10612 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsRequest"
10613 }
10614}
10615
10616/// `QueryCompilationResultActions` response message.
10617#[derive(Clone, Default, PartialEq)]
10618#[non_exhaustive]
10619pub struct QueryCompilationResultActionsResponse {
10620 /// List of compilation result actions.
10621 pub compilation_result_actions: std::vec::Vec<crate::model::CompilationResultAction>,
10622
10623 /// A token, which can be sent as `page_token` to retrieve the next page.
10624 /// If this field is omitted, there are no subsequent pages.
10625 pub next_page_token: std::string::String,
10626
10627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10628}
10629
10630impl QueryCompilationResultActionsResponse {
10631 pub fn new() -> Self {
10632 std::default::Default::default()
10633 }
10634
10635 /// Sets the value of [compilation_result_actions][crate::model::QueryCompilationResultActionsResponse::compilation_result_actions].
10636 ///
10637 /// # Example
10638 /// ```ignore,no_run
10639 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
10640 /// use google_cloud_dataform_v1::model::CompilationResultAction;
10641 /// let x = QueryCompilationResultActionsResponse::new()
10642 /// .set_compilation_result_actions([
10643 /// CompilationResultAction::default()/* use setters */,
10644 /// CompilationResultAction::default()/* use (different) setters */,
10645 /// ]);
10646 /// ```
10647 pub fn set_compilation_result_actions<T, V>(mut self, v: T) -> Self
10648 where
10649 T: std::iter::IntoIterator<Item = V>,
10650 V: std::convert::Into<crate::model::CompilationResultAction>,
10651 {
10652 use std::iter::Iterator;
10653 self.compilation_result_actions = v.into_iter().map(|i| i.into()).collect();
10654 self
10655 }
10656
10657 /// Sets the value of [next_page_token][crate::model::QueryCompilationResultActionsResponse::next_page_token].
10658 ///
10659 /// # Example
10660 /// ```ignore,no_run
10661 /// # use google_cloud_dataform_v1::model::QueryCompilationResultActionsResponse;
10662 /// let x = QueryCompilationResultActionsResponse::new().set_next_page_token("example");
10663 /// ```
10664 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10665 self.next_page_token = v.into();
10666 self
10667 }
10668}
10669
10670impl wkt::message::Message for QueryCompilationResultActionsResponse {
10671 fn typename() -> &'static str {
10672 "type.googleapis.com/google.cloud.dataform.v1.QueryCompilationResultActionsResponse"
10673 }
10674}
10675
10676#[doc(hidden)]
10677impl google_cloud_gax::paginator::internal::PageableResponse
10678 for QueryCompilationResultActionsResponse
10679{
10680 type PageItem = crate::model::CompilationResultAction;
10681
10682 fn items(self) -> std::vec::Vec<Self::PageItem> {
10683 self.compilation_result_actions
10684 }
10685
10686 fn next_page_token(&self) -> std::string::String {
10687 use std::clone::Clone;
10688 self.next_page_token.clone()
10689 }
10690}
10691
10692/// Represents a Dataform workflow configuration.
10693#[derive(Clone, Default, PartialEq)]
10694#[non_exhaustive]
10695pub struct WorkflowConfig {
10696 /// Identifier. The workflow config's name.
10697 pub name: std::string::String,
10698
10699 /// Required. The name of the release config whose release_compilation_result
10700 /// should be executed. Must be in the format
10701 /// `projects/*/locations/*/repositories/*/releaseConfigs/*`.
10702 pub release_config: std::string::String,
10703
10704 /// Optional. If left unset, a default InvocationConfig will be used.
10705 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
10706
10707 /// Optional. Optional schedule (in cron format) for automatic execution of
10708 /// this workflow config.
10709 pub cron_schedule: std::string::String,
10710
10711 /// Optional. Specifies the time zone to be used when interpreting
10712 /// cron_schedule. Must be a time zone name from the time zone database
10713 /// (<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>). If left
10714 /// unspecified, the default is UTC.
10715 pub time_zone: std::string::String,
10716
10717 /// Output only. Records of the 10 most recent scheduled execution attempts,
10718 /// ordered in descending order of `execution_time`. Updated whenever automatic
10719 /// creation of a workflow invocation is triggered by cron_schedule.
10720 pub recent_scheduled_execution_records:
10721 std::vec::Vec<crate::model::workflow_config::ScheduledExecutionRecord>,
10722
10723 /// Optional. Disables automatic creation of workflow invocations.
10724 pub disabled: bool,
10725
10726 /// Output only. The timestamp of when the WorkflowConfig was created.
10727 pub create_time: std::option::Option<wkt::Timestamp>,
10728
10729 /// Output only. The timestamp of when the WorkflowConfig was last updated.
10730 pub update_time: std::option::Option<wkt::Timestamp>,
10731
10732 /// Output only. All the metadata information that is used internally to serve
10733 /// the resource. For example: timestamps, flags, status fields, etc. The
10734 /// format of this field is a JSON string.
10735 pub internal_metadata: std::option::Option<std::string::String>,
10736
10737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10738}
10739
10740impl WorkflowConfig {
10741 pub fn new() -> Self {
10742 std::default::Default::default()
10743 }
10744
10745 /// Sets the value of [name][crate::model::WorkflowConfig::name].
10746 ///
10747 /// # Example
10748 /// ```ignore,no_run
10749 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10750 /// let x = WorkflowConfig::new().set_name("example");
10751 /// ```
10752 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10753 self.name = v.into();
10754 self
10755 }
10756
10757 /// Sets the value of [release_config][crate::model::WorkflowConfig::release_config].
10758 ///
10759 /// # Example
10760 /// ```ignore,no_run
10761 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10762 /// let x = WorkflowConfig::new().set_release_config("example");
10763 /// ```
10764 pub fn set_release_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10765 self.release_config = v.into();
10766 self
10767 }
10768
10769 /// Sets the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
10770 ///
10771 /// # Example
10772 /// ```ignore,no_run
10773 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10774 /// use google_cloud_dataform_v1::model::InvocationConfig;
10775 /// let x = WorkflowConfig::new().set_invocation_config(InvocationConfig::default()/* use setters */);
10776 /// ```
10777 pub fn set_invocation_config<T>(mut self, v: T) -> Self
10778 where
10779 T: std::convert::Into<crate::model::InvocationConfig>,
10780 {
10781 self.invocation_config = std::option::Option::Some(v.into());
10782 self
10783 }
10784
10785 /// Sets or clears the value of [invocation_config][crate::model::WorkflowConfig::invocation_config].
10786 ///
10787 /// # Example
10788 /// ```ignore,no_run
10789 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10790 /// use google_cloud_dataform_v1::model::InvocationConfig;
10791 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
10792 /// let x = WorkflowConfig::new().set_or_clear_invocation_config(None::<InvocationConfig>);
10793 /// ```
10794 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
10795 where
10796 T: std::convert::Into<crate::model::InvocationConfig>,
10797 {
10798 self.invocation_config = v.map(|x| x.into());
10799 self
10800 }
10801
10802 /// Sets the value of [cron_schedule][crate::model::WorkflowConfig::cron_schedule].
10803 ///
10804 /// # Example
10805 /// ```ignore,no_run
10806 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10807 /// let x = WorkflowConfig::new().set_cron_schedule("example");
10808 /// ```
10809 pub fn set_cron_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10810 self.cron_schedule = v.into();
10811 self
10812 }
10813
10814 /// Sets the value of [time_zone][crate::model::WorkflowConfig::time_zone].
10815 ///
10816 /// # Example
10817 /// ```ignore,no_run
10818 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10819 /// let x = WorkflowConfig::new().set_time_zone("example");
10820 /// ```
10821 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10822 self.time_zone = v.into();
10823 self
10824 }
10825
10826 /// Sets the value of [recent_scheduled_execution_records][crate::model::WorkflowConfig::recent_scheduled_execution_records].
10827 ///
10828 /// # Example
10829 /// ```ignore,no_run
10830 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10831 /// use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
10832 /// let x = WorkflowConfig::new()
10833 /// .set_recent_scheduled_execution_records([
10834 /// ScheduledExecutionRecord::default()/* use setters */,
10835 /// ScheduledExecutionRecord::default()/* use (different) setters */,
10836 /// ]);
10837 /// ```
10838 pub fn set_recent_scheduled_execution_records<T, V>(mut self, v: T) -> Self
10839 where
10840 T: std::iter::IntoIterator<Item = V>,
10841 V: std::convert::Into<crate::model::workflow_config::ScheduledExecutionRecord>,
10842 {
10843 use std::iter::Iterator;
10844 self.recent_scheduled_execution_records = v.into_iter().map(|i| i.into()).collect();
10845 self
10846 }
10847
10848 /// Sets the value of [disabled][crate::model::WorkflowConfig::disabled].
10849 ///
10850 /// # Example
10851 /// ```ignore,no_run
10852 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10853 /// let x = WorkflowConfig::new().set_disabled(true);
10854 /// ```
10855 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10856 self.disabled = v.into();
10857 self
10858 }
10859
10860 /// Sets the value of [create_time][crate::model::WorkflowConfig::create_time].
10861 ///
10862 /// # Example
10863 /// ```ignore,no_run
10864 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10865 /// use wkt::Timestamp;
10866 /// let x = WorkflowConfig::new().set_create_time(Timestamp::default()/* use setters */);
10867 /// ```
10868 pub fn set_create_time<T>(mut self, v: T) -> Self
10869 where
10870 T: std::convert::Into<wkt::Timestamp>,
10871 {
10872 self.create_time = std::option::Option::Some(v.into());
10873 self
10874 }
10875
10876 /// Sets or clears the value of [create_time][crate::model::WorkflowConfig::create_time].
10877 ///
10878 /// # Example
10879 /// ```ignore,no_run
10880 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10881 /// use wkt::Timestamp;
10882 /// let x = WorkflowConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10883 /// let x = WorkflowConfig::new().set_or_clear_create_time(None::<Timestamp>);
10884 /// ```
10885 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10886 where
10887 T: std::convert::Into<wkt::Timestamp>,
10888 {
10889 self.create_time = v.map(|x| x.into());
10890 self
10891 }
10892
10893 /// Sets the value of [update_time][crate::model::WorkflowConfig::update_time].
10894 ///
10895 /// # Example
10896 /// ```ignore,no_run
10897 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10898 /// use wkt::Timestamp;
10899 /// let x = WorkflowConfig::new().set_update_time(Timestamp::default()/* use setters */);
10900 /// ```
10901 pub fn set_update_time<T>(mut self, v: T) -> Self
10902 where
10903 T: std::convert::Into<wkt::Timestamp>,
10904 {
10905 self.update_time = std::option::Option::Some(v.into());
10906 self
10907 }
10908
10909 /// Sets or clears the value of [update_time][crate::model::WorkflowConfig::update_time].
10910 ///
10911 /// # Example
10912 /// ```ignore,no_run
10913 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10914 /// use wkt::Timestamp;
10915 /// let x = WorkflowConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10916 /// let x = WorkflowConfig::new().set_or_clear_update_time(None::<Timestamp>);
10917 /// ```
10918 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10919 where
10920 T: std::convert::Into<wkt::Timestamp>,
10921 {
10922 self.update_time = v.map(|x| x.into());
10923 self
10924 }
10925
10926 /// Sets the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
10927 ///
10928 /// # Example
10929 /// ```ignore,no_run
10930 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10931 /// let x = WorkflowConfig::new().set_internal_metadata("example");
10932 /// ```
10933 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
10934 where
10935 T: std::convert::Into<std::string::String>,
10936 {
10937 self.internal_metadata = std::option::Option::Some(v.into());
10938 self
10939 }
10940
10941 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowConfig::internal_metadata].
10942 ///
10943 /// # Example
10944 /// ```ignore,no_run
10945 /// # use google_cloud_dataform_v1::model::WorkflowConfig;
10946 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(Some("example"));
10947 /// let x = WorkflowConfig::new().set_or_clear_internal_metadata(None::<String>);
10948 /// ```
10949 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
10950 where
10951 T: std::convert::Into<std::string::String>,
10952 {
10953 self.internal_metadata = v.map(|x| x.into());
10954 self
10955 }
10956}
10957
10958impl wkt::message::Message for WorkflowConfig {
10959 fn typename() -> &'static str {
10960 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig"
10961 }
10962}
10963
10964/// Defines additional types related to [WorkflowConfig].
10965pub mod workflow_config {
10966 #[allow(unused_imports)]
10967 use super::*;
10968
10969 /// A record of an attempt to create a workflow invocation for this workflow
10970 /// config.
10971 #[derive(Clone, Default, PartialEq)]
10972 #[non_exhaustive]
10973 pub struct ScheduledExecutionRecord {
10974 /// Output only. The timestamp of this execution attempt.
10975 pub execution_time: std::option::Option<wkt::Timestamp>,
10976
10977 /// The result of this execution attempt.
10978 pub result:
10979 std::option::Option<crate::model::workflow_config::scheduled_execution_record::Result>,
10980
10981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10982 }
10983
10984 impl ScheduledExecutionRecord {
10985 pub fn new() -> Self {
10986 std::default::Default::default()
10987 }
10988
10989 /// Sets the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
10990 ///
10991 /// # Example
10992 /// ```ignore,no_run
10993 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
10994 /// use wkt::Timestamp;
10995 /// let x = ScheduledExecutionRecord::new().set_execution_time(Timestamp::default()/* use setters */);
10996 /// ```
10997 pub fn set_execution_time<T>(mut self, v: T) -> Self
10998 where
10999 T: std::convert::Into<wkt::Timestamp>,
11000 {
11001 self.execution_time = std::option::Option::Some(v.into());
11002 self
11003 }
11004
11005 /// Sets or clears the value of [execution_time][crate::model::workflow_config::ScheduledExecutionRecord::execution_time].
11006 ///
11007 /// # Example
11008 /// ```ignore,no_run
11009 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11010 /// use wkt::Timestamp;
11011 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(Some(Timestamp::default()/* use setters */));
11012 /// let x = ScheduledExecutionRecord::new().set_or_clear_execution_time(None::<Timestamp>);
11013 /// ```
11014 pub fn set_or_clear_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
11015 where
11016 T: std::convert::Into<wkt::Timestamp>,
11017 {
11018 self.execution_time = v.map(|x| x.into());
11019 self
11020 }
11021
11022 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result].
11023 ///
11024 /// Note that all the setters affecting `result` are mutually
11025 /// exclusive.
11026 ///
11027 /// # Example
11028 /// ```ignore,no_run
11029 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11030 /// use google_cloud_dataform_v1::model::workflow_config::scheduled_execution_record::Result;
11031 /// let x = ScheduledExecutionRecord::new().set_result(Some(Result::WorkflowInvocation("example".to_string())));
11032 /// ```
11033 pub fn set_result<
11034 T: std::convert::Into<
11035 std::option::Option<
11036 crate::model::workflow_config::scheduled_execution_record::Result,
11037 >,
11038 >,
11039 >(
11040 mut self,
11041 v: T,
11042 ) -> Self {
11043 self.result = v.into();
11044 self
11045 }
11046
11047 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11048 /// if it holds a `WorkflowInvocation`, `None` if the field is not set or
11049 /// holds a different branch.
11050 pub fn workflow_invocation(&self) -> std::option::Option<&std::string::String> {
11051 #[allow(unreachable_patterns)]
11052 self.result.as_ref().and_then(|v| match v {
11053 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(v) => std::option::Option::Some(v),
11054 _ => std::option::Option::None,
11055 })
11056 }
11057
11058 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11059 /// to hold a `WorkflowInvocation`.
11060 ///
11061 /// Note that all the setters affecting `result` are
11062 /// mutually exclusive.
11063 ///
11064 /// # Example
11065 /// ```ignore,no_run
11066 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11067 /// let x = ScheduledExecutionRecord::new().set_workflow_invocation("example");
11068 /// assert!(x.workflow_invocation().is_some());
11069 /// assert!(x.error_status().is_none());
11070 /// ```
11071 pub fn set_workflow_invocation<T: std::convert::Into<std::string::String>>(
11072 mut self,
11073 v: T,
11074 ) -> Self {
11075 self.result = std::option::Option::Some(
11076 crate::model::workflow_config::scheduled_execution_record::Result::WorkflowInvocation(
11077 v.into()
11078 )
11079 );
11080 self
11081 }
11082
11083 /// The value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11084 /// if it holds a `ErrorStatus`, `None` if the field is not set or
11085 /// holds a different branch.
11086 pub fn error_status(
11087 &self,
11088 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>> {
11089 #[allow(unreachable_patterns)]
11090 self.result.as_ref().and_then(|v| match v {
11091 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
11092 v,
11093 ) => std::option::Option::Some(v),
11094 _ => std::option::Option::None,
11095 })
11096 }
11097
11098 /// Sets the value of [result][crate::model::workflow_config::ScheduledExecutionRecord::result]
11099 /// to hold a `ErrorStatus`.
11100 ///
11101 /// Note that all the setters affecting `result` are
11102 /// mutually exclusive.
11103 ///
11104 /// # Example
11105 /// ```ignore,no_run
11106 /// # use google_cloud_dataform_v1::model::workflow_config::ScheduledExecutionRecord;
11107 /// use google_cloud_rpc::model::Status;
11108 /// let x = ScheduledExecutionRecord::new().set_error_status(Status::default()/* use setters */);
11109 /// assert!(x.error_status().is_some());
11110 /// assert!(x.workflow_invocation().is_none());
11111 /// ```
11112 pub fn set_error_status<
11113 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
11114 >(
11115 mut self,
11116 v: T,
11117 ) -> Self {
11118 self.result = std::option::Option::Some(
11119 crate::model::workflow_config::scheduled_execution_record::Result::ErrorStatus(
11120 v.into(),
11121 ),
11122 );
11123 self
11124 }
11125 }
11126
11127 impl wkt::message::Message for ScheduledExecutionRecord {
11128 fn typename() -> &'static str {
11129 "type.googleapis.com/google.cloud.dataform.v1.WorkflowConfig.ScheduledExecutionRecord"
11130 }
11131 }
11132
11133 /// Defines additional types related to [ScheduledExecutionRecord].
11134 pub mod scheduled_execution_record {
11135 #[allow(unused_imports)]
11136 use super::*;
11137
11138 /// The result of this execution attempt.
11139 #[derive(Clone, Debug, PartialEq)]
11140 #[non_exhaustive]
11141 pub enum Result {
11142 /// The name of the created workflow invocation, if one was successfully
11143 /// created. Must be in the format
11144 /// `projects/*/locations/*/repositories/*/workflowInvocations/*`.
11145 WorkflowInvocation(std::string::String),
11146 /// The error status encountered upon this attempt to create the
11147 /// workflow invocation, if the attempt was unsuccessful.
11148 ErrorStatus(std::boxed::Box<google_cloud_rpc::model::Status>),
11149 }
11150 }
11151}
11152
11153/// Includes various configuration options for a workflow invocation.
11154/// If both `included_targets` and `included_tags` are unset, all actions
11155/// will be included.
11156#[derive(Clone, Default, PartialEq)]
11157#[non_exhaustive]
11158pub struct InvocationConfig {
11159 /// Optional. The set of action identifiers to include.
11160 pub included_targets: std::vec::Vec<crate::model::Target>,
11161
11162 /// Optional. The set of tags to include.
11163 pub included_tags: std::vec::Vec<std::string::String>,
11164
11165 /// Optional. When set to true, transitive dependencies of included actions
11166 /// will be executed.
11167 pub transitive_dependencies_included: bool,
11168
11169 /// Optional. When set to true, transitive dependents of included actions will
11170 /// be executed.
11171 pub transitive_dependents_included: bool,
11172
11173 /// Optional. When set to true, any incremental tables will be fully refreshed.
11174 pub fully_refresh_incremental_tables_enabled: bool,
11175
11176 /// Optional. The service account to run workflow invocations under.
11177 pub service_account: std::string::String,
11178
11179 /// Optional. Specifies the priority for query execution in BigQuery.
11180 /// More information can be found at
11181 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
11182 pub query_priority: std::option::Option<crate::model::invocation_config::QueryPriority>,
11183
11184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11185}
11186
11187impl InvocationConfig {
11188 pub fn new() -> Self {
11189 std::default::Default::default()
11190 }
11191
11192 /// Sets the value of [included_targets][crate::model::InvocationConfig::included_targets].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11197 /// use google_cloud_dataform_v1::model::Target;
11198 /// let x = InvocationConfig::new()
11199 /// .set_included_targets([
11200 /// Target::default()/* use setters */,
11201 /// Target::default()/* use (different) setters */,
11202 /// ]);
11203 /// ```
11204 pub fn set_included_targets<T, V>(mut self, v: T) -> Self
11205 where
11206 T: std::iter::IntoIterator<Item = V>,
11207 V: std::convert::Into<crate::model::Target>,
11208 {
11209 use std::iter::Iterator;
11210 self.included_targets = v.into_iter().map(|i| i.into()).collect();
11211 self
11212 }
11213
11214 /// Sets the value of [included_tags][crate::model::InvocationConfig::included_tags].
11215 ///
11216 /// # Example
11217 /// ```ignore,no_run
11218 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11219 /// let x = InvocationConfig::new().set_included_tags(["a", "b", "c"]);
11220 /// ```
11221 pub fn set_included_tags<T, V>(mut self, v: T) -> Self
11222 where
11223 T: std::iter::IntoIterator<Item = V>,
11224 V: std::convert::Into<std::string::String>,
11225 {
11226 use std::iter::Iterator;
11227 self.included_tags = v.into_iter().map(|i| i.into()).collect();
11228 self
11229 }
11230
11231 /// Sets the value of [transitive_dependencies_included][crate::model::InvocationConfig::transitive_dependencies_included].
11232 ///
11233 /// # Example
11234 /// ```ignore,no_run
11235 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11236 /// let x = InvocationConfig::new().set_transitive_dependencies_included(true);
11237 /// ```
11238 pub fn set_transitive_dependencies_included<T: std::convert::Into<bool>>(
11239 mut self,
11240 v: T,
11241 ) -> Self {
11242 self.transitive_dependencies_included = v.into();
11243 self
11244 }
11245
11246 /// Sets the value of [transitive_dependents_included][crate::model::InvocationConfig::transitive_dependents_included].
11247 ///
11248 /// # Example
11249 /// ```ignore,no_run
11250 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11251 /// let x = InvocationConfig::new().set_transitive_dependents_included(true);
11252 /// ```
11253 pub fn set_transitive_dependents_included<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11254 self.transitive_dependents_included = v.into();
11255 self
11256 }
11257
11258 /// Sets the value of [fully_refresh_incremental_tables_enabled][crate::model::InvocationConfig::fully_refresh_incremental_tables_enabled].
11259 ///
11260 /// # Example
11261 /// ```ignore,no_run
11262 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11263 /// let x = InvocationConfig::new().set_fully_refresh_incremental_tables_enabled(true);
11264 /// ```
11265 pub fn set_fully_refresh_incremental_tables_enabled<T: std::convert::Into<bool>>(
11266 mut self,
11267 v: T,
11268 ) -> Self {
11269 self.fully_refresh_incremental_tables_enabled = v.into();
11270 self
11271 }
11272
11273 /// Sets the value of [service_account][crate::model::InvocationConfig::service_account].
11274 ///
11275 /// # Example
11276 /// ```ignore,no_run
11277 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11278 /// let x = InvocationConfig::new().set_service_account("example");
11279 /// ```
11280 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11281 self.service_account = v.into();
11282 self
11283 }
11284
11285 /// Sets the value of [query_priority][crate::model::InvocationConfig::query_priority].
11286 ///
11287 /// # Example
11288 /// ```ignore,no_run
11289 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11290 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
11291 /// let x0 = InvocationConfig::new().set_query_priority(QueryPriority::Interactive);
11292 /// let x1 = InvocationConfig::new().set_query_priority(QueryPriority::Batch);
11293 /// ```
11294 pub fn set_query_priority<T>(mut self, v: T) -> Self
11295 where
11296 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
11297 {
11298 self.query_priority = std::option::Option::Some(v.into());
11299 self
11300 }
11301
11302 /// Sets or clears the value of [query_priority][crate::model::InvocationConfig::query_priority].
11303 ///
11304 /// # Example
11305 /// ```ignore,no_run
11306 /// # use google_cloud_dataform_v1::model::InvocationConfig;
11307 /// use google_cloud_dataform_v1::model::invocation_config::QueryPriority;
11308 /// let x0 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Interactive));
11309 /// let x1 = InvocationConfig::new().set_or_clear_query_priority(Some(QueryPriority::Batch));
11310 /// let x_none = InvocationConfig::new().set_or_clear_query_priority(None::<QueryPriority>);
11311 /// ```
11312 pub fn set_or_clear_query_priority<T>(mut self, v: std::option::Option<T>) -> Self
11313 where
11314 T: std::convert::Into<crate::model::invocation_config::QueryPriority>,
11315 {
11316 self.query_priority = v.map(|x| x.into());
11317 self
11318 }
11319}
11320
11321impl wkt::message::Message for InvocationConfig {
11322 fn typename() -> &'static str {
11323 "type.googleapis.com/google.cloud.dataform.v1.InvocationConfig"
11324 }
11325}
11326
11327/// Defines additional types related to [InvocationConfig].
11328pub mod invocation_config {
11329 #[allow(unused_imports)]
11330 use super::*;
11331
11332 /// Types of priority for query execution in BigQuery.
11333 ///
11334 /// # Working with unknown values
11335 ///
11336 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11337 /// additional enum variants at any time. Adding new variants is not considered
11338 /// a breaking change. Applications should write their code in anticipation of:
11339 ///
11340 /// - New values appearing in future releases of the client library, **and**
11341 /// - New values received dynamically, without application changes.
11342 ///
11343 /// Please consult the [Working with enums] section in the user guide for some
11344 /// guidelines.
11345 ///
11346 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11347 #[derive(Clone, Debug, PartialEq)]
11348 #[non_exhaustive]
11349 pub enum QueryPriority {
11350 /// Default value. This value is unused.
11351 Unspecified,
11352 /// Query will be executed in BigQuery with interactive priority.
11353 /// More information can be found at
11354 /// <https://cloud.google.com/bigquery/docs/running-queries#queries>.
11355 Interactive,
11356 /// Query will be executed in BigQuery with batch priority.
11357 /// More information can be found at
11358 /// <https://cloud.google.com/bigquery/docs/running-queries#batchqueries>.
11359 Batch,
11360 /// If set, the enum was initialized with an unknown value.
11361 ///
11362 /// Applications can examine the value using [QueryPriority::value] or
11363 /// [QueryPriority::name].
11364 UnknownValue(query_priority::UnknownValue),
11365 }
11366
11367 #[doc(hidden)]
11368 pub mod query_priority {
11369 #[allow(unused_imports)]
11370 use super::*;
11371 #[derive(Clone, Debug, PartialEq)]
11372 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11373 }
11374
11375 impl QueryPriority {
11376 /// Gets the enum value.
11377 ///
11378 /// Returns `None` if the enum contains an unknown value deserialized from
11379 /// the string representation of enums.
11380 pub fn value(&self) -> std::option::Option<i32> {
11381 match self {
11382 Self::Unspecified => std::option::Option::Some(0),
11383 Self::Interactive => std::option::Option::Some(1),
11384 Self::Batch => std::option::Option::Some(2),
11385 Self::UnknownValue(u) => u.0.value(),
11386 }
11387 }
11388
11389 /// Gets the enum value as a string.
11390 ///
11391 /// Returns `None` if the enum contains an unknown value deserialized from
11392 /// the integer representation of enums.
11393 pub fn name(&self) -> std::option::Option<&str> {
11394 match self {
11395 Self::Unspecified => std::option::Option::Some("QUERY_PRIORITY_UNSPECIFIED"),
11396 Self::Interactive => std::option::Option::Some("INTERACTIVE"),
11397 Self::Batch => std::option::Option::Some("BATCH"),
11398 Self::UnknownValue(u) => u.0.name(),
11399 }
11400 }
11401 }
11402
11403 impl std::default::Default for QueryPriority {
11404 fn default() -> Self {
11405 use std::convert::From;
11406 Self::from(0)
11407 }
11408 }
11409
11410 impl std::fmt::Display for QueryPriority {
11411 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11412 wkt::internal::display_enum(f, self.name(), self.value())
11413 }
11414 }
11415
11416 impl std::convert::From<i32> for QueryPriority {
11417 fn from(value: i32) -> Self {
11418 match value {
11419 0 => Self::Unspecified,
11420 1 => Self::Interactive,
11421 2 => Self::Batch,
11422 _ => Self::UnknownValue(query_priority::UnknownValue(
11423 wkt::internal::UnknownEnumValue::Integer(value),
11424 )),
11425 }
11426 }
11427 }
11428
11429 impl std::convert::From<&str> for QueryPriority {
11430 fn from(value: &str) -> Self {
11431 use std::string::ToString;
11432 match value {
11433 "QUERY_PRIORITY_UNSPECIFIED" => Self::Unspecified,
11434 "INTERACTIVE" => Self::Interactive,
11435 "BATCH" => Self::Batch,
11436 _ => Self::UnknownValue(query_priority::UnknownValue(
11437 wkt::internal::UnknownEnumValue::String(value.to_string()),
11438 )),
11439 }
11440 }
11441 }
11442
11443 impl serde::ser::Serialize for QueryPriority {
11444 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11445 where
11446 S: serde::Serializer,
11447 {
11448 match self {
11449 Self::Unspecified => serializer.serialize_i32(0),
11450 Self::Interactive => serializer.serialize_i32(1),
11451 Self::Batch => serializer.serialize_i32(2),
11452 Self::UnknownValue(u) => u.0.serialize(serializer),
11453 }
11454 }
11455 }
11456
11457 impl<'de> serde::de::Deserialize<'de> for QueryPriority {
11458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11459 where
11460 D: serde::Deserializer<'de>,
11461 {
11462 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryPriority>::new(
11463 ".google.cloud.dataform.v1.InvocationConfig.QueryPriority",
11464 ))
11465 }
11466 }
11467}
11468
11469/// `ListWorkflowConfigs` request message.
11470#[derive(Clone, Default, PartialEq)]
11471#[non_exhaustive]
11472pub struct ListWorkflowConfigsRequest {
11473 /// Required. The repository in which to list workflow configs. Must be in the
11474 /// format `projects/*/locations/*/repositories/*`.
11475 pub parent: std::string::String,
11476
11477 /// Optional. Maximum number of workflow configs to return. The server may
11478 /// return fewer items than requested. If unspecified, the server will pick an
11479 /// appropriate default.
11480 pub page_size: i32,
11481
11482 /// Optional. Page token received from a previous `ListWorkflowConfigs` call.
11483 /// Provide this to retrieve the subsequent page.
11484 ///
11485 /// When paginating, all other parameters provided to `ListWorkflowConfigs`,
11486 /// with the exception of `page_size`, must match the call that provided the
11487 /// page token.
11488 pub page_token: std::string::String,
11489
11490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11491}
11492
11493impl ListWorkflowConfigsRequest {
11494 pub fn new() -> Self {
11495 std::default::Default::default()
11496 }
11497
11498 /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
11499 ///
11500 /// # Example
11501 /// ```ignore,no_run
11502 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
11503 /// let x = ListWorkflowConfigsRequest::new().set_parent("example");
11504 /// ```
11505 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11506 self.parent = v.into();
11507 self
11508 }
11509
11510 /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
11511 ///
11512 /// # Example
11513 /// ```ignore,no_run
11514 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
11515 /// let x = ListWorkflowConfigsRequest::new().set_page_size(42);
11516 /// ```
11517 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11518 self.page_size = v.into();
11519 self
11520 }
11521
11522 /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
11523 ///
11524 /// # Example
11525 /// ```ignore,no_run
11526 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsRequest;
11527 /// let x = ListWorkflowConfigsRequest::new().set_page_token("example");
11528 /// ```
11529 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11530 self.page_token = v.into();
11531 self
11532 }
11533}
11534
11535impl wkt::message::Message for ListWorkflowConfigsRequest {
11536 fn typename() -> &'static str {
11537 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsRequest"
11538 }
11539}
11540
11541/// `ListWorkflowConfigs` response message.
11542#[derive(Clone, Default, PartialEq)]
11543#[non_exhaustive]
11544pub struct ListWorkflowConfigsResponse {
11545 /// List of workflow configs.
11546 pub workflow_configs: std::vec::Vec<crate::model::WorkflowConfig>,
11547
11548 /// A token, which can be sent as `page_token` to retrieve the next page.
11549 /// If this field is omitted, there are no subsequent pages.
11550 pub next_page_token: std::string::String,
11551
11552 /// Locations which could not be reached.
11553 pub unreachable: std::vec::Vec<std::string::String>,
11554
11555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11556}
11557
11558impl ListWorkflowConfigsResponse {
11559 pub fn new() -> Self {
11560 std::default::Default::default()
11561 }
11562
11563 /// Sets the value of [workflow_configs][crate::model::ListWorkflowConfigsResponse::workflow_configs].
11564 ///
11565 /// # Example
11566 /// ```ignore,no_run
11567 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
11568 /// use google_cloud_dataform_v1::model::WorkflowConfig;
11569 /// let x = ListWorkflowConfigsResponse::new()
11570 /// .set_workflow_configs([
11571 /// WorkflowConfig::default()/* use setters */,
11572 /// WorkflowConfig::default()/* use (different) setters */,
11573 /// ]);
11574 /// ```
11575 pub fn set_workflow_configs<T, V>(mut self, v: T) -> Self
11576 where
11577 T: std::iter::IntoIterator<Item = V>,
11578 V: std::convert::Into<crate::model::WorkflowConfig>,
11579 {
11580 use std::iter::Iterator;
11581 self.workflow_configs = v.into_iter().map(|i| i.into()).collect();
11582 self
11583 }
11584
11585 /// Sets the value of [next_page_token][crate::model::ListWorkflowConfigsResponse::next_page_token].
11586 ///
11587 /// # Example
11588 /// ```ignore,no_run
11589 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
11590 /// let x = ListWorkflowConfigsResponse::new().set_next_page_token("example");
11591 /// ```
11592 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11593 self.next_page_token = v.into();
11594 self
11595 }
11596
11597 /// Sets the value of [unreachable][crate::model::ListWorkflowConfigsResponse::unreachable].
11598 ///
11599 /// # Example
11600 /// ```ignore,no_run
11601 /// # use google_cloud_dataform_v1::model::ListWorkflowConfigsResponse;
11602 /// let x = ListWorkflowConfigsResponse::new().set_unreachable(["a", "b", "c"]);
11603 /// ```
11604 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11605 where
11606 T: std::iter::IntoIterator<Item = V>,
11607 V: std::convert::Into<std::string::String>,
11608 {
11609 use std::iter::Iterator;
11610 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11611 self
11612 }
11613}
11614
11615impl wkt::message::Message for ListWorkflowConfigsResponse {
11616 fn typename() -> &'static str {
11617 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowConfigsResponse"
11618 }
11619}
11620
11621#[doc(hidden)]
11622impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowConfigsResponse {
11623 type PageItem = crate::model::WorkflowConfig;
11624
11625 fn items(self) -> std::vec::Vec<Self::PageItem> {
11626 self.workflow_configs
11627 }
11628
11629 fn next_page_token(&self) -> std::string::String {
11630 use std::clone::Clone;
11631 self.next_page_token.clone()
11632 }
11633}
11634
11635/// `GetWorkflowConfig` request message.
11636#[derive(Clone, Default, PartialEq)]
11637#[non_exhaustive]
11638pub struct GetWorkflowConfigRequest {
11639 /// Required. The workflow config's name.
11640 pub name: std::string::String,
11641
11642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11643}
11644
11645impl GetWorkflowConfigRequest {
11646 pub fn new() -> Self {
11647 std::default::Default::default()
11648 }
11649
11650 /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
11651 ///
11652 /// # Example
11653 /// ```ignore,no_run
11654 /// # use google_cloud_dataform_v1::model::GetWorkflowConfigRequest;
11655 /// let x = GetWorkflowConfigRequest::new().set_name("example");
11656 /// ```
11657 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11658 self.name = v.into();
11659 self
11660 }
11661}
11662
11663impl wkt::message::Message for GetWorkflowConfigRequest {
11664 fn typename() -> &'static str {
11665 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowConfigRequest"
11666 }
11667}
11668
11669/// `CreateWorkflowConfig` request message.
11670#[derive(Clone, Default, PartialEq)]
11671#[non_exhaustive]
11672pub struct CreateWorkflowConfigRequest {
11673 /// Required. The repository in which to create the workflow config. Must be in
11674 /// the format `projects/*/locations/*/repositories/*`.
11675 pub parent: std::string::String,
11676
11677 /// Required. The workflow config to create.
11678 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
11679
11680 /// Required. The ID to use for the workflow config, which will become the
11681 /// final component of the workflow config's resource name.
11682 pub workflow_config_id: std::string::String,
11683
11684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11685}
11686
11687impl CreateWorkflowConfigRequest {
11688 pub fn new() -> Self {
11689 std::default::Default::default()
11690 }
11691
11692 /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
11693 ///
11694 /// # Example
11695 /// ```ignore,no_run
11696 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
11697 /// let x = CreateWorkflowConfigRequest::new().set_parent("example");
11698 /// ```
11699 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11700 self.parent = v.into();
11701 self
11702 }
11703
11704 /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
11705 ///
11706 /// # Example
11707 /// ```ignore,no_run
11708 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
11709 /// use google_cloud_dataform_v1::model::WorkflowConfig;
11710 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
11711 /// ```
11712 pub fn set_workflow_config<T>(mut self, v: T) -> Self
11713 where
11714 T: std::convert::Into<crate::model::WorkflowConfig>,
11715 {
11716 self.workflow_config = std::option::Option::Some(v.into());
11717 self
11718 }
11719
11720 /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
11721 ///
11722 /// # Example
11723 /// ```ignore,no_run
11724 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
11725 /// use google_cloud_dataform_v1::model::WorkflowConfig;
11726 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
11727 /// let x = CreateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
11728 /// ```
11729 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
11730 where
11731 T: std::convert::Into<crate::model::WorkflowConfig>,
11732 {
11733 self.workflow_config = v.map(|x| x.into());
11734 self
11735 }
11736
11737 /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
11738 ///
11739 /// # Example
11740 /// ```ignore,no_run
11741 /// # use google_cloud_dataform_v1::model::CreateWorkflowConfigRequest;
11742 /// let x = CreateWorkflowConfigRequest::new().set_workflow_config_id("example");
11743 /// ```
11744 pub fn set_workflow_config_id<T: std::convert::Into<std::string::String>>(
11745 mut self,
11746 v: T,
11747 ) -> Self {
11748 self.workflow_config_id = v.into();
11749 self
11750 }
11751}
11752
11753impl wkt::message::Message for CreateWorkflowConfigRequest {
11754 fn typename() -> &'static str {
11755 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowConfigRequest"
11756 }
11757}
11758
11759/// `UpdateWorkflowConfig` request message.
11760#[derive(Clone, Default, PartialEq)]
11761#[non_exhaustive]
11762pub struct UpdateWorkflowConfigRequest {
11763 /// Optional. Specifies the fields to be updated in the workflow config. If
11764 /// left unset, all fields will be updated.
11765 pub update_mask: std::option::Option<wkt::FieldMask>,
11766
11767 /// Required. The workflow config to update.
11768 pub workflow_config: std::option::Option<crate::model::WorkflowConfig>,
11769
11770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11771}
11772
11773impl UpdateWorkflowConfigRequest {
11774 pub fn new() -> Self {
11775 std::default::Default::default()
11776 }
11777
11778 /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
11779 ///
11780 /// # Example
11781 /// ```ignore,no_run
11782 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
11783 /// use wkt::FieldMask;
11784 /// let x = UpdateWorkflowConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11785 /// ```
11786 pub fn set_update_mask<T>(mut self, v: T) -> Self
11787 where
11788 T: std::convert::Into<wkt::FieldMask>,
11789 {
11790 self.update_mask = std::option::Option::Some(v.into());
11791 self
11792 }
11793
11794 /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
11795 ///
11796 /// # Example
11797 /// ```ignore,no_run
11798 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
11799 /// use wkt::FieldMask;
11800 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11801 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11802 /// ```
11803 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11804 where
11805 T: std::convert::Into<wkt::FieldMask>,
11806 {
11807 self.update_mask = v.map(|x| x.into());
11808 self
11809 }
11810
11811 /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
11812 ///
11813 /// # Example
11814 /// ```ignore,no_run
11815 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
11816 /// use google_cloud_dataform_v1::model::WorkflowConfig;
11817 /// let x = UpdateWorkflowConfigRequest::new().set_workflow_config(WorkflowConfig::default()/* use setters */);
11818 /// ```
11819 pub fn set_workflow_config<T>(mut self, v: T) -> Self
11820 where
11821 T: std::convert::Into<crate::model::WorkflowConfig>,
11822 {
11823 self.workflow_config = std::option::Option::Some(v.into());
11824 self
11825 }
11826
11827 /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
11828 ///
11829 /// # Example
11830 /// ```ignore,no_run
11831 /// # use google_cloud_dataform_v1::model::UpdateWorkflowConfigRequest;
11832 /// use google_cloud_dataform_v1::model::WorkflowConfig;
11833 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(Some(WorkflowConfig::default()/* use setters */));
11834 /// let x = UpdateWorkflowConfigRequest::new().set_or_clear_workflow_config(None::<WorkflowConfig>);
11835 /// ```
11836 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
11837 where
11838 T: std::convert::Into<crate::model::WorkflowConfig>,
11839 {
11840 self.workflow_config = v.map(|x| x.into());
11841 self
11842 }
11843}
11844
11845impl wkt::message::Message for UpdateWorkflowConfigRequest {
11846 fn typename() -> &'static str {
11847 "type.googleapis.com/google.cloud.dataform.v1.UpdateWorkflowConfigRequest"
11848 }
11849}
11850
11851/// `DeleteWorkflowConfig` request message.
11852#[derive(Clone, Default, PartialEq)]
11853#[non_exhaustive]
11854pub struct DeleteWorkflowConfigRequest {
11855 /// Required. The workflow config's name.
11856 pub name: std::string::String,
11857
11858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11859}
11860
11861impl DeleteWorkflowConfigRequest {
11862 pub fn new() -> Self {
11863 std::default::Default::default()
11864 }
11865
11866 /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
11867 ///
11868 /// # Example
11869 /// ```ignore,no_run
11870 /// # use google_cloud_dataform_v1::model::DeleteWorkflowConfigRequest;
11871 /// let x = DeleteWorkflowConfigRequest::new().set_name("example");
11872 /// ```
11873 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11874 self.name = v.into();
11875 self
11876 }
11877}
11878
11879impl wkt::message::Message for DeleteWorkflowConfigRequest {
11880 fn typename() -> &'static str {
11881 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowConfigRequest"
11882 }
11883}
11884
11885/// Represents a single invocation of a compilation result.
11886#[derive(Clone, Default, PartialEq)]
11887#[non_exhaustive]
11888pub struct WorkflowInvocation {
11889 /// Output only. The workflow invocation's name.
11890 pub name: std::string::String,
11891
11892 /// Immutable. If left unset, a default InvocationConfig will be used.
11893 pub invocation_config: std::option::Option<crate::model::InvocationConfig>,
11894
11895 /// Output only. This workflow invocation's current state.
11896 pub state: crate::model::workflow_invocation::State,
11897
11898 /// Output only. This workflow invocation's timing details.
11899 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
11900
11901 /// Output only. The resolved compilation result that was used to create this
11902 /// invocation. Will be in the format
11903 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
11904 pub resolved_compilation_result: std::string::String,
11905
11906 /// Output only. Only set if the repository has a KMS Key.
11907 pub data_encryption_state: std::option::Option<crate::model::DataEncryptionState>,
11908
11909 /// Output only. All the metadata information that is used internally to serve
11910 /// the resource. For example: timestamps, flags, status fields, etc. The
11911 /// format of this field is a JSON string.
11912 pub internal_metadata: std::option::Option<std::string::String>,
11913
11914 /// Output only. Metadata indicating whether this resource is user-scoped.
11915 /// `WorkflowInvocation` resource is `user_scoped` only if it is sourced
11916 /// from a compilation result and the compilation result is user-scoped.
11917 pub private_resource_metadata: std::option::Option<crate::model::PrivateResourceMetadata>,
11918
11919 /// The source of the compilation result to use for this invocation.
11920 pub compilation_source:
11921 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
11922
11923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11924}
11925
11926impl WorkflowInvocation {
11927 pub fn new() -> Self {
11928 std::default::Default::default()
11929 }
11930
11931 /// Sets the value of [name][crate::model::WorkflowInvocation::name].
11932 ///
11933 /// # Example
11934 /// ```ignore,no_run
11935 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
11936 /// let x = WorkflowInvocation::new().set_name("example");
11937 /// ```
11938 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11939 self.name = v.into();
11940 self
11941 }
11942
11943 /// Sets the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
11944 ///
11945 /// # Example
11946 /// ```ignore,no_run
11947 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
11948 /// use google_cloud_dataform_v1::model::InvocationConfig;
11949 /// let x = WorkflowInvocation::new().set_invocation_config(InvocationConfig::default()/* use setters */);
11950 /// ```
11951 pub fn set_invocation_config<T>(mut self, v: T) -> Self
11952 where
11953 T: std::convert::Into<crate::model::InvocationConfig>,
11954 {
11955 self.invocation_config = std::option::Option::Some(v.into());
11956 self
11957 }
11958
11959 /// Sets or clears the value of [invocation_config][crate::model::WorkflowInvocation::invocation_config].
11960 ///
11961 /// # Example
11962 /// ```ignore,no_run
11963 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
11964 /// use google_cloud_dataform_v1::model::InvocationConfig;
11965 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(Some(InvocationConfig::default()/* use setters */));
11966 /// let x = WorkflowInvocation::new().set_or_clear_invocation_config(None::<InvocationConfig>);
11967 /// ```
11968 pub fn set_or_clear_invocation_config<T>(mut self, v: std::option::Option<T>) -> Self
11969 where
11970 T: std::convert::Into<crate::model::InvocationConfig>,
11971 {
11972 self.invocation_config = v.map(|x| x.into());
11973 self
11974 }
11975
11976 /// Sets the value of [state][crate::model::WorkflowInvocation::state].
11977 ///
11978 /// # Example
11979 /// ```ignore,no_run
11980 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
11981 /// use google_cloud_dataform_v1::model::workflow_invocation::State;
11982 /// let x0 = WorkflowInvocation::new().set_state(State::Running);
11983 /// let x1 = WorkflowInvocation::new().set_state(State::Succeeded);
11984 /// let x2 = WorkflowInvocation::new().set_state(State::Cancelled);
11985 /// ```
11986 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation::State>>(
11987 mut self,
11988 v: T,
11989 ) -> Self {
11990 self.state = v.into();
11991 self
11992 }
11993
11994 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
11995 ///
11996 /// # Example
11997 /// ```ignore,no_run
11998 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
11999 /// use google_cloud_type::model::Interval;
12000 /// let x = WorkflowInvocation::new().set_invocation_timing(Interval::default()/* use setters */);
12001 /// ```
12002 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
12003 where
12004 T: std::convert::Into<google_cloud_type::model::Interval>,
12005 {
12006 self.invocation_timing = std::option::Option::Some(v.into());
12007 self
12008 }
12009
12010 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocation::invocation_timing].
12011 ///
12012 /// # Example
12013 /// ```ignore,no_run
12014 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12015 /// use google_cloud_type::model::Interval;
12016 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
12017 /// let x = WorkflowInvocation::new().set_or_clear_invocation_timing(None::<Interval>);
12018 /// ```
12019 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
12020 where
12021 T: std::convert::Into<google_cloud_type::model::Interval>,
12022 {
12023 self.invocation_timing = v.map(|x| x.into());
12024 self
12025 }
12026
12027 /// Sets the value of [resolved_compilation_result][crate::model::WorkflowInvocation::resolved_compilation_result].
12028 ///
12029 /// # Example
12030 /// ```ignore,no_run
12031 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12032 /// let x = WorkflowInvocation::new().set_resolved_compilation_result("example");
12033 /// ```
12034 pub fn set_resolved_compilation_result<T: std::convert::Into<std::string::String>>(
12035 mut self,
12036 v: T,
12037 ) -> Self {
12038 self.resolved_compilation_result = v.into();
12039 self
12040 }
12041
12042 /// Sets the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
12043 ///
12044 /// # Example
12045 /// ```ignore,no_run
12046 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12047 /// use google_cloud_dataform_v1::model::DataEncryptionState;
12048 /// let x = WorkflowInvocation::new().set_data_encryption_state(DataEncryptionState::default()/* use setters */);
12049 /// ```
12050 pub fn set_data_encryption_state<T>(mut self, v: T) -> Self
12051 where
12052 T: std::convert::Into<crate::model::DataEncryptionState>,
12053 {
12054 self.data_encryption_state = std::option::Option::Some(v.into());
12055 self
12056 }
12057
12058 /// Sets or clears the value of [data_encryption_state][crate::model::WorkflowInvocation::data_encryption_state].
12059 ///
12060 /// # Example
12061 /// ```ignore,no_run
12062 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12063 /// use google_cloud_dataform_v1::model::DataEncryptionState;
12064 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(Some(DataEncryptionState::default()/* use setters */));
12065 /// let x = WorkflowInvocation::new().set_or_clear_data_encryption_state(None::<DataEncryptionState>);
12066 /// ```
12067 pub fn set_or_clear_data_encryption_state<T>(mut self, v: std::option::Option<T>) -> Self
12068 where
12069 T: std::convert::Into<crate::model::DataEncryptionState>,
12070 {
12071 self.data_encryption_state = v.map(|x| x.into());
12072 self
12073 }
12074
12075 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
12076 ///
12077 /// # Example
12078 /// ```ignore,no_run
12079 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12080 /// let x = WorkflowInvocation::new().set_internal_metadata("example");
12081 /// ```
12082 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
12083 where
12084 T: std::convert::Into<std::string::String>,
12085 {
12086 self.internal_metadata = std::option::Option::Some(v.into());
12087 self
12088 }
12089
12090 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocation::internal_metadata].
12091 ///
12092 /// # Example
12093 /// ```ignore,no_run
12094 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12095 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(Some("example"));
12096 /// let x = WorkflowInvocation::new().set_or_clear_internal_metadata(None::<String>);
12097 /// ```
12098 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12099 where
12100 T: std::convert::Into<std::string::String>,
12101 {
12102 self.internal_metadata = v.map(|x| x.into());
12103 self
12104 }
12105
12106 /// Sets the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
12107 ///
12108 /// # Example
12109 /// ```ignore,no_run
12110 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12111 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
12112 /// let x = WorkflowInvocation::new().set_private_resource_metadata(PrivateResourceMetadata::default()/* use setters */);
12113 /// ```
12114 pub fn set_private_resource_metadata<T>(mut self, v: T) -> Self
12115 where
12116 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
12117 {
12118 self.private_resource_metadata = std::option::Option::Some(v.into());
12119 self
12120 }
12121
12122 /// Sets or clears the value of [private_resource_metadata][crate::model::WorkflowInvocation::private_resource_metadata].
12123 ///
12124 /// # Example
12125 /// ```ignore,no_run
12126 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12127 /// use google_cloud_dataform_v1::model::PrivateResourceMetadata;
12128 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(Some(PrivateResourceMetadata::default()/* use setters */));
12129 /// let x = WorkflowInvocation::new().set_or_clear_private_resource_metadata(None::<PrivateResourceMetadata>);
12130 /// ```
12131 pub fn set_or_clear_private_resource_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12132 where
12133 T: std::convert::Into<crate::model::PrivateResourceMetadata>,
12134 {
12135 self.private_resource_metadata = v.map(|x| x.into());
12136 self
12137 }
12138
12139 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source].
12140 ///
12141 /// Note that all the setters affecting `compilation_source` are mutually
12142 /// exclusive.
12143 ///
12144 /// # Example
12145 /// ```ignore,no_run
12146 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12147 /// use google_cloud_dataform_v1::model::workflow_invocation::CompilationSource;
12148 /// let x = WorkflowInvocation::new().set_compilation_source(Some(CompilationSource::CompilationResult("example".to_string())));
12149 /// ```
12150 pub fn set_compilation_source<
12151 T: std::convert::Into<
12152 std::option::Option<crate::model::workflow_invocation::CompilationSource>,
12153 >,
12154 >(
12155 mut self,
12156 v: T,
12157 ) -> Self {
12158 self.compilation_source = v.into();
12159 self
12160 }
12161
12162 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
12163 /// if it holds a `CompilationResult`, `None` if the field is not set or
12164 /// holds a different branch.
12165 pub fn compilation_result(&self) -> std::option::Option<&std::string::String> {
12166 #[allow(unreachable_patterns)]
12167 self.compilation_source.as_ref().and_then(|v| match v {
12168 crate::model::workflow_invocation::CompilationSource::CompilationResult(v) => {
12169 std::option::Option::Some(v)
12170 }
12171 _ => std::option::Option::None,
12172 })
12173 }
12174
12175 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
12176 /// to hold a `CompilationResult`.
12177 ///
12178 /// Note that all the setters affecting `compilation_source` are
12179 /// mutually exclusive.
12180 ///
12181 /// # Example
12182 /// ```ignore,no_run
12183 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12184 /// let x = WorkflowInvocation::new().set_compilation_result("example");
12185 /// assert!(x.compilation_result().is_some());
12186 /// assert!(x.workflow_config().is_none());
12187 /// ```
12188 pub fn set_compilation_result<T: std::convert::Into<std::string::String>>(
12189 mut self,
12190 v: T,
12191 ) -> Self {
12192 self.compilation_source = std::option::Option::Some(
12193 crate::model::workflow_invocation::CompilationSource::CompilationResult(v.into()),
12194 );
12195 self
12196 }
12197
12198 /// The value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
12199 /// if it holds a `WorkflowConfig`, `None` if the field is not set or
12200 /// holds a different branch.
12201 pub fn workflow_config(&self) -> std::option::Option<&std::string::String> {
12202 #[allow(unreachable_patterns)]
12203 self.compilation_source.as_ref().and_then(|v| match v {
12204 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v) => {
12205 std::option::Option::Some(v)
12206 }
12207 _ => std::option::Option::None,
12208 })
12209 }
12210
12211 /// Sets the value of [compilation_source][crate::model::WorkflowInvocation::compilation_source]
12212 /// to hold a `WorkflowConfig`.
12213 ///
12214 /// Note that all the setters affecting `compilation_source` are
12215 /// mutually exclusive.
12216 ///
12217 /// # Example
12218 /// ```ignore,no_run
12219 /// # use google_cloud_dataform_v1::model::WorkflowInvocation;
12220 /// let x = WorkflowInvocation::new().set_workflow_config("example");
12221 /// assert!(x.workflow_config().is_some());
12222 /// assert!(x.compilation_result().is_none());
12223 /// ```
12224 pub fn set_workflow_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12225 self.compilation_source = std::option::Option::Some(
12226 crate::model::workflow_invocation::CompilationSource::WorkflowConfig(v.into()),
12227 );
12228 self
12229 }
12230}
12231
12232impl wkt::message::Message for WorkflowInvocation {
12233 fn typename() -> &'static str {
12234 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocation"
12235 }
12236}
12237
12238/// Defines additional types related to [WorkflowInvocation].
12239pub mod workflow_invocation {
12240 #[allow(unused_imports)]
12241 use super::*;
12242
12243 /// Represents the current state of a workflow invocation.
12244 ///
12245 /// # Working with unknown values
12246 ///
12247 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12248 /// additional enum variants at any time. Adding new variants is not considered
12249 /// a breaking change. Applications should write their code in anticipation of:
12250 ///
12251 /// - New values appearing in future releases of the client library, **and**
12252 /// - New values received dynamically, without application changes.
12253 ///
12254 /// Please consult the [Working with enums] section in the user guide for some
12255 /// guidelines.
12256 ///
12257 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12258 #[derive(Clone, Debug, PartialEq)]
12259 #[non_exhaustive]
12260 pub enum State {
12261 /// Default value. This value is unused.
12262 Unspecified,
12263 /// The workflow invocation is currently running.
12264 Running,
12265 /// The workflow invocation succeeded. A terminal state.
12266 Succeeded,
12267 /// The workflow invocation was cancelled. A terminal state.
12268 Cancelled,
12269 /// The workflow invocation failed. A terminal state.
12270 Failed,
12271 /// The workflow invocation is being cancelled, but some actions are still
12272 /// running.
12273 Canceling,
12274 /// If set, the enum was initialized with an unknown value.
12275 ///
12276 /// Applications can examine the value using [State::value] or
12277 /// [State::name].
12278 UnknownValue(state::UnknownValue),
12279 }
12280
12281 #[doc(hidden)]
12282 pub mod state {
12283 #[allow(unused_imports)]
12284 use super::*;
12285 #[derive(Clone, Debug, PartialEq)]
12286 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12287 }
12288
12289 impl State {
12290 /// Gets the enum value.
12291 ///
12292 /// Returns `None` if the enum contains an unknown value deserialized from
12293 /// the string representation of enums.
12294 pub fn value(&self) -> std::option::Option<i32> {
12295 match self {
12296 Self::Unspecified => std::option::Option::Some(0),
12297 Self::Running => std::option::Option::Some(1),
12298 Self::Succeeded => std::option::Option::Some(2),
12299 Self::Cancelled => std::option::Option::Some(3),
12300 Self::Failed => std::option::Option::Some(4),
12301 Self::Canceling => std::option::Option::Some(5),
12302 Self::UnknownValue(u) => u.0.value(),
12303 }
12304 }
12305
12306 /// Gets the enum value as a string.
12307 ///
12308 /// Returns `None` if the enum contains an unknown value deserialized from
12309 /// the integer representation of enums.
12310 pub fn name(&self) -> std::option::Option<&str> {
12311 match self {
12312 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12313 Self::Running => std::option::Option::Some("RUNNING"),
12314 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12315 Self::Cancelled => std::option::Option::Some("CANCELLED"),
12316 Self::Failed => std::option::Option::Some("FAILED"),
12317 Self::Canceling => std::option::Option::Some("CANCELING"),
12318 Self::UnknownValue(u) => u.0.name(),
12319 }
12320 }
12321 }
12322
12323 impl std::default::Default for State {
12324 fn default() -> Self {
12325 use std::convert::From;
12326 Self::from(0)
12327 }
12328 }
12329
12330 impl std::fmt::Display for State {
12331 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12332 wkt::internal::display_enum(f, self.name(), self.value())
12333 }
12334 }
12335
12336 impl std::convert::From<i32> for State {
12337 fn from(value: i32) -> Self {
12338 match value {
12339 0 => Self::Unspecified,
12340 1 => Self::Running,
12341 2 => Self::Succeeded,
12342 3 => Self::Cancelled,
12343 4 => Self::Failed,
12344 5 => Self::Canceling,
12345 _ => Self::UnknownValue(state::UnknownValue(
12346 wkt::internal::UnknownEnumValue::Integer(value),
12347 )),
12348 }
12349 }
12350 }
12351
12352 impl std::convert::From<&str> for State {
12353 fn from(value: &str) -> Self {
12354 use std::string::ToString;
12355 match value {
12356 "STATE_UNSPECIFIED" => Self::Unspecified,
12357 "RUNNING" => Self::Running,
12358 "SUCCEEDED" => Self::Succeeded,
12359 "CANCELLED" => Self::Cancelled,
12360 "FAILED" => Self::Failed,
12361 "CANCELING" => Self::Canceling,
12362 _ => Self::UnknownValue(state::UnknownValue(
12363 wkt::internal::UnknownEnumValue::String(value.to_string()),
12364 )),
12365 }
12366 }
12367 }
12368
12369 impl serde::ser::Serialize for State {
12370 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12371 where
12372 S: serde::Serializer,
12373 {
12374 match self {
12375 Self::Unspecified => serializer.serialize_i32(0),
12376 Self::Running => serializer.serialize_i32(1),
12377 Self::Succeeded => serializer.serialize_i32(2),
12378 Self::Cancelled => serializer.serialize_i32(3),
12379 Self::Failed => serializer.serialize_i32(4),
12380 Self::Canceling => serializer.serialize_i32(5),
12381 Self::UnknownValue(u) => u.0.serialize(serializer),
12382 }
12383 }
12384 }
12385
12386 impl<'de> serde::de::Deserialize<'de> for State {
12387 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12388 where
12389 D: serde::Deserializer<'de>,
12390 {
12391 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12392 ".google.cloud.dataform.v1.WorkflowInvocation.State",
12393 ))
12394 }
12395 }
12396
12397 /// The source of the compilation result to use for this invocation.
12398 #[derive(Clone, Debug, PartialEq)]
12399 #[non_exhaustive]
12400 pub enum CompilationSource {
12401 /// Immutable. The name of the compilation result to use for this invocation.
12402 /// Must be in the format
12403 /// `projects/*/locations/*/repositories/*/compilationResults/*`.
12404 CompilationResult(std::string::String),
12405 /// Immutable. The name of the workflow config to invoke. Must be in the
12406 /// format `projects/*/locations/*/repositories/*/workflowConfigs/*`.
12407 WorkflowConfig(std::string::String),
12408 }
12409}
12410
12411/// `ListWorkflowInvocations` request message.
12412#[derive(Clone, Default, PartialEq)]
12413#[non_exhaustive]
12414pub struct ListWorkflowInvocationsRequest {
12415 /// Required. The parent resource of the WorkflowInvocation type. Must be in
12416 /// the format `projects/*/locations/*/repositories/*`.
12417 pub parent: std::string::String,
12418
12419 /// Optional. Maximum number of workflow invocations to return. The server may
12420 /// return fewer items than requested. If unspecified, the server will pick an
12421 /// appropriate default.
12422 pub page_size: i32,
12423
12424 /// Optional. Page token received from a previous `ListWorkflowInvocations`
12425 /// call. Provide this to retrieve the subsequent page.
12426 ///
12427 /// When paginating, all other parameters provided to
12428 /// `ListWorkflowInvocations`, with the exception of `page_size`, must match
12429 /// the call that provided the page token.
12430 pub page_token: std::string::String,
12431
12432 /// Optional. This field only supports ordering by `name`. If unspecified, the
12433 /// server will choose the ordering. If specified, the default order is
12434 /// ascending for the `name` field.
12435 pub order_by: std::string::String,
12436
12437 /// Optional. Filter for the returned list.
12438 pub filter: std::string::String,
12439
12440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12441}
12442
12443impl ListWorkflowInvocationsRequest {
12444 pub fn new() -> Self {
12445 std::default::Default::default()
12446 }
12447
12448 /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
12449 ///
12450 /// # Example
12451 /// ```ignore,no_run
12452 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
12453 /// let x = ListWorkflowInvocationsRequest::new().set_parent("example");
12454 /// ```
12455 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12456 self.parent = v.into();
12457 self
12458 }
12459
12460 /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
12461 ///
12462 /// # Example
12463 /// ```ignore,no_run
12464 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
12465 /// let x = ListWorkflowInvocationsRequest::new().set_page_size(42);
12466 /// ```
12467 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12468 self.page_size = v.into();
12469 self
12470 }
12471
12472 /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
12473 ///
12474 /// # Example
12475 /// ```ignore,no_run
12476 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
12477 /// let x = ListWorkflowInvocationsRequest::new().set_page_token("example");
12478 /// ```
12479 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12480 self.page_token = v.into();
12481 self
12482 }
12483
12484 /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
12485 ///
12486 /// # Example
12487 /// ```ignore,no_run
12488 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
12489 /// let x = ListWorkflowInvocationsRequest::new().set_order_by("example");
12490 /// ```
12491 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12492 self.order_by = v.into();
12493 self
12494 }
12495
12496 /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
12497 ///
12498 /// # Example
12499 /// ```ignore,no_run
12500 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsRequest;
12501 /// let x = ListWorkflowInvocationsRequest::new().set_filter("example");
12502 /// ```
12503 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12504 self.filter = v.into();
12505 self
12506 }
12507}
12508
12509impl wkt::message::Message for ListWorkflowInvocationsRequest {
12510 fn typename() -> &'static str {
12511 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsRequest"
12512 }
12513}
12514
12515/// `ListWorkflowInvocations` response message.
12516#[derive(Clone, Default, PartialEq)]
12517#[non_exhaustive]
12518pub struct ListWorkflowInvocationsResponse {
12519 /// List of workflow invocations.
12520 pub workflow_invocations: std::vec::Vec<crate::model::WorkflowInvocation>,
12521
12522 /// A token, which can be sent as `page_token` to retrieve the next page.
12523 /// If this field is omitted, there are no subsequent pages.
12524 pub next_page_token: std::string::String,
12525
12526 /// Locations which could not be reached.
12527 pub unreachable: std::vec::Vec<std::string::String>,
12528
12529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12530}
12531
12532impl ListWorkflowInvocationsResponse {
12533 pub fn new() -> Self {
12534 std::default::Default::default()
12535 }
12536
12537 /// Sets the value of [workflow_invocations][crate::model::ListWorkflowInvocationsResponse::workflow_invocations].
12538 ///
12539 /// # Example
12540 /// ```ignore,no_run
12541 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
12542 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
12543 /// let x = ListWorkflowInvocationsResponse::new()
12544 /// .set_workflow_invocations([
12545 /// WorkflowInvocation::default()/* use setters */,
12546 /// WorkflowInvocation::default()/* use (different) setters */,
12547 /// ]);
12548 /// ```
12549 pub fn set_workflow_invocations<T, V>(mut self, v: T) -> Self
12550 where
12551 T: std::iter::IntoIterator<Item = V>,
12552 V: std::convert::Into<crate::model::WorkflowInvocation>,
12553 {
12554 use std::iter::Iterator;
12555 self.workflow_invocations = v.into_iter().map(|i| i.into()).collect();
12556 self
12557 }
12558
12559 /// Sets the value of [next_page_token][crate::model::ListWorkflowInvocationsResponse::next_page_token].
12560 ///
12561 /// # Example
12562 /// ```ignore,no_run
12563 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
12564 /// let x = ListWorkflowInvocationsResponse::new().set_next_page_token("example");
12565 /// ```
12566 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12567 self.next_page_token = v.into();
12568 self
12569 }
12570
12571 /// Sets the value of [unreachable][crate::model::ListWorkflowInvocationsResponse::unreachable].
12572 ///
12573 /// # Example
12574 /// ```ignore,no_run
12575 /// # use google_cloud_dataform_v1::model::ListWorkflowInvocationsResponse;
12576 /// let x = ListWorkflowInvocationsResponse::new().set_unreachable(["a", "b", "c"]);
12577 /// ```
12578 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12579 where
12580 T: std::iter::IntoIterator<Item = V>,
12581 V: std::convert::Into<std::string::String>,
12582 {
12583 use std::iter::Iterator;
12584 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12585 self
12586 }
12587}
12588
12589impl wkt::message::Message for ListWorkflowInvocationsResponse {
12590 fn typename() -> &'static str {
12591 "type.googleapis.com/google.cloud.dataform.v1.ListWorkflowInvocationsResponse"
12592 }
12593}
12594
12595#[doc(hidden)]
12596impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkflowInvocationsResponse {
12597 type PageItem = crate::model::WorkflowInvocation;
12598
12599 fn items(self) -> std::vec::Vec<Self::PageItem> {
12600 self.workflow_invocations
12601 }
12602
12603 fn next_page_token(&self) -> std::string::String {
12604 use std::clone::Clone;
12605 self.next_page_token.clone()
12606 }
12607}
12608
12609/// `GetWorkflowInvocation` request message.
12610#[derive(Clone, Default, PartialEq)]
12611#[non_exhaustive]
12612pub struct GetWorkflowInvocationRequest {
12613 /// Required. The workflow invocation resource's name.
12614 pub name: std::string::String,
12615
12616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12617}
12618
12619impl GetWorkflowInvocationRequest {
12620 pub fn new() -> Self {
12621 std::default::Default::default()
12622 }
12623
12624 /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
12625 ///
12626 /// # Example
12627 /// ```ignore,no_run
12628 /// # use google_cloud_dataform_v1::model::GetWorkflowInvocationRequest;
12629 /// let x = GetWorkflowInvocationRequest::new().set_name("example");
12630 /// ```
12631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12632 self.name = v.into();
12633 self
12634 }
12635}
12636
12637impl wkt::message::Message for GetWorkflowInvocationRequest {
12638 fn typename() -> &'static str {
12639 "type.googleapis.com/google.cloud.dataform.v1.GetWorkflowInvocationRequest"
12640 }
12641}
12642
12643/// `CreateWorkflowInvocation` request message.
12644#[derive(Clone, Default, PartialEq)]
12645#[non_exhaustive]
12646pub struct CreateWorkflowInvocationRequest {
12647 /// Required. The repository in which to create the workflow invocation. Must
12648 /// be in the format `projects/*/locations/*/repositories/*`.
12649 pub parent: std::string::String,
12650
12651 /// Required. The workflow invocation resource to create.
12652 pub workflow_invocation: std::option::Option<crate::model::WorkflowInvocation>,
12653
12654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12655}
12656
12657impl CreateWorkflowInvocationRequest {
12658 pub fn new() -> Self {
12659 std::default::Default::default()
12660 }
12661
12662 /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
12663 ///
12664 /// # Example
12665 /// ```ignore,no_run
12666 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
12667 /// let x = CreateWorkflowInvocationRequest::new().set_parent("example");
12668 /// ```
12669 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12670 self.parent = v.into();
12671 self
12672 }
12673
12674 /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
12675 ///
12676 /// # Example
12677 /// ```ignore,no_run
12678 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
12679 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
12680 /// let x = CreateWorkflowInvocationRequest::new().set_workflow_invocation(WorkflowInvocation::default()/* use setters */);
12681 /// ```
12682 pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
12683 where
12684 T: std::convert::Into<crate::model::WorkflowInvocation>,
12685 {
12686 self.workflow_invocation = std::option::Option::Some(v.into());
12687 self
12688 }
12689
12690 /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
12691 ///
12692 /// # Example
12693 /// ```ignore,no_run
12694 /// # use google_cloud_dataform_v1::model::CreateWorkflowInvocationRequest;
12695 /// use google_cloud_dataform_v1::model::WorkflowInvocation;
12696 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(Some(WorkflowInvocation::default()/* use setters */));
12697 /// let x = CreateWorkflowInvocationRequest::new().set_or_clear_workflow_invocation(None::<WorkflowInvocation>);
12698 /// ```
12699 pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
12700 where
12701 T: std::convert::Into<crate::model::WorkflowInvocation>,
12702 {
12703 self.workflow_invocation = v.map(|x| x.into());
12704 self
12705 }
12706}
12707
12708impl wkt::message::Message for CreateWorkflowInvocationRequest {
12709 fn typename() -> &'static str {
12710 "type.googleapis.com/google.cloud.dataform.v1.CreateWorkflowInvocationRequest"
12711 }
12712}
12713
12714/// `DeleteWorkflowInvocation` request message.
12715#[derive(Clone, Default, PartialEq)]
12716#[non_exhaustive]
12717pub struct DeleteWorkflowInvocationRequest {
12718 /// Required. The workflow invocation resource's name.
12719 pub name: std::string::String,
12720
12721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12722}
12723
12724impl DeleteWorkflowInvocationRequest {
12725 pub fn new() -> Self {
12726 std::default::Default::default()
12727 }
12728
12729 /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
12730 ///
12731 /// # Example
12732 /// ```ignore,no_run
12733 /// # use google_cloud_dataform_v1::model::DeleteWorkflowInvocationRequest;
12734 /// let x = DeleteWorkflowInvocationRequest::new().set_name("example");
12735 /// ```
12736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12737 self.name = v.into();
12738 self
12739 }
12740}
12741
12742impl wkt::message::Message for DeleteWorkflowInvocationRequest {
12743 fn typename() -> &'static str {
12744 "type.googleapis.com/google.cloud.dataform.v1.DeleteWorkflowInvocationRequest"
12745 }
12746}
12747
12748/// `CancelWorkflowInvocation` request message.
12749#[derive(Clone, Default, PartialEq)]
12750#[non_exhaustive]
12751pub struct CancelWorkflowInvocationRequest {
12752 /// Required. The workflow invocation resource's name.
12753 pub name: std::string::String,
12754
12755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12756}
12757
12758impl CancelWorkflowInvocationRequest {
12759 pub fn new() -> Self {
12760 std::default::Default::default()
12761 }
12762
12763 /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
12764 ///
12765 /// # Example
12766 /// ```ignore,no_run
12767 /// # use google_cloud_dataform_v1::model::CancelWorkflowInvocationRequest;
12768 /// let x = CancelWorkflowInvocationRequest::new().set_name("example");
12769 /// ```
12770 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12771 self.name = v.into();
12772 self
12773 }
12774}
12775
12776impl wkt::message::Message for CancelWorkflowInvocationRequest {
12777 fn typename() -> &'static str {
12778 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationRequest"
12779 }
12780}
12781
12782/// `CancelWorkflowInvocation` response message.
12783#[derive(Clone, Default, PartialEq)]
12784#[non_exhaustive]
12785pub struct CancelWorkflowInvocationResponse {
12786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12787}
12788
12789impl CancelWorkflowInvocationResponse {
12790 pub fn new() -> Self {
12791 std::default::Default::default()
12792 }
12793}
12794
12795impl wkt::message::Message for CancelWorkflowInvocationResponse {
12796 fn typename() -> &'static str {
12797 "type.googleapis.com/google.cloud.dataform.v1.CancelWorkflowInvocationResponse"
12798 }
12799}
12800
12801/// Represents a single action in a workflow invocation.
12802#[derive(Clone, Default, PartialEq)]
12803#[non_exhaustive]
12804pub struct WorkflowInvocationAction {
12805 /// Output only. This action's identifier. Unique within the workflow
12806 /// invocation.
12807 pub target: std::option::Option<crate::model::Target>,
12808
12809 /// Output only. The action's identifier if the project had been compiled
12810 /// without any overrides configured. Unique within the compilation result.
12811 pub canonical_target: std::option::Option<crate::model::Target>,
12812
12813 /// Output only. This action's current state.
12814 pub state: crate::model::workflow_invocation_action::State,
12815
12816 /// Output only. If and only if action's state is FAILED a failure reason is
12817 /// set.
12818 pub failure_reason: std::string::String,
12819
12820 /// Output only. This action's timing details.
12821 /// `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
12822 /// CANCELLED, FAILED] state.
12823 /// `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
12824 /// state.
12825 pub invocation_timing: std::option::Option<google_cloud_type::model::Interval>,
12826
12827 /// Output only. All the metadata information that is used internally to serve
12828 /// the resource. For example: timestamps, flags, status fields, etc. The
12829 /// format of this field is a JSON string.
12830 pub internal_metadata: std::option::Option<std::string::String>,
12831
12832 /// The action's details.
12833 pub action: std::option::Option<crate::model::workflow_invocation_action::Action>,
12834
12835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12836}
12837
12838impl WorkflowInvocationAction {
12839 pub fn new() -> Self {
12840 std::default::Default::default()
12841 }
12842
12843 /// Sets the value of [target][crate::model::WorkflowInvocationAction::target].
12844 ///
12845 /// # Example
12846 /// ```ignore,no_run
12847 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12848 /// use google_cloud_dataform_v1::model::Target;
12849 /// let x = WorkflowInvocationAction::new().set_target(Target::default()/* use setters */);
12850 /// ```
12851 pub fn set_target<T>(mut self, v: T) -> Self
12852 where
12853 T: std::convert::Into<crate::model::Target>,
12854 {
12855 self.target = std::option::Option::Some(v.into());
12856 self
12857 }
12858
12859 /// Sets or clears the value of [target][crate::model::WorkflowInvocationAction::target].
12860 ///
12861 /// # Example
12862 /// ```ignore,no_run
12863 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12864 /// use google_cloud_dataform_v1::model::Target;
12865 /// let x = WorkflowInvocationAction::new().set_or_clear_target(Some(Target::default()/* use setters */));
12866 /// let x = WorkflowInvocationAction::new().set_or_clear_target(None::<Target>);
12867 /// ```
12868 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
12869 where
12870 T: std::convert::Into<crate::model::Target>,
12871 {
12872 self.target = v.map(|x| x.into());
12873 self
12874 }
12875
12876 /// Sets the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
12877 ///
12878 /// # Example
12879 /// ```ignore,no_run
12880 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12881 /// use google_cloud_dataform_v1::model::Target;
12882 /// let x = WorkflowInvocationAction::new().set_canonical_target(Target::default()/* use setters */);
12883 /// ```
12884 pub fn set_canonical_target<T>(mut self, v: T) -> Self
12885 where
12886 T: std::convert::Into<crate::model::Target>,
12887 {
12888 self.canonical_target = std::option::Option::Some(v.into());
12889 self
12890 }
12891
12892 /// Sets or clears the value of [canonical_target][crate::model::WorkflowInvocationAction::canonical_target].
12893 ///
12894 /// # Example
12895 /// ```ignore,no_run
12896 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12897 /// use google_cloud_dataform_v1::model::Target;
12898 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(Some(Target::default()/* use setters */));
12899 /// let x = WorkflowInvocationAction::new().set_or_clear_canonical_target(None::<Target>);
12900 /// ```
12901 pub fn set_or_clear_canonical_target<T>(mut self, v: std::option::Option<T>) -> Self
12902 where
12903 T: std::convert::Into<crate::model::Target>,
12904 {
12905 self.canonical_target = v.map(|x| x.into());
12906 self
12907 }
12908
12909 /// Sets the value of [state][crate::model::WorkflowInvocationAction::state].
12910 ///
12911 /// # Example
12912 /// ```ignore,no_run
12913 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12914 /// use google_cloud_dataform_v1::model::workflow_invocation_action::State;
12915 /// let x0 = WorkflowInvocationAction::new().set_state(State::Running);
12916 /// let x1 = WorkflowInvocationAction::new().set_state(State::Skipped);
12917 /// let x2 = WorkflowInvocationAction::new().set_state(State::Disabled);
12918 /// ```
12919 pub fn set_state<T: std::convert::Into<crate::model::workflow_invocation_action::State>>(
12920 mut self,
12921 v: T,
12922 ) -> Self {
12923 self.state = v.into();
12924 self
12925 }
12926
12927 /// Sets the value of [failure_reason][crate::model::WorkflowInvocationAction::failure_reason].
12928 ///
12929 /// # Example
12930 /// ```ignore,no_run
12931 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12932 /// let x = WorkflowInvocationAction::new().set_failure_reason("example");
12933 /// ```
12934 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12935 self.failure_reason = v.into();
12936 self
12937 }
12938
12939 /// Sets the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
12940 ///
12941 /// # Example
12942 /// ```ignore,no_run
12943 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12944 /// use google_cloud_type::model::Interval;
12945 /// let x = WorkflowInvocationAction::new().set_invocation_timing(Interval::default()/* use setters */);
12946 /// ```
12947 pub fn set_invocation_timing<T>(mut self, v: T) -> Self
12948 where
12949 T: std::convert::Into<google_cloud_type::model::Interval>,
12950 {
12951 self.invocation_timing = std::option::Option::Some(v.into());
12952 self
12953 }
12954
12955 /// Sets or clears the value of [invocation_timing][crate::model::WorkflowInvocationAction::invocation_timing].
12956 ///
12957 /// # Example
12958 /// ```ignore,no_run
12959 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12960 /// use google_cloud_type::model::Interval;
12961 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(Some(Interval::default()/* use setters */));
12962 /// let x = WorkflowInvocationAction::new().set_or_clear_invocation_timing(None::<Interval>);
12963 /// ```
12964 pub fn set_or_clear_invocation_timing<T>(mut self, v: std::option::Option<T>) -> Self
12965 where
12966 T: std::convert::Into<google_cloud_type::model::Interval>,
12967 {
12968 self.invocation_timing = v.map(|x| x.into());
12969 self
12970 }
12971
12972 /// Sets the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
12973 ///
12974 /// # Example
12975 /// ```ignore,no_run
12976 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12977 /// let x = WorkflowInvocationAction::new().set_internal_metadata("example");
12978 /// ```
12979 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
12980 where
12981 T: std::convert::Into<std::string::String>,
12982 {
12983 self.internal_metadata = std::option::Option::Some(v.into());
12984 self
12985 }
12986
12987 /// Sets or clears the value of [internal_metadata][crate::model::WorkflowInvocationAction::internal_metadata].
12988 ///
12989 /// # Example
12990 /// ```ignore,no_run
12991 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
12992 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(Some("example"));
12993 /// let x = WorkflowInvocationAction::new().set_or_clear_internal_metadata(None::<String>);
12994 /// ```
12995 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12996 where
12997 T: std::convert::Into<std::string::String>,
12998 {
12999 self.internal_metadata = v.map(|x| x.into());
13000 self
13001 }
13002
13003 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action].
13004 ///
13005 /// Note that all the setters affecting `action` are mutually
13006 /// exclusive.
13007 ///
13008 /// # Example
13009 /// ```ignore,no_run
13010 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13011 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
13012 /// let x = WorkflowInvocationAction::new().set_action(Some(
13013 /// google_cloud_dataform_v1::model::workflow_invocation_action::Action::BigqueryAction(BigQueryAction::default().into())));
13014 /// ```
13015 pub fn set_action<
13016 T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::Action>>,
13017 >(
13018 mut self,
13019 v: T,
13020 ) -> Self {
13021 self.action = v.into();
13022 self
13023 }
13024
13025 /// The value of [action][crate::model::WorkflowInvocationAction::action]
13026 /// if it holds a `BigqueryAction`, `None` if the field is not set or
13027 /// holds a different branch.
13028 pub fn bigquery_action(
13029 &self,
13030 ) -> std::option::Option<
13031 &std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
13032 > {
13033 #[allow(unreachable_patterns)]
13034 self.action.as_ref().and_then(|v| match v {
13035 crate::model::workflow_invocation_action::Action::BigqueryAction(v) => {
13036 std::option::Option::Some(v)
13037 }
13038 _ => std::option::Option::None,
13039 })
13040 }
13041
13042 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
13043 /// to hold a `BigqueryAction`.
13044 ///
13045 /// Note that all the setters affecting `action` are
13046 /// mutually exclusive.
13047 ///
13048 /// # Example
13049 /// ```ignore,no_run
13050 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13051 /// use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
13052 /// let x = WorkflowInvocationAction::new().set_bigquery_action(BigQueryAction::default()/* use setters */);
13053 /// assert!(x.bigquery_action().is_some());
13054 /// assert!(x.notebook_action().is_none());
13055 /// assert!(x.data_preparation_action().is_none());
13056 /// ```
13057 pub fn set_bigquery_action<
13058 T: std::convert::Into<
13059 std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>,
13060 >,
13061 >(
13062 mut self,
13063 v: T,
13064 ) -> Self {
13065 self.action = std::option::Option::Some(
13066 crate::model::workflow_invocation_action::Action::BigqueryAction(v.into()),
13067 );
13068 self
13069 }
13070
13071 /// The value of [action][crate::model::WorkflowInvocationAction::action]
13072 /// if it holds a `NotebookAction`, `None` if the field is not set or
13073 /// holds a different branch.
13074 pub fn notebook_action(
13075 &self,
13076 ) -> std::option::Option<
13077 &std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
13078 > {
13079 #[allow(unreachable_patterns)]
13080 self.action.as_ref().and_then(|v| match v {
13081 crate::model::workflow_invocation_action::Action::NotebookAction(v) => {
13082 std::option::Option::Some(v)
13083 }
13084 _ => std::option::Option::None,
13085 })
13086 }
13087
13088 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
13089 /// to hold a `NotebookAction`.
13090 ///
13091 /// Note that all the setters affecting `action` are
13092 /// mutually exclusive.
13093 ///
13094 /// # Example
13095 /// ```ignore,no_run
13096 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13097 /// use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
13098 /// let x = WorkflowInvocationAction::new().set_notebook_action(NotebookAction::default()/* use setters */);
13099 /// assert!(x.notebook_action().is_some());
13100 /// assert!(x.bigquery_action().is_none());
13101 /// assert!(x.data_preparation_action().is_none());
13102 /// ```
13103 pub fn set_notebook_action<
13104 T: std::convert::Into<
13105 std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>,
13106 >,
13107 >(
13108 mut self,
13109 v: T,
13110 ) -> Self {
13111 self.action = std::option::Option::Some(
13112 crate::model::workflow_invocation_action::Action::NotebookAction(v.into()),
13113 );
13114 self
13115 }
13116
13117 /// The value of [action][crate::model::WorkflowInvocationAction::action]
13118 /// if it holds a `DataPreparationAction`, `None` if the field is not set or
13119 /// holds a different branch.
13120 pub fn data_preparation_action(
13121 &self,
13122 ) -> std::option::Option<
13123 &std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
13124 > {
13125 #[allow(unreachable_patterns)]
13126 self.action.as_ref().and_then(|v| match v {
13127 crate::model::workflow_invocation_action::Action::DataPreparationAction(v) => {
13128 std::option::Option::Some(v)
13129 }
13130 _ => std::option::Option::None,
13131 })
13132 }
13133
13134 /// Sets the value of [action][crate::model::WorkflowInvocationAction::action]
13135 /// to hold a `DataPreparationAction`.
13136 ///
13137 /// Note that all the setters affecting `action` are
13138 /// mutually exclusive.
13139 ///
13140 /// # Example
13141 /// ```ignore,no_run
13142 /// # use google_cloud_dataform_v1::model::WorkflowInvocationAction;
13143 /// use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13144 /// let x = WorkflowInvocationAction::new().set_data_preparation_action(DataPreparationAction::default()/* use setters */);
13145 /// assert!(x.data_preparation_action().is_some());
13146 /// assert!(x.bigquery_action().is_none());
13147 /// assert!(x.notebook_action().is_none());
13148 /// ```
13149 pub fn set_data_preparation_action<
13150 T: std::convert::Into<
13151 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
13152 >,
13153 >(
13154 mut self,
13155 v: T,
13156 ) -> Self {
13157 self.action = std::option::Option::Some(
13158 crate::model::workflow_invocation_action::Action::DataPreparationAction(v.into()),
13159 );
13160 self
13161 }
13162}
13163
13164impl wkt::message::Message for WorkflowInvocationAction {
13165 fn typename() -> &'static str {
13166 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction"
13167 }
13168}
13169
13170/// Defines additional types related to [WorkflowInvocationAction].
13171pub mod workflow_invocation_action {
13172 #[allow(unused_imports)]
13173 use super::*;
13174
13175 /// Represents a workflow action that will run against BigQuery.
13176 #[derive(Clone, Default, PartialEq)]
13177 #[non_exhaustive]
13178 pub struct BigQueryAction {
13179 /// Output only. The generated BigQuery SQL script that will be executed.
13180 pub sql_script: std::string::String,
13181
13182 /// Output only. The ID of the BigQuery job that executed the SQL in
13183 /// sql_script. Only set once the job has started to run.
13184 pub job_id: std::string::String,
13185
13186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13187 }
13188
13189 impl BigQueryAction {
13190 pub fn new() -> Self {
13191 std::default::Default::default()
13192 }
13193
13194 /// Sets the value of [sql_script][crate::model::workflow_invocation_action::BigQueryAction::sql_script].
13195 ///
13196 /// # Example
13197 /// ```ignore,no_run
13198 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
13199 /// let x = BigQueryAction::new().set_sql_script("example");
13200 /// ```
13201 pub fn set_sql_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13202 self.sql_script = v.into();
13203 self
13204 }
13205
13206 /// Sets the value of [job_id][crate::model::workflow_invocation_action::BigQueryAction::job_id].
13207 ///
13208 /// # Example
13209 /// ```ignore,no_run
13210 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::BigQueryAction;
13211 /// let x = BigQueryAction::new().set_job_id("example");
13212 /// ```
13213 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13214 self.job_id = v.into();
13215 self
13216 }
13217 }
13218
13219 impl wkt::message::Message for BigQueryAction {
13220 fn typename() -> &'static str {
13221 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.BigQueryAction"
13222 }
13223 }
13224
13225 /// Represents a workflow action that will run against a Notebook runtime.
13226 #[derive(Clone, Default, PartialEq)]
13227 #[non_exhaustive]
13228 pub struct NotebookAction {
13229 /// Output only. The code contents of a Notebook to be run.
13230 pub contents: std::string::String,
13231
13232 /// Output only. The ID of the Vertex job that executed the notebook in
13233 /// contents and also the ID used for the outputs created in Google Cloud
13234 /// Storage buckets. Only set once the job has started to run.
13235 pub job_id: std::string::String,
13236
13237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13238 }
13239
13240 impl NotebookAction {
13241 pub fn new() -> Self {
13242 std::default::Default::default()
13243 }
13244
13245 /// Sets the value of [contents][crate::model::workflow_invocation_action::NotebookAction::contents].
13246 ///
13247 /// # Example
13248 /// ```ignore,no_run
13249 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
13250 /// let x = NotebookAction::new().set_contents("example");
13251 /// ```
13252 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13253 self.contents = v.into();
13254 self
13255 }
13256
13257 /// Sets the value of [job_id][crate::model::workflow_invocation_action::NotebookAction::job_id].
13258 ///
13259 /// # Example
13260 /// ```ignore,no_run
13261 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::NotebookAction;
13262 /// let x = NotebookAction::new().set_job_id("example");
13263 /// ```
13264 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13265 self.job_id = v.into();
13266 self
13267 }
13268 }
13269
13270 impl wkt::message::Message for NotebookAction {
13271 fn typename() -> &'static str {
13272 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.NotebookAction"
13273 }
13274 }
13275
13276 /// Represents a workflow action that will run a Data Preparation.
13277 #[derive(Clone, Default, PartialEq)]
13278 #[non_exhaustive]
13279 pub struct DataPreparationAction {
13280 /// Output only. The generated BigQuery SQL script that will be executed. For
13281 /// reference only.
13282 pub generated_sql: std::string::String,
13283
13284 /// Output only. The ID of the BigQuery job that executed the SQL in
13285 /// sql_script. Only set once the job has started to run.
13286 pub job_id: std::string::String,
13287
13288 /// The definition for the data preparation.
13289 pub definition: std::option::Option<
13290 crate::model::workflow_invocation_action::data_preparation_action::Definition,
13291 >,
13292
13293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13294 }
13295
13296 impl DataPreparationAction {
13297 pub fn new() -> Self {
13298 std::default::Default::default()
13299 }
13300
13301 /// Sets the value of [generated_sql][crate::model::workflow_invocation_action::DataPreparationAction::generated_sql].
13302 ///
13303 /// # Example
13304 /// ```ignore,no_run
13305 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13306 /// let x = DataPreparationAction::new().set_generated_sql("example");
13307 /// ```
13308 pub fn set_generated_sql<T: std::convert::Into<std::string::String>>(
13309 mut self,
13310 v: T,
13311 ) -> Self {
13312 self.generated_sql = v.into();
13313 self
13314 }
13315
13316 /// Sets the value of [job_id][crate::model::workflow_invocation_action::DataPreparationAction::job_id].
13317 ///
13318 /// # Example
13319 /// ```ignore,no_run
13320 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13321 /// let x = DataPreparationAction::new().set_job_id("example");
13322 /// ```
13323 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13324 self.job_id = v.into();
13325 self
13326 }
13327
13328 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition].
13329 ///
13330 /// Note that all the setters affecting `definition` are mutually
13331 /// exclusive.
13332 ///
13333 /// # Example
13334 /// ```ignore,no_run
13335 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13336 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::Definition;
13337 /// let x = DataPreparationAction::new().set_definition(Some(Definition::ContentsYaml("example".to_string())));
13338 /// ```
13339 pub fn set_definition<T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::Definition>>>(mut self, v: T) -> Self
13340 {
13341 self.definition = v.into();
13342 self
13343 }
13344
13345 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
13346 /// if it holds a `ContentsYaml`, `None` if the field is not set or
13347 /// holds a different branch.
13348 pub fn contents_yaml(&self) -> std::option::Option<&std::string::String> {
13349 #[allow(unreachable_patterns)]
13350 self.definition.as_ref().and_then(|v| match v {
13351 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(v) => std::option::Option::Some(v),
13352 _ => std::option::Option::None,
13353 })
13354 }
13355
13356 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
13357 /// to hold a `ContentsYaml`.
13358 ///
13359 /// Note that all the setters affecting `definition` are
13360 /// mutually exclusive.
13361 ///
13362 /// # Example
13363 /// ```ignore,no_run
13364 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13365 /// let x = DataPreparationAction::new().set_contents_yaml("example");
13366 /// assert!(x.contents_yaml().is_some());
13367 /// assert!(x.contents_sql().is_none());
13368 /// ```
13369 pub fn set_contents_yaml<T: std::convert::Into<std::string::String>>(
13370 mut self,
13371 v: T,
13372 ) -> Self {
13373 self.definition = std::option::Option::Some(
13374 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsYaml(
13375 v.into()
13376 )
13377 );
13378 self
13379 }
13380
13381 /// The value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
13382 /// if it holds a `ContentsSql`, `None` if the field is not set or
13383 /// holds a different branch.
13384 pub fn contents_sql(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>{
13385 #[allow(unreachable_patterns)]
13386 self.definition.as_ref().and_then(|v| match v {
13387 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(v) => std::option::Option::Some(v),
13388 _ => std::option::Option::None,
13389 })
13390 }
13391
13392 /// Sets the value of [definition][crate::model::workflow_invocation_action::DataPreparationAction::definition]
13393 /// to hold a `ContentsSql`.
13394 ///
13395 /// Note that all the setters affecting `definition` are
13396 /// mutually exclusive.
13397 ///
13398 /// # Example
13399 /// ```ignore,no_run
13400 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::DataPreparationAction;
13401 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13402 /// let x = DataPreparationAction::new().set_contents_sql(ActionSqlDefinition::default()/* use setters */);
13403 /// assert!(x.contents_sql().is_some());
13404 /// assert!(x.contents_yaml().is_none());
13405 /// ```
13406 pub fn set_contents_sql<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>>>(mut self, v: T) -> Self{
13407 self.definition = std::option::Option::Some(
13408 crate::model::workflow_invocation_action::data_preparation_action::Definition::ContentsSql(
13409 v.into()
13410 )
13411 );
13412 self
13413 }
13414 }
13415
13416 impl wkt::message::Message for DataPreparationAction {
13417 fn typename() -> &'static str {
13418 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction"
13419 }
13420 }
13421
13422 /// Defines additional types related to [DataPreparationAction].
13423 pub mod data_preparation_action {
13424 #[allow(unused_imports)]
13425 use super::*;
13426
13427 /// Definition of a SQL Data Preparation
13428 #[derive(Clone, Default, PartialEq)]
13429 #[non_exhaustive]
13430 pub struct ActionSqlDefinition {
13431 /// The SQL query representing the data preparation steps. Formatted as a
13432 /// Pipe SQL query statement.
13433 pub query: std::string::String,
13434
13435 /// Error table configuration,
13436 pub error_table: std::option::Option<
13437 crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable,
13438 >,
13439
13440 /// Load configuration.
13441 pub load_config: std::option::Option<
13442 crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig,
13443 >,
13444
13445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13446 }
13447
13448 impl ActionSqlDefinition {
13449 pub fn new() -> Self {
13450 std::default::Default::default()
13451 }
13452
13453 /// Sets the value of [query][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::query].
13454 ///
13455 /// # Example
13456 /// ```ignore,no_run
13457 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13458 /// let x = ActionSqlDefinition::new().set_query("example");
13459 /// ```
13460 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13461 self.query = v.into();
13462 self
13463 }
13464
13465 /// Sets the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
13466 ///
13467 /// # Example
13468 /// ```ignore,no_run
13469 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13470 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
13471 /// let x = ActionSqlDefinition::new().set_error_table(ActionErrorTable::default()/* use setters */);
13472 /// ```
13473 pub fn set_error_table<T>(mut self, v: T) -> Self
13474 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
13475 {
13476 self.error_table = std::option::Option::Some(v.into());
13477 self
13478 }
13479
13480 /// Sets or clears the value of [error_table][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::error_table].
13481 ///
13482 /// # Example
13483 /// ```ignore,no_run
13484 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13485 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
13486 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(Some(ActionErrorTable::default()/* use setters */));
13487 /// let x = ActionSqlDefinition::new().set_or_clear_error_table(None::<ActionErrorTable>);
13488 /// ```
13489 pub fn set_or_clear_error_table<T>(mut self, v: std::option::Option<T>) -> Self
13490 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable>
13491 {
13492 self.error_table = v.map(|x| x.into());
13493 self
13494 }
13495
13496 /// Sets the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
13497 ///
13498 /// # Example
13499 /// ```ignore,no_run
13500 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13501 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13502 /// let x = ActionSqlDefinition::new().set_load_config(ActionLoadConfig::default()/* use setters */);
13503 /// ```
13504 pub fn set_load_config<T>(mut self, v: T) -> Self
13505 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
13506 {
13507 self.load_config = std::option::Option::Some(v.into());
13508 self
13509 }
13510
13511 /// Sets or clears the value of [load_config][crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition::load_config].
13512 ///
13513 /// # Example
13514 /// ```ignore,no_run
13515 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition;
13516 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13517 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(Some(ActionLoadConfig::default()/* use setters */));
13518 /// let x = ActionSqlDefinition::new().set_or_clear_load_config(None::<ActionLoadConfig>);
13519 /// ```
13520 pub fn set_or_clear_load_config<T>(mut self, v: std::option::Option<T>) -> Self
13521 where T: std::convert::Into<crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig>
13522 {
13523 self.load_config = v.map(|x| x.into());
13524 self
13525 }
13526 }
13527
13528 impl wkt::message::Message for ActionSqlDefinition {
13529 fn typename() -> &'static str {
13530 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition"
13531 }
13532 }
13533
13534 /// Error table information, used to write error data into a BigQuery
13535 /// table.
13536 #[derive(Clone, Default, PartialEq)]
13537 #[non_exhaustive]
13538 pub struct ActionErrorTable {
13539 /// Error Table target.
13540 pub target: std::option::Option<crate::model::Target>,
13541
13542 /// Error table partition expiration in days. Only positive values are
13543 /// allowed.
13544 pub retention_days: i32,
13545
13546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13547 }
13548
13549 impl ActionErrorTable {
13550 pub fn new() -> Self {
13551 std::default::Default::default()
13552 }
13553
13554 /// Sets the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
13555 ///
13556 /// # Example
13557 /// ```ignore,no_run
13558 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
13559 /// use google_cloud_dataform_v1::model::Target;
13560 /// let x = ActionErrorTable::new().set_target(Target::default()/* use setters */);
13561 /// ```
13562 pub fn set_target<T>(mut self, v: T) -> Self
13563 where
13564 T: std::convert::Into<crate::model::Target>,
13565 {
13566 self.target = std::option::Option::Some(v.into());
13567 self
13568 }
13569
13570 /// Sets or clears the value of [target][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::target].
13571 ///
13572 /// # Example
13573 /// ```ignore,no_run
13574 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
13575 /// use google_cloud_dataform_v1::model::Target;
13576 /// let x = ActionErrorTable::new().set_or_clear_target(Some(Target::default()/* use setters */));
13577 /// let x = ActionErrorTable::new().set_or_clear_target(None::<Target>);
13578 /// ```
13579 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
13580 where
13581 T: std::convert::Into<crate::model::Target>,
13582 {
13583 self.target = v.map(|x| x.into());
13584 self
13585 }
13586
13587 /// Sets the value of [retention_days][crate::model::workflow_invocation_action::data_preparation_action::ActionErrorTable::retention_days].
13588 ///
13589 /// # Example
13590 /// ```ignore,no_run
13591 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionErrorTable;
13592 /// let x = ActionErrorTable::new().set_retention_days(42);
13593 /// ```
13594 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13595 self.retention_days = v.into();
13596 self
13597 }
13598 }
13599
13600 impl wkt::message::Message for ActionErrorTable {
13601 fn typename() -> &'static str {
13602 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable"
13603 }
13604 }
13605
13606 /// Simplified load configuration for actions
13607 #[derive(Clone, Default, PartialEq)]
13608 #[non_exhaustive]
13609 pub struct ActionLoadConfig {
13610
13611 /// Load mode
13612 pub mode: std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>,
13613
13614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13615 }
13616
13617 impl ActionLoadConfig {
13618 pub fn new() -> Self {
13619 std::default::Default::default()
13620 }
13621
13622 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode].
13623 ///
13624 /// Note that all the setters affecting `mode` are mutually
13625 /// exclusive.
13626 ///
13627 /// # Example
13628 /// ```ignore,no_run
13629 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13630 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
13631 /// let x = ActionLoadConfig::new().set_mode(Some(
13632 /// google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(ActionSimpleLoadMode::default().into())));
13633 /// ```
13634 pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode>>>(mut self, v: T) -> Self
13635 {
13636 self.mode = v.into();
13637 self
13638 }
13639
13640 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13641 /// if it holds a `Replace`, `None` if the field is not set or
13642 /// holds a different branch.
13643 pub fn replace(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
13644 #[allow(unreachable_patterns)]
13645 self.mode.as_ref().and_then(|v| match v {
13646 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(v) => std::option::Option::Some(v),
13647 _ => std::option::Option::None,
13648 })
13649 }
13650
13651 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13652 /// to hold a `Replace`.
13653 ///
13654 /// Note that all the setters affecting `mode` are
13655 /// mutually exclusive.
13656 ///
13657 /// # Example
13658 /// ```ignore,no_run
13659 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13660 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
13661 /// let x = ActionLoadConfig::new().set_replace(ActionSimpleLoadMode::default()/* use setters */);
13662 /// assert!(x.replace().is_some());
13663 /// assert!(x.append().is_none());
13664 /// assert!(x.maximum().is_none());
13665 /// assert!(x.unique().is_none());
13666 /// ```
13667 pub fn set_replace<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>>(mut self, v: T) -> Self{
13668 self.mode = std::option::Option::Some(
13669 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Replace(
13670 v.into()
13671 )
13672 );
13673 self
13674 }
13675
13676 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13677 /// if it holds a `Append`, `None` if the field is not set or
13678 /// holds a different branch.
13679 pub fn append(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>{
13680 #[allow(unreachable_patterns)]
13681 self.mode.as_ref().and_then(|v| match v {
13682 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(v) => std::option::Option::Some(v),
13683 _ => std::option::Option::None,
13684 })
13685 }
13686
13687 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13688 /// to hold a `Append`.
13689 ///
13690 /// Note that all the setters affecting `mode` are
13691 /// mutually exclusive.
13692 ///
13693 /// # Example
13694 /// ```ignore,no_run
13695 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13696 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode;
13697 /// let x = ActionLoadConfig::new().set_append(ActionSimpleLoadMode::default()/* use setters */);
13698 /// assert!(x.append().is_some());
13699 /// assert!(x.replace().is_none());
13700 /// assert!(x.maximum().is_none());
13701 /// assert!(x.unique().is_none());
13702 /// ```
13703 pub fn set_append<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>>>(mut self, v: T) -> Self{
13704 self.mode = std::option::Option::Some(
13705 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Append(
13706 v.into()
13707 )
13708 );
13709 self
13710 }
13711
13712 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13713 /// if it holds a `Maximum`, `None` if the field is not set or
13714 /// holds a different branch.
13715 pub fn maximum(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
13716 #[allow(unreachable_patterns)]
13717 self.mode.as_ref().and_then(|v| match v {
13718 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(v) => std::option::Option::Some(v),
13719 _ => std::option::Option::None,
13720 })
13721 }
13722
13723 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13724 /// to hold a `Maximum`.
13725 ///
13726 /// Note that all the setters affecting `mode` are
13727 /// mutually exclusive.
13728 ///
13729 /// # Example
13730 /// ```ignore,no_run
13731 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13732 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
13733 /// let x = ActionLoadConfig::new().set_maximum(ActionIncrementalLoadMode::default()/* use setters */);
13734 /// assert!(x.maximum().is_some());
13735 /// assert!(x.replace().is_none());
13736 /// assert!(x.append().is_none());
13737 /// assert!(x.unique().is_none());
13738 /// ```
13739 pub fn set_maximum<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>>(mut self, v: T) -> Self{
13740 self.mode = std::option::Option::Some(
13741 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Maximum(
13742 v.into()
13743 )
13744 );
13745 self
13746 }
13747
13748 /// The value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13749 /// if it holds a `Unique`, `None` if the field is not set or
13750 /// holds a different branch.
13751 pub fn unique(&self) -> std::option::Option<&std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>{
13752 #[allow(unreachable_patterns)]
13753 self.mode.as_ref().and_then(|v| match v {
13754 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(v) => std::option::Option::Some(v),
13755 _ => std::option::Option::None,
13756 })
13757 }
13758
13759 /// Sets the value of [mode][crate::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig::mode]
13760 /// to hold a `Unique`.
13761 ///
13762 /// Note that all the setters affecting `mode` are
13763 /// mutually exclusive.
13764 ///
13765 /// # Example
13766 /// ```ignore,no_run
13767 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionLoadConfig;
13768 /// use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
13769 /// let x = ActionLoadConfig::new().set_unique(ActionIncrementalLoadMode::default()/* use setters */);
13770 /// assert!(x.unique().is_some());
13771 /// assert!(x.replace().is_none());
13772 /// assert!(x.append().is_none());
13773 /// assert!(x.maximum().is_none());
13774 /// ```
13775 pub fn set_unique<T: std::convert::Into<std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>>>(mut self, v: T) -> Self{
13776 self.mode = std::option::Option::Some(
13777 crate::model::workflow_invocation_action::data_preparation_action::action_load_config::Mode::Unique(
13778 v.into()
13779 )
13780 );
13781 self
13782 }
13783 }
13784
13785 impl wkt::message::Message for ActionLoadConfig {
13786 fn typename() -> &'static str {
13787 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig"
13788 }
13789 }
13790
13791 /// Defines additional types related to [ActionLoadConfig].
13792 pub mod action_load_config {
13793 #[allow(unused_imports)]
13794 use super::*;
13795
13796 /// Load mode
13797 #[derive(Clone, Debug, PartialEq)]
13798 #[non_exhaustive]
13799 pub enum Mode {
13800 /// Replace destination table
13801 Replace(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
13802 /// Append into destination table
13803 Append(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSimpleLoadMode>),
13804 /// Insert records where the value exceeds the previous maximum value for
13805 /// a column in the destination table
13806 Maximum(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
13807 /// Insert records where the value of a column is not already present in
13808 /// the destination table
13809 Unique(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode>),
13810 }
13811 }
13812
13813 /// Simple load definition
13814 #[derive(Clone, Default, PartialEq)]
13815 #[non_exhaustive]
13816 pub struct ActionSimpleLoadMode {
13817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13818 }
13819
13820 impl ActionSimpleLoadMode {
13821 pub fn new() -> Self {
13822 std::default::Default::default()
13823 }
13824 }
13825
13826 impl wkt::message::Message for ActionSimpleLoadMode {
13827 fn typename() -> &'static str {
13828 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode"
13829 }
13830 }
13831
13832 /// Load definition for incremental load modes
13833 #[derive(Clone, Default, PartialEq)]
13834 #[non_exhaustive]
13835 pub struct ActionIncrementalLoadMode {
13836 /// Column name for incremental load modes
13837 pub column: std::string::String,
13838
13839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13840 }
13841
13842 impl ActionIncrementalLoadMode {
13843 pub fn new() -> Self {
13844 std::default::Default::default()
13845 }
13846
13847 /// Sets the value of [column][crate::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode::column].
13848 ///
13849 /// # Example
13850 /// ```ignore,no_run
13851 /// # use google_cloud_dataform_v1::model::workflow_invocation_action::data_preparation_action::ActionIncrementalLoadMode;
13852 /// let x = ActionIncrementalLoadMode::new().set_column("example");
13853 /// ```
13854 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13855 self.column = v.into();
13856 self
13857 }
13858 }
13859
13860 impl wkt::message::Message for ActionIncrementalLoadMode {
13861 fn typename() -> &'static str {
13862 "type.googleapis.com/google.cloud.dataform.v1.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode"
13863 }
13864 }
13865
13866 /// The definition for the data preparation.
13867 #[derive(Clone, Debug, PartialEq)]
13868 #[non_exhaustive]
13869 pub enum Definition {
13870 /// Output only. YAML representing the contents of the data preparation.
13871 /// Can be used to show the customer what the input was to their workflow.
13872 ContentsYaml(std::string::String),
13873 /// SQL definition for a Data Preparation. Contains a SQL query and
13874 /// additional context information.
13875 ContentsSql(std::boxed::Box<crate::model::workflow_invocation_action::data_preparation_action::ActionSqlDefinition>),
13876 }
13877 }
13878
13879 /// Represents the current state of a workflow invocation action.
13880 ///
13881 /// # Working with unknown values
13882 ///
13883 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13884 /// additional enum variants at any time. Adding new variants is not considered
13885 /// a breaking change. Applications should write their code in anticipation of:
13886 ///
13887 /// - New values appearing in future releases of the client library, **and**
13888 /// - New values received dynamically, without application changes.
13889 ///
13890 /// Please consult the [Working with enums] section in the user guide for some
13891 /// guidelines.
13892 ///
13893 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13894 #[derive(Clone, Debug, PartialEq)]
13895 #[non_exhaustive]
13896 pub enum State {
13897 /// The action has not yet been considered for invocation.
13898 Pending,
13899 /// The action is currently running.
13900 Running,
13901 /// Execution of the action was skipped because upstream dependencies did not
13902 /// all complete successfully. A terminal state.
13903 Skipped,
13904 /// Execution of the action was disabled as per the configuration of the
13905 /// corresponding compilation result action. A terminal state.
13906 Disabled,
13907 /// The action succeeded. A terminal state.
13908 Succeeded,
13909 /// The action was cancelled. A terminal state.
13910 Cancelled,
13911 /// The action failed. A terminal state.
13912 Failed,
13913 /// If set, the enum was initialized with an unknown value.
13914 ///
13915 /// Applications can examine the value using [State::value] or
13916 /// [State::name].
13917 UnknownValue(state::UnknownValue),
13918 }
13919
13920 #[doc(hidden)]
13921 pub mod state {
13922 #[allow(unused_imports)]
13923 use super::*;
13924 #[derive(Clone, Debug, PartialEq)]
13925 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13926 }
13927
13928 impl State {
13929 /// Gets the enum value.
13930 ///
13931 /// Returns `None` if the enum contains an unknown value deserialized from
13932 /// the string representation of enums.
13933 pub fn value(&self) -> std::option::Option<i32> {
13934 match self {
13935 Self::Pending => std::option::Option::Some(0),
13936 Self::Running => std::option::Option::Some(1),
13937 Self::Skipped => std::option::Option::Some(2),
13938 Self::Disabled => std::option::Option::Some(3),
13939 Self::Succeeded => std::option::Option::Some(4),
13940 Self::Cancelled => std::option::Option::Some(5),
13941 Self::Failed => std::option::Option::Some(6),
13942 Self::UnknownValue(u) => u.0.value(),
13943 }
13944 }
13945
13946 /// Gets the enum value as a string.
13947 ///
13948 /// Returns `None` if the enum contains an unknown value deserialized from
13949 /// the integer representation of enums.
13950 pub fn name(&self) -> std::option::Option<&str> {
13951 match self {
13952 Self::Pending => std::option::Option::Some("PENDING"),
13953 Self::Running => std::option::Option::Some("RUNNING"),
13954 Self::Skipped => std::option::Option::Some("SKIPPED"),
13955 Self::Disabled => std::option::Option::Some("DISABLED"),
13956 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13957 Self::Cancelled => std::option::Option::Some("CANCELLED"),
13958 Self::Failed => std::option::Option::Some("FAILED"),
13959 Self::UnknownValue(u) => u.0.name(),
13960 }
13961 }
13962 }
13963
13964 impl std::default::Default for State {
13965 fn default() -> Self {
13966 use std::convert::From;
13967 Self::from(0)
13968 }
13969 }
13970
13971 impl std::fmt::Display for State {
13972 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13973 wkt::internal::display_enum(f, self.name(), self.value())
13974 }
13975 }
13976
13977 impl std::convert::From<i32> for State {
13978 fn from(value: i32) -> Self {
13979 match value {
13980 0 => Self::Pending,
13981 1 => Self::Running,
13982 2 => Self::Skipped,
13983 3 => Self::Disabled,
13984 4 => Self::Succeeded,
13985 5 => Self::Cancelled,
13986 6 => Self::Failed,
13987 _ => Self::UnknownValue(state::UnknownValue(
13988 wkt::internal::UnknownEnumValue::Integer(value),
13989 )),
13990 }
13991 }
13992 }
13993
13994 impl std::convert::From<&str> for State {
13995 fn from(value: &str) -> Self {
13996 use std::string::ToString;
13997 match value {
13998 "PENDING" => Self::Pending,
13999 "RUNNING" => Self::Running,
14000 "SKIPPED" => Self::Skipped,
14001 "DISABLED" => Self::Disabled,
14002 "SUCCEEDED" => Self::Succeeded,
14003 "CANCELLED" => Self::Cancelled,
14004 "FAILED" => Self::Failed,
14005 _ => Self::UnknownValue(state::UnknownValue(
14006 wkt::internal::UnknownEnumValue::String(value.to_string()),
14007 )),
14008 }
14009 }
14010 }
14011
14012 impl serde::ser::Serialize for State {
14013 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14014 where
14015 S: serde::Serializer,
14016 {
14017 match self {
14018 Self::Pending => serializer.serialize_i32(0),
14019 Self::Running => serializer.serialize_i32(1),
14020 Self::Skipped => serializer.serialize_i32(2),
14021 Self::Disabled => serializer.serialize_i32(3),
14022 Self::Succeeded => serializer.serialize_i32(4),
14023 Self::Cancelled => serializer.serialize_i32(5),
14024 Self::Failed => serializer.serialize_i32(6),
14025 Self::UnknownValue(u) => u.0.serialize(serializer),
14026 }
14027 }
14028 }
14029
14030 impl<'de> serde::de::Deserialize<'de> for State {
14031 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14032 where
14033 D: serde::Deserializer<'de>,
14034 {
14035 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14036 ".google.cloud.dataform.v1.WorkflowInvocationAction.State",
14037 ))
14038 }
14039 }
14040
14041 /// The action's details.
14042 #[derive(Clone, Debug, PartialEq)]
14043 #[non_exhaustive]
14044 pub enum Action {
14045 /// Output only. The workflow action's bigquery action details.
14046 BigqueryAction(std::boxed::Box<crate::model::workflow_invocation_action::BigQueryAction>),
14047 /// Output only. The workflow action's notebook action details.
14048 NotebookAction(std::boxed::Box<crate::model::workflow_invocation_action::NotebookAction>),
14049 /// Output only. The workflow action's data preparation action details.
14050 DataPreparationAction(
14051 std::boxed::Box<crate::model::workflow_invocation_action::DataPreparationAction>,
14052 ),
14053 }
14054}
14055
14056/// `QueryWorkflowInvocationActions` request message.
14057#[derive(Clone, Default, PartialEq)]
14058#[non_exhaustive]
14059pub struct QueryWorkflowInvocationActionsRequest {
14060 /// Required. The workflow invocation's name.
14061 pub name: std::string::String,
14062
14063 /// Optional. Maximum number of workflow invocations to return. The server may
14064 /// return fewer items than requested. If unspecified, the server will pick an
14065 /// appropriate default.
14066 pub page_size: i32,
14067
14068 /// Optional. Page token received from a previous
14069 /// `QueryWorkflowInvocationActions` call. Provide this to retrieve the
14070 /// subsequent page.
14071 ///
14072 /// When paginating, all other parameters provided to
14073 /// `QueryWorkflowInvocationActions`, with the exception of `page_size`, must
14074 /// match the call that provided the page token.
14075 pub page_token: std::string::String,
14076
14077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14078}
14079
14080impl QueryWorkflowInvocationActionsRequest {
14081 pub fn new() -> Self {
14082 std::default::Default::default()
14083 }
14084
14085 /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
14086 ///
14087 /// # Example
14088 /// ```ignore,no_run
14089 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
14090 /// let x = QueryWorkflowInvocationActionsRequest::new().set_name("example");
14091 /// ```
14092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14093 self.name = v.into();
14094 self
14095 }
14096
14097 /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
14098 ///
14099 /// # Example
14100 /// ```ignore,no_run
14101 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
14102 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_size(42);
14103 /// ```
14104 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14105 self.page_size = v.into();
14106 self
14107 }
14108
14109 /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
14110 ///
14111 /// # Example
14112 /// ```ignore,no_run
14113 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsRequest;
14114 /// let x = QueryWorkflowInvocationActionsRequest::new().set_page_token("example");
14115 /// ```
14116 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14117 self.page_token = v.into();
14118 self
14119 }
14120}
14121
14122impl wkt::message::Message for QueryWorkflowInvocationActionsRequest {
14123 fn typename() -> &'static str {
14124 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsRequest"
14125 }
14126}
14127
14128/// `QueryWorkflowInvocationActions` response message.
14129#[derive(Clone, Default, PartialEq)]
14130#[non_exhaustive]
14131pub struct QueryWorkflowInvocationActionsResponse {
14132 /// List of workflow invocation actions.
14133 pub workflow_invocation_actions: std::vec::Vec<crate::model::WorkflowInvocationAction>,
14134
14135 /// A token, which can be sent as `page_token` to retrieve the next page.
14136 /// If this field is omitted, there are no subsequent pages.
14137 pub next_page_token: std::string::String,
14138
14139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14140}
14141
14142impl QueryWorkflowInvocationActionsResponse {
14143 pub fn new() -> Self {
14144 std::default::Default::default()
14145 }
14146
14147 /// Sets the value of [workflow_invocation_actions][crate::model::QueryWorkflowInvocationActionsResponse::workflow_invocation_actions].
14148 ///
14149 /// # Example
14150 /// ```ignore,no_run
14151 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
14152 /// use google_cloud_dataform_v1::model::WorkflowInvocationAction;
14153 /// let x = QueryWorkflowInvocationActionsResponse::new()
14154 /// .set_workflow_invocation_actions([
14155 /// WorkflowInvocationAction::default()/* use setters */,
14156 /// WorkflowInvocationAction::default()/* use (different) setters */,
14157 /// ]);
14158 /// ```
14159 pub fn set_workflow_invocation_actions<T, V>(mut self, v: T) -> Self
14160 where
14161 T: std::iter::IntoIterator<Item = V>,
14162 V: std::convert::Into<crate::model::WorkflowInvocationAction>,
14163 {
14164 use std::iter::Iterator;
14165 self.workflow_invocation_actions = v.into_iter().map(|i| i.into()).collect();
14166 self
14167 }
14168
14169 /// Sets the value of [next_page_token][crate::model::QueryWorkflowInvocationActionsResponse::next_page_token].
14170 ///
14171 /// # Example
14172 /// ```ignore,no_run
14173 /// # use google_cloud_dataform_v1::model::QueryWorkflowInvocationActionsResponse;
14174 /// let x = QueryWorkflowInvocationActionsResponse::new().set_next_page_token("example");
14175 /// ```
14176 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14177 self.next_page_token = v.into();
14178 self
14179 }
14180}
14181
14182impl wkt::message::Message for QueryWorkflowInvocationActionsResponse {
14183 fn typename() -> &'static str {
14184 "type.googleapis.com/google.cloud.dataform.v1.QueryWorkflowInvocationActionsResponse"
14185 }
14186}
14187
14188#[doc(hidden)]
14189impl google_cloud_gax::paginator::internal::PageableResponse
14190 for QueryWorkflowInvocationActionsResponse
14191{
14192 type PageItem = crate::model::WorkflowInvocationAction;
14193
14194 fn items(self) -> std::vec::Vec<Self::PageItem> {
14195 self.workflow_invocation_actions
14196 }
14197
14198 fn next_page_token(&self) -> std::string::String {
14199 use std::clone::Clone;
14200 self.next_page_token.clone()
14201 }
14202}
14203
14204/// Config for all repositories in a given project and location.
14205#[derive(Clone, Default, PartialEq)]
14206#[non_exhaustive]
14207pub struct Config {
14208 /// Identifier. The config name.
14209 pub name: std::string::String,
14210
14211 /// Optional. The default KMS key that is used if no encryption key is provided
14212 /// when a repository is created.
14213 pub default_kms_key_name: std::string::String,
14214
14215 /// Output only. All the metadata information that is used internally to serve
14216 /// the resource. For example: timestamps, flags, status fields, etc. The
14217 /// format of this field is a JSON string.
14218 pub internal_metadata: std::option::Option<std::string::String>,
14219
14220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14221}
14222
14223impl Config {
14224 pub fn new() -> Self {
14225 std::default::Default::default()
14226 }
14227
14228 /// Sets the value of [name][crate::model::Config::name].
14229 ///
14230 /// # Example
14231 /// ```ignore,no_run
14232 /// # use google_cloud_dataform_v1::model::Config;
14233 /// let x = Config::new().set_name("example");
14234 /// ```
14235 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14236 self.name = v.into();
14237 self
14238 }
14239
14240 /// Sets the value of [default_kms_key_name][crate::model::Config::default_kms_key_name].
14241 ///
14242 /// # Example
14243 /// ```ignore,no_run
14244 /// # use google_cloud_dataform_v1::model::Config;
14245 /// let x = Config::new().set_default_kms_key_name("example");
14246 /// ```
14247 pub fn set_default_kms_key_name<T: std::convert::Into<std::string::String>>(
14248 mut self,
14249 v: T,
14250 ) -> Self {
14251 self.default_kms_key_name = v.into();
14252 self
14253 }
14254
14255 /// Sets the value of [internal_metadata][crate::model::Config::internal_metadata].
14256 ///
14257 /// # Example
14258 /// ```ignore,no_run
14259 /// # use google_cloud_dataform_v1::model::Config;
14260 /// let x = Config::new().set_internal_metadata("example");
14261 /// ```
14262 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
14263 where
14264 T: std::convert::Into<std::string::String>,
14265 {
14266 self.internal_metadata = std::option::Option::Some(v.into());
14267 self
14268 }
14269
14270 /// Sets or clears the value of [internal_metadata][crate::model::Config::internal_metadata].
14271 ///
14272 /// # Example
14273 /// ```ignore,no_run
14274 /// # use google_cloud_dataform_v1::model::Config;
14275 /// let x = Config::new().set_or_clear_internal_metadata(Some("example"));
14276 /// let x = Config::new().set_or_clear_internal_metadata(None::<String>);
14277 /// ```
14278 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14279 where
14280 T: std::convert::Into<std::string::String>,
14281 {
14282 self.internal_metadata = v.map(|x| x.into());
14283 self
14284 }
14285}
14286
14287impl wkt::message::Message for Config {
14288 fn typename() -> &'static str {
14289 "type.googleapis.com/google.cloud.dataform.v1.Config"
14290 }
14291}
14292
14293/// `GetConfig` request message.
14294#[derive(Clone, Default, PartialEq)]
14295#[non_exhaustive]
14296pub struct GetConfigRequest {
14297 /// Required. The config name.
14298 pub name: std::string::String,
14299
14300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14301}
14302
14303impl GetConfigRequest {
14304 pub fn new() -> Self {
14305 std::default::Default::default()
14306 }
14307
14308 /// Sets the value of [name][crate::model::GetConfigRequest::name].
14309 ///
14310 /// # Example
14311 /// ```ignore,no_run
14312 /// # use google_cloud_dataform_v1::model::GetConfigRequest;
14313 /// let x = GetConfigRequest::new().set_name("example");
14314 /// ```
14315 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14316 self.name = v.into();
14317 self
14318 }
14319}
14320
14321impl wkt::message::Message for GetConfigRequest {
14322 fn typename() -> &'static str {
14323 "type.googleapis.com/google.cloud.dataform.v1.GetConfigRequest"
14324 }
14325}
14326
14327/// `UpdateConfig` request message.
14328#[derive(Clone, Default, PartialEq)]
14329#[non_exhaustive]
14330pub struct UpdateConfigRequest {
14331 /// Required. The config to update.
14332 pub config: std::option::Option<crate::model::Config>,
14333
14334 /// Optional. Specifies the fields to be updated in the config.
14335 pub update_mask: std::option::Option<wkt::FieldMask>,
14336
14337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14338}
14339
14340impl UpdateConfigRequest {
14341 pub fn new() -> Self {
14342 std::default::Default::default()
14343 }
14344
14345 /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
14346 ///
14347 /// # Example
14348 /// ```ignore,no_run
14349 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
14350 /// use google_cloud_dataform_v1::model::Config;
14351 /// let x = UpdateConfigRequest::new().set_config(Config::default()/* use setters */);
14352 /// ```
14353 pub fn set_config<T>(mut self, v: T) -> Self
14354 where
14355 T: std::convert::Into<crate::model::Config>,
14356 {
14357 self.config = std::option::Option::Some(v.into());
14358 self
14359 }
14360
14361 /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
14362 ///
14363 /// # Example
14364 /// ```ignore,no_run
14365 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
14366 /// use google_cloud_dataform_v1::model::Config;
14367 /// let x = UpdateConfigRequest::new().set_or_clear_config(Some(Config::default()/* use setters */));
14368 /// let x = UpdateConfigRequest::new().set_or_clear_config(None::<Config>);
14369 /// ```
14370 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
14371 where
14372 T: std::convert::Into<crate::model::Config>,
14373 {
14374 self.config = v.map(|x| x.into());
14375 self
14376 }
14377
14378 /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
14379 ///
14380 /// # Example
14381 /// ```ignore,no_run
14382 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
14383 /// use wkt::FieldMask;
14384 /// let x = UpdateConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14385 /// ```
14386 pub fn set_update_mask<T>(mut self, v: T) -> Self
14387 where
14388 T: std::convert::Into<wkt::FieldMask>,
14389 {
14390 self.update_mask = std::option::Option::Some(v.into());
14391 self
14392 }
14393
14394 /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
14395 ///
14396 /// # Example
14397 /// ```ignore,no_run
14398 /// # use google_cloud_dataform_v1::model::UpdateConfigRequest;
14399 /// use wkt::FieldMask;
14400 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14401 /// let x = UpdateConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14402 /// ```
14403 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14404 where
14405 T: std::convert::Into<wkt::FieldMask>,
14406 {
14407 self.update_mask = v.map(|x| x.into());
14408 self
14409 }
14410}
14411
14412impl wkt::message::Message for UpdateConfigRequest {
14413 fn typename() -> &'static str {
14414 "type.googleapis.com/google.cloud.dataform.v1.UpdateConfigRequest"
14415 }
14416}
14417
14418/// Represents a Dataform Folder. This is a resource that is used to organize
14419/// Files and other Folders and provide hierarchical access controls.
14420#[derive(Clone, Default, PartialEq)]
14421#[non_exhaustive]
14422pub struct Folder {
14423 /// Identifier. The Folder's name.
14424 pub name: std::string::String,
14425
14426 /// Required. The Folder's user-friendly name.
14427 pub display_name: std::string::String,
14428
14429 /// Optional. The containing Folder resource name. This should take
14430 /// the format: projects/{project}/locations/{location}/folders/{folder},
14431 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}, or just
14432 /// projects/{project}/locations/{location} if this is a root Folder. This
14433 /// field can only be updated through MoveFolder.
14434 pub containing_folder: std::string::String,
14435
14436 /// Output only. The resource name of the TeamFolder that this Folder is
14437 /// associated with. This should take the format:
14438 /// projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this
14439 /// is not set, the Folder is not associated with a TeamFolder and is a
14440 /// UserFolder.
14441 pub team_folder_name: std::string::String,
14442
14443 /// Output only. The timestamp of when the Folder was created.
14444 pub create_time: std::option::Option<wkt::Timestamp>,
14445
14446 /// Output only. The timestamp of when the Folder was last updated.
14447 pub update_time: std::option::Option<wkt::Timestamp>,
14448
14449 /// Output only. All the metadata information that is used internally to serve
14450 /// the resource. For example: timestamps, flags, status fields, etc. The
14451 /// format of this field is a JSON string.
14452 pub internal_metadata: std::option::Option<std::string::String>,
14453
14454 /// Output only. The IAM principal identifier of the creator of the Folder.
14455 pub creator_iam_principal: std::option::Option<std::string::String>,
14456
14457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14458}
14459
14460impl Folder {
14461 pub fn new() -> Self {
14462 std::default::Default::default()
14463 }
14464
14465 /// Sets the value of [name][crate::model::Folder::name].
14466 ///
14467 /// # Example
14468 /// ```ignore,no_run
14469 /// # use google_cloud_dataform_v1::model::Folder;
14470 /// let x = Folder::new().set_name("example");
14471 /// ```
14472 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14473 self.name = v.into();
14474 self
14475 }
14476
14477 /// Sets the value of [display_name][crate::model::Folder::display_name].
14478 ///
14479 /// # Example
14480 /// ```ignore,no_run
14481 /// # use google_cloud_dataform_v1::model::Folder;
14482 /// let x = Folder::new().set_display_name("example");
14483 /// ```
14484 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14485 self.display_name = v.into();
14486 self
14487 }
14488
14489 /// Sets the value of [containing_folder][crate::model::Folder::containing_folder].
14490 ///
14491 /// # Example
14492 /// ```ignore,no_run
14493 /// # use google_cloud_dataform_v1::model::Folder;
14494 /// let x = Folder::new().set_containing_folder("example");
14495 /// ```
14496 pub fn set_containing_folder<T: std::convert::Into<std::string::String>>(
14497 mut self,
14498 v: T,
14499 ) -> Self {
14500 self.containing_folder = v.into();
14501 self
14502 }
14503
14504 /// Sets the value of [team_folder_name][crate::model::Folder::team_folder_name].
14505 ///
14506 /// # Example
14507 /// ```ignore,no_run
14508 /// # use google_cloud_dataform_v1::model::Folder;
14509 /// let x = Folder::new().set_team_folder_name("example");
14510 /// ```
14511 pub fn set_team_folder_name<T: std::convert::Into<std::string::String>>(
14512 mut self,
14513 v: T,
14514 ) -> Self {
14515 self.team_folder_name = v.into();
14516 self
14517 }
14518
14519 /// Sets the value of [create_time][crate::model::Folder::create_time].
14520 ///
14521 /// # Example
14522 /// ```ignore,no_run
14523 /// # use google_cloud_dataform_v1::model::Folder;
14524 /// use wkt::Timestamp;
14525 /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
14526 /// ```
14527 pub fn set_create_time<T>(mut self, v: T) -> Self
14528 where
14529 T: std::convert::Into<wkt::Timestamp>,
14530 {
14531 self.create_time = std::option::Option::Some(v.into());
14532 self
14533 }
14534
14535 /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
14536 ///
14537 /// # Example
14538 /// ```ignore,no_run
14539 /// # use google_cloud_dataform_v1::model::Folder;
14540 /// use wkt::Timestamp;
14541 /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14542 /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
14543 /// ```
14544 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14545 where
14546 T: std::convert::Into<wkt::Timestamp>,
14547 {
14548 self.create_time = v.map(|x| x.into());
14549 self
14550 }
14551
14552 /// Sets the value of [update_time][crate::model::Folder::update_time].
14553 ///
14554 /// # Example
14555 /// ```ignore,no_run
14556 /// # use google_cloud_dataform_v1::model::Folder;
14557 /// use wkt::Timestamp;
14558 /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
14559 /// ```
14560 pub fn set_update_time<T>(mut self, v: T) -> Self
14561 where
14562 T: std::convert::Into<wkt::Timestamp>,
14563 {
14564 self.update_time = std::option::Option::Some(v.into());
14565 self
14566 }
14567
14568 /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
14569 ///
14570 /// # Example
14571 /// ```ignore,no_run
14572 /// # use google_cloud_dataform_v1::model::Folder;
14573 /// use wkt::Timestamp;
14574 /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14575 /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
14576 /// ```
14577 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14578 where
14579 T: std::convert::Into<wkt::Timestamp>,
14580 {
14581 self.update_time = v.map(|x| x.into());
14582 self
14583 }
14584
14585 /// Sets the value of [internal_metadata][crate::model::Folder::internal_metadata].
14586 ///
14587 /// # Example
14588 /// ```ignore,no_run
14589 /// # use google_cloud_dataform_v1::model::Folder;
14590 /// let x = Folder::new().set_internal_metadata("example");
14591 /// ```
14592 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
14593 where
14594 T: std::convert::Into<std::string::String>,
14595 {
14596 self.internal_metadata = std::option::Option::Some(v.into());
14597 self
14598 }
14599
14600 /// Sets or clears the value of [internal_metadata][crate::model::Folder::internal_metadata].
14601 ///
14602 /// # Example
14603 /// ```ignore,no_run
14604 /// # use google_cloud_dataform_v1::model::Folder;
14605 /// let x = Folder::new().set_or_clear_internal_metadata(Some("example"));
14606 /// let x = Folder::new().set_or_clear_internal_metadata(None::<String>);
14607 /// ```
14608 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14609 where
14610 T: std::convert::Into<std::string::String>,
14611 {
14612 self.internal_metadata = v.map(|x| x.into());
14613 self
14614 }
14615
14616 /// Sets the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
14617 ///
14618 /// # Example
14619 /// ```ignore,no_run
14620 /// # use google_cloud_dataform_v1::model::Folder;
14621 /// let x = Folder::new().set_creator_iam_principal("example");
14622 /// ```
14623 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
14624 where
14625 T: std::convert::Into<std::string::String>,
14626 {
14627 self.creator_iam_principal = std::option::Option::Some(v.into());
14628 self
14629 }
14630
14631 /// Sets or clears the value of [creator_iam_principal][crate::model::Folder::creator_iam_principal].
14632 ///
14633 /// # Example
14634 /// ```ignore,no_run
14635 /// # use google_cloud_dataform_v1::model::Folder;
14636 /// let x = Folder::new().set_or_clear_creator_iam_principal(Some("example"));
14637 /// let x = Folder::new().set_or_clear_creator_iam_principal(None::<String>);
14638 /// ```
14639 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
14640 where
14641 T: std::convert::Into<std::string::String>,
14642 {
14643 self.creator_iam_principal = v.map(|x| x.into());
14644 self
14645 }
14646}
14647
14648impl wkt::message::Message for Folder {
14649 fn typename() -> &'static str {
14650 "type.googleapis.com/google.cloud.dataform.v1.Folder"
14651 }
14652}
14653
14654/// `CreateFolder` request message.
14655#[derive(Clone, Default, PartialEq)]
14656#[non_exhaustive]
14657pub struct CreateFolderRequest {
14658 /// Required. The location in which to create the Folder. Must be in the format
14659 /// `projects/*/locations/*`.
14660 pub parent: std::string::String,
14661
14662 /// Required. The Folder to create.
14663 pub folder: std::option::Option<crate::model::Folder>,
14664
14665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14666}
14667
14668impl CreateFolderRequest {
14669 pub fn new() -> Self {
14670 std::default::Default::default()
14671 }
14672
14673 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
14674 ///
14675 /// # Example
14676 /// ```ignore,no_run
14677 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
14678 /// let x = CreateFolderRequest::new().set_parent("example");
14679 /// ```
14680 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14681 self.parent = v.into();
14682 self
14683 }
14684
14685 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
14686 ///
14687 /// # Example
14688 /// ```ignore,no_run
14689 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
14690 /// use google_cloud_dataform_v1::model::Folder;
14691 /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
14692 /// ```
14693 pub fn set_folder<T>(mut self, v: T) -> Self
14694 where
14695 T: std::convert::Into<crate::model::Folder>,
14696 {
14697 self.folder = std::option::Option::Some(v.into());
14698 self
14699 }
14700
14701 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
14702 ///
14703 /// # Example
14704 /// ```ignore,no_run
14705 /// # use google_cloud_dataform_v1::model::CreateFolderRequest;
14706 /// use google_cloud_dataform_v1::model::Folder;
14707 /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
14708 /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
14709 /// ```
14710 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
14711 where
14712 T: std::convert::Into<crate::model::Folder>,
14713 {
14714 self.folder = v.map(|x| x.into());
14715 self
14716 }
14717}
14718
14719impl wkt::message::Message for CreateFolderRequest {
14720 fn typename() -> &'static str {
14721 "type.googleapis.com/google.cloud.dataform.v1.CreateFolderRequest"
14722 }
14723}
14724
14725/// `MoveFolder` request message.
14726#[derive(Clone, Default, PartialEq)]
14727#[non_exhaustive]
14728pub struct MoveFolderRequest {
14729 /// Required. The full resource name of the Folder to move.
14730 pub name: std::string::String,
14731
14732 /// Optional. The name of the Folder, TeamFolder, or root location to move the
14733 /// Folder to. Can be in the format of: "" to move into the root User folder,
14734 /// `projects/*/locations/*/folders/*`, `projects/*/locations/*/teamFolders/*`
14735 pub destination_containing_folder: std::option::Option<std::string::String>,
14736
14737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14738}
14739
14740impl MoveFolderRequest {
14741 pub fn new() -> Self {
14742 std::default::Default::default()
14743 }
14744
14745 /// Sets the value of [name][crate::model::MoveFolderRequest::name].
14746 ///
14747 /// # Example
14748 /// ```ignore,no_run
14749 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
14750 /// let x = MoveFolderRequest::new().set_name("example");
14751 /// ```
14752 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14753 self.name = v.into();
14754 self
14755 }
14756
14757 /// Sets the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
14758 ///
14759 /// # Example
14760 /// ```ignore,no_run
14761 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
14762 /// let x = MoveFolderRequest::new().set_destination_containing_folder("example");
14763 /// ```
14764 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
14765 where
14766 T: std::convert::Into<std::string::String>,
14767 {
14768 self.destination_containing_folder = std::option::Option::Some(v.into());
14769 self
14770 }
14771
14772 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
14773 ///
14774 /// # Example
14775 /// ```ignore,no_run
14776 /// # use google_cloud_dataform_v1::model::MoveFolderRequest;
14777 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(Some("example"));
14778 /// let x = MoveFolderRequest::new().set_or_clear_destination_containing_folder(None::<String>);
14779 /// ```
14780 pub fn set_or_clear_destination_containing_folder<T>(
14781 mut self,
14782 v: std::option::Option<T>,
14783 ) -> Self
14784 where
14785 T: std::convert::Into<std::string::String>,
14786 {
14787 self.destination_containing_folder = v.map(|x| x.into());
14788 self
14789 }
14790}
14791
14792impl wkt::message::Message for MoveFolderRequest {
14793 fn typename() -> &'static str {
14794 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderRequest"
14795 }
14796}
14797
14798/// `GetFolder` request message.
14799#[derive(Clone, Default, PartialEq)]
14800#[non_exhaustive]
14801pub struct GetFolderRequest {
14802 /// Required. The Folder's name.
14803 pub name: std::string::String,
14804
14805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14806}
14807
14808impl GetFolderRequest {
14809 pub fn new() -> Self {
14810 std::default::Default::default()
14811 }
14812
14813 /// Sets the value of [name][crate::model::GetFolderRequest::name].
14814 ///
14815 /// # Example
14816 /// ```ignore,no_run
14817 /// # use google_cloud_dataform_v1::model::GetFolderRequest;
14818 /// let x = GetFolderRequest::new().set_name("example");
14819 /// ```
14820 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14821 self.name = v.into();
14822 self
14823 }
14824}
14825
14826impl wkt::message::Message for GetFolderRequest {
14827 fn typename() -> &'static str {
14828 "type.googleapis.com/google.cloud.dataform.v1.GetFolderRequest"
14829 }
14830}
14831
14832/// `UpdateFolder` request message.
14833#[derive(Clone, Default, PartialEq)]
14834#[non_exhaustive]
14835pub struct UpdateFolderRequest {
14836 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
14837 /// all fields that can be updated, will be updated. A few fields cannot be
14838 /// updated and will be ignored if specified in the update_mask (e.g.
14839 /// parent_name, team_folder_name).
14840 pub update_mask: std::option::Option<wkt::FieldMask>,
14841
14842 /// Required. The updated Folder.
14843 pub folder: std::option::Option<crate::model::Folder>,
14844
14845 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14846}
14847
14848impl UpdateFolderRequest {
14849 pub fn new() -> Self {
14850 std::default::Default::default()
14851 }
14852
14853 /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
14854 ///
14855 /// # Example
14856 /// ```ignore,no_run
14857 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
14858 /// use wkt::FieldMask;
14859 /// let x = UpdateFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14860 /// ```
14861 pub fn set_update_mask<T>(mut self, v: T) -> Self
14862 where
14863 T: std::convert::Into<wkt::FieldMask>,
14864 {
14865 self.update_mask = std::option::Option::Some(v.into());
14866 self
14867 }
14868
14869 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
14870 ///
14871 /// # Example
14872 /// ```ignore,no_run
14873 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
14874 /// use wkt::FieldMask;
14875 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14876 /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14877 /// ```
14878 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14879 where
14880 T: std::convert::Into<wkt::FieldMask>,
14881 {
14882 self.update_mask = v.map(|x| x.into());
14883 self
14884 }
14885
14886 /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
14887 ///
14888 /// # Example
14889 /// ```ignore,no_run
14890 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
14891 /// use google_cloud_dataform_v1::model::Folder;
14892 /// let x = UpdateFolderRequest::new().set_folder(Folder::default()/* use setters */);
14893 /// ```
14894 pub fn set_folder<T>(mut self, v: T) -> Self
14895 where
14896 T: std::convert::Into<crate::model::Folder>,
14897 {
14898 self.folder = std::option::Option::Some(v.into());
14899 self
14900 }
14901
14902 /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
14903 ///
14904 /// # Example
14905 /// ```ignore,no_run
14906 /// # use google_cloud_dataform_v1::model::UpdateFolderRequest;
14907 /// use google_cloud_dataform_v1::model::Folder;
14908 /// let x = UpdateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
14909 /// let x = UpdateFolderRequest::new().set_or_clear_folder(None::<Folder>);
14910 /// ```
14911 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
14912 where
14913 T: std::convert::Into<crate::model::Folder>,
14914 {
14915 self.folder = v.map(|x| x.into());
14916 self
14917 }
14918}
14919
14920impl wkt::message::Message for UpdateFolderRequest {
14921 fn typename() -> &'static str {
14922 "type.googleapis.com/google.cloud.dataform.v1.UpdateFolderRequest"
14923 }
14924}
14925
14926/// `DeleteFolder` request message.
14927#[derive(Clone, Default, PartialEq)]
14928#[non_exhaustive]
14929pub struct DeleteFolderRequest {
14930 /// Required. The Folder's name.
14931 pub name: std::string::String,
14932
14933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14934}
14935
14936impl DeleteFolderRequest {
14937 pub fn new() -> Self {
14938 std::default::Default::default()
14939 }
14940
14941 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
14942 ///
14943 /// # Example
14944 /// ```ignore,no_run
14945 /// # use google_cloud_dataform_v1::model::DeleteFolderRequest;
14946 /// let x = DeleteFolderRequest::new().set_name("example");
14947 /// ```
14948 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14949 self.name = v.into();
14950 self
14951 }
14952}
14953
14954impl wkt::message::Message for DeleteFolderRequest {
14955 fn typename() -> &'static str {
14956 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderRequest"
14957 }
14958}
14959
14960/// `DeleteFolderTree` request message.
14961#[derive(Clone, Default, PartialEq)]
14962#[non_exhaustive]
14963pub struct DeleteFolderTreeRequest {
14964 /// Required. The Folder's name.
14965 /// Format: projects/{project}/locations/{location}/folders/{folder}
14966 pub name: std::string::String,
14967
14968 /// Optional. If `false` (default): The operation will fail if any
14969 /// Repository within the folder hierarchy has associated Release Configs or
14970 /// Workflow Configs.
14971 ///
14972 /// If `true`: The operation will attempt to delete everything, including any
14973 /// Release Configs and Workflow Configs linked to Repositories within the
14974 /// folder hierarchy. This permanently removes schedules and resources.
14975 pub force: bool,
14976
14977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14978}
14979
14980impl DeleteFolderTreeRequest {
14981 pub fn new() -> Self {
14982 std::default::Default::default()
14983 }
14984
14985 /// Sets the value of [name][crate::model::DeleteFolderTreeRequest::name].
14986 ///
14987 /// # Example
14988 /// ```ignore,no_run
14989 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
14990 /// let x = DeleteFolderTreeRequest::new().set_name("example");
14991 /// ```
14992 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14993 self.name = v.into();
14994 self
14995 }
14996
14997 /// Sets the value of [force][crate::model::DeleteFolderTreeRequest::force].
14998 ///
14999 /// # Example
15000 /// ```ignore,no_run
15001 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeRequest;
15002 /// let x = DeleteFolderTreeRequest::new().set_force(true);
15003 /// ```
15004 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15005 self.force = v.into();
15006 self
15007 }
15008}
15009
15010impl wkt::message::Message for DeleteFolderTreeRequest {
15011 fn typename() -> &'static str {
15012 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeRequest"
15013 }
15014}
15015
15016/// `DeleteTeamFolderTree` request message.
15017#[derive(Clone, Default, PartialEq)]
15018#[non_exhaustive]
15019pub struct DeleteTeamFolderTreeRequest {
15020 /// Required. The TeamFolder's name.
15021 /// Format: projects/{project}/locations/{location}/teamFolders/{team_folder}
15022 pub name: std::string::String,
15023
15024 /// Optional. If `false` (default): The operation will fail if any
15025 /// Repository within the folder hierarchy has associated Release Configs or
15026 /// Workflow Configs.
15027 ///
15028 /// If `true`: The operation will attempt to delete everything, including any
15029 /// Release Configs and Workflow Configs linked to Repositories within the
15030 /// folder hierarchy. This permanently removes schedules and resources.
15031 pub force: bool,
15032
15033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15034}
15035
15036impl DeleteTeamFolderTreeRequest {
15037 pub fn new() -> Self {
15038 std::default::Default::default()
15039 }
15040
15041 /// Sets the value of [name][crate::model::DeleteTeamFolderTreeRequest::name].
15042 ///
15043 /// # Example
15044 /// ```ignore,no_run
15045 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
15046 /// let x = DeleteTeamFolderTreeRequest::new().set_name("example");
15047 /// ```
15048 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15049 self.name = v.into();
15050 self
15051 }
15052
15053 /// Sets the value of [force][crate::model::DeleteTeamFolderTreeRequest::force].
15054 ///
15055 /// # Example
15056 /// ```ignore,no_run
15057 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderTreeRequest;
15058 /// let x = DeleteTeamFolderTreeRequest::new().set_force(true);
15059 /// ```
15060 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15061 self.force = v.into();
15062 self
15063 }
15064}
15065
15066impl wkt::message::Message for DeleteTeamFolderTreeRequest {
15067 fn typename() -> &'static str {
15068 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderTreeRequest"
15069 }
15070}
15071
15072/// Contains metadata about the progress of the DeleteFolderTree Long-running
15073/// operations.
15074#[derive(Clone, Default, PartialEq)]
15075#[non_exhaustive]
15076pub struct DeleteFolderTreeMetadata {
15077 /// Output only. The time the operation was created.
15078 pub create_time: std::option::Option<wkt::Timestamp>,
15079
15080 /// Output only. The time the operation finished running.
15081 pub end_time: std::option::Option<wkt::Timestamp>,
15082
15083 /// Output only. Resource name of the target of the operation.
15084 /// Format: projects/{project}/locations/{location}/folders/{folder} or
15085 /// projects/{project}/locations/{location}/teamFolders/{team_folder}
15086 pub target: std::string::String,
15087
15088 /// Output only. The state of the operation.
15089 pub state: crate::model::delete_folder_tree_metadata::State,
15090
15091 /// Output only. Percent complete of the operation [0, 100].
15092 pub percent_complete: i32,
15093
15094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15095}
15096
15097impl DeleteFolderTreeMetadata {
15098 pub fn new() -> Self {
15099 std::default::Default::default()
15100 }
15101
15102 /// Sets the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
15103 ///
15104 /// # Example
15105 /// ```ignore,no_run
15106 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15107 /// use wkt::Timestamp;
15108 /// let x = DeleteFolderTreeMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15109 /// ```
15110 pub fn set_create_time<T>(mut self, v: T) -> Self
15111 where
15112 T: std::convert::Into<wkt::Timestamp>,
15113 {
15114 self.create_time = std::option::Option::Some(v.into());
15115 self
15116 }
15117
15118 /// Sets or clears the value of [create_time][crate::model::DeleteFolderTreeMetadata::create_time].
15119 ///
15120 /// # Example
15121 /// ```ignore,no_run
15122 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15123 /// use wkt::Timestamp;
15124 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15125 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15126 /// ```
15127 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15128 where
15129 T: std::convert::Into<wkt::Timestamp>,
15130 {
15131 self.create_time = v.map(|x| x.into());
15132 self
15133 }
15134
15135 /// Sets the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
15136 ///
15137 /// # Example
15138 /// ```ignore,no_run
15139 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15140 /// use wkt::Timestamp;
15141 /// let x = DeleteFolderTreeMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15142 /// ```
15143 pub fn set_end_time<T>(mut self, v: T) -> Self
15144 where
15145 T: std::convert::Into<wkt::Timestamp>,
15146 {
15147 self.end_time = std::option::Option::Some(v.into());
15148 self
15149 }
15150
15151 /// Sets or clears the value of [end_time][crate::model::DeleteFolderTreeMetadata::end_time].
15152 ///
15153 /// # Example
15154 /// ```ignore,no_run
15155 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15156 /// use wkt::Timestamp;
15157 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15158 /// let x = DeleteFolderTreeMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15159 /// ```
15160 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15161 where
15162 T: std::convert::Into<wkt::Timestamp>,
15163 {
15164 self.end_time = v.map(|x| x.into());
15165 self
15166 }
15167
15168 /// Sets the value of [target][crate::model::DeleteFolderTreeMetadata::target].
15169 ///
15170 /// # Example
15171 /// ```ignore,no_run
15172 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15173 /// let x = DeleteFolderTreeMetadata::new().set_target("example");
15174 /// ```
15175 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15176 self.target = v.into();
15177 self
15178 }
15179
15180 /// Sets the value of [state][crate::model::DeleteFolderTreeMetadata::state].
15181 ///
15182 /// # Example
15183 /// ```ignore,no_run
15184 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15185 /// use google_cloud_dataform_v1::model::delete_folder_tree_metadata::State;
15186 /// let x0 = DeleteFolderTreeMetadata::new().set_state(State::Initialized);
15187 /// let x1 = DeleteFolderTreeMetadata::new().set_state(State::InProgress);
15188 /// let x2 = DeleteFolderTreeMetadata::new().set_state(State::Succeeded);
15189 /// ```
15190 pub fn set_state<T: std::convert::Into<crate::model::delete_folder_tree_metadata::State>>(
15191 mut self,
15192 v: T,
15193 ) -> Self {
15194 self.state = v.into();
15195 self
15196 }
15197
15198 /// Sets the value of [percent_complete][crate::model::DeleteFolderTreeMetadata::percent_complete].
15199 ///
15200 /// # Example
15201 /// ```ignore,no_run
15202 /// # use google_cloud_dataform_v1::model::DeleteFolderTreeMetadata;
15203 /// let x = DeleteFolderTreeMetadata::new().set_percent_complete(42);
15204 /// ```
15205 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15206 self.percent_complete = v.into();
15207 self
15208 }
15209}
15210
15211impl wkt::message::Message for DeleteFolderTreeMetadata {
15212 fn typename() -> &'static str {
15213 "type.googleapis.com/google.cloud.dataform.v1.DeleteFolderTreeMetadata"
15214 }
15215}
15216
15217/// Defines additional types related to [DeleteFolderTreeMetadata].
15218pub mod delete_folder_tree_metadata {
15219 #[allow(unused_imports)]
15220 use super::*;
15221
15222 /// Different states of the DeleteFolderTree operation.
15223 ///
15224 /// # Working with unknown values
15225 ///
15226 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15227 /// additional enum variants at any time. Adding new variants is not considered
15228 /// a breaking change. Applications should write their code in anticipation of:
15229 ///
15230 /// - New values appearing in future releases of the client library, **and**
15231 /// - New values received dynamically, without application changes.
15232 ///
15233 /// Please consult the [Working with enums] section in the user guide for some
15234 /// guidelines.
15235 ///
15236 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15237 #[derive(Clone, Debug, PartialEq)]
15238 #[non_exhaustive]
15239 pub enum State {
15240 /// The state is unspecified.
15241 Unspecified,
15242 /// The operation was initialized and recorded by the server, but not yet
15243 /// started.
15244 Initialized,
15245 /// The operation is in progress.
15246 InProgress,
15247 /// The operation has completed successfully.
15248 Succeeded,
15249 /// The operation has failed.
15250 Failed,
15251 /// If set, the enum was initialized with an unknown value.
15252 ///
15253 /// Applications can examine the value using [State::value] or
15254 /// [State::name].
15255 UnknownValue(state::UnknownValue),
15256 }
15257
15258 #[doc(hidden)]
15259 pub mod state {
15260 #[allow(unused_imports)]
15261 use super::*;
15262 #[derive(Clone, Debug, PartialEq)]
15263 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15264 }
15265
15266 impl State {
15267 /// Gets the enum value.
15268 ///
15269 /// Returns `None` if the enum contains an unknown value deserialized from
15270 /// the string representation of enums.
15271 pub fn value(&self) -> std::option::Option<i32> {
15272 match self {
15273 Self::Unspecified => std::option::Option::Some(0),
15274 Self::Initialized => std::option::Option::Some(1),
15275 Self::InProgress => std::option::Option::Some(2),
15276 Self::Succeeded => std::option::Option::Some(3),
15277 Self::Failed => std::option::Option::Some(4),
15278 Self::UnknownValue(u) => u.0.value(),
15279 }
15280 }
15281
15282 /// Gets the enum value as a string.
15283 ///
15284 /// Returns `None` if the enum contains an unknown value deserialized from
15285 /// the integer representation of enums.
15286 pub fn name(&self) -> std::option::Option<&str> {
15287 match self {
15288 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15289 Self::Initialized => std::option::Option::Some("INITIALIZED"),
15290 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
15291 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
15292 Self::Failed => std::option::Option::Some("FAILED"),
15293 Self::UnknownValue(u) => u.0.name(),
15294 }
15295 }
15296 }
15297
15298 impl std::default::Default for State {
15299 fn default() -> Self {
15300 use std::convert::From;
15301 Self::from(0)
15302 }
15303 }
15304
15305 impl std::fmt::Display for State {
15306 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15307 wkt::internal::display_enum(f, self.name(), self.value())
15308 }
15309 }
15310
15311 impl std::convert::From<i32> for State {
15312 fn from(value: i32) -> Self {
15313 match value {
15314 0 => Self::Unspecified,
15315 1 => Self::Initialized,
15316 2 => Self::InProgress,
15317 3 => Self::Succeeded,
15318 4 => Self::Failed,
15319 _ => Self::UnknownValue(state::UnknownValue(
15320 wkt::internal::UnknownEnumValue::Integer(value),
15321 )),
15322 }
15323 }
15324 }
15325
15326 impl std::convert::From<&str> for State {
15327 fn from(value: &str) -> Self {
15328 use std::string::ToString;
15329 match value {
15330 "STATE_UNSPECIFIED" => Self::Unspecified,
15331 "INITIALIZED" => Self::Initialized,
15332 "IN_PROGRESS" => Self::InProgress,
15333 "SUCCEEDED" => Self::Succeeded,
15334 "FAILED" => Self::Failed,
15335 _ => Self::UnknownValue(state::UnknownValue(
15336 wkt::internal::UnknownEnumValue::String(value.to_string()),
15337 )),
15338 }
15339 }
15340 }
15341
15342 impl serde::ser::Serialize for State {
15343 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15344 where
15345 S: serde::Serializer,
15346 {
15347 match self {
15348 Self::Unspecified => serializer.serialize_i32(0),
15349 Self::Initialized => serializer.serialize_i32(1),
15350 Self::InProgress => serializer.serialize_i32(2),
15351 Self::Succeeded => serializer.serialize_i32(3),
15352 Self::Failed => serializer.serialize_i32(4),
15353 Self::UnknownValue(u) => u.0.serialize(serializer),
15354 }
15355 }
15356 }
15357
15358 impl<'de> serde::de::Deserialize<'de> for State {
15359 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15360 where
15361 D: serde::Deserializer<'de>,
15362 {
15363 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15364 ".google.cloud.dataform.v1.DeleteFolderTreeMetadata.State",
15365 ))
15366 }
15367 }
15368}
15369
15370/// `QueryFolderContents` request message.
15371#[derive(Clone, Default, PartialEq)]
15372#[non_exhaustive]
15373pub struct QueryFolderContentsRequest {
15374 /// Required. Name of the folder whose contents to list.
15375 /// Format: projects/*/locations/*/folders/*
15376 pub folder: std::string::String,
15377
15378 /// Optional. Maximum number of paths to return. The server may return fewer
15379 /// items than requested. If unspecified, the server will pick an appropriate
15380 /// default.
15381 pub page_size: i32,
15382
15383 /// Optional. Page token received from a previous `QueryFolderContents` call.
15384 /// Provide this to retrieve the subsequent page.
15385 ///
15386 /// When paginating, all other parameters provided to
15387 /// `QueryFolderContents`, with the exception of `page_size`, must match the
15388 /// call that provided the page token.
15389 pub page_token: std::string::String,
15390
15391 /// Optional. Field to additionally sort results by.
15392 /// Will order Folders before Repositories, and then by `order_by` in ascending
15393 /// order. Supported keywords: display_name (default), create_time,
15394 /// last_modified_time.
15395 /// Examples:
15396 ///
15397 /// - `orderBy="display_name"`
15398 /// - `orderBy="display_name desc"`
15399 pub order_by: std::string::String,
15400
15401 /// Optional. Optional filtering for the returned list. Filtering is currently
15402 /// only supported on the `display_name` field.
15403 ///
15404 /// Example:
15405 ///
15406 /// - `filter="display_name="MyFolder""`
15407 pub filter: std::string::String,
15408
15409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15410}
15411
15412impl QueryFolderContentsRequest {
15413 pub fn new() -> Self {
15414 std::default::Default::default()
15415 }
15416
15417 /// Sets the value of [folder][crate::model::QueryFolderContentsRequest::folder].
15418 ///
15419 /// # Example
15420 /// ```ignore,no_run
15421 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
15422 /// let x = QueryFolderContentsRequest::new().set_folder("example");
15423 /// ```
15424 pub fn set_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15425 self.folder = v.into();
15426 self
15427 }
15428
15429 /// Sets the value of [page_size][crate::model::QueryFolderContentsRequest::page_size].
15430 ///
15431 /// # Example
15432 /// ```ignore,no_run
15433 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
15434 /// let x = QueryFolderContentsRequest::new().set_page_size(42);
15435 /// ```
15436 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15437 self.page_size = v.into();
15438 self
15439 }
15440
15441 /// Sets the value of [page_token][crate::model::QueryFolderContentsRequest::page_token].
15442 ///
15443 /// # Example
15444 /// ```ignore,no_run
15445 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
15446 /// let x = QueryFolderContentsRequest::new().set_page_token("example");
15447 /// ```
15448 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15449 self.page_token = v.into();
15450 self
15451 }
15452
15453 /// Sets the value of [order_by][crate::model::QueryFolderContentsRequest::order_by].
15454 ///
15455 /// # Example
15456 /// ```ignore,no_run
15457 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
15458 /// let x = QueryFolderContentsRequest::new().set_order_by("example");
15459 /// ```
15460 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15461 self.order_by = v.into();
15462 self
15463 }
15464
15465 /// Sets the value of [filter][crate::model::QueryFolderContentsRequest::filter].
15466 ///
15467 /// # Example
15468 /// ```ignore,no_run
15469 /// # use google_cloud_dataform_v1::model::QueryFolderContentsRequest;
15470 /// let x = QueryFolderContentsRequest::new().set_filter("example");
15471 /// ```
15472 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15473 self.filter = v.into();
15474 self
15475 }
15476}
15477
15478impl wkt::message::Message for QueryFolderContentsRequest {
15479 fn typename() -> &'static str {
15480 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsRequest"
15481 }
15482}
15483
15484/// `QueryFolderContents` response message.
15485#[derive(Clone, Default, PartialEq)]
15486#[non_exhaustive]
15487pub struct QueryFolderContentsResponse {
15488 /// List of entries in the folder.
15489 pub entries: std::vec::Vec<crate::model::query_folder_contents_response::FolderContentsEntry>,
15490
15491 /// A token, which can be sent as `page_token` to retrieve the next page.
15492 /// If this field is omitted, there are no subsequent pages.
15493 pub next_page_token: std::string::String,
15494
15495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15496}
15497
15498impl QueryFolderContentsResponse {
15499 pub fn new() -> Self {
15500 std::default::Default::default()
15501 }
15502
15503 /// Sets the value of [entries][crate::model::QueryFolderContentsResponse::entries].
15504 ///
15505 /// # Example
15506 /// ```ignore,no_run
15507 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
15508 /// use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
15509 /// let x = QueryFolderContentsResponse::new()
15510 /// .set_entries([
15511 /// FolderContentsEntry::default()/* use setters */,
15512 /// FolderContentsEntry::default()/* use (different) setters */,
15513 /// ]);
15514 /// ```
15515 pub fn set_entries<T, V>(mut self, v: T) -> Self
15516 where
15517 T: std::iter::IntoIterator<Item = V>,
15518 V: std::convert::Into<crate::model::query_folder_contents_response::FolderContentsEntry>,
15519 {
15520 use std::iter::Iterator;
15521 self.entries = v.into_iter().map(|i| i.into()).collect();
15522 self
15523 }
15524
15525 /// Sets the value of [next_page_token][crate::model::QueryFolderContentsResponse::next_page_token].
15526 ///
15527 /// # Example
15528 /// ```ignore,no_run
15529 /// # use google_cloud_dataform_v1::model::QueryFolderContentsResponse;
15530 /// let x = QueryFolderContentsResponse::new().set_next_page_token("example");
15531 /// ```
15532 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15533 self.next_page_token = v.into();
15534 self
15535 }
15536}
15537
15538impl wkt::message::Message for QueryFolderContentsResponse {
15539 fn typename() -> &'static str {
15540 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse"
15541 }
15542}
15543
15544#[doc(hidden)]
15545impl google_cloud_gax::paginator::internal::PageableResponse for QueryFolderContentsResponse {
15546 type PageItem = crate::model::query_folder_contents_response::FolderContentsEntry;
15547
15548 fn items(self) -> std::vec::Vec<Self::PageItem> {
15549 self.entries
15550 }
15551
15552 fn next_page_token(&self) -> std::string::String {
15553 use std::clone::Clone;
15554 self.next_page_token.clone()
15555 }
15556}
15557
15558/// Defines additional types related to [QueryFolderContentsResponse].
15559pub mod query_folder_contents_response {
15560 #[allow(unused_imports)]
15561 use super::*;
15562
15563 /// Represents a single content entry.
15564 #[derive(Clone, Default, PartialEq)]
15565 #[non_exhaustive]
15566 pub struct FolderContentsEntry {
15567 /// The content entry.
15568 pub entry: std::option::Option<
15569 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
15570 >,
15571
15572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15573 }
15574
15575 impl FolderContentsEntry {
15576 pub fn new() -> Self {
15577 std::default::Default::default()
15578 }
15579
15580 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry].
15581 ///
15582 /// Note that all the setters affecting `entry` are mutually
15583 /// exclusive.
15584 ///
15585 /// # Example
15586 /// ```ignore,no_run
15587 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
15588 /// use google_cloud_dataform_v1::model::Folder;
15589 /// let x = FolderContentsEntry::new().set_entry(Some(
15590 /// google_cloud_dataform_v1::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(Folder::default().into())));
15591 /// ```
15592 pub fn set_entry<
15593 T: std::convert::Into<
15594 std::option::Option<
15595 crate::model::query_folder_contents_response::folder_contents_entry::Entry,
15596 >,
15597 >,
15598 >(
15599 mut self,
15600 v: T,
15601 ) -> Self {
15602 self.entry = v.into();
15603 self
15604 }
15605
15606 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
15607 /// if it holds a `Folder`, `None` if the field is not set or
15608 /// holds a different branch.
15609 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
15610 #[allow(unreachable_patterns)]
15611 self.entry.as_ref().and_then(|v| match v {
15612 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
15613 _ => std::option::Option::None,
15614 })
15615 }
15616
15617 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
15618 /// to hold a `Folder`.
15619 ///
15620 /// Note that all the setters affecting `entry` are
15621 /// mutually exclusive.
15622 ///
15623 /// # Example
15624 /// ```ignore,no_run
15625 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
15626 /// use google_cloud_dataform_v1::model::Folder;
15627 /// let x = FolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
15628 /// assert!(x.folder().is_some());
15629 /// assert!(x.repository().is_none());
15630 /// ```
15631 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
15632 mut self,
15633 v: T,
15634 ) -> Self {
15635 self.entry = std::option::Option::Some(
15636 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Folder(
15637 v.into(),
15638 ),
15639 );
15640 self
15641 }
15642
15643 /// The value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
15644 /// if it holds a `Repository`, `None` if the field is not set or
15645 /// holds a different branch.
15646 pub fn repository(
15647 &self,
15648 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
15649 #[allow(unreachable_patterns)]
15650 self.entry.as_ref().and_then(|v| match v {
15651 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
15652 _ => std::option::Option::None,
15653 })
15654 }
15655
15656 /// Sets the value of [entry][crate::model::query_folder_contents_response::FolderContentsEntry::entry]
15657 /// to hold a `Repository`.
15658 ///
15659 /// Note that all the setters affecting `entry` are
15660 /// mutually exclusive.
15661 ///
15662 /// # Example
15663 /// ```ignore,no_run
15664 /// # use google_cloud_dataform_v1::model::query_folder_contents_response::FolderContentsEntry;
15665 /// use google_cloud_dataform_v1::model::Repository;
15666 /// let x = FolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
15667 /// assert!(x.repository().is_some());
15668 /// assert!(x.folder().is_none());
15669 /// ```
15670 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
15671 mut self,
15672 v: T,
15673 ) -> Self {
15674 self.entry = std::option::Option::Some(
15675 crate::model::query_folder_contents_response::folder_contents_entry::Entry::Repository(
15676 v.into()
15677 )
15678 );
15679 self
15680 }
15681 }
15682
15683 impl wkt::message::Message for FolderContentsEntry {
15684 fn typename() -> &'static str {
15685 "type.googleapis.com/google.cloud.dataform.v1.QueryFolderContentsResponse.FolderContentsEntry"
15686 }
15687 }
15688
15689 /// Defines additional types related to [FolderContentsEntry].
15690 pub mod folder_contents_entry {
15691 #[allow(unused_imports)]
15692 use super::*;
15693
15694 /// The content entry.
15695 #[derive(Clone, Debug, PartialEq)]
15696 #[non_exhaustive]
15697 pub enum Entry {
15698 /// A subfolder.
15699 Folder(std::boxed::Box<crate::model::Folder>),
15700 /// A repository.
15701 Repository(std::boxed::Box<crate::model::Repository>),
15702 }
15703 }
15704}
15705
15706/// `QueryUserRootContents` request message.
15707#[derive(Clone, Default, PartialEq)]
15708#[non_exhaustive]
15709pub struct QueryUserRootContentsRequest {
15710 /// Required. Location of the user root folder whose contents to list.
15711 /// Format: projects/*/locations/*
15712 pub location: std::string::String,
15713
15714 /// Optional. Maximum number of paths to return. The server may return fewer
15715 /// items than requested. If unspecified, the server will pick an appropriate
15716 /// default.
15717 pub page_size: i32,
15718
15719 /// Optional. Page token received from a previous `QueryUserRootContents` call.
15720 /// Provide this to retrieve the subsequent page.
15721 ///
15722 /// When paginating, all other parameters provided to
15723 /// `QueryUserRootFolderContents`, with the exception of `page_size`, must
15724 /// match the call that provided the page token.
15725 pub page_token: std::string::String,
15726
15727 /// Optional. Field to additionally sort results by.
15728 /// Will order Folders before Repositories, and then by `order_by` in ascending
15729 /// order. Supported keywords: display_name (default), created_at,
15730 /// last_modified_at. Examples:
15731 ///
15732 /// - `orderBy="display_name"`
15733 /// - `orderBy="display_name desc"`
15734 pub order_by: std::string::String,
15735
15736 /// Optional. Optional filtering for the returned list. Filtering is currently
15737 /// only supported on the `display_name` field.
15738 ///
15739 /// Example:
15740 ///
15741 /// - `filter="display_name="MyFolder""`
15742 pub filter: std::string::String,
15743
15744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15745}
15746
15747impl QueryUserRootContentsRequest {
15748 pub fn new() -> Self {
15749 std::default::Default::default()
15750 }
15751
15752 /// Sets the value of [location][crate::model::QueryUserRootContentsRequest::location].
15753 ///
15754 /// # Example
15755 /// ```ignore,no_run
15756 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
15757 /// let x = QueryUserRootContentsRequest::new().set_location("example");
15758 /// ```
15759 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15760 self.location = v.into();
15761 self
15762 }
15763
15764 /// Sets the value of [page_size][crate::model::QueryUserRootContentsRequest::page_size].
15765 ///
15766 /// # Example
15767 /// ```ignore,no_run
15768 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
15769 /// let x = QueryUserRootContentsRequest::new().set_page_size(42);
15770 /// ```
15771 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15772 self.page_size = v.into();
15773 self
15774 }
15775
15776 /// Sets the value of [page_token][crate::model::QueryUserRootContentsRequest::page_token].
15777 ///
15778 /// # Example
15779 /// ```ignore,no_run
15780 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
15781 /// let x = QueryUserRootContentsRequest::new().set_page_token("example");
15782 /// ```
15783 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15784 self.page_token = v.into();
15785 self
15786 }
15787
15788 /// Sets the value of [order_by][crate::model::QueryUserRootContentsRequest::order_by].
15789 ///
15790 /// # Example
15791 /// ```ignore,no_run
15792 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
15793 /// let x = QueryUserRootContentsRequest::new().set_order_by("example");
15794 /// ```
15795 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15796 self.order_by = v.into();
15797 self
15798 }
15799
15800 /// Sets the value of [filter][crate::model::QueryUserRootContentsRequest::filter].
15801 ///
15802 /// # Example
15803 /// ```ignore,no_run
15804 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsRequest;
15805 /// let x = QueryUserRootContentsRequest::new().set_filter("example");
15806 /// ```
15807 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15808 self.filter = v.into();
15809 self
15810 }
15811}
15812
15813impl wkt::message::Message for QueryUserRootContentsRequest {
15814 fn typename() -> &'static str {
15815 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsRequest"
15816 }
15817}
15818
15819/// `QueryUserRootContents` response message.
15820#[derive(Clone, Default, PartialEq)]
15821#[non_exhaustive]
15822pub struct QueryUserRootContentsResponse {
15823 /// List of entries in the folder.
15824 pub entries: std::vec::Vec<crate::model::query_user_root_contents_response::RootContentsEntry>,
15825
15826 /// A token, which can be sent as `page_token` to retrieve the next page.
15827 /// If this field is omitted, there are no subsequent pages.
15828 pub next_page_token: std::string::String,
15829
15830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15831}
15832
15833impl QueryUserRootContentsResponse {
15834 pub fn new() -> Self {
15835 std::default::Default::default()
15836 }
15837
15838 /// Sets the value of [entries][crate::model::QueryUserRootContentsResponse::entries].
15839 ///
15840 /// # Example
15841 /// ```ignore,no_run
15842 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
15843 /// use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
15844 /// let x = QueryUserRootContentsResponse::new()
15845 /// .set_entries([
15846 /// RootContentsEntry::default()/* use setters */,
15847 /// RootContentsEntry::default()/* use (different) setters */,
15848 /// ]);
15849 /// ```
15850 pub fn set_entries<T, V>(mut self, v: T) -> Self
15851 where
15852 T: std::iter::IntoIterator<Item = V>,
15853 V: std::convert::Into<crate::model::query_user_root_contents_response::RootContentsEntry>,
15854 {
15855 use std::iter::Iterator;
15856 self.entries = v.into_iter().map(|i| i.into()).collect();
15857 self
15858 }
15859
15860 /// Sets the value of [next_page_token][crate::model::QueryUserRootContentsResponse::next_page_token].
15861 ///
15862 /// # Example
15863 /// ```ignore,no_run
15864 /// # use google_cloud_dataform_v1::model::QueryUserRootContentsResponse;
15865 /// let x = QueryUserRootContentsResponse::new().set_next_page_token("example");
15866 /// ```
15867 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15868 self.next_page_token = v.into();
15869 self
15870 }
15871}
15872
15873impl wkt::message::Message for QueryUserRootContentsResponse {
15874 fn typename() -> &'static str {
15875 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse"
15876 }
15877}
15878
15879#[doc(hidden)]
15880impl google_cloud_gax::paginator::internal::PageableResponse for QueryUserRootContentsResponse {
15881 type PageItem = crate::model::query_user_root_contents_response::RootContentsEntry;
15882
15883 fn items(self) -> std::vec::Vec<Self::PageItem> {
15884 self.entries
15885 }
15886
15887 fn next_page_token(&self) -> std::string::String {
15888 use std::clone::Clone;
15889 self.next_page_token.clone()
15890 }
15891}
15892
15893/// Defines additional types related to [QueryUserRootContentsResponse].
15894pub mod query_user_root_contents_response {
15895 #[allow(unused_imports)]
15896 use super::*;
15897
15898 /// Represents a single content entry.
15899 #[derive(Clone, Default, PartialEq)]
15900 #[non_exhaustive]
15901 pub struct RootContentsEntry {
15902 /// The content entry.
15903 pub entry: std::option::Option<
15904 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
15905 >,
15906
15907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15908 }
15909
15910 impl RootContentsEntry {
15911 pub fn new() -> Self {
15912 std::default::Default::default()
15913 }
15914
15915 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry].
15916 ///
15917 /// Note that all the setters affecting `entry` are mutually
15918 /// exclusive.
15919 ///
15920 /// # Example
15921 /// ```ignore,no_run
15922 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
15923 /// use google_cloud_dataform_v1::model::Folder;
15924 /// let x = RootContentsEntry::new().set_entry(Some(
15925 /// google_cloud_dataform_v1::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(Folder::default().into())));
15926 /// ```
15927 pub fn set_entry<
15928 T: std::convert::Into<
15929 std::option::Option<
15930 crate::model::query_user_root_contents_response::root_contents_entry::Entry,
15931 >,
15932 >,
15933 >(
15934 mut self,
15935 v: T,
15936 ) -> Self {
15937 self.entry = v.into();
15938 self
15939 }
15940
15941 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
15942 /// if it holds a `Folder`, `None` if the field is not set or
15943 /// holds a different branch.
15944 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
15945 #[allow(unreachable_patterns)]
15946 self.entry.as_ref().and_then(|v| match v {
15947 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
15948 _ => std::option::Option::None,
15949 })
15950 }
15951
15952 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
15953 /// to hold a `Folder`.
15954 ///
15955 /// Note that all the setters affecting `entry` are
15956 /// mutually exclusive.
15957 ///
15958 /// # Example
15959 /// ```ignore,no_run
15960 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
15961 /// use google_cloud_dataform_v1::model::Folder;
15962 /// let x = RootContentsEntry::new().set_folder(Folder::default()/* use setters */);
15963 /// assert!(x.folder().is_some());
15964 /// assert!(x.repository().is_none());
15965 /// ```
15966 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
15967 mut self,
15968 v: T,
15969 ) -> Self {
15970 self.entry = std::option::Option::Some(
15971 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Folder(
15972 v.into(),
15973 ),
15974 );
15975 self
15976 }
15977
15978 /// The value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
15979 /// if it holds a `Repository`, `None` if the field is not set or
15980 /// holds a different branch.
15981 pub fn repository(
15982 &self,
15983 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
15984 #[allow(unreachable_patterns)]
15985 self.entry.as_ref().and_then(|v| match v {
15986 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
15987 _ => std::option::Option::None,
15988 })
15989 }
15990
15991 /// Sets the value of [entry][crate::model::query_user_root_contents_response::RootContentsEntry::entry]
15992 /// to hold a `Repository`.
15993 ///
15994 /// Note that all the setters affecting `entry` are
15995 /// mutually exclusive.
15996 ///
15997 /// # Example
15998 /// ```ignore,no_run
15999 /// # use google_cloud_dataform_v1::model::query_user_root_contents_response::RootContentsEntry;
16000 /// use google_cloud_dataform_v1::model::Repository;
16001 /// let x = RootContentsEntry::new().set_repository(Repository::default()/* use setters */);
16002 /// assert!(x.repository().is_some());
16003 /// assert!(x.folder().is_none());
16004 /// ```
16005 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
16006 mut self,
16007 v: T,
16008 ) -> Self {
16009 self.entry = std::option::Option::Some(
16010 crate::model::query_user_root_contents_response::root_contents_entry::Entry::Repository(
16011 v.into()
16012 )
16013 );
16014 self
16015 }
16016 }
16017
16018 impl wkt::message::Message for RootContentsEntry {
16019 fn typename() -> &'static str {
16020 "type.googleapis.com/google.cloud.dataform.v1.QueryUserRootContentsResponse.RootContentsEntry"
16021 }
16022 }
16023
16024 /// Defines additional types related to [RootContentsEntry].
16025 pub mod root_contents_entry {
16026 #[allow(unused_imports)]
16027 use super::*;
16028
16029 /// The content entry.
16030 #[derive(Clone, Debug, PartialEq)]
16031 #[non_exhaustive]
16032 pub enum Entry {
16033 /// A subfolder.
16034 Folder(std::boxed::Box<crate::model::Folder>),
16035 /// A repository.
16036 Repository(std::boxed::Box<crate::model::Repository>),
16037 }
16038 }
16039}
16040
16041/// Represents a Dataform TeamFolder. This is a resource that sits at the project
16042/// level and is used to organize Repositories and Folders with hierarchical
16043/// access controls. They provide a team context and stricter access controls.
16044#[derive(Clone, Default, PartialEq)]
16045#[non_exhaustive]
16046pub struct TeamFolder {
16047 /// Identifier. The TeamFolder's name.
16048 pub name: std::string::String,
16049
16050 /// Required. The TeamFolder's user-friendly name.
16051 pub display_name: std::string::String,
16052
16053 /// Output only. The timestamp of when the TeamFolder was created.
16054 pub create_time: std::option::Option<wkt::Timestamp>,
16055
16056 /// Output only. The timestamp of when the TeamFolder was last updated.
16057 pub update_time: std::option::Option<wkt::Timestamp>,
16058
16059 /// Output only. All the metadata information that is used internally to serve
16060 /// the resource. For example: timestamps, flags, status fields, etc. The
16061 /// format of this field is a JSON string.
16062 pub internal_metadata: std::option::Option<std::string::String>,
16063
16064 /// Output only. The IAM principal identifier of the creator of the TeamFolder.
16065 pub creator_iam_principal: std::option::Option<std::string::String>,
16066
16067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16068}
16069
16070impl TeamFolder {
16071 pub fn new() -> Self {
16072 std::default::Default::default()
16073 }
16074
16075 /// Sets the value of [name][crate::model::TeamFolder::name].
16076 ///
16077 /// # Example
16078 /// ```ignore,no_run
16079 /// # use google_cloud_dataform_v1::model::TeamFolder;
16080 /// let x = TeamFolder::new().set_name("example");
16081 /// ```
16082 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16083 self.name = v.into();
16084 self
16085 }
16086
16087 /// Sets the value of [display_name][crate::model::TeamFolder::display_name].
16088 ///
16089 /// # Example
16090 /// ```ignore,no_run
16091 /// # use google_cloud_dataform_v1::model::TeamFolder;
16092 /// let x = TeamFolder::new().set_display_name("example");
16093 /// ```
16094 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16095 self.display_name = v.into();
16096 self
16097 }
16098
16099 /// Sets the value of [create_time][crate::model::TeamFolder::create_time].
16100 ///
16101 /// # Example
16102 /// ```ignore,no_run
16103 /// # use google_cloud_dataform_v1::model::TeamFolder;
16104 /// use wkt::Timestamp;
16105 /// let x = TeamFolder::new().set_create_time(Timestamp::default()/* use setters */);
16106 /// ```
16107 pub fn set_create_time<T>(mut self, v: T) -> Self
16108 where
16109 T: std::convert::Into<wkt::Timestamp>,
16110 {
16111 self.create_time = std::option::Option::Some(v.into());
16112 self
16113 }
16114
16115 /// Sets or clears the value of [create_time][crate::model::TeamFolder::create_time].
16116 ///
16117 /// # Example
16118 /// ```ignore,no_run
16119 /// # use google_cloud_dataform_v1::model::TeamFolder;
16120 /// use wkt::Timestamp;
16121 /// let x = TeamFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16122 /// let x = TeamFolder::new().set_or_clear_create_time(None::<Timestamp>);
16123 /// ```
16124 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16125 where
16126 T: std::convert::Into<wkt::Timestamp>,
16127 {
16128 self.create_time = v.map(|x| x.into());
16129 self
16130 }
16131
16132 /// Sets the value of [update_time][crate::model::TeamFolder::update_time].
16133 ///
16134 /// # Example
16135 /// ```ignore,no_run
16136 /// # use google_cloud_dataform_v1::model::TeamFolder;
16137 /// use wkt::Timestamp;
16138 /// let x = TeamFolder::new().set_update_time(Timestamp::default()/* use setters */);
16139 /// ```
16140 pub fn set_update_time<T>(mut self, v: T) -> Self
16141 where
16142 T: std::convert::Into<wkt::Timestamp>,
16143 {
16144 self.update_time = std::option::Option::Some(v.into());
16145 self
16146 }
16147
16148 /// Sets or clears the value of [update_time][crate::model::TeamFolder::update_time].
16149 ///
16150 /// # Example
16151 /// ```ignore,no_run
16152 /// # use google_cloud_dataform_v1::model::TeamFolder;
16153 /// use wkt::Timestamp;
16154 /// let x = TeamFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16155 /// let x = TeamFolder::new().set_or_clear_update_time(None::<Timestamp>);
16156 /// ```
16157 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16158 where
16159 T: std::convert::Into<wkt::Timestamp>,
16160 {
16161 self.update_time = v.map(|x| x.into());
16162 self
16163 }
16164
16165 /// Sets the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
16166 ///
16167 /// # Example
16168 /// ```ignore,no_run
16169 /// # use google_cloud_dataform_v1::model::TeamFolder;
16170 /// let x = TeamFolder::new().set_internal_metadata("example");
16171 /// ```
16172 pub fn set_internal_metadata<T>(mut self, v: T) -> Self
16173 where
16174 T: std::convert::Into<std::string::String>,
16175 {
16176 self.internal_metadata = std::option::Option::Some(v.into());
16177 self
16178 }
16179
16180 /// Sets or clears the value of [internal_metadata][crate::model::TeamFolder::internal_metadata].
16181 ///
16182 /// # Example
16183 /// ```ignore,no_run
16184 /// # use google_cloud_dataform_v1::model::TeamFolder;
16185 /// let x = TeamFolder::new().set_or_clear_internal_metadata(Some("example"));
16186 /// let x = TeamFolder::new().set_or_clear_internal_metadata(None::<String>);
16187 /// ```
16188 pub fn set_or_clear_internal_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16189 where
16190 T: std::convert::Into<std::string::String>,
16191 {
16192 self.internal_metadata = v.map(|x| x.into());
16193 self
16194 }
16195
16196 /// Sets the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
16197 ///
16198 /// # Example
16199 /// ```ignore,no_run
16200 /// # use google_cloud_dataform_v1::model::TeamFolder;
16201 /// let x = TeamFolder::new().set_creator_iam_principal("example");
16202 /// ```
16203 pub fn set_creator_iam_principal<T>(mut self, v: T) -> Self
16204 where
16205 T: std::convert::Into<std::string::String>,
16206 {
16207 self.creator_iam_principal = std::option::Option::Some(v.into());
16208 self
16209 }
16210
16211 /// Sets or clears the value of [creator_iam_principal][crate::model::TeamFolder::creator_iam_principal].
16212 ///
16213 /// # Example
16214 /// ```ignore,no_run
16215 /// # use google_cloud_dataform_v1::model::TeamFolder;
16216 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(Some("example"));
16217 /// let x = TeamFolder::new().set_or_clear_creator_iam_principal(None::<String>);
16218 /// ```
16219 pub fn set_or_clear_creator_iam_principal<T>(mut self, v: std::option::Option<T>) -> Self
16220 where
16221 T: std::convert::Into<std::string::String>,
16222 {
16223 self.creator_iam_principal = v.map(|x| x.into());
16224 self
16225 }
16226}
16227
16228impl wkt::message::Message for TeamFolder {
16229 fn typename() -> &'static str {
16230 "type.googleapis.com/google.cloud.dataform.v1.TeamFolder"
16231 }
16232}
16233
16234/// `CreateTeamFolder` request message.
16235#[derive(Clone, Default, PartialEq)]
16236#[non_exhaustive]
16237pub struct CreateTeamFolderRequest {
16238 /// Required. The location in which to create the TeamFolder. Must be in the
16239 /// format `projects/*/locations/*`.
16240 pub parent: std::string::String,
16241
16242 /// Required. The TeamFolder to create.
16243 pub team_folder: std::option::Option<crate::model::TeamFolder>,
16244
16245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16246}
16247
16248impl CreateTeamFolderRequest {
16249 pub fn new() -> Self {
16250 std::default::Default::default()
16251 }
16252
16253 /// Sets the value of [parent][crate::model::CreateTeamFolderRequest::parent].
16254 ///
16255 /// # Example
16256 /// ```ignore,no_run
16257 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
16258 /// let x = CreateTeamFolderRequest::new().set_parent("example");
16259 /// ```
16260 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16261 self.parent = v.into();
16262 self
16263 }
16264
16265 /// Sets the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
16266 ///
16267 /// # Example
16268 /// ```ignore,no_run
16269 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
16270 /// use google_cloud_dataform_v1::model::TeamFolder;
16271 /// let x = CreateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
16272 /// ```
16273 pub fn set_team_folder<T>(mut self, v: T) -> Self
16274 where
16275 T: std::convert::Into<crate::model::TeamFolder>,
16276 {
16277 self.team_folder = std::option::Option::Some(v.into());
16278 self
16279 }
16280
16281 /// Sets or clears the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
16282 ///
16283 /// # Example
16284 /// ```ignore,no_run
16285 /// # use google_cloud_dataform_v1::model::CreateTeamFolderRequest;
16286 /// use google_cloud_dataform_v1::model::TeamFolder;
16287 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
16288 /// let x = CreateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
16289 /// ```
16290 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
16291 where
16292 T: std::convert::Into<crate::model::TeamFolder>,
16293 {
16294 self.team_folder = v.map(|x| x.into());
16295 self
16296 }
16297}
16298
16299impl wkt::message::Message for CreateTeamFolderRequest {
16300 fn typename() -> &'static str {
16301 "type.googleapis.com/google.cloud.dataform.v1.CreateTeamFolderRequest"
16302 }
16303}
16304
16305/// `GetTeamFolder` request message.
16306#[derive(Clone, Default, PartialEq)]
16307#[non_exhaustive]
16308pub struct GetTeamFolderRequest {
16309 /// Required. The TeamFolder's name.
16310 pub name: std::string::String,
16311
16312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16313}
16314
16315impl GetTeamFolderRequest {
16316 pub fn new() -> Self {
16317 std::default::Default::default()
16318 }
16319
16320 /// Sets the value of [name][crate::model::GetTeamFolderRequest::name].
16321 ///
16322 /// # Example
16323 /// ```ignore,no_run
16324 /// # use google_cloud_dataform_v1::model::GetTeamFolderRequest;
16325 /// let x = GetTeamFolderRequest::new().set_name("example");
16326 /// ```
16327 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16328 self.name = v.into();
16329 self
16330 }
16331}
16332
16333impl wkt::message::Message for GetTeamFolderRequest {
16334 fn typename() -> &'static str {
16335 "type.googleapis.com/google.cloud.dataform.v1.GetTeamFolderRequest"
16336 }
16337}
16338
16339/// `UpdateTeamFolder` request message.
16340#[derive(Clone, Default, PartialEq)]
16341#[non_exhaustive]
16342pub struct UpdateTeamFolderRequest {
16343 /// Optional. Specifies the fields to be updated in the Folder. If left unset,
16344 /// all fields will be updated.
16345 pub update_mask: std::option::Option<wkt::FieldMask>,
16346
16347 /// Required. The updated TeamFolder.
16348 pub team_folder: std::option::Option<crate::model::TeamFolder>,
16349
16350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16351}
16352
16353impl UpdateTeamFolderRequest {
16354 pub fn new() -> Self {
16355 std::default::Default::default()
16356 }
16357
16358 /// Sets the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
16359 ///
16360 /// # Example
16361 /// ```ignore,no_run
16362 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
16363 /// use wkt::FieldMask;
16364 /// let x = UpdateTeamFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16365 /// ```
16366 pub fn set_update_mask<T>(mut self, v: T) -> Self
16367 where
16368 T: std::convert::Into<wkt::FieldMask>,
16369 {
16370 self.update_mask = std::option::Option::Some(v.into());
16371 self
16372 }
16373
16374 /// Sets or clears the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
16375 ///
16376 /// # Example
16377 /// ```ignore,no_run
16378 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
16379 /// use wkt::FieldMask;
16380 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16381 /// let x = UpdateTeamFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16382 /// ```
16383 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16384 where
16385 T: std::convert::Into<wkt::FieldMask>,
16386 {
16387 self.update_mask = v.map(|x| x.into());
16388 self
16389 }
16390
16391 /// Sets the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
16392 ///
16393 /// # Example
16394 /// ```ignore,no_run
16395 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
16396 /// use google_cloud_dataform_v1::model::TeamFolder;
16397 /// let x = UpdateTeamFolderRequest::new().set_team_folder(TeamFolder::default()/* use setters */);
16398 /// ```
16399 pub fn set_team_folder<T>(mut self, v: T) -> Self
16400 where
16401 T: std::convert::Into<crate::model::TeamFolder>,
16402 {
16403 self.team_folder = std::option::Option::Some(v.into());
16404 self
16405 }
16406
16407 /// Sets or clears the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
16408 ///
16409 /// # Example
16410 /// ```ignore,no_run
16411 /// # use google_cloud_dataform_v1::model::UpdateTeamFolderRequest;
16412 /// use google_cloud_dataform_v1::model::TeamFolder;
16413 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(Some(TeamFolder::default()/* use setters */));
16414 /// let x = UpdateTeamFolderRequest::new().set_or_clear_team_folder(None::<TeamFolder>);
16415 /// ```
16416 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
16417 where
16418 T: std::convert::Into<crate::model::TeamFolder>,
16419 {
16420 self.team_folder = v.map(|x| x.into());
16421 self
16422 }
16423}
16424
16425impl wkt::message::Message for UpdateTeamFolderRequest {
16426 fn typename() -> &'static str {
16427 "type.googleapis.com/google.cloud.dataform.v1.UpdateTeamFolderRequest"
16428 }
16429}
16430
16431/// `DeleteTeamFolder` request message.
16432#[derive(Clone, Default, PartialEq)]
16433#[non_exhaustive]
16434pub struct DeleteTeamFolderRequest {
16435 /// Required. The TeamFolder's name.
16436 pub name: std::string::String,
16437
16438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16439}
16440
16441impl DeleteTeamFolderRequest {
16442 pub fn new() -> Self {
16443 std::default::Default::default()
16444 }
16445
16446 /// Sets the value of [name][crate::model::DeleteTeamFolderRequest::name].
16447 ///
16448 /// # Example
16449 /// ```ignore,no_run
16450 /// # use google_cloud_dataform_v1::model::DeleteTeamFolderRequest;
16451 /// let x = DeleteTeamFolderRequest::new().set_name("example");
16452 /// ```
16453 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16454 self.name = v.into();
16455 self
16456 }
16457}
16458
16459impl wkt::message::Message for DeleteTeamFolderRequest {
16460 fn typename() -> &'static str {
16461 "type.googleapis.com/google.cloud.dataform.v1.DeleteTeamFolderRequest"
16462 }
16463}
16464
16465/// `QueryTeamFolderContents` request message.
16466#[derive(Clone, Default, PartialEq)]
16467#[non_exhaustive]
16468pub struct QueryTeamFolderContentsRequest {
16469 /// Required. Name of the team_folder whose contents to list.
16470 /// Format: `projects/*/locations/*/teamFolders/*`.
16471 pub team_folder: std::string::String,
16472
16473 /// Optional. Maximum number of paths to return. The server may return fewer
16474 /// items than requested. If unspecified, the server will pick an appropriate
16475 /// default.
16476 pub page_size: i32,
16477
16478 /// Optional. Page token received from a previous `QueryTeamFolderContents`
16479 /// call. Provide this to retrieve the subsequent page.
16480 ///
16481 /// When paginating, all other parameters provided to
16482 /// `QueryTeamFolderContents`, with the exception of `page_size`, must match
16483 /// the call that provided the page token.
16484 pub page_token: std::string::String,
16485
16486 /// Optional. Field to additionally sort results by.
16487 /// Will order Folders before Repositories, and then by `order_by` in ascending
16488 /// order. Supported keywords: `display_name` (default), `create_time`,
16489 /// last_modified_time.
16490 /// Examples:
16491 ///
16492 /// - `orderBy="display_name"`
16493 /// - `orderBy="display_name desc"`
16494 pub order_by: std::string::String,
16495
16496 /// Optional. Optional filtering for the returned list. Filtering is currently
16497 /// only supported on the `display_name` field.
16498 ///
16499 /// Example:
16500 ///
16501 /// - `filter="display_name="MyFolder""`
16502 pub filter: std::string::String,
16503
16504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16505}
16506
16507impl QueryTeamFolderContentsRequest {
16508 pub fn new() -> Self {
16509 std::default::Default::default()
16510 }
16511
16512 /// Sets the value of [team_folder][crate::model::QueryTeamFolderContentsRequest::team_folder].
16513 ///
16514 /// # Example
16515 /// ```ignore,no_run
16516 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
16517 /// let x = QueryTeamFolderContentsRequest::new().set_team_folder("example");
16518 /// ```
16519 pub fn set_team_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16520 self.team_folder = v.into();
16521 self
16522 }
16523
16524 /// Sets the value of [page_size][crate::model::QueryTeamFolderContentsRequest::page_size].
16525 ///
16526 /// # Example
16527 /// ```ignore,no_run
16528 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
16529 /// let x = QueryTeamFolderContentsRequest::new().set_page_size(42);
16530 /// ```
16531 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16532 self.page_size = v.into();
16533 self
16534 }
16535
16536 /// Sets the value of [page_token][crate::model::QueryTeamFolderContentsRequest::page_token].
16537 ///
16538 /// # Example
16539 /// ```ignore,no_run
16540 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
16541 /// let x = QueryTeamFolderContentsRequest::new().set_page_token("example");
16542 /// ```
16543 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16544 self.page_token = v.into();
16545 self
16546 }
16547
16548 /// Sets the value of [order_by][crate::model::QueryTeamFolderContentsRequest::order_by].
16549 ///
16550 /// # Example
16551 /// ```ignore,no_run
16552 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
16553 /// let x = QueryTeamFolderContentsRequest::new().set_order_by("example");
16554 /// ```
16555 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16556 self.order_by = v.into();
16557 self
16558 }
16559
16560 /// Sets the value of [filter][crate::model::QueryTeamFolderContentsRequest::filter].
16561 ///
16562 /// # Example
16563 /// ```ignore,no_run
16564 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsRequest;
16565 /// let x = QueryTeamFolderContentsRequest::new().set_filter("example");
16566 /// ```
16567 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16568 self.filter = v.into();
16569 self
16570 }
16571}
16572
16573impl wkt::message::Message for QueryTeamFolderContentsRequest {
16574 fn typename() -> &'static str {
16575 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsRequest"
16576 }
16577}
16578
16579/// `QueryTeamFolderContents` response message.
16580#[derive(Clone, Default, PartialEq)]
16581#[non_exhaustive]
16582pub struct QueryTeamFolderContentsResponse {
16583 /// List of entries in the TeamFolder.
16584 pub entries:
16585 std::vec::Vec<crate::model::query_team_folder_contents_response::TeamFolderContentsEntry>,
16586
16587 /// A token, which can be sent as `page_token` to retrieve the next page.
16588 /// If this field is omitted, there are no subsequent pages.
16589 pub next_page_token: std::string::String,
16590
16591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16592}
16593
16594impl QueryTeamFolderContentsResponse {
16595 pub fn new() -> Self {
16596 std::default::Default::default()
16597 }
16598
16599 /// Sets the value of [entries][crate::model::QueryTeamFolderContentsResponse::entries].
16600 ///
16601 /// # Example
16602 /// ```ignore,no_run
16603 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
16604 /// use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
16605 /// let x = QueryTeamFolderContentsResponse::new()
16606 /// .set_entries([
16607 /// TeamFolderContentsEntry::default()/* use setters */,
16608 /// TeamFolderContentsEntry::default()/* use (different) setters */,
16609 /// ]);
16610 /// ```
16611 pub fn set_entries<T, V>(mut self, v: T) -> Self
16612 where
16613 T: std::iter::IntoIterator<Item = V>,
16614 V: std::convert::Into<
16615 crate::model::query_team_folder_contents_response::TeamFolderContentsEntry,
16616 >,
16617 {
16618 use std::iter::Iterator;
16619 self.entries = v.into_iter().map(|i| i.into()).collect();
16620 self
16621 }
16622
16623 /// Sets the value of [next_page_token][crate::model::QueryTeamFolderContentsResponse::next_page_token].
16624 ///
16625 /// # Example
16626 /// ```ignore,no_run
16627 /// # use google_cloud_dataform_v1::model::QueryTeamFolderContentsResponse;
16628 /// let x = QueryTeamFolderContentsResponse::new().set_next_page_token("example");
16629 /// ```
16630 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16631 self.next_page_token = v.into();
16632 self
16633 }
16634}
16635
16636impl wkt::message::Message for QueryTeamFolderContentsResponse {
16637 fn typename() -> &'static str {
16638 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse"
16639 }
16640}
16641
16642#[doc(hidden)]
16643impl google_cloud_gax::paginator::internal::PageableResponse for QueryTeamFolderContentsResponse {
16644 type PageItem = crate::model::query_team_folder_contents_response::TeamFolderContentsEntry;
16645
16646 fn items(self) -> std::vec::Vec<Self::PageItem> {
16647 self.entries
16648 }
16649
16650 fn next_page_token(&self) -> std::string::String {
16651 use std::clone::Clone;
16652 self.next_page_token.clone()
16653 }
16654}
16655
16656/// Defines additional types related to [QueryTeamFolderContentsResponse].
16657pub mod query_team_folder_contents_response {
16658 #[allow(unused_imports)]
16659 use super::*;
16660
16661 /// Represents a single content entry.
16662 #[derive(Clone, Default, PartialEq)]
16663 #[non_exhaustive]
16664 pub struct TeamFolderContentsEntry {
16665 /// The content entry.
16666 pub entry: std::option::Option<
16667 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry,
16668 >,
16669
16670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16671 }
16672
16673 impl TeamFolderContentsEntry {
16674 pub fn new() -> Self {
16675 std::default::Default::default()
16676 }
16677
16678 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry].
16679 ///
16680 /// Note that all the setters affecting `entry` are mutually
16681 /// exclusive.
16682 ///
16683 /// # Example
16684 /// ```ignore,no_run
16685 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
16686 /// use google_cloud_dataform_v1::model::Folder;
16687 /// let x = TeamFolderContentsEntry::new().set_entry(Some(
16688 /// google_cloud_dataform_v1::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(Folder::default().into())));
16689 /// ```
16690 pub fn set_entry<T: std::convert::Into<std::option::Option<crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry>>>(mut self, v: T) -> Self
16691 {
16692 self.entry = v.into();
16693 self
16694 }
16695
16696 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
16697 /// if it holds a `Folder`, `None` if the field is not set or
16698 /// holds a different branch.
16699 pub fn folder(&self) -> std::option::Option<&std::boxed::Box<crate::model::Folder>> {
16700 #[allow(unreachable_patterns)]
16701 self.entry.as_ref().and_then(|v| match v {
16702 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(v) => std::option::Option::Some(v),
16703 _ => std::option::Option::None,
16704 })
16705 }
16706
16707 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
16708 /// to hold a `Folder`.
16709 ///
16710 /// Note that all the setters affecting `entry` are
16711 /// mutually exclusive.
16712 ///
16713 /// # Example
16714 /// ```ignore,no_run
16715 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
16716 /// use google_cloud_dataform_v1::model::Folder;
16717 /// let x = TeamFolderContentsEntry::new().set_folder(Folder::default()/* use setters */);
16718 /// assert!(x.folder().is_some());
16719 /// assert!(x.repository().is_none());
16720 /// ```
16721 pub fn set_folder<T: std::convert::Into<std::boxed::Box<crate::model::Folder>>>(
16722 mut self,
16723 v: T,
16724 ) -> Self {
16725 self.entry = std::option::Option::Some(
16726 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Folder(
16727 v.into()
16728 )
16729 );
16730 self
16731 }
16732
16733 /// The value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
16734 /// if it holds a `Repository`, `None` if the field is not set or
16735 /// holds a different branch.
16736 pub fn repository(
16737 &self,
16738 ) -> std::option::Option<&std::boxed::Box<crate::model::Repository>> {
16739 #[allow(unreachable_patterns)]
16740 self.entry.as_ref().and_then(|v| match v {
16741 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(v) => std::option::Option::Some(v),
16742 _ => std::option::Option::None,
16743 })
16744 }
16745
16746 /// Sets the value of [entry][crate::model::query_team_folder_contents_response::TeamFolderContentsEntry::entry]
16747 /// to hold a `Repository`.
16748 ///
16749 /// Note that all the setters affecting `entry` are
16750 /// mutually exclusive.
16751 ///
16752 /// # Example
16753 /// ```ignore,no_run
16754 /// # use google_cloud_dataform_v1::model::query_team_folder_contents_response::TeamFolderContentsEntry;
16755 /// use google_cloud_dataform_v1::model::Repository;
16756 /// let x = TeamFolderContentsEntry::new().set_repository(Repository::default()/* use setters */);
16757 /// assert!(x.repository().is_some());
16758 /// assert!(x.folder().is_none());
16759 /// ```
16760 pub fn set_repository<T: std::convert::Into<std::boxed::Box<crate::model::Repository>>>(
16761 mut self,
16762 v: T,
16763 ) -> Self {
16764 self.entry = std::option::Option::Some(
16765 crate::model::query_team_folder_contents_response::team_folder_contents_entry::Entry::Repository(
16766 v.into()
16767 )
16768 );
16769 self
16770 }
16771 }
16772
16773 impl wkt::message::Message for TeamFolderContentsEntry {
16774 fn typename() -> &'static str {
16775 "type.googleapis.com/google.cloud.dataform.v1.QueryTeamFolderContentsResponse.TeamFolderContentsEntry"
16776 }
16777 }
16778
16779 /// Defines additional types related to [TeamFolderContentsEntry].
16780 pub mod team_folder_contents_entry {
16781 #[allow(unused_imports)]
16782 use super::*;
16783
16784 /// The content entry.
16785 #[derive(Clone, Debug, PartialEq)]
16786 #[non_exhaustive]
16787 pub enum Entry {
16788 /// A subfolder.
16789 Folder(std::boxed::Box<crate::model::Folder>),
16790 /// A repository.
16791 Repository(std::boxed::Box<crate::model::Repository>),
16792 }
16793 }
16794}
16795
16796/// `SearchTeamFolders` request message.
16797#[derive(Clone, Default, PartialEq)]
16798#[non_exhaustive]
16799pub struct SearchTeamFoldersRequest {
16800 /// Required. Location in which to query TeamFolders.
16801 /// Format: `projects/*/locations/*`.
16802 pub location: std::string::String,
16803
16804 /// Optional. Maximum number of TeamFolders to return. The server may return
16805 /// fewer items than requested. If unspecified, the server will pick an
16806 /// appropriate default.
16807 pub page_size: i32,
16808
16809 /// Optional. Page token received from a previous `SearchTeamFolders` call.
16810 /// Provide this to retrieve the subsequent page.
16811 ///
16812 /// When paginating, all other parameters provided to
16813 /// `SearchTeamFolders`, with the exception of `page_size`, must
16814 /// match the call that provided the page token.
16815 pub page_token: std::string::String,
16816
16817 /// Optional. Field to additionally sort results by.
16818 /// Supported keywords: `display_name` (default), `create_time`,
16819 /// `last_modified_time`. Examples:
16820 ///
16821 /// - `orderBy="display_name"`
16822 /// - `orderBy="display_name desc"`
16823 pub order_by: std::string::String,
16824
16825 /// Optional. Optional filtering for the returned list. Filtering is currently
16826 /// only supported on the `display_name` field.
16827 ///
16828 /// Example:
16829 ///
16830 /// - `filter="display_name="MyFolder""`
16831 pub filter: std::string::String,
16832
16833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16834}
16835
16836impl SearchTeamFoldersRequest {
16837 pub fn new() -> Self {
16838 std::default::Default::default()
16839 }
16840
16841 /// Sets the value of [location][crate::model::SearchTeamFoldersRequest::location].
16842 ///
16843 /// # Example
16844 /// ```ignore,no_run
16845 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
16846 /// let x = SearchTeamFoldersRequest::new().set_location("example");
16847 /// ```
16848 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16849 self.location = v.into();
16850 self
16851 }
16852
16853 /// Sets the value of [page_size][crate::model::SearchTeamFoldersRequest::page_size].
16854 ///
16855 /// # Example
16856 /// ```ignore,no_run
16857 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
16858 /// let x = SearchTeamFoldersRequest::new().set_page_size(42);
16859 /// ```
16860 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16861 self.page_size = v.into();
16862 self
16863 }
16864
16865 /// Sets the value of [page_token][crate::model::SearchTeamFoldersRequest::page_token].
16866 ///
16867 /// # Example
16868 /// ```ignore,no_run
16869 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
16870 /// let x = SearchTeamFoldersRequest::new().set_page_token("example");
16871 /// ```
16872 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16873 self.page_token = v.into();
16874 self
16875 }
16876
16877 /// Sets the value of [order_by][crate::model::SearchTeamFoldersRequest::order_by].
16878 ///
16879 /// # Example
16880 /// ```ignore,no_run
16881 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
16882 /// let x = SearchTeamFoldersRequest::new().set_order_by("example");
16883 /// ```
16884 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16885 self.order_by = v.into();
16886 self
16887 }
16888
16889 /// Sets the value of [filter][crate::model::SearchTeamFoldersRequest::filter].
16890 ///
16891 /// # Example
16892 /// ```ignore,no_run
16893 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersRequest;
16894 /// let x = SearchTeamFoldersRequest::new().set_filter("example");
16895 /// ```
16896 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16897 self.filter = v.into();
16898 self
16899 }
16900}
16901
16902impl wkt::message::Message for SearchTeamFoldersRequest {
16903 fn typename() -> &'static str {
16904 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersRequest"
16905 }
16906}
16907
16908/// `SearchTeamFolders` response message.
16909#[derive(Clone, Default, PartialEq)]
16910#[non_exhaustive]
16911pub struct SearchTeamFoldersResponse {
16912 /// List of TeamFolders that match the search query.
16913 pub results: std::vec::Vec<crate::model::search_team_folders_response::TeamFolderSearchResult>,
16914
16915 /// A token, which can be sent as `page_token` to retrieve the next page.
16916 /// If this field is omitted, there are no subsequent pages.
16917 pub next_page_token: std::string::String,
16918
16919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16920}
16921
16922impl SearchTeamFoldersResponse {
16923 pub fn new() -> Self {
16924 std::default::Default::default()
16925 }
16926
16927 /// Sets the value of [results][crate::model::SearchTeamFoldersResponse::results].
16928 ///
16929 /// # Example
16930 /// ```ignore,no_run
16931 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
16932 /// use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
16933 /// let x = SearchTeamFoldersResponse::new()
16934 /// .set_results([
16935 /// TeamFolderSearchResult::default()/* use setters */,
16936 /// TeamFolderSearchResult::default()/* use (different) setters */,
16937 /// ]);
16938 /// ```
16939 pub fn set_results<T, V>(mut self, v: T) -> Self
16940 where
16941 T: std::iter::IntoIterator<Item = V>,
16942 V: std::convert::Into<crate::model::search_team_folders_response::TeamFolderSearchResult>,
16943 {
16944 use std::iter::Iterator;
16945 self.results = v.into_iter().map(|i| i.into()).collect();
16946 self
16947 }
16948
16949 /// Sets the value of [next_page_token][crate::model::SearchTeamFoldersResponse::next_page_token].
16950 ///
16951 /// # Example
16952 /// ```ignore,no_run
16953 /// # use google_cloud_dataform_v1::model::SearchTeamFoldersResponse;
16954 /// let x = SearchTeamFoldersResponse::new().set_next_page_token("example");
16955 /// ```
16956 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16957 self.next_page_token = v.into();
16958 self
16959 }
16960}
16961
16962impl wkt::message::Message for SearchTeamFoldersResponse {
16963 fn typename() -> &'static str {
16964 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse"
16965 }
16966}
16967
16968#[doc(hidden)]
16969impl google_cloud_gax::paginator::internal::PageableResponse for SearchTeamFoldersResponse {
16970 type PageItem = crate::model::search_team_folders_response::TeamFolderSearchResult;
16971
16972 fn items(self) -> std::vec::Vec<Self::PageItem> {
16973 self.results
16974 }
16975
16976 fn next_page_token(&self) -> std::string::String {
16977 use std::clone::Clone;
16978 self.next_page_token.clone()
16979 }
16980}
16981
16982/// Defines additional types related to [SearchTeamFoldersResponse].
16983pub mod search_team_folders_response {
16984 #[allow(unused_imports)]
16985 use super::*;
16986
16987 /// Represents a single content entry.
16988 #[derive(Clone, Default, PartialEq)]
16989 #[non_exhaustive]
16990 pub struct TeamFolderSearchResult {
16991 /// The content entry.
16992 pub entry: std::option::Option<
16993 crate::model::search_team_folders_response::team_folder_search_result::Entry,
16994 >,
16995
16996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16997 }
16998
16999 impl TeamFolderSearchResult {
17000 pub fn new() -> Self {
17001 std::default::Default::default()
17002 }
17003
17004 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry].
17005 ///
17006 /// Note that all the setters affecting `entry` are mutually
17007 /// exclusive.
17008 ///
17009 /// # Example
17010 /// ```ignore,no_run
17011 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
17012 /// use google_cloud_dataform_v1::model::TeamFolder;
17013 /// let x = TeamFolderSearchResult::new().set_entry(Some(
17014 /// google_cloud_dataform_v1::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(TeamFolder::default().into())));
17015 /// ```
17016 pub fn set_entry<T: std::convert::Into<std::option::Option<crate::model::search_team_folders_response::team_folder_search_result::Entry>>>(mut self, v: T) -> Self
17017 {
17018 self.entry = v.into();
17019 self
17020 }
17021
17022 /// The value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
17023 /// if it holds a `TeamFolder`, `None` if the field is not set or
17024 /// holds a different branch.
17025 pub fn team_folder(
17026 &self,
17027 ) -> std::option::Option<&std::boxed::Box<crate::model::TeamFolder>> {
17028 #[allow(unreachable_patterns)]
17029 self.entry.as_ref().and_then(|v| match v {
17030 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(v) => std::option::Option::Some(v),
17031 _ => std::option::Option::None,
17032 })
17033 }
17034
17035 /// Sets the value of [entry][crate::model::search_team_folders_response::TeamFolderSearchResult::entry]
17036 /// to hold a `TeamFolder`.
17037 ///
17038 /// Note that all the setters affecting `entry` are
17039 /// mutually exclusive.
17040 ///
17041 /// # Example
17042 /// ```ignore,no_run
17043 /// # use google_cloud_dataform_v1::model::search_team_folders_response::TeamFolderSearchResult;
17044 /// use google_cloud_dataform_v1::model::TeamFolder;
17045 /// let x = TeamFolderSearchResult::new().set_team_folder(TeamFolder::default()/* use setters */);
17046 /// assert!(x.team_folder().is_some());
17047 /// ```
17048 pub fn set_team_folder<T: std::convert::Into<std::boxed::Box<crate::model::TeamFolder>>>(
17049 mut self,
17050 v: T,
17051 ) -> Self {
17052 self.entry = std::option::Option::Some(
17053 crate::model::search_team_folders_response::team_folder_search_result::Entry::TeamFolder(
17054 v.into()
17055 )
17056 );
17057 self
17058 }
17059 }
17060
17061 impl wkt::message::Message for TeamFolderSearchResult {
17062 fn typename() -> &'static str {
17063 "type.googleapis.com/google.cloud.dataform.v1.SearchTeamFoldersResponse.TeamFolderSearchResult"
17064 }
17065 }
17066
17067 /// Defines additional types related to [TeamFolderSearchResult].
17068 pub mod team_folder_search_result {
17069 #[allow(unused_imports)]
17070 use super::*;
17071
17072 /// The content entry.
17073 #[derive(Clone, Debug, PartialEq)]
17074 #[non_exhaustive]
17075 pub enum Entry {
17076 /// A TeamFolder resource that is in the project / location.
17077 TeamFolder(std::boxed::Box<crate::model::TeamFolder>),
17078 }
17079 }
17080}
17081
17082/// Contains metadata about the progress of the MoveFolder Long-running
17083/// operations.
17084#[derive(Clone, Default, PartialEq)]
17085#[non_exhaustive]
17086pub struct MoveFolderMetadata {
17087 /// Output only. The time the operation was created.
17088 pub create_time: std::option::Option<wkt::Timestamp>,
17089
17090 /// Output only. The time the operation finished running.
17091 pub end_time: std::option::Option<wkt::Timestamp>,
17092
17093 /// Output only. Server-defined resource path for the target of the operation.
17094 pub target: std::string::String,
17095
17096 /// The state of the move.
17097 pub state: crate::model::move_folder_metadata::State,
17098
17099 /// Percent complete of the move [0, 100].
17100 pub percent_complete: i32,
17101
17102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17103}
17104
17105impl MoveFolderMetadata {
17106 pub fn new() -> Self {
17107 std::default::Default::default()
17108 }
17109
17110 /// Sets the value of [create_time][crate::model::MoveFolderMetadata::create_time].
17111 ///
17112 /// # Example
17113 /// ```ignore,no_run
17114 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17115 /// use wkt::Timestamp;
17116 /// let x = MoveFolderMetadata::new().set_create_time(Timestamp::default()/* use setters */);
17117 /// ```
17118 pub fn set_create_time<T>(mut self, v: T) -> Self
17119 where
17120 T: std::convert::Into<wkt::Timestamp>,
17121 {
17122 self.create_time = std::option::Option::Some(v.into());
17123 self
17124 }
17125
17126 /// Sets or clears the value of [create_time][crate::model::MoveFolderMetadata::create_time].
17127 ///
17128 /// # Example
17129 /// ```ignore,no_run
17130 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17131 /// use wkt::Timestamp;
17132 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17133 /// let x = MoveFolderMetadata::new().set_or_clear_create_time(None::<Timestamp>);
17134 /// ```
17135 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17136 where
17137 T: std::convert::Into<wkt::Timestamp>,
17138 {
17139 self.create_time = v.map(|x| x.into());
17140 self
17141 }
17142
17143 /// Sets the value of [end_time][crate::model::MoveFolderMetadata::end_time].
17144 ///
17145 /// # Example
17146 /// ```ignore,no_run
17147 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17148 /// use wkt::Timestamp;
17149 /// let x = MoveFolderMetadata::new().set_end_time(Timestamp::default()/* use setters */);
17150 /// ```
17151 pub fn set_end_time<T>(mut self, v: T) -> Self
17152 where
17153 T: std::convert::Into<wkt::Timestamp>,
17154 {
17155 self.end_time = std::option::Option::Some(v.into());
17156 self
17157 }
17158
17159 /// Sets or clears the value of [end_time][crate::model::MoveFolderMetadata::end_time].
17160 ///
17161 /// # Example
17162 /// ```ignore,no_run
17163 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17164 /// use wkt::Timestamp;
17165 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
17166 /// let x = MoveFolderMetadata::new().set_or_clear_end_time(None::<Timestamp>);
17167 /// ```
17168 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
17169 where
17170 T: std::convert::Into<wkt::Timestamp>,
17171 {
17172 self.end_time = v.map(|x| x.into());
17173 self
17174 }
17175
17176 /// Sets the value of [target][crate::model::MoveFolderMetadata::target].
17177 ///
17178 /// # Example
17179 /// ```ignore,no_run
17180 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17181 /// let x = MoveFolderMetadata::new().set_target("example");
17182 /// ```
17183 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17184 self.target = v.into();
17185 self
17186 }
17187
17188 /// Sets the value of [state][crate::model::MoveFolderMetadata::state].
17189 ///
17190 /// # Example
17191 /// ```ignore,no_run
17192 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17193 /// use google_cloud_dataform_v1::model::move_folder_metadata::State;
17194 /// let x0 = MoveFolderMetadata::new().set_state(State::Initialized);
17195 /// let x1 = MoveFolderMetadata::new().set_state(State::InProgress);
17196 /// let x2 = MoveFolderMetadata::new().set_state(State::Success);
17197 /// ```
17198 pub fn set_state<T: std::convert::Into<crate::model::move_folder_metadata::State>>(
17199 mut self,
17200 v: T,
17201 ) -> Self {
17202 self.state = v.into();
17203 self
17204 }
17205
17206 /// Sets the value of [percent_complete][crate::model::MoveFolderMetadata::percent_complete].
17207 ///
17208 /// # Example
17209 /// ```ignore,no_run
17210 /// # use google_cloud_dataform_v1::model::MoveFolderMetadata;
17211 /// let x = MoveFolderMetadata::new().set_percent_complete(42);
17212 /// ```
17213 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17214 self.percent_complete = v.into();
17215 self
17216 }
17217}
17218
17219impl wkt::message::Message for MoveFolderMetadata {
17220 fn typename() -> &'static str {
17221 "type.googleapis.com/google.cloud.dataform.v1.MoveFolderMetadata"
17222 }
17223}
17224
17225/// Defines additional types related to [MoveFolderMetadata].
17226pub mod move_folder_metadata {
17227 #[allow(unused_imports)]
17228 use super::*;
17229
17230 /// Different states of the move.
17231 ///
17232 /// # Working with unknown values
17233 ///
17234 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17235 /// additional enum variants at any time. Adding new variants is not considered
17236 /// a breaking change. Applications should write their code in anticipation of:
17237 ///
17238 /// - New values appearing in future releases of the client library, **and**
17239 /// - New values received dynamically, without application changes.
17240 ///
17241 /// Please consult the [Working with enums] section in the user guide for some
17242 /// guidelines.
17243 ///
17244 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17245 #[derive(Clone, Debug, PartialEq)]
17246 #[non_exhaustive]
17247 pub enum State {
17248 /// The state is unspecified.
17249 Unspecified,
17250 /// The move was initialized and recorded by the server, but not yet started.
17251 Initialized,
17252 /// The move is in progress.
17253 InProgress,
17254 /// The move has completed successfully.
17255 Success,
17256 /// The move has failed.
17257 Failed,
17258 /// If set, the enum was initialized with an unknown value.
17259 ///
17260 /// Applications can examine the value using [State::value] or
17261 /// [State::name].
17262 UnknownValue(state::UnknownValue),
17263 }
17264
17265 #[doc(hidden)]
17266 pub mod state {
17267 #[allow(unused_imports)]
17268 use super::*;
17269 #[derive(Clone, Debug, PartialEq)]
17270 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17271 }
17272
17273 impl State {
17274 /// Gets the enum value.
17275 ///
17276 /// Returns `None` if the enum contains an unknown value deserialized from
17277 /// the string representation of enums.
17278 pub fn value(&self) -> std::option::Option<i32> {
17279 match self {
17280 Self::Unspecified => std::option::Option::Some(0),
17281 Self::Initialized => std::option::Option::Some(1),
17282 Self::InProgress => std::option::Option::Some(2),
17283 Self::Success => std::option::Option::Some(3),
17284 Self::Failed => std::option::Option::Some(4),
17285 Self::UnknownValue(u) => u.0.value(),
17286 }
17287 }
17288
17289 /// Gets the enum value as a string.
17290 ///
17291 /// Returns `None` if the enum contains an unknown value deserialized from
17292 /// the integer representation of enums.
17293 pub fn name(&self) -> std::option::Option<&str> {
17294 match self {
17295 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17296 Self::Initialized => std::option::Option::Some("INITIALIZED"),
17297 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
17298 Self::Success => std::option::Option::Some("SUCCESS"),
17299 Self::Failed => std::option::Option::Some("FAILED"),
17300 Self::UnknownValue(u) => u.0.name(),
17301 }
17302 }
17303 }
17304
17305 impl std::default::Default for State {
17306 fn default() -> Self {
17307 use std::convert::From;
17308 Self::from(0)
17309 }
17310 }
17311
17312 impl std::fmt::Display for State {
17313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17314 wkt::internal::display_enum(f, self.name(), self.value())
17315 }
17316 }
17317
17318 impl std::convert::From<i32> for State {
17319 fn from(value: i32) -> Self {
17320 match value {
17321 0 => Self::Unspecified,
17322 1 => Self::Initialized,
17323 2 => Self::InProgress,
17324 3 => Self::Success,
17325 4 => Self::Failed,
17326 _ => Self::UnknownValue(state::UnknownValue(
17327 wkt::internal::UnknownEnumValue::Integer(value),
17328 )),
17329 }
17330 }
17331 }
17332
17333 impl std::convert::From<&str> for State {
17334 fn from(value: &str) -> Self {
17335 use std::string::ToString;
17336 match value {
17337 "STATE_UNSPECIFIED" => Self::Unspecified,
17338 "INITIALIZED" => Self::Initialized,
17339 "IN_PROGRESS" => Self::InProgress,
17340 "SUCCESS" => Self::Success,
17341 "FAILED" => Self::Failed,
17342 _ => Self::UnknownValue(state::UnknownValue(
17343 wkt::internal::UnknownEnumValue::String(value.to_string()),
17344 )),
17345 }
17346 }
17347 }
17348
17349 impl serde::ser::Serialize for State {
17350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17351 where
17352 S: serde::Serializer,
17353 {
17354 match self {
17355 Self::Unspecified => serializer.serialize_i32(0),
17356 Self::Initialized => serializer.serialize_i32(1),
17357 Self::InProgress => serializer.serialize_i32(2),
17358 Self::Success => serializer.serialize_i32(3),
17359 Self::Failed => serializer.serialize_i32(4),
17360 Self::UnknownValue(u) => u.0.serialize(serializer),
17361 }
17362 }
17363 }
17364
17365 impl<'de> serde::de::Deserialize<'de> for State {
17366 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17367 where
17368 D: serde::Deserializer<'de>,
17369 {
17370 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17371 ".google.cloud.dataform.v1.MoveFolderMetadata.State",
17372 ))
17373 }
17374 }
17375}
17376
17377/// Contains metadata about the progress of the MoveRepository Long-running
17378/// operations.
17379#[derive(Clone, Default, PartialEq)]
17380#[non_exhaustive]
17381pub struct MoveRepositoryMetadata {
17382 /// Output only. The time the operation was created.
17383 pub create_time: std::option::Option<wkt::Timestamp>,
17384
17385 /// Output only. The time the operation finished running.
17386 pub end_time: std::option::Option<wkt::Timestamp>,
17387
17388 /// Output only. Server-defined resource path for the target of the operation.
17389 pub target: std::string::String,
17390
17391 /// The state of the move.
17392 pub state: crate::model::move_repository_metadata::State,
17393
17394 /// Percent complete of the move [0, 100].
17395 pub percent_complete: i32,
17396
17397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17398}
17399
17400impl MoveRepositoryMetadata {
17401 pub fn new() -> Self {
17402 std::default::Default::default()
17403 }
17404
17405 /// Sets the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
17406 ///
17407 /// # Example
17408 /// ```ignore,no_run
17409 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17410 /// use wkt::Timestamp;
17411 /// let x = MoveRepositoryMetadata::new().set_create_time(Timestamp::default()/* use setters */);
17412 /// ```
17413 pub fn set_create_time<T>(mut self, v: T) -> Self
17414 where
17415 T: std::convert::Into<wkt::Timestamp>,
17416 {
17417 self.create_time = std::option::Option::Some(v.into());
17418 self
17419 }
17420
17421 /// Sets or clears the value of [create_time][crate::model::MoveRepositoryMetadata::create_time].
17422 ///
17423 /// # Example
17424 /// ```ignore,no_run
17425 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17426 /// use wkt::Timestamp;
17427 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17428 /// let x = MoveRepositoryMetadata::new().set_or_clear_create_time(None::<Timestamp>);
17429 /// ```
17430 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17431 where
17432 T: std::convert::Into<wkt::Timestamp>,
17433 {
17434 self.create_time = v.map(|x| x.into());
17435 self
17436 }
17437
17438 /// Sets the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
17439 ///
17440 /// # Example
17441 /// ```ignore,no_run
17442 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17443 /// use wkt::Timestamp;
17444 /// let x = MoveRepositoryMetadata::new().set_end_time(Timestamp::default()/* use setters */);
17445 /// ```
17446 pub fn set_end_time<T>(mut self, v: T) -> Self
17447 where
17448 T: std::convert::Into<wkt::Timestamp>,
17449 {
17450 self.end_time = std::option::Option::Some(v.into());
17451 self
17452 }
17453
17454 /// Sets or clears the value of [end_time][crate::model::MoveRepositoryMetadata::end_time].
17455 ///
17456 /// # Example
17457 /// ```ignore,no_run
17458 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17459 /// use wkt::Timestamp;
17460 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
17461 /// let x = MoveRepositoryMetadata::new().set_or_clear_end_time(None::<Timestamp>);
17462 /// ```
17463 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
17464 where
17465 T: std::convert::Into<wkt::Timestamp>,
17466 {
17467 self.end_time = v.map(|x| x.into());
17468 self
17469 }
17470
17471 /// Sets the value of [target][crate::model::MoveRepositoryMetadata::target].
17472 ///
17473 /// # Example
17474 /// ```ignore,no_run
17475 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17476 /// let x = MoveRepositoryMetadata::new().set_target("example");
17477 /// ```
17478 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17479 self.target = v.into();
17480 self
17481 }
17482
17483 /// Sets the value of [state][crate::model::MoveRepositoryMetadata::state].
17484 ///
17485 /// # Example
17486 /// ```ignore,no_run
17487 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17488 /// use google_cloud_dataform_v1::model::move_repository_metadata::State;
17489 /// let x0 = MoveRepositoryMetadata::new().set_state(State::Initialized);
17490 /// let x1 = MoveRepositoryMetadata::new().set_state(State::InProgress);
17491 /// let x2 = MoveRepositoryMetadata::new().set_state(State::Success);
17492 /// ```
17493 pub fn set_state<T: std::convert::Into<crate::model::move_repository_metadata::State>>(
17494 mut self,
17495 v: T,
17496 ) -> Self {
17497 self.state = v.into();
17498 self
17499 }
17500
17501 /// Sets the value of [percent_complete][crate::model::MoveRepositoryMetadata::percent_complete].
17502 ///
17503 /// # Example
17504 /// ```ignore,no_run
17505 /// # use google_cloud_dataform_v1::model::MoveRepositoryMetadata;
17506 /// let x = MoveRepositoryMetadata::new().set_percent_complete(42);
17507 /// ```
17508 pub fn set_percent_complete<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17509 self.percent_complete = v.into();
17510 self
17511 }
17512}
17513
17514impl wkt::message::Message for MoveRepositoryMetadata {
17515 fn typename() -> &'static str {
17516 "type.googleapis.com/google.cloud.dataform.v1.MoveRepositoryMetadata"
17517 }
17518}
17519
17520/// Defines additional types related to [MoveRepositoryMetadata].
17521pub mod move_repository_metadata {
17522 #[allow(unused_imports)]
17523 use super::*;
17524
17525 /// Different states of the move.
17526 ///
17527 /// # Working with unknown values
17528 ///
17529 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17530 /// additional enum variants at any time. Adding new variants is not considered
17531 /// a breaking change. Applications should write their code in anticipation of:
17532 ///
17533 /// - New values appearing in future releases of the client library, **and**
17534 /// - New values received dynamically, without application changes.
17535 ///
17536 /// Please consult the [Working with enums] section in the user guide for some
17537 /// guidelines.
17538 ///
17539 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17540 #[derive(Clone, Debug, PartialEq)]
17541 #[non_exhaustive]
17542 pub enum State {
17543 /// The state is unspecified.
17544 Unspecified,
17545 /// The move was initialized and recorded by the server, but not yet started.
17546 Initialized,
17547 /// The move is in progress.
17548 InProgress,
17549 /// The move has completed successfully.
17550 Success,
17551 /// The move has failed.
17552 Failed,
17553 /// If set, the enum was initialized with an unknown value.
17554 ///
17555 /// Applications can examine the value using [State::value] or
17556 /// [State::name].
17557 UnknownValue(state::UnknownValue),
17558 }
17559
17560 #[doc(hidden)]
17561 pub mod state {
17562 #[allow(unused_imports)]
17563 use super::*;
17564 #[derive(Clone, Debug, PartialEq)]
17565 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17566 }
17567
17568 impl State {
17569 /// Gets the enum value.
17570 ///
17571 /// Returns `None` if the enum contains an unknown value deserialized from
17572 /// the string representation of enums.
17573 pub fn value(&self) -> std::option::Option<i32> {
17574 match self {
17575 Self::Unspecified => std::option::Option::Some(0),
17576 Self::Initialized => std::option::Option::Some(1),
17577 Self::InProgress => std::option::Option::Some(2),
17578 Self::Success => std::option::Option::Some(3),
17579 Self::Failed => std::option::Option::Some(4),
17580 Self::UnknownValue(u) => u.0.value(),
17581 }
17582 }
17583
17584 /// Gets the enum value as a string.
17585 ///
17586 /// Returns `None` if the enum contains an unknown value deserialized from
17587 /// the integer representation of enums.
17588 pub fn name(&self) -> std::option::Option<&str> {
17589 match self {
17590 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17591 Self::Initialized => std::option::Option::Some("INITIALIZED"),
17592 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
17593 Self::Success => std::option::Option::Some("SUCCESS"),
17594 Self::Failed => std::option::Option::Some("FAILED"),
17595 Self::UnknownValue(u) => u.0.name(),
17596 }
17597 }
17598 }
17599
17600 impl std::default::Default for State {
17601 fn default() -> Self {
17602 use std::convert::From;
17603 Self::from(0)
17604 }
17605 }
17606
17607 impl std::fmt::Display for State {
17608 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17609 wkt::internal::display_enum(f, self.name(), self.value())
17610 }
17611 }
17612
17613 impl std::convert::From<i32> for State {
17614 fn from(value: i32) -> Self {
17615 match value {
17616 0 => Self::Unspecified,
17617 1 => Self::Initialized,
17618 2 => Self::InProgress,
17619 3 => Self::Success,
17620 4 => Self::Failed,
17621 _ => Self::UnknownValue(state::UnknownValue(
17622 wkt::internal::UnknownEnumValue::Integer(value),
17623 )),
17624 }
17625 }
17626 }
17627
17628 impl std::convert::From<&str> for State {
17629 fn from(value: &str) -> Self {
17630 use std::string::ToString;
17631 match value {
17632 "STATE_UNSPECIFIED" => Self::Unspecified,
17633 "INITIALIZED" => Self::Initialized,
17634 "IN_PROGRESS" => Self::InProgress,
17635 "SUCCESS" => Self::Success,
17636 "FAILED" => Self::Failed,
17637 _ => Self::UnknownValue(state::UnknownValue(
17638 wkt::internal::UnknownEnumValue::String(value.to_string()),
17639 )),
17640 }
17641 }
17642 }
17643
17644 impl serde::ser::Serialize for State {
17645 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17646 where
17647 S: serde::Serializer,
17648 {
17649 match self {
17650 Self::Unspecified => serializer.serialize_i32(0),
17651 Self::Initialized => serializer.serialize_i32(1),
17652 Self::InProgress => serializer.serialize_i32(2),
17653 Self::Success => serializer.serialize_i32(3),
17654 Self::Failed => serializer.serialize_i32(4),
17655 Self::UnknownValue(u) => u.0.serialize(serializer),
17656 }
17657 }
17658 }
17659
17660 impl<'de> serde::de::Deserialize<'de> for State {
17661 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17662 where
17663 D: serde::Deserializer<'de>,
17664 {
17665 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17666 ".google.cloud.dataform.v1.MoveRepositoryMetadata.State",
17667 ))
17668 }
17669 }
17670}
17671
17672/// Represents the level of detail to return for directory contents.
17673///
17674/// # Working with unknown values
17675///
17676/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17677/// additional enum variants at any time. Adding new variants is not considered
17678/// a breaking change. Applications should write their code in anticipation of:
17679///
17680/// - New values appearing in future releases of the client library, **and**
17681/// - New values received dynamically, without application changes.
17682///
17683/// Please consult the [Working with enums] section in the user guide for some
17684/// guidelines.
17685///
17686/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17687#[derive(Clone, Debug, PartialEq)]
17688#[non_exhaustive]
17689pub enum DirectoryContentsView {
17690 /// The default / unset value. Defaults to DIRECTORY_CONTENTS_VIEW_BASIC.
17691 Unspecified,
17692 /// Includes only the file or directory name. This is the default behavior.
17693 Basic,
17694 /// Includes all metadata for each file or directory. Currently not supported
17695 /// by CMEK-protected workspaces.
17696 Metadata,
17697 /// If set, the enum was initialized with an unknown value.
17698 ///
17699 /// Applications can examine the value using [DirectoryContentsView::value] or
17700 /// [DirectoryContentsView::name].
17701 UnknownValue(directory_contents_view::UnknownValue),
17702}
17703
17704#[doc(hidden)]
17705pub mod directory_contents_view {
17706 #[allow(unused_imports)]
17707 use super::*;
17708 #[derive(Clone, Debug, PartialEq)]
17709 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17710}
17711
17712impl DirectoryContentsView {
17713 /// Gets the enum value.
17714 ///
17715 /// Returns `None` if the enum contains an unknown value deserialized from
17716 /// the string representation of enums.
17717 pub fn value(&self) -> std::option::Option<i32> {
17718 match self {
17719 Self::Unspecified => std::option::Option::Some(0),
17720 Self::Basic => std::option::Option::Some(1),
17721 Self::Metadata => std::option::Option::Some(2),
17722 Self::UnknownValue(u) => u.0.value(),
17723 }
17724 }
17725
17726 /// Gets the enum value as a string.
17727 ///
17728 /// Returns `None` if the enum contains an unknown value deserialized from
17729 /// the integer representation of enums.
17730 pub fn name(&self) -> std::option::Option<&str> {
17731 match self {
17732 Self::Unspecified => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_UNSPECIFIED"),
17733 Self::Basic => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_BASIC"),
17734 Self::Metadata => std::option::Option::Some("DIRECTORY_CONTENTS_VIEW_METADATA"),
17735 Self::UnknownValue(u) => u.0.name(),
17736 }
17737 }
17738}
17739
17740impl std::default::Default for DirectoryContentsView {
17741 fn default() -> Self {
17742 use std::convert::From;
17743 Self::from(0)
17744 }
17745}
17746
17747impl std::fmt::Display for DirectoryContentsView {
17748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17749 wkt::internal::display_enum(f, self.name(), self.value())
17750 }
17751}
17752
17753impl std::convert::From<i32> for DirectoryContentsView {
17754 fn from(value: i32) -> Self {
17755 match value {
17756 0 => Self::Unspecified,
17757 1 => Self::Basic,
17758 2 => Self::Metadata,
17759 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
17760 wkt::internal::UnknownEnumValue::Integer(value),
17761 )),
17762 }
17763 }
17764}
17765
17766impl std::convert::From<&str> for DirectoryContentsView {
17767 fn from(value: &str) -> Self {
17768 use std::string::ToString;
17769 match value {
17770 "DIRECTORY_CONTENTS_VIEW_UNSPECIFIED" => Self::Unspecified,
17771 "DIRECTORY_CONTENTS_VIEW_BASIC" => Self::Basic,
17772 "DIRECTORY_CONTENTS_VIEW_METADATA" => Self::Metadata,
17773 _ => Self::UnknownValue(directory_contents_view::UnknownValue(
17774 wkt::internal::UnknownEnumValue::String(value.to_string()),
17775 )),
17776 }
17777 }
17778}
17779
17780impl serde::ser::Serialize for DirectoryContentsView {
17781 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17782 where
17783 S: serde::Serializer,
17784 {
17785 match self {
17786 Self::Unspecified => serializer.serialize_i32(0),
17787 Self::Basic => serializer.serialize_i32(1),
17788 Self::Metadata => serializer.serialize_i32(2),
17789 Self::UnknownValue(u) => u.0.serialize(serializer),
17790 }
17791 }
17792}
17793
17794impl<'de> serde::de::Deserialize<'de> for DirectoryContentsView {
17795 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17796 where
17797 D: serde::Deserializer<'de>,
17798 {
17799 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryContentsView>::new(
17800 ".google.cloud.dataform.v1.DirectoryContentsView",
17801 ))
17802 }
17803}